mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 01:00:29 +08:00
refactoring
This commit is contained in:
parent
293490298c
commit
61cdf10a83
@ -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>`;
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user