后台:服务器维护

This commit is contained in:
luying
2021-12-08 10:25:21 +08:00
parent 103314a8bf
commit 22f8d3c438
29 changed files with 512 additions and 343 deletions

View File

@@ -1,5 +1,4 @@
import { RoleType } from '../../db/Role';
import { getSeconds } from '../../pubUtils/timeUtil';
import { ServerlistType } from '../../db/Serverlist';
export class ServerParam {
@@ -15,10 +14,10 @@ export class ServerParam {
constructor(server: ServerlistType) {
this.id = server.id;
this.serverId = server.serverId;
this.serverStr = `S${server.serverId}`;
this.serverStr = `${server.prefix}${server.serverId}`;
this.name = server.name;
this.status = server.status;
this.openTime = getSeconds(server.openTime);
this.openTime = server.openTime;
}
}
@@ -31,15 +30,17 @@ export class GroupParam {
constructor(server: ServerlistType) {
this.groupId = server.groupId;
this.groupName = server.groupName;
this.groupStr = `S${server.serverId}-S${server.serverId + 9}`;
this.groupStr = `${server.prefix}${server.serverId}`;
this.servers = new Array<ServerParam>();
}
public pushServer(server: ServerlistType) {
let srv = new ServerParam(server);
this.servers.push(srv);
let min = this.servers.reduce((pre, cur) => pre < cur? pre: cur);
this.groupStr = `${min.serverId}-${min.serverId + 9}`
this.servers.sort((a, b) => b.serverId - a.serverId);
let min = this.servers[this.servers.length - 1];
let max = this.servers[0];
this.groupStr = `${min.serverStr}-${max.serverStr}`
}
}