Revision d4e4f434

b/ui/templates/machines.html
256 256
    if (metadata.values.OS == undefined || metadata.values.OS == '') {
257 257
        return 'unknown';
258 258
    } else {
259
        return metadata.values.OS;
259
        if (UrlExists("static/machines/" + metadata.values.OS + '-on.png')) {
260
            return metadata.values.OS;
261
        } else {
262
            return 'unknown';
263
        }
260 264
    }
265

  
261 266
} 
262 267

  
268
//helper function to check file existance
269
function UrlExists(url)
270
{
271
    var http = new XMLHttpRequest();
272
    http.open('HEAD', url, false);
273
    http.send();
274
    return http.status!=404;
275
}
276

  
277

  
263 278
// switch to list view
264 279
$("a#list").click(function(){
265 280
    list_view(); 

Also available in: Unified diff