后台:服务器维护
This commit is contained in:
@@ -121,7 +121,9 @@ export class CreateServerParam {
|
||||
env: string = '';
|
||||
openTime: number = 0;
|
||||
activityGroupId: number[] = [];
|
||||
hasOpenMail: boolean = false;
|
||||
openMail?: GMMail;
|
||||
hasCircleMail: boolean = false;
|
||||
circleMail?: GMMail;
|
||||
stopRegisterTime: number = 0;
|
||||
|
||||
@@ -135,6 +137,8 @@ export class CreateServerParam {
|
||||
if(!this.env || !this.openTime || !this.stopRegisterTime || !isArray(this.activityGroupId) || this.activityGroupId.length <= 0 ) {
|
||||
return false
|
||||
}
|
||||
if(this.hasOpenMail && !this.openMail) return false;
|
||||
if(this.hasCircleMail && !this.circleMail) return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -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