]>
Commit | Line | Data |
---|---|---|
11fdf7f2 TL |
1 | import { Injectable } from '@angular/core'; |
2 | ||
3 | import { I18n } from '@ngx-translate/i18n-polyfill'; | |
4 | ||
5 | export class AppConstants { | |
6 | public static readonly organization = 'ceph'; | |
9f95a23c | 7 | public static readonly projectName = 'Ceph Dashboard'; |
11fdf7f2 TL |
8 | public static readonly license = 'Free software (LGPL 2.1).'; |
9 | } | |
10 | ||
11 | export enum URLVerbs { | |
12 | /* Create a new item */ | |
13 | CREATE = 'create', | |
14 | ||
15 | /* Make changes to an existing item */ | |
16 | EDIT = 'edit', | |
17 | ||
18 | /* Make changes to an existing item */ | |
19 | UPDATE = 'update', | |
20 | ||
21 | /* Remove an item from a container WITHOUT deleting it */ | |
22 | REMOVE = 'remove', | |
23 | ||
24 | /* Destroy an existing item */ | |
25 | DELETE = 'delete', | |
26 | ||
27 | /* Add an existing item to a container */ | |
28 | ADD = 'add', | |
29 | ||
30 | /* Non-standard verbs */ | |
31 | COPY = 'copy', | |
494da23a TL |
32 | CLONE = 'clone', |
33 | ||
34 | /* Prometheus wording */ | |
35 | RECREATE = 'recreate', | |
36 | EXPIRE = 'expire' | |
11fdf7f2 TL |
37 | } |
38 | ||
39 | export enum ActionLabels { | |
40 | /* Create a new item */ | |
41 | CREATE = 'Create', | |
42 | ||
43 | /* Destroy an existing item */ | |
44 | DELETE = 'Delete', | |
45 | ||
46 | /* Add an existing item to a container */ | |
47 | ADD = 'Add', | |
48 | ||
49 | /* Remove an item from a container WITHOUT deleting it */ | |
50 | REMOVE = 'Remove', | |
51 | ||
52 | /* Make changes to an existing item */ | |
53 | EDIT = 'Edit', | |
54 | ||
55 | /* */ | |
56 | CANCEL = 'Cancel', | |
57 | ||
58 | /* Non-standard actions */ | |
59 | COPY = 'Copy', | |
60 | CLONE = 'Clone', | |
9f95a23c TL |
61 | UPDATE = 'Update', |
62 | EVICT = 'Evict', | |
11fdf7f2 TL |
63 | |
64 | /* Read-only */ | |
494da23a TL |
65 | SHOW = 'Show', |
66 | ||
67 | /* Prometheus wording */ | |
68 | RECREATE = 'Recreate', | |
69 | EXPIRE = 'Expire' | |
11fdf7f2 TL |
70 | } |
71 | ||
72 | @Injectable({ | |
73 | providedIn: 'root' | |
74 | }) | |
75 | export class ActionLabelsI18n { | |
76 | /* This service is required as the i18n polyfill does not provide static | |
77 | translation | |
78 | */ | |
79 | CREATE: string; | |
80 | DELETE: string; | |
81 | ADD: string; | |
82 | REMOVE: string; | |
83 | EDIT: string; | |
84 | CANCEL: string; | |
9f95a23c | 85 | CHANGE: string; |
11fdf7f2 TL |
86 | COPY: string; |
87 | CLONE: string; | |
eafe8130 TL |
88 | DEEP_SCRUB: string; |
89 | DESTROY: string; | |
9f95a23c TL |
90 | EVICT: string; |
91 | EXPIRE: string; | |
eafe8130 TL |
92 | FLATTEN: string; |
93 | MARK_DOWN: string; | |
94 | MARK_IN: string; | |
95 | MARK_LOST: string; | |
96 | MARK_OUT: string; | |
97 | PROTECT: string; | |
98 | PURGE: string; | |
9f95a23c | 99 | RECREATE: string; |
eafe8130 TL |
100 | RENAME: string; |
101 | RESTORE: string; | |
102 | REWEIGHT: string; | |
103 | ROLLBACK: string; | |
104 | SCRUB: string; | |
9f95a23c | 105 | SET: string; |
11fdf7f2 | 106 | SHOW: string; |
494da23a TL |
107 | TRASH: string; |
108 | UNPROTECT: string; | |
9f95a23c TL |
109 | UNSET: string; |
110 | UPDATE: string; | |
adb31ebb | 111 | FLAGS: string; |
11fdf7f2 TL |
112 | |
113 | constructor(private i18n: I18n) { | |
114 | /* Create a new item */ | |
115 | this.CREATE = this.i18n('Create'); | |
116 | ||
117 | /* Destroy an existing item */ | |
118 | this.DELETE = this.i18n('Delete'); | |
119 | ||
120 | /* Add an existing item to a container */ | |
121 | this.ADD = this.i18n('Add'); | |
9f95a23c | 122 | this.SET = this.i18n('Set'); |
11fdf7f2 TL |
123 | |
124 | /* Remove an item from a container WITHOUT deleting it */ | |
125 | this.REMOVE = this.i18n('Remove'); | |
9f95a23c | 126 | this.UNSET = this.i18n('Unset'); |
11fdf7f2 TL |
127 | |
128 | /* Make changes to an existing item */ | |
129 | this.EDIT = this.i18n('Edit'); | |
9f95a23c | 130 | this.UPDATE = this.i18n('Update'); |
11fdf7f2 TL |
131 | this.CANCEL = this.i18n('Cancel'); |
132 | ||
133 | /* Non-standard actions */ | |
11fdf7f2 | 134 | this.CLONE = this.i18n('Clone'); |
eafe8130 TL |
135 | this.COPY = this.i18n('Copy'); |
136 | this.DEEP_SCRUB = this.i18n('Deep Scrub'); | |
137 | this.DESTROY = this.i18n('Destroy'); | |
9f95a23c | 138 | this.EVICT = this.i18n('Evict'); |
eafe8130 TL |
139 | this.FLATTEN = this.i18n('Flatten'); |
140 | this.MARK_DOWN = this.i18n('Mark Down'); | |
141 | this.MARK_IN = this.i18n('Mark In'); | |
142 | this.MARK_LOST = this.i18n('Mark Lost'); | |
143 | this.MARK_OUT = this.i18n('Mark Out'); | |
144 | this.PROTECT = this.i18n('Protect'); | |
145 | this.PURGE = this.i18n('Purge'); | |
146 | this.RENAME = this.i18n('Rename'); | |
147 | this.RESTORE = this.i18n('Restore'); | |
148 | this.REWEIGHT = this.i18n('Reweight'); | |
149 | this.ROLLBACK = this.i18n('Rollback'); | |
150 | this.SCRUB = this.i18n('Scrub'); | |
11fdf7f2 | 151 | this.SHOW = this.i18n('Show'); |
494da23a TL |
152 | this.TRASH = this.i18n('Move to Trash'); |
153 | this.UNPROTECT = this.i18n('Unprotect'); | |
9f95a23c | 154 | this.CHANGE = this.i18n('Change'); |
adb31ebb | 155 | this.FLAGS = this.i18n('Flags'); |
494da23a TL |
156 | |
157 | /* Prometheus wording */ | |
158 | this.RECREATE = this.i18n('Recreate'); | |
159 | this.EXPIRE = this.i18n('Expire'); | |
160 | } | |
161 | } | |
162 | ||
163 | @Injectable({ | |
164 | providedIn: 'root' | |
165 | }) | |
166 | export class SucceededActionLabelsI18n { | |
167 | /* This service is required as the i18n polyfill does not provide static | |
168 | translation | |
169 | */ | |
170 | CREATED: string; | |
171 | DELETED: string; | |
172 | ADDED: string; | |
173 | REMOVED: string; | |
174 | EDITED: string; | |
175 | CANCELED: string; | |
176 | COPIED: string; | |
177 | CLONED: string; | |
9f95a23c TL |
178 | DEEP_SCRUBBED: string; |
179 | DESTROYED: string; | |
180 | FLATTENED: string; | |
181 | MARKED_DOWN: string; | |
182 | MARKED_IN: string; | |
183 | MARKED_LOST: string; | |
184 | MARKED_OUT: string; | |
185 | PROTECTED: string; | |
186 | PURGED: string; | |
187 | RENAMED: string; | |
188 | RESTORED: string; | |
189 | REWEIGHTED: string; | |
190 | ROLLED_BACK: string; | |
191 | SCRUBBED: string; | |
494da23a TL |
192 | SHOWED: string; |
193 | TRASHED: string; | |
194 | UNPROTECTED: string; | |
9f95a23c | 195 | CHANGE: string; |
494da23a TL |
196 | RECREATED: string; |
197 | EXPIRED: string; | |
198 | ||
199 | constructor(private i18n: I18n) { | |
200 | /* Create a new item */ | |
201 | this.CREATED = this.i18n('Created'); | |
202 | ||
203 | /* Destroy an existing item */ | |
204 | this.DELETED = this.i18n('Deleted'); | |
205 | ||
206 | /* Add an existing item to a container */ | |
207 | this.ADDED = this.i18n('Added'); | |
208 | ||
209 | /* Remove an item from a container WITHOUT deleting it */ | |
210 | this.REMOVED = this.i18n('Removed'); | |
211 | ||
212 | /* Make changes to an existing item */ | |
213 | this.EDITED = this.i18n('Edited'); | |
214 | this.CANCELED = this.i18n('Canceled'); | |
215 | ||
216 | /* Non-standard actions */ | |
217 | this.CLONED = this.i18n('Cloned'); | |
218 | this.COPIED = this.i18n('Copied'); | |
9f95a23c TL |
219 | this.DEEP_SCRUBBED = this.i18n('Deep Scrubbed'); |
220 | this.DESTROYED = this.i18n('Destroyed'); | |
221 | this.FLATTENED = this.i18n('Flattened'); | |
222 | this.MARKED_DOWN = this.i18n('Marked Down'); | |
223 | this.MARKED_IN = this.i18n('Marked In'); | |
224 | this.MARKED_LOST = this.i18n('Marked Lost'); | |
225 | this.MARKED_OUT = this.i18n('Marked Out'); | |
226 | this.PROTECTED = this.i18n('Protected'); | |
227 | this.PURGED = this.i18n('Purged'); | |
228 | this.RENAMED = this.i18n('Renamed'); | |
229 | this.RESTORED = this.i18n('Restored'); | |
230 | this.REWEIGHTED = this.i18n('Reweighted'); | |
231 | this.ROLLED_BACK = this.i18n('Rolled back'); | |
232 | this.SCRUBBED = this.i18n('Scrubbed'); | |
494da23a TL |
233 | this.SHOWED = this.i18n('Showed'); |
234 | this.TRASHED = this.i18n('Moved to Trash'); | |
235 | this.UNPROTECTED = this.i18n('Unprotected'); | |
9f95a23c | 236 | this.CHANGE = this.i18n('Change'); |
494da23a TL |
237 | |
238 | /* Prometheus wording */ | |
239 | this.RECREATED = this.i18n('Recreated'); | |
240 | this.EXPIRED = this.i18n('Expired'); | |
11fdf7f2 TL |
241 | } |
242 | } |