审核中服务增加提交审核时间/已通过域名标绿

This commit is contained in:
GoEdgeLab
2021-12-01 17:06:05 +08:00
parent bcb079e902
commit fbd71c142b
8 changed files with 54 additions and 8 deletions

View File

@@ -199,6 +199,12 @@ func (this *IndexAction) RunGet(params struct {
} }
} }
// 提交审核时间
var auditingTime = ""
if server.AuditingAt > 0 {
auditingTime = timeutil.FormatTime("Y-m-d", server.AuditingAt)
}
serverMaps = append(serverMaps, maps.Map{ serverMaps = append(serverMaps, maps.Map{
"id": server.Id, "id": server.Id,
"isOn": server.IsOn, "isOn": server.IsOn,
@@ -215,6 +221,7 @@ func (this *IndexAction) RunGet(params struct {
"isAuditing": server.IsAuditing, "isAuditing": server.IsAuditing,
"auditingIsOk": auditingIsOk, "auditingIsOk": auditingIsOk,
"user": userMap, "user": userMap,
"auditingTime": auditingTime,
}) })
} }
this.Data["servers"] = serverMaps this.Data["servers"] = serverMaps

View File

@@ -30,8 +30,26 @@ func (this *IndexAction) RunGet(params struct {
return return
} }
// 已审核域名
var passedDomains = []string{}
if len(serverNamesResp.ServerNamesJSON) > 0 {
var passedServerNameConfigs = []*serverconfigs.ServerNameConfig{}
err = json.Unmarshal(serverNamesResp.ServerNamesJSON, &passedServerNameConfigs)
if err == nil {
passedDomains = serverconfigs.PlainServerNames(passedServerNameConfigs)
}
}
this.Data["passedDomains"] = passedDomains
// 提交审核时间
var auditingTime = ""
if serverNamesResp.AuditingAt > 0 {
auditingTime = timeutil.FormatTime("Y-m-d", serverNamesResp.AuditingAt)
}
serverNamesConfig := []*serverconfigs.ServerNameConfig{} serverNamesConfig := []*serverconfigs.ServerNameConfig{}
this.Data["isAuditing"] = serverNamesResp.IsAuditing this.Data["isAuditing"] = serverNamesResp.IsAuditing
this.Data["auditingTime"] = auditingTime
this.Data["auditingResult"] = maps.Map{ this.Data["auditingResult"] = maps.Map{
"isOk": true, "isOk": true,
} }

View File

@@ -7,7 +7,7 @@
padding-right: 1em; padding-right: 1em;
} }
.node-logs-box { .node-logs-box {
max-height: 11.6em; max-height: 14em;
overflow-y: auto; overflow-y: auto;
} }
.node-logs-box::-webkit-scrollbar { .node-logs-box::-webkit-scrollbar {

View File

@@ -1 +1 @@
{"version":3,"sources":["index.less"],"names":[],"mappings":"AAAA,GAAG,QACF,MAAK;EACJ,kBAAA;EACA,UAAA;EACA,UAAA;;AAJF,GAAG,QAOF;EACC,kBAAA;;AAIF;EACC,kBAAA;EACA,gBAAA;;AAGD,cAAc;EACb,UAAA","file":"index.css"} {"version":3,"sources":["index.less"],"names":[],"mappings":"AAAA,GAAG,QACF,MAAK;EACJ,kBAAA;EACA,UAAA;EACA,UAAA;;AAJF,GAAG,QAOF;EACC,kBAAA;;AAIF;EACC,gBAAA;EACA,gBAAA;;AAGD,cAAc;EACb,UAAA","file":"index.css"}

View File

@@ -101,7 +101,7 @@
<!-- 审核中 --> <!-- 审核中 -->
<div v-if="server.isAuditing" style="margin-top: 0.5em"> <div v-if="server.isAuditing" style="margin-top: 0.5em">
<a class="ui label basic tiny red" title="点击跳到审核页面" :href="'/servers/server/settings/serverNames?serverId=' + server.id">审核中 &nbsp;<i class="icon long arrow right alternate"></i></a> <a class="ui label basic tiny red" title="点击跳到审核页面" :href="'/servers/server/settings/serverNames?serverId=' + server.id">审核中<span class="small grey" v-if="server.auditingTime.length > 0">{{server.auditingTime}}</span> &nbsp;<i class="icon long arrow right alternate"></i></a>
</div> </div>
<!-- 审核失败 --> <!-- 审核失败 -->

View File

@@ -11,7 +11,7 @@
} }
.node-logs-box { .node-logs-box {
max-height: 11.6em; max-height: 14em;
overflow-y: auto; overflow-y: auto;
} }

View File

@@ -12,11 +12,16 @@
<tr> <tr>
<td class="title">审核中域名</td> <td class="title">审核中域名</td>
<td> <td>
<span v-for="serverName in allServerNames" class="ui label basic"> <span v-for="serverName in allServerNames" class="ui label basic" :class="{green: serverName.isPassed}">
{{serverName}} {{serverName.name}}
</span> </span>
<p class="comment" v-if="hasPassedDomains"><span class="green">绿色</span>标注的域名表示之前已经审核通过的域名。</p>
</td> </td>
</tr> </tr>
<tr v-if="auditingTime.length > 0">
<td>提交审核时间</td>
<td>{{auditingTime}}</td>
</tr>
<tr> <tr>
<td>审核结果</td> <td>审核结果</td>
<td> <td>

View File

@@ -6,10 +6,26 @@ Tea.context(function () {
let that = this let that = this
this.serverNames.forEach(function (v) { this.serverNames.forEach(function (v) {
if (v.subNames == null || v.subNames.length == 0) { if (v.subNames == null || v.subNames.length == 0) {
that.allServerNames.push(v.name) that.allServerNames.push({
name: v.name,
isPassed: that.passedDomains.$contains(v.name)
})
} else { } else {
that.allServerNames.$pushAll(v.subNames) v.subNames.forEach(function (subName) {
that.allServerNames.push({
name: subName,
isPassed: that.passedDomains.$contains(subName)
})
})
} }
}) })
this.hasPassedDomains = false
this.allServerNames.forEach(function (serverName) {
if (serverName.isPassed) {
that.hasPassedDomains = true
}
})
this.auditing = 1 this.auditing = 1
}) })