实现基础的智能调度

This commit is contained in:
刘祥超
2023-05-17 18:41:27 +08:00
parent 275320ad9b
commit c65dffee13
7 changed files with 85 additions and 31 deletions

View File

@@ -1,5 +1,5 @@
Vue.component("time-duration-box", {
props: ["v-name", "v-value", "v-count", "v-unit"],
props: ["name", "v-name", "v-value", "v-count", "v-unit"],
mounted: function () {
this.change()
},
@@ -14,9 +14,18 @@ Vue.component("time-duration-box", {
if (typeof (v["count"]) != "number") {
v["count"] = -1
}
let realName = ""
if (typeof this.name == "string" && this.name.length > 0) {
realName = this.name
} else if (typeof this.vName == "string" && this.vName.length > 0) {
realName = this.vName
}
return {
duration: v,
countString: (v.count >= 0) ? v.count.toString() : ""
countString: (v.count >= 0) ? v.count.toString() : "",
realName: realName
}
},
watch: {
@@ -39,7 +48,7 @@ Vue.component("time-duration-box", {
}
},
template: `<div class="ui fields inline" style="padding-bottom: 0; margin-bottom: 0">
<input type="hidden" :name="vName" :value="JSON.stringify(duration)"/>
<input type="hidden" :name="realName" :value="JSON.stringify(duration)"/>
<div class="ui field">
<input type="text" v-model="countString" maxlength="11" size="11" @keypress.enter.prevent="1"/>
</div>

View File

@@ -95,6 +95,16 @@ Vue.component("message-row", {
<div v-if="message.type == 'serverNamesRequireAuditing'" style="margin-top: 0.8em">
<a :href="'/servers/server/settings/serverNames?serverId=' + params.serverId" target="_top">去审核</a></a>
</div>
<!-- 节点调度 -->
<div v-if="message.type == 'NodeSchedule'" style="margin-top: 0.8em">
<a :href="'/clusters/cluster/node/settings/schedule?clusterId=' + message.cluster.id + '&nodeId=' + message.node.id" target="_top">查看调度状态 &raquo;</a>
</div>
<!-- 节点租期结束 -->
<div v-if="message.type == 'NodeOfflineDay'" style="margin-top: 0.8em">
<a :href="'/clusters/cluster/node/detail?clusterId=' + message.cluster.id + '&nodeId=' + message.node.id" target="_top">查看详情 &raquo;</a>
</div>
</td>
</tr>
</table>