60
60
return hour + ":" + mins + ":" + secs;// + " " + month + "/" + day;
63
function pretty_time_runtime(time){
67
var secs = pad(d.getUTCSeconds(),2);
68
var hour = pad(d.getUTCHours(),2);
69
var mins = pad(d.getUTCMinutes(),2);
70
var day = d.getUTCDate()-1;
71
var month = pad(d.getUTCMonth()+1,2); //getMonths returns 0-11
72
var year = d.getUTCFullYear();
74
return day + "d " + hour + ":" + mins;// + ":" + secs;// + " " + month + "/" + day;
63
77
//returns a human readable size in Kilo, Mega, Giga or Tera bytes
64
78
function humanize_size(value) {
65
79
if (typeof(value) === "undefined") {
404
418
function getUserName(uid){
405
419
if (typeof(dataTable_users) != "undefined"){
406
return getName(uid,dataTable_users);
420
return getName(uid,dataTable_users,2);
411
425
function getGroupName(gid){
412
426
if (typeof(dataTable_groups) != "undefined"){
413
return getName(gid,dataTable_groups);
427
return getName(gid,dataTable_groups,2);
418
function getName(id,dataTable){
432
function getImageName(id){
433
if (typeof(dataTable_images) != "undefined"){
434
return getName(id,dataTable_images,4);
439
function getClusterName(id){
440
if (typeof(dataTable_clusters) != "undefined"){
441
return getName(id,dataTable_clusters,2);
446
function getDatastoreName(id){
447
if (typeof(dataTable_datastores) != "undefined"){
448
return getName(id,dataTable_datastores,4);
453
function getVNetName(id){
454
if (typeof(dataTable_vNetworks) != "undefined"){
455
return getName(id,dataTable_vNetworks,4);
460
function getHostName(id){
461
if (typeof(dataTable_hosts) != "undefined"){
462
return getName(id,dataTable_hosts,2);
467
function getName(id,dataTable,name_col){
420
469
if (typeof(dataTable) == "undefined") {
750
//Workaround so deletion of templates is allowed.
751
if (!new_template) new_template=" ";
701
753
var resource = $(this).val();
702
754
Sunstone.runAction(resource+".update",id,new_template);
703
755
dialog.dialog('close');
751
803
return hosts_select;
806
function clusters_sel() {
807
return clusters_select;
810
function datastores_sel() {
811
return datastores_select;
754
816
function ownerUse(resource){
755
817
return parseInt(resource.PERMISSIONS.OWNER_U);