后台:服务器维护
This commit is contained in:
@@ -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}`
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user