root / snf-cyclades-app / synnefo / ui / new_ui / ui / javascripts / okeanos-ember / obj.js @ cc5d0e0e
History | View | Annotate | Download (3.9 kB)
1 |
/* Objects */
|
---|---|
2 |
|
3 |
Ember.Inflector.inflector.uncountable('account');
|
4 |
|
5 |
Synnefo.Account = DS.Model.extend({ |
6 |
email: DS.attr('string') |
7 |
}); |
8 |
|
9 |
// CHECK can i use a single obj and not an array of obj
|
10 |
Synnefo.Account.FIXTURES = { |
11 |
id: 001, |
12 |
email: "athina@mail.com" |
13 |
}; |
14 |
|
15 |
|
16 |
|
17 |
Synnefo.Vm = DS.Model.extend({ |
18 |
// id: DS.attr('number'), we do not define it ;)
|
19 |
name: DS.attr('string'), |
20 |
hostname: DS.attr('string'), |
21 |
status: DS.attr('string'), |
22 |
os: DS.attr()
|
23 |
}); |
24 |
|
25 |
Synnefo.Vm.FIXTURES = |
26 |
[{ |
27 |
id: 125355, |
28 |
name: "web-server", |
29 |
hostname: "user@snf-38389.vm.okeanos.grnet.gr", |
30 |
status: "running", |
31 |
os: "kubuntu" |
32 |
}, |
33 |
{ |
34 |
id: 12, |
35 |
name: "another-server", |
36 |
hostname: "user@snf-33333.vm.okeanos.grnet.gr", |
37 |
status: "off", |
38 |
os: "fedora" |
39 |
}]; |
40 |
|
41 |
Synnefo.Network = DS.Model.extend({ |
42 |
name: DS.attr('string'), |
43 |
status: DS.attr('string'), |
44 |
}); |
45 |
|
46 |
Synnefo.Network.FIXTURES = |
47 |
[{ |
48 |
id: 11, |
49 |
name: 'Network-1', |
50 |
status: 'running' |
51 |
}, |
52 |
{ |
53 |
id: 22, |
54 |
name: 'Network-2', |
55 |
status: 'error' |
56 |
}]; |
57 |
|
58 |
|
59 |
Synnefo.Volume = DS.Model.extend({ |
60 |
name: DS.attr('string'), |
61 |
status: DS.attr('string'), |
62 |
}); |
63 |
|
64 |
Synnefo.Volume.FIXTURES = |
65 |
[{ |
66 |
id: 111, |
67 |
name: 'Volume-1', |
68 |
status: 'running' |
69 |
}, |
70 |
{ |
71 |
id: 222, |
72 |
name: 'Volume-2', |
73 |
status: 'building' |
74 |
}]; |
75 |
|
76 |
Synnefo.Snapshot = DS.Model.extend({ |
77 |
name: DS.attr('string'), |
78 |
status: DS.attr('string'), |
79 |
}); |
80 |
|
81 |
Synnefo.Snapshot.FIXTURES = |
82 |
[{ |
83 |
id: 33, |
84 |
name: 'Snapshot-1', |
85 |
status: 'running' |
86 |
}, |
87 |
{ |
88 |
id: 44, |
89 |
name: 'Snapshot-2', |
90 |
status: 'building' |
91 |
}]; |
92 |
|
93 |
|
94 |
Synnefo.UserImage = DS.Model.extend({ |
95 |
name: DS.attr('string'), |
96 |
status: DS.attr('string'), |
97 |
}); |
98 |
|
99 |
Synnefo.UserImage.FIXTURES = |
100 |
[{ |
101 |
id: 55, |
102 |
name: 'Image-1', |
103 |
status: 'running' |
104 |
}, |
105 |
{ |
106 |
id: 66, |
107 |
name: 'Image-2', |
108 |
status: 'running' |
109 |
}]; |
110 |
|
111 |
|
112 |
Synnefo.conf = { |
113 |
sectors: [{
|
114 |
destination: "vms", |
115 |
title: "Virtual Machines", |
116 |
icon: "snf-pc-outline" |
117 |
}, |
118 |
{ |
119 |
destination: "networks", |
120 |
title: "Network", |
121 |
icon: "snf-network-outline" |
122 |
|
123 |
}, |
124 |
{ |
125 |
destination: "volumes", |
126 |
title: "Volumes", |
127 |
icon: "snf-volume-outline" |
128 |
}, |
129 |
{ |
130 |
destination: "pithos", |
131 |
title: "Pithos", |
132 |
icon: "snf-pithos-outline" |
133 |
}, |
134 |
{ |
135 |
destination: "images", |
136 |
title: "Images", |
137 |
icon: "snf-image-outline" |
138 |
}, |
139 |
{ |
140 |
destination: "snapshots", |
141 |
title: "Snapshots", |
142 |
icon: "snf-snapshot-outline" |
143 |
}, |
144 |
{ |
145 |
destination: "ips", |
146 |
title: "IPs", |
147 |
icon: "snf-nic-outline" |
148 |
}, |
149 |
{ |
150 |
destination: "sshkeys", |
151 |
title: "SSh Keys", |
152 |
icon: "snf-key-outline" |
153 |
}], |
154 |
|
155 |
userActions: [{
|
156 |
description:'start', |
157 |
'snf-components':['vms'], |
158 |
'enabled-status': ['off'], |
159 |
action: 'is this a function?' |
160 |
}, |
161 |
{ |
162 |
description:'destroyElement', |
163 |
'snf-components': ['vms', 'networks'], |
164 |
'enabled-status': ['all'], |
165 |
action: 'is this a function?', |
166 |
}, |
167 |
{ |
168 |
description:'shutdown', |
169 |
'snf-components': ['vms'], |
170 |
'enabled-status': ['running'], |
171 |
action: 'is this a function?' |
172 |
}, |
173 |
{ |
174 |
description:'add machine', |
175 |
'snf-components': ['networks'], |
176 |
'enabled-status': ['active'], |
177 |
action: 'is this a function?' |
178 |
}, |
179 |
{ |
180 |
description:'action for all', |
181 |
'snf-components': ['vms', 'networks'], |
182 |
'enabled-status': ['all'], |
183 |
action: 'is this a function?' |
184 |
}] |
185 |
}; |
186 |
|
187 |
Synnefo.wizards = { |
188 |
vmWizard: {
|
189 |
// each step must have a headline
|
190 |
stepsHeadlines: [
|
191 |
{ |
192 |
title:'Select an OS', |
193 |
subtitle:'Choose your preferred image' |
194 |
}, |
195 |
{ |
196 |
title:'Select CPUs, RAM and Disk Size', |
197 |
subtitle:'Available options are filtered based on the selected image' |
198 |
}, |
199 |
{ |
200 |
title:'Virtual machine custom options', |
201 |
subtitle:'tba' |
202 |
}, |
203 |
{ |
204 |
title:'Confirm your settings', |
205 |
subtitle:'Confirm that the options you have selected are correct' |
206 |
}, |
207 |
], |
208 |
stepsSubmenus: [
|
209 |
{ |
210 |
options:['System', 'My images', 'Shared with me', 'Public'] |
211 |
}, |
212 |
{ |
213 |
options: ['Small', 'Medium', 'large'] |
214 |
} |
215 |
], |
216 |
stepsContent: ['step-1', 'step-2', 'step-3', 'step-4'] |
217 |
}, |
218 |
networkWizard: {}
|
219 |
} |