clean, move jquery-bootgrid converters now included in library

This commit is contained in:
Ad Schellevis 2019-03-08 18:36:05 +01:00
parent 8933feae1e
commit 0672cd0483
4 changed files with 0 additions and 54 deletions

View File

@ -64,13 +64,6 @@ POSSIBILITY OF SUCH DAMAGE.
"commands": function (column, row) {
return "<button type=\"button\" class=\"btn btn-xs btn-default command-disconnect\" data-row-id=\"" + row.sessionid + "\"><span class=\"fa fa-trash-o\"></span></button>";
}
},
converters: {
// convert datetime type fields from unix timestamp to readable format
datetime: {
from: function (value) { return moment(parseInt(value)*1000); },
to: function (value) { return value.format("lll"); }
}
}
};
$("#grid-clients").bootgrid('destroy');

View File

@ -29,7 +29,6 @@ POSSIBILITY OF SUCH DAMAGE.
<script>
'use strict';
const modifiers = ['', 'K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'];
$( document ).ready(function() {
/**
@ -40,30 +39,6 @@ POSSIBILITY OF SUCH DAMAGE.
ajax: false,
selection: true,
multiSelect: true,
converters: {
memsize: {
from: function (value) {
let ret = parseInt(value);
let modifier = value.slice(-1);
for (let exponent = modifiers.length - 1; exponent >= 0; exponent--) {
if (modifier === modifiers[exponent]) {
ret *= Math.pow(1024, exponent);
break;
}
}
return ret;
},
to: function (value) {
for (let exponent = modifiers.length - 1; exponent >= 0; exponent--) {
if (value >= (5 * Math.pow(1024, exponent))) {
return parseInt(value / Math.pow(1024, exponent)) + modifiers[exponent];
}
}
return parseInt(value) + '';
}
}
}
};
$("#grid-top").bootgrid('destroy');
ajaxGet("/api/diagnostics/activity/getActivity", {}, function (data, status) {

View File

@ -58,17 +58,6 @@
'add':'/api/proxy/settings/addPACMatch/',
'del':'/api/proxy/settings/delPACMatch/',
'options': {
converters: {
notprefixable: {
to: function (value) {
if (value.not) {
return '<i class="fa fa-exclamation"></i> ' + value.val;
} else {
return value.val;
}
}
}
},
responseHandler: function (response) {
// concatenate fields for not.
if ('rows' in response) {

View File

@ -67,17 +67,6 @@ POSSIBILITY OF SUCH DAMAGE.
del:'/api/trafficshaper/settings/delRule/',
toggle:'/api/trafficshaper/settings/toggleRule/',
options: {
converters: {
notprefixable: {
to: function (value) {
if (value.not) {
return '<i class="fa fa-exclamation"></i> ' + value.val;
} else {
return value.val;
}
}
}
},
responseHandler: function (response) {
// concatenate fields for not.
if ('rows' in response) {