summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2022-04-25 15:55:07 +0300
committerMaxim Devaev <[email protected]>2022-04-25 15:55:07 +0300
commit61cdf10a83c4e9889ce5743e635ec1440b918a26 (patch)
tree7122770692df8be979eb6c6d873e45268fb9244a
parent293490298cbe5896920b338f05a8d269b47c04fd (diff)
refactoring
-rw-r--r--web/share/js/kvm/session.js12
1 files changed, 4 insertions, 8 deletions
diff --git a/web/share/js/kvm/session.js b/web/share/js/kvm/session.js
index ebcdd25d..1ef8b3c3 100644
--- a/web/share/js/kvm/session.js
+++ b/web/share/js/kvm/session.js
@@ -187,9 +187,12 @@ export function Session() {
if (throttling !== null) {
let pairs = [];
for (let field of Object.keys(throttling.parsed_flags).sort()) {
+ let flags = throttling.parsed_flags[field];
pairs.push([
tools.upperFirst(field).replace("_", " "),
- __formatThrottleError(throttling.parsed_flags[field]),
+ (flags["now"] ? __colored("red", "RIGHT NOW") : __colored("green", "No"))
+ + " " +
+ (flags["past"] ? __colored("red", "In the past") : __colored("green", "Never")),
]);
}
return __formatUl(pairs);
@@ -198,13 +201,6 @@ export function Session() {
}
};
- var __formatThrottleError = function(flags) {
- return `
- ${flags["now"] ? __colored("red", "RIGHT NOW") : __colored("green", "No")};
- ${flags["past"] ? __colored("red", "In the past") : __colored("green", "Never")}
- `;
- };
-
var __colored = function(color, text) {
return `<font color="${color}">${text}</font>`;
};