root / ui / templates / standard.html @ 038383b1
History | View | Annotate | Download (12.3 kB)
1 | 42f67a2a | Dimitris Moraitis | {% load i18n %} |
---|---|---|---|
2 | 42f67a2a | Dimitris Moraitis | |
3 | 42f67a2a | Dimitris Moraitis | <!-- the standard view -->
|
4 | 42f67a2a | Dimitris Moraitis | <div id="machinesview" class="standard"> |
5 | 935bb83f | Markos Gogoulos | <div id="emptymachineslist">{% trans "You have no virtual machines! Press Create New to create some!" %}</div> |
6 | 42f67a2a | Dimitris Moraitis | <div id="spinner"></div> |
7 | 42f67a2a | Dimitris Moraitis | <div class="machine" id="machine-template" style="display:none"> |
8 | 6d0a36e5 | Dimitris Moraitis | <div class="actions"> |
9 | 6d0a36e5 | Dimitris Moraitis | <a href="#" class="action-start">{% trans "Start" %}</a> |
10 | 6d0a36e5 | Dimitris Moraitis | <a href="#" class="action-reboot">{% trans "Reboot" %}</a> |
11 | 6d0a36e5 | Dimitris Moraitis | <a href="#" class="action-shutdown">{% trans "Shutdown" %}</a> |
12 | 6d0a36e5 | Dimitris Moraitis | <a href="#" class="more">{% trans "more …" %}</a> |
13 | 6d0a36e5 | Dimitris Moraitis | </div>
|
14 | 42f67a2a | Dimitris Moraitis | <div class="state"> |
15 | 42f67a2a | Dimitris Moraitis | <div class="status">{% trans "Running" %}</div> |
16 | 42f67a2a | Dimitris Moraitis | <div class="indicator"></div> |
17 | 42f67a2a | Dimitris Moraitis | <div class="indicator"></div> |
18 | 42f67a2a | Dimitris Moraitis | <div class="indicator"></div> |
19 | 42f67a2a | Dimitris Moraitis | <div class="indicator"></div> |
20 | 1d72dcdc | Markos Gogoulos | <img class="spinner" style="display:none" src="/static/progress.gif" /> |
21 | 1d72dcdc | Markos Gogoulos | <img class="wave" style="display:none" src="/static/wave.gif" /> |
22 | 42f67a2a | Dimitris Moraitis | </div>
|
23 | 42f67a2a | Dimitris Moraitis | <img class="logo" src="" /> |
24 | 42f67a2a | Dimitris Moraitis | <a href="#" class="name"> |
25 | 42f67a2a | Dimitris Moraitis | <h5>Name: <span class="name">node.name</span><span class="rename"></span></h5> |
26 | 42f67a2a | Dimitris Moraitis | </a>
|
27 | 42f67a2a | Dimitris Moraitis | <a href="#" class="ip"> |
28 | 42f67a2a | Dimitris Moraitis | <h5>IP: <span class="public">node.public_ip</span></h5> |
29 | 42f67a2a | Dimitris Moraitis | </a>
|
30 | 42f67a2a | Dimitris Moraitis | <h5 class="settings"> |
31 | 42f67a2a | Dimitris Moraitis | {% trans "Show:" %} <a href="#">{% trans "disks" %}</a> | <a href="#">{% trans "networks" %}</a> | <a href="#">{% trans "group" %}</a> |
32 | 42f67a2a | Dimitris Moraitis | </h5>
|
33 | 6d0a36e5 | Dimitris Moraitis | |
34 | 267403ca | Dimitris Moraitis | <div class="confirm_single"> |
35 | c2464ef2 | Christodoulos Psaltis | <button class="yes">{% trans "Confirm" %}</button> |
36 | c2464ef2 | Christodoulos Psaltis | <button class="no">{% trans "Cancel" %}</button> |
37 | 31343277 | Christodoulos Psaltis | </div>
|
38 | 695e1b21 | Dimitris Moraitis | <div class="action_error" align="center"> |
39 | 695e1b21 | Dimitris Moraitis | {% trans "<span class='orange'>Error</span> on" %} <span class="action">error action</span> |
40 | 038383b1 | Dimitris Moraitis | <span class="code"></span> |
41 | 695e1b21 | Dimitris Moraitis | <span class="message"></span> |
42 | 695e1b21 | Dimitris Moraitis | <button class="details">Details</button> |
43 | 879748ec | Markos Gogoulos | </div>
|
44 | c2464ef2 | Christodoulos Psaltis | <div class="separator"></div> |
45 | 42f67a2a | Dimitris Moraitis | </div>
|
46 | 42f67a2a | Dimitris Moraitis | |
47 | 42f67a2a | Dimitris Moraitis | <div class="running"></div> |
48 | e5b0ba20 | Vangelis Koukis | <div id="mini" class="separator"></div> |
49 | 42f67a2a | Dimitris Moraitis | <div class="terminated"></div> |
50 | 42f67a2a | Dimitris Moraitis | </div>
|
51 | 42f67a2a | Dimitris Moraitis | |
52 | 42f67a2a | Dimitris Moraitis | <script>
|
53 | 990772be | Dimitris Moraitis |
|
54 | 42f67a2a | Dimitris Moraitis | // intercept reboot click
|
55 | 42f67a2a | Dimitris Moraitis | $("div.actions a.action-reboot").live('click', function(){
|
56 | 42f67a2a | Dimitris Moraitis | var serverID = $(this).parent().parent().attr("id");
|
57 | 42f67a2a | Dimitris Moraitis | var serverName = $(this).parent().prevAll("a.name").find("span.name").text();
|
58 | 267403ca | Dimitris Moraitis | var found = false;
|
59 | 695e1b21 | Dimitris Moraitis |
|
60 | aa0534a7 | Dimitris Moraitis | $(this).parent().children('a').removeClass('selected');
|
61 | aa0534a7 | Dimitris Moraitis | $(this).addClass('selected');
|
62 | 695e1b21 | Dimitris Moraitis | $(this).parent().addClass('display');
|
63 | 695e1b21 | Dimitris Moraitis | $(this).parent().parent().find('.action_error').hide();
|
64 | 267403ca | Dimitris Moraitis | for (i=0;i<pending_actions.length;i++){ // if there is already a pending action for this server replace it
|
65 | 267403ca | Dimitris Moraitis | if (pending_actions[i][1]==serverID){
|
66 | 267403ca | Dimitris Moraitis | pending_actions[i][0] = reboot;
|
67 | 267403ca | Dimitris Moraitis | found = true
|
68 | 267403ca | Dimitris Moraitis | }
|
69 | 267403ca | Dimitris Moraitis | }
|
70 | 267403ca | Dimitris Moraitis | if (!found) // no pending action for this server was found, so let's just add it to the list
|
71 | 267403ca | Dimitris Moraitis | pending_actions.push([reboot, serverID, serverName])
|
72 | 267403ca | Dimitris Moraitis | update_confirmations();
|
73 | 42f67a2a | Dimitris Moraitis | return false;
|
74 | 42f67a2a | Dimitris Moraitis | });
|
75 | 42f67a2a | Dimitris Moraitis | |
76 | 42f67a2a | Dimitris Moraitis | // intercept shutdown click
|
77 | 42f67a2a | Dimitris Moraitis | $("div.actions a.action-shutdown").live('click', function(){
|
78 | 42f67a2a | Dimitris Moraitis | var serverID = $(this).parent().parent().attr("id");
|
79 | 42f67a2a | Dimitris Moraitis | var serverName = $(this).parent().prevAll("a.name").find("span.name").text();
|
80 | 267403ca | Dimitris Moraitis | var found = false;
|
81 | aa0534a7 | Dimitris Moraitis | $(this).parent().children('a').removeClass('selected');
|
82 | aa0534a7 | Dimitris Moraitis | $(this).addClass('selected');
|
83 | aa0534a7 | Dimitris Moraitis | $(this).parent().addClass('display')
|
84 | 695e1b21 | Dimitris Moraitis | $(this).parent().parent().find('.action_error').hide();
|
85 | aa0534a7 | Dimitris Moraitis | |
86 | 267403ca | Dimitris Moraitis | for (i=0;i<pending_actions.length;i++){ // if there is already a pending action for this server replace it
|
87 | 267403ca | Dimitris Moraitis | if (pending_actions[i][1]==serverID){
|
88 | 267403ca | Dimitris Moraitis | pending_actions[i][0] = shutdown;
|
89 | 267403ca | Dimitris Moraitis | found = true
|
90 | 267403ca | Dimitris Moraitis | }
|
91 | 267403ca | Dimitris Moraitis | }
|
92 | 267403ca | Dimitris Moraitis | if (!found) // no pending action for this server was found, so let's just add it to the list
|
93 | 267403ca | Dimitris Moraitis | pending_actions.push([shutdown, serverID, serverName])
|
94 | 267403ca | Dimitris Moraitis | update_confirmations();
|
95 | 42f67a2a | Dimitris Moraitis | return false;
|
96 | 42f67a2a | Dimitris Moraitis | });
|
97 | eae0a59a | Dimitris Moraitis | |
98 | 42f67a2a | Dimitris Moraitis | // intercept start click
|
99 | 42f67a2a | Dimitris Moraitis | $("div.actions a.action-start").live('click', function(){
|
100 | 42f67a2a | Dimitris Moraitis | var serverID = $(this).parent().parent().attr("id");
|
101 | 42f67a2a | Dimitris Moraitis | var serverName = $(this).parent().prevAll("a.name").find("span.name").text();
|
102 | 267403ca | Dimitris Moraitis | var found = false;
|
103 | aa0534a7 | Dimitris Moraitis | $(this).parent().children('a').removeClass('selected');
|
104 | aa0534a7 | Dimitris Moraitis | $(this).addClass('selected');
|
105 | aa0534a7 | Dimitris Moraitis | $(this).parent().addClass('display')
|
106 | 695e1b21 | Dimitris Moraitis | $(this).parent().parent().find('.action_error').hide();
|
107 | 695e1b21 | Dimitris Moraitis | |
108 | 267403ca | Dimitris Moraitis | for (i=0;i<pending_actions.length;i++){ // if there is already a pending action for this server replace it
|
109 | 267403ca | Dimitris Moraitis | if (pending_actions[i][1]==serverID){
|
110 | 267403ca | Dimitris Moraitis | pending_actions[i][0] = start;
|
111 | 267403ca | Dimitris Moraitis | found = true
|
112 | 267403ca | Dimitris Moraitis | }
|
113 | 267403ca | Dimitris Moraitis | }
|
114 | 267403ca | Dimitris Moraitis | if (!found) // no pending action for this server was found, so let's just add it to the list
|
115 | 267403ca | Dimitris Moraitis | pending_actions.push([start, serverID, serverName])
|
116 | 267403ca | Dimitris Moraitis | update_confirmations();
|
117 | 267403ca | Dimitris Moraitis | return false;
|
118 | 267403ca | Dimitris Moraitis | });
|
119 | 267403ca | Dimitris Moraitis | |
120 | 267403ca | Dimitris Moraitis | $("div.confirm_single .yes").live('click', function(){
|
121 | 267403ca | Dimitris Moraitis | var serverID = $(this).parent().parent().attr("id");
|
122 | 267403ca | Dimitris Moraitis | for (i=0;i<pending_actions.length;i++){ // if there is a pending action for this server execute it
|
123 | 267403ca | Dimitris Moraitis | if (pending_actions[i][1]==serverID){
|
124 | a1a31201 | Dimitris Moraitis | action = pending_actions.splice(i,1)[0]; // extract action
|
125 | a1a31201 | Dimitris Moraitis | action[0]([action[1]]); // execute action
|
126 | 267403ca | Dimitris Moraitis | }
|
127 | 267403ca | Dimitris Moraitis | }
|
128 | 267403ca | Dimitris Moraitis | $(this).parent().hide();
|
129 | aa0534a7 | Dimitris Moraitis | $(this).parent().parent().children('div.actions').children('a').removeClass('selected');
|
130 | aa0534a7 | Dimitris Moraitis | $(this).parent().parent().children('.state').children('.spinner').show()
|
131 | aa0534a7 | Dimitris Moraitis | $(this).parent().parent().children('div.actions').removeClass('display');
|
132 | 3d286f84 | Dimitris Moraitis | update_confirmations();
|
133 | 42f67a2a | Dimitris Moraitis | return false;
|
134 | 42f67a2a | Dimitris Moraitis | });
|
135 | 42f67a2a | Dimitris Moraitis | |
136 | 267403ca | Dimitris Moraitis | $("div.confirm_single .no").live('click', function(){
|
137 | 267403ca | Dimitris Moraitis | // remove the action from the pending list
|
138 | 267403ca | Dimitris Moraitis | var serverID = $(this).parent().parent().attr("id");
|
139 | aa0534a7 | Dimitris Moraitis |
|
140 | aa0534a7 | Dimitris Moraitis | $(this).parent().parent().children('div.actions').children('a').removeClass('selected');
|
141 | aa0534a7 | Dimitris Moraitis | $(this).parent().parent().children('div.actions').removeClass('display');
|
142 | 267403ca | Dimitris Moraitis | for (i=0;i<pending_actions.length;i++){ // if there is a pending action for this server remove it
|
143 | 267403ca | Dimitris Moraitis | if (pending_actions[i][1]==serverID){
|
144 | 267403ca | Dimitris Moraitis | pending_actions.splice(i,1);
|
145 | 267403ca | Dimitris Moraitis | }
|
146 | 267403ca | Dimitris Moraitis | }
|
147 | 267403ca | Dimitris Moraitis | $(this).parent().hide();
|
148 | 3d286f84 | Dimitris Moraitis | update_confirmations();
|
149 | 267403ca | Dimitris Moraitis | return false;
|
150 | 267403ca | Dimitris Moraitis | });
|
151 | 267403ca | Dimitris Moraitis | |
152 | 695e1b21 | Dimitris Moraitis | $("div.action_error .details").live('click', function(){
|
153 | 695e1b21 | Dimitris Moraitis | // remove the action from the pending list
|
154 | 038383b1 | Dimitris Moraitis | ajax_error($(this).parent().children('.code').text(), undefined, $(this).parent().children('.action').text(), $(this).parent().children('.message').text());
|
155 | 695e1b21 | Dimitris Moraitis | $(this).parent().hide();
|
156 | 695e1b21 | Dimitris Moraitis | });
|
157 | 695e1b21 | Dimitris Moraitis | |
158 | 695e1b21 | Dimitris Moraitis | |
159 | eae0a59a | Dimitris Moraitis | // update the servers list
|
160 | eae0a59a | Dimitris Moraitis | function update_machines_view(data){
|
161 | eae0a59a | Dimitris Moraitis | /*
|
162 | 1a49199e | Dimitris Moraitis | Go through the servers in the input data. Update existing entries, add
|
163 | eae0a59a | Dimitris Moraitis | new ones to the list
|
164 | eae0a59a | Dimitris Moraitis | */
|
165 | eae0a59a | Dimitris Moraitis | $.each(data.servers, function(i,server){
|
166 | eae0a59a | Dimitris Moraitis |
|
167 | 150eb972 | Christodoulos Psaltis | existing = $('#' + server.id);
|
168 | eae0a59a | Dimitris Moraitis |
|
169 | 87feccc4 | Dimitris Moraitis | // if multiple machines exist in the DOM, delete all but one
|
170 | 87feccc4 | Dimitris Moraitis | // defensive coding - that shouldn't happen normally
|
171 | 87feccc4 | Dimitris Moraitis | while (existing.length > 1){
|
172 | eae0a59a | Dimitris Moraitis | existing.remove();
|
173 | eae0a59a | Dimitris Moraitis | }
|
174 | eae0a59a | Dimitris Moraitis |
|
175 | 87feccc4 | Dimitris Moraitis | // server already exists in DOM
|
176 | 1a49199e | Dimitris Moraitis | if (existing.length){
|
177 | ab5282e4 | Dimitris Moraitis | $("div.machine:last-child").find("div.separator").show();
|
178 | ab5282e4 | Dimitris Moraitis | |
179 | 87feccc4 | Dimitris Moraitis | // if the status is deleted, delete it from the DOM
|
180 | 87feccc4 | Dimitris Moraitis | if (server.status == 'DELETED') {
|
181 | 1a49199e | Dimitris Moraitis | existing.remove();
|
182 | 81d48bff | Christodoulos Psaltis | try {
|
183 | 1a49199e | Dimitris Moraitis | console.info(existing.find("a.name span.name").text() + ' removed');
|
184 | 1a49199e | Dimitris Moraitis | } catch(err) {}
|
185 | 1a49199e | Dimitris Moraitis | } else if (existing.find(".status").text() != STATUS_MESSAGES[server.status]) {
|
186 | 1a49199e | Dimitris Moraitis |
|
187 | 1a49199e | Dimitris Moraitis | try { // firebug console logging
|
188 | 150eb972 | Christodoulos Psaltis | console.info(existing.find("a.name span.name").text() + ' from '
|
189 | 150eb972 | Christodoulos Psaltis | + existing.find(".status").text() + ' to ' + STATUS_MESSAGES[server.status]);
|
190 | 81d48bff | Christodoulos Psaltis | } catch(err) {}
|
191 | 1a49199e | Dimitris Moraitis |
|
192 | 1a49199e | Dimitris Moraitis | if (['BUILD','ACTIVE','REBOOT'].indexOf(server.status) >= 0 &&
|
193 | 1a49199e | Dimitris Moraitis | [STATUS_MESSAGES['STOPPED'], STATUS_MESSAGES['ERROR']].indexOf(existing.find(".status").text()) >= 0) {
|
194 | 1a49199e | Dimitris Moraitis | // from stopped to running
|
195 | 1a49199e | Dimitris Moraitis | moved = existing.clone().appendTo(".running");
|
196 | 1a49199e | Dimitris Moraitis | moved.find("img.logo").attr("src","static/machines/"+image_tags[server.imageRef]+'.png');
|
197 | 1a49199e | Dimitris Moraitis | existing.remove();
|
198 | 1a49199e | Dimitris Moraitis | existing = moved;
|
199 | 1a49199e | Dimitris Moraitis | } else if (['STOPPED','ERROR'].indexOf(server.status) >= 0 &&
|
200 | 1a49199e | Dimitris Moraitis | [STATUS_MESSAGES['ACTIVE'], STATUS_MESSAGES['BUILD'], STATUS_MESSAGES['REBOOT']].indexOf(existing.find(".status").text()) >= 0) {
|
201 | 1a49199e | Dimitris Moraitis | moved = existing.clone().appendTo(".terminated");
|
202 | 1a49199e | Dimitris Moraitis | moved.find("img.logo").attr("src","static/machines/"+image_tags[server.imageRef]+'-off.png');
|
203 | 1a49199e | Dimitris Moraitis | existing.remove();
|
204 | 1a49199e | Dimitris Moraitis | existing = moved;
|
205 | 309d7ed2 | Dimitris Moraitis | }
|
206 | 309d7ed2 | Dimitris Moraitis | existing.find('.spinner').hide();
|
207 | 309d7ed2 | Dimitris Moraitis | existing.find(' .wave').attr('src','static/wave.gif').show();
|
208 | 309d7ed2 | Dimitris Moraitis | setTimeout("$('#" + server.id +" .wave').attr('src','').hide()", 3000);
|
209 | eae0a59a | Dimitris Moraitis | existing.find(".status").text(STATUS_MESSAGES[server.status]);
|
210 | 87feccc4 | Dimitris Moraitis |
|
211 | eae0a59a | Dimitris Moraitis | }
|
212 | eae0a59a | Dimitris Moraitis | existing.find("a.name span.name").text(server.name);
|
213 | eae0a59a | Dimitris Moraitis | existing.find("a.ip span.public").text(String(server.addresses.public.ip.addr).replace(',',' '));
|
214 | 87feccc4 | Dimitris Moraitis | } else if (server.status != 'DELETED') {
|
215 | 1a49199e | Dimitris Moraitis | // If it does not exist and it's not deleted, we should create it
|
216 | eae0a59a | Dimitris Moraitis | var machine = $("#machine-template").clone().attr("id", server.id).fadeIn("slow");
|
217 | eae0a59a | Dimitris Moraitis | machine.find("a.name span.name").text(server.name);
|
218 | b335768e | Markos Gogoulos | machine.find("img.logo").attr("src","static/machines/"+image_tags[server.imageRef]+'.png');
|
219 | b335768e | Markos Gogoulos | machine.find("span.imagetag").text(image_tags[server.imageRef]);
|
220 | eae0a59a | Dimitris Moraitis | machine.find("a.ip span.public").text(String(server.addresses.public.ip.addr).replace(',',' '));
|
221 | eae0a59a | Dimitris Moraitis | machine.find(".status").text(STATUS_MESSAGES[server.status]);
|
222 | eae0a59a | Dimitris Moraitis | if (['BUILD', 'ACTIVE', 'REBOOT'].indexOf(server.status) >= 0){
|
223 | eae0a59a | Dimitris Moraitis | machine.appendTo(".running");
|
224 | eae0a59a | Dimitris Moraitis | } else {
|
225 | b335768e | Markos Gogoulos | machine.find("img.logo").attr("src","static/machines/"+image_tags[server.imageRef]+'-off.png');
|
226 | eae0a59a | Dimitris Moraitis | machine.appendTo(".terminated");
|
227 | eae0a59a | Dimitris Moraitis | }
|
228 | 309d7ed2 | Dimitris Moraitis | //machine.find(' .wave').attr('src','static/wave.gif').show();
|
229 | 309d7ed2 | Dimitris Moraitis | //setTimeout("$('#" + server.id +" .wave').attr('src','').hide()", 3000);
|
230 | eae0a59a | Dimitris Moraitis | }
|
231 | eae0a59a | Dimitris Moraitis | });
|
232 | eae0a59a | Dimitris Moraitis | |
233 | eae0a59a | Dimitris Moraitis | $("#spinner").hide();
|
234 | ed81826a | Christodoulos Psaltis | // show all separators
|
235 | ed81826a | Christodoulos Psaltis | $("div.machine div.separator").show();
|
236 | ed81826a | Christodoulos Psaltis | // hide the last one
|
237 | e5b0ba20 | Vangelis Koukis | $("div.machine:last-child").find("div.separator").hide();
|
238 | e5b0ba20 | Vangelis Koukis | // the separator shows only when running and terminated machines are available
|
239 | c58db69b | Christodoulos Psaltis | if ($(".terminated a.name").length > 0 && $(".running a.name").length > 0) {
|
240 | e5b0ba20 | Vangelis Koukis | $("#mini.separator").fadeIn("slow");
|
241 | e5b0ba20 | Vangelis Koukis | } else {
|
242 | e5b0ba20 | Vangelis Koukis | $("#mini.separator").fadeOut("slow");
|
243 | eae0a59a | Dimitris Moraitis | }
|
244 | 935bb83f | Markos Gogoulos | // show message in case user has no servers!
|
245 | 935bb83f | Markos Gogoulos | if (servers.length == 0) {
|
246 | 935bb83f | Markos Gogoulos | $("#emptymachineslist").fadeIn("slow");
|
247 | 935bb83f | Markos Gogoulos | }
|
248 | 309d7ed2 | Dimitris Moraitis |
|
249 | 309d7ed2 | Dimitris Moraitis | // set confirm box position
|
250 | 82bf6df0 | Dimitris Moraitis | if (window.innerHeight - 220 < $('#machinesview').height())
|
251 | 309d7ed2 | Dimitris Moraitis | $('.confirm_multiple').addClass('fixed');
|
252 | 309d7ed2 | Dimitris Moraitis | else
|
253 | 309d7ed2 | Dimitris Moraitis | $('.confirm_multiple').removeClass('fixed');
|
254 | eae0a59a | Dimitris Moraitis | }
|
255 | eae0a59a | Dimitris Moraitis | |
256 | a1a31201 | Dimitris Moraitis | // indicate that the requested action was succesfully completed
|
257 | a1a31201 | Dimitris Moraitis | function display_success(serverID) {
|
258 | 6d0a36e5 | Dimitris Moraitis | |
259 | a1a31201 | Dimitris Moraitis | }
|
260 | a1a31201 | Dimitris Moraitis | |
261 | 879748ec | Markos Gogoulos | // indicate that the requested action was not completed
|
262 | 038383b1 | Dimitris Moraitis | function display_failure(status, serverID, action, responseText) {
|
263 | 879748ec | Markos Gogoulos | $('#'+serverID+ ' .spinner').hide();
|
264 | 879748ec | Markos Gogoulos | $('#'+serverID+ ' .action_error .action').text(action);
|
265 | 038383b1 | Dimitris Moraitis | $('#'+serverID+ ' .action_error .code').text(status);
|
266 | 038383b1 | Dimitris Moraitis | $('#'+serverID+ ' .action_error .message').text(responseText);
|
267 | 879748ec | Markos Gogoulos | $('#'+serverID+ ' .action_error').show();
|
268 | 695e1b21 | Dimitris Moraitis |
|
269 | 879748ec | Markos Gogoulos | }
|
270 | 879748ec | Markos Gogoulos | |
271 | 146b6003 | Dimitris Moraitis | if (images.length == 0) {
|
272 | 146b6003 | Dimitris Moraitis | // populate image list
|
273 | 146b6003 | Dimitris Moraitis | update_images();
|
274 | 146b6003 | Dimitris Moraitis | }
|
275 | 146b6003 | Dimitris Moraitis | if (flavors.length == 0) {
|
276 | 146b6003 | Dimitris Moraitis | // configure flavors
|
277 | 146b6003 | Dimitris Moraitis | update_flavors();
|
278 | 146b6003 | Dimitris Moraitis | }
|
279 | c53d09e2 | Christodoulos Psaltis | // set the label of the multiple buttons
|
280 | c53d09e2 | Christodoulos Psaltis | $('div.confirm_multiple button.yes').text('Confirm All');
|
281 | c53d09e2 | Christodoulos Psaltis | $('div.confirm_multiple button.no').text('Cancel All');
|
282 | 82bf6df0 | Dimitris Moraitis | |
283 | 82bf6df0 | Dimitris Moraitis | // reposition multiple confirmation box on window resize
|
284 | 82bf6df0 | Dimitris Moraitis | $(window).resize(function(){
|
285 | 82bf6df0 | Dimitris Moraitis | if (this.innerHeight - 220 < $('#machinesview').height())
|
286 | 82bf6df0 | Dimitris Moraitis | $('.confirm_multiple').addClass('fixed');
|
287 | 82bf6df0 | Dimitris Moraitis | else
|
288 | 82bf6df0 | Dimitris Moraitis | $('.confirm_multiple').removeClass('fixed');
|
289 | 82bf6df0 | Dimitris Moraitis | });
|
290 | 82bf6df0 | Dimitris Moraitis | |
291 | c53d09e2 | Christodoulos Psaltis | // start updating vm list
|
292 | 146b6003 | Dimitris Moraitis | update_vms(UPDATE_INTERVAL);
|
293 | 2ed4ced5 | Markos Gogoulos | </script> |