initial commit of file from CVS for smeserver-phpsysinfo on Sat Sep 7 20:53:46 AEST 2024
This commit is contained in:
50
root/opt/phpsysinfo/plugins/quotas/js/quotas_bootstrap.js
Normal file
50
root/opt/phpsysinfo/plugins/quotas/js/quotas_bootstrap.js
Normal file
@@ -0,0 +1,50 @@
|
||||
function renderPlugin_quotas(data) {
|
||||
|
||||
var directives = {
|
||||
|
||||
ByteUsed: {
|
||||
text: function () {
|
||||
return formatBytes(this["ByteUsed"], data["Options"]["@attributes"]["byteFormat"]);
|
||||
}
|
||||
},
|
||||
ByteSoft: {
|
||||
text: function () {
|
||||
return formatBytes(this["ByteSoft"], data["Options"]["@attributes"]["byteFormat"]);
|
||||
}
|
||||
},
|
||||
ByteHard: {
|
||||
text: function () {
|
||||
return formatBytes(this["ByteHard"], data["Options"]["@attributes"]["byteFormat"]);
|
||||
}
|
||||
},
|
||||
BytePercentUsed: {
|
||||
html: function () {
|
||||
return '<div class="progress"><div class="progress-bar progress-bar-info" style="width: ' + this["BytePercentUsed"] + '%;"></div>' +
|
||||
'</div><div class="percent">' + this["BytePercentUsed"] + '%</div>';
|
||||
}
|
||||
},
|
||||
FilePercentUsed: {
|
||||
html: function () {
|
||||
return '<div class="progress"><div class="progress-bar progress-bar-info" style="width: ' + this["FilePercentUsed"] + '%;"></div>' +
|
||||
'</div><div class="percent">' + this["FilePercentUsed"] + '%</div>';
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
if (data['Plugins']['Plugin_Quotas'] !== undefined) {
|
||||
var qtitems = items(data['Plugins']['Plugin_Quotas']['Quota']);
|
||||
if (qtitems.length > 0) {
|
||||
var qt_memory = [];
|
||||
qt_memory.push_attrs(qtitems);
|
||||
$('#quotas-data').render(qt_memory, directives);
|
||||
$('#quotas_User').removeClass("sorttable_sorted"); // reset sort order
|
||||
sorttable.innerSortFunction.apply($('#quotas_User')[0], []);
|
||||
|
||||
$('#block_quotas').show();
|
||||
} else {
|
||||
$('#block_quotas').hide();
|
||||
}
|
||||
} else {
|
||||
$('#block_quotas').hide();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user