Revision c3b3043d ui/templates/machines.html
b/ui/templates/machines.html | ||
---|---|---|
20 | 20 |
<div class="indicator"></div> |
21 | 21 |
<div class="indicator"></div> |
22 | 22 |
</div> |
23 |
<img class="logo" src="path/to/logos" />
|
|
23 |
<img class="logo" src="" /> |
|
24 | 24 |
<a href="#" class="name"> |
25 | 25 |
<h5>Νame: <span class="name">node.name</span><span class="rename"></span></h5> |
26 | 26 |
</a> |
... | ... | |
68 | 68 |
<li id="image-template" style="display:none"> |
69 | 69 |
<label for="image.id"> |
70 | 70 |
<a><div class="image"> |
71 |
<img src="static/os_logos/image.logo" class="image-logo"/>
|
|
71 |
<img src="" class="image-logo"/> |
|
72 | 72 |
<strong class="image-title">image.title</strong> |
73 | 73 |
<input class="radio" type="radio" name="image-id" id="image-id" /> |
74 | 74 |
<br /> |
... | ... | |
198 | 198 |
20: 'ubuntu', |
199 | 199 |
}; |
200 | 200 |
|
201 |
// populate listings of machines |
|
202 | 201 |
function update() { |
203 | 202 |
|
204 | 203 |
$(".running").text(''); |
... | ... | |
209 | 208 |
$.ajax({ |
210 | 209 |
url: '/api/v1.0/servers/detail', |
211 | 210 |
type: "GET", |
212 |
//async: false,
|
|
211 |
// async: false,
|
|
213 | 212 |
dataType: "json", |
214 | 213 |
success: function(data) { |
215 | 214 |
$.each(data.servers, function(i,server){ |
... | ... | |
218 | 217 |
machine.find("a.name span.name").text(server.name); |
219 | 218 |
machine.find("img.logo").attr("src","static/machines/"+image_tags[server.imageId]+'.png'); |
220 | 219 |
machine.find("img.list-logo").attr("src","static/os_logos/"+image_tags[server.imageId]+'.png'); |
221 |
machine.find("a.ip span.public").text(String(server.addresses.public)); |
|
220 |
machine.find("img.list-logo").attr("title",image_tags[server.imageId]); |
|
221 |
machine.find("span.imagetag").text(image_tags[server.imageId]); |
|
222 |
|
|
223 |
machine.find("a.ip span.public").text(String(server.addresses.public).replace(',',' ')); |
|
222 | 224 |
|
223 | 225 |
if (server.status == 'PE_VM_MIGRATING'){ |
224 | 226 |
machine.find(".status").text('Building'); |
... | ... | |
239 | 241 |
}); |
240 | 242 |
$("div.machine:last-child").find("div.seperator").hide(); |
241 | 243 |
$("#spinner").hide(); |
244 |
$(".list table").show(); |
|
242 | 245 |
$(".list table").tablesorter({ |
243 |
headers: { 0: { sorter: false}, 1: {sorter: false} },
|
|
246 |
headers: { 0: { sorter: false}, 6: { sorter: false }},
|
|
244 | 247 |
sortMultiSortKey: "ctrlKey" }).show(); |
245 | 248 |
$(".list .actions").show(); |
246 | 249 |
} |
... | ... | |
249 | 252 |
$.ajax({ |
250 | 253 |
url: '/api/v1.0/images/detail', |
251 | 254 |
type: "GET", |
252 |
//async: false,
|
|
255 |
// async: false,
|
|
253 | 256 |
dataType: "json", |
254 | 257 |
success: function(data) { |
255 | 258 |
$.each(data.images, function(i,image){ |
... | ... | |
267 | 270 |
}); |
268 | 271 |
} |
269 | 272 |
}); |
270 |
} |
|
271 | 273 |
|
272 |
update(); |
|
273 |
|
|
274 |
// reboot action |
|
275 |
$(".reboot").click(function(event) { |
|
274 |
//TESTING $.ajax POST+DELETE. api/handlers.py/ServerHandler and ServerActionHandler receive these calls |
|
275 |
//DELETE is working, while POST is not (maybe this has to do with piston+django csrf? |
|
276 |
/* |
|
276 | 277 |
$.ajax({ |
277 | 278 |
url: '/api/v1.0/servers/1234/action', |
278 | 279 |
type: "POST", |
279 | 280 |
data: { |
280 |
"reboot": {"type" : "HARD"} |
|
281 |
}, |
|
281 |
"reboot": { |
|
282 |
"type" : "HARD" |
|
283 |
} |
|
284 |
}, |
|
282 | 285 |
dataType: "json", |
283 |
success: function() {} |
|
284 |
}); |
|
285 |
}); |
|
286 |
success: function() { |
|
287 |
} |
|
288 |
}); |
|
289 |
|
|
290 |
|
|
286 | 291 |
|
287 |
// destroy action |
|
288 |
$(".destroy").click(function(event) { |
|
289 | 292 |
$.ajax({ |
290 | 293 |
url: '/api/v1.0/servers/1234', |
291 | 294 |
type: "DELETE", |
292 |
//async: false,
|
|
295 |
// async: false,
|
|
293 | 296 |
dataType: "json", |
294 |
success: function(data) {} |
|
295 |
}); |
|
296 |
}); |
|
297 |
success: function(data) { |
|
298 |
} |
|
299 |
}); |
|
300 |
*/ |
|
301 |
//DELETE TILL HERE |
|
302 |
} |
|
303 |
|
|
304 |
|
|
305 |
|
|
306 |
update(); |
|
297 | 307 |
|
298 |
// switch to list view |
|
299 | 308 |
$("#list").click(function(event){ |
300 | 309 |
$("div.standard#machinesview").load($("#list").attr("href")); |
301 | 310 |
$("a#standard")[0].className += ' activelink' |
... | ... | |
304 | 313 |
return false; |
305 | 314 |
}); |
306 | 315 |
|
307 |
// switch to standard view |
|
308 | 316 |
$("a#standard").click(function(event){ |
309 | 317 |
href=$("a#standard").attr("href"); |
310 | 318 |
$("div.pane#machines-pane").load(href); |
Also available in: Unified diff