Commit db99de40 authored by Mike Muzurakis's avatar Mike Muzurakis
Browse files

show unknown machine icon when OS metadata is nonstandard, Refs #375

parent 8968ee5c
......@@ -256,10 +256,25 @@ function os_icon(metadata) {
if (metadata.values.OS == undefined || metadata.values.OS == '') {
return 'unknown';
} else {
return metadata.values.OS;
if (UrlExists("static/machines/" + metadata.values.OS + '-on.png')) {
return metadata.values.OS;
} else {
return 'unknown';
}
}
}
//helper function to check file existance
function UrlExists(url)
{
var http = new XMLHttpRequest();
http.open('HEAD', url, false);
http.send();
return http.status!=404;
}
// switch to list view
$("a#list").click(function(){
list_view();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment