实现HTTP部分功能

This commit is contained in:
刘祥超
2020-09-26 08:07:18 +08:00
parent 94cdd7abb8
commit 81121bb7dc
32 changed files with 280 additions and 147 deletions
+13 -3
View File
@@ -38,11 +38,21 @@ Tea.context(function () {
*/
this.checkClusterChanges = function () {
this.$get("/common/changedClusters")
.params({
isNotifying: (this.globalChangedClusters.length > 0) ? 1 : 0
})
.timeout(60)
.success(function (resp) {
this.globalChangedClusters = resp.data.clusters;
}).fail(function () {
this.globalChangedClusters = [];
})
})
.fail(function () {
this.globalChangedClusters = [];
})
.done(function () {
this.$delay(function () {
this.checkClusterChanges()
}, 3000)
})
};
/**
+14 -1
View File
@@ -17,6 +17,16 @@
<option value="2">未安装</option>
</select>
</div>
<div class="ui field">
在线状态:
</div>
<div class="ui field">
<select class="ui dropdown" name="activeState" v-model="activeState">
<option value="0">[全部]</option>
<option value="1">在线</option>
<option value="2">不在线</option>
</select>
</div>
<div class="ui field">
<button class="ui button" type="submit">搜索</button>
</div>
@@ -63,7 +73,10 @@
</td>
<td>
<div v-if="node.isInstalled">
<span v-if="node.status.isActive"><span class="green">运行中</span></span>
<div v-if="node.status.isActive">
<span v-if="!node.isSynced" class="red">同步中</span>
<span v-else class="green">运行中</span>
</div>
<span v-else-if="node.status.updatedAt > 0" class="red">已断开</span>
<span v-else-if="node.status.updatedAt == 0" class="red">未连接</span>
</div>
+9 -1
View File
@@ -8,13 +8,21 @@
<tr>
<th>集群名称</th>
<th>节点数量</th>
<th>在线节点数量</th>
<th>默认认证</th>
<th class="two op">操作</th>
</tr>
</thead>
<tr v-for="cluster in clusters">
<td>{{cluster.name}}</td>
<td>{{cluster.countNodes}}</td>
<td>
<a :href="'/clusters/cluster?clusterId=' + cluster.id" v-if="cluster.countAllNodes > 0">{{cluster.countAllNodes}}</a>
<span class="disabled" v-else="">-</span>
</td>
<td>
<a :href="'/clusters/cluster?clusterId=' + cluster.id + '&activeState=1'" v-if="cluster.countActiveNodes > 0"><span class="green">{{cluster.countActiveNodes}}</span></a>
<span class="disabled" v-else>-</span>
</td>
<td>
<span v-if="cluster.hasGrant" class="green">Y</span>
<span v-else class="disabled">N</span>
-1
View File
@@ -15,7 +15,6 @@
<div>
{$template "/menu"}
<div class="form-box">
<form class="ui form" data-tea-action="$" data-tea-before="submitBefore" data-tea-done="submitDone" data-tea-success="submitSuccess" autocomplete="off">
<input type="hidden" name="password" v-model="passwordMd5"/>
+7 -1
View File
@@ -9,6 +9,8 @@
<th>服务名称</th>
<th>服务类型</th>
<th>部署集群</th>
<th>运行节点数</th>
<th>未运行节点数</th>
<th>端口</th>
<th>状态</th>
<th class="two op">操作</th>
@@ -18,13 +20,17 @@
<td>{{server.name}}</td>
<td>{{server.serverTypeName}}</td>
<td>{{server.cluster.name}}</td>
<td><span class="disabled">[暂无]</span></td>
<td><span class="disabled">[暂无]</span></td>
<td>
<span v-if="server.ports.length == 0">-</span>
<div v-for="port in server.ports" class="ui label small">
{{port.portRange}}<span class="small">{{port.protocol}}</span>
</div>
</td>
<td></td>
<td>
<span class="disabled">[暂无]</span>
</td>
<td>
<a :href="'/servers/server?serverId=' + server.id">详情</a>
</td>
@@ -6,7 +6,9 @@ Tea.context(function () {
"serverId": serverId
})
.success(function () {
teaweb.successURL("删除成功", "/servers")
teaweb.success("删除成功", function () {
window.location = "/servers"
})
})
})
}
@@ -1,28 +0,0 @@
{$layout "layout_popup"}
<h3>添加特殊页面</h3>
<form class="ui form" data-tea-action="$" data-tea-success="success">
<table class="ui table selectable definition">
<tr>
<td class="title">响应状态码 *</td>
<td>
<input type="text" name="status" size="3" placeholder="状态码" maxlength="3" style="width:5.2em" ref="focus"/>
<p class="comment">比如404,或者50x。</p>
</td>
</tr>
<tr>
<td>URL *</td>
<td>
<input type="text" name="url" maxlength="500" placeholder="页面文件路径或者完整的URL"/>
<p class="comment">页面文件是相对于节点安装目录的页面文件比如web/pages/40x.html,或者一个完整的URL。</p>
</td>
</tr>
<tr>
<td>新状态码</td>
<td>
<input type="text" name="newStatus" size="3" placeholder="状态码" maxlength="3" style="width:5.2em"/>
<p class="comment">可以用来修改响应的状态码,不填表示不改变原有状态码。</p>
</td>
</tr>
</table>
<submit-btn></submit-btn>
</form>
@@ -1,3 +0,0 @@
Tea.context(function () {
this.success = NotifyPopup
})
@@ -9,7 +9,7 @@
<div class="right-box tiny">
<form class="ui form" data-tea-action="$" data-tea-success="success">
<input type="hidden" name="webId" :value="webId"/>
<http-pages-and-shutdown-box :v-pages="pages" :v-shutdown-config="shutdownConfig"></http-pages-and-shutdown-box>
<http-pages-and-shutdown-box :v-pages="pages" :v-shutdown-config="shutdownConfig" :v-is-location="true"></http-pages-and-shutdown-box>
<submit-btn></submit-btn>
</form>
</div>
@@ -1,29 +0,0 @@
{$layout "layout_popup"}
<h3>修改特殊页面</h3>
<form class="ui form" data-tea-action="$" data-tea-success="success">
<input type="hidden" name="pageId" :value="pageConfig.id"/>
<table class="ui table selectable definition">
<tr>
<td class="title">响应状态码 *</td>
<td>
<input type="text" name="status" size="3" placeholder="状态码" maxlength="3" style="width:5.2em" ref="focus" v-model="pageConfig.status"/>
<p class="comment">比如404,或者50x。</p>
</td>
</tr>
<tr>
<td>URL *</td>
<td>
<input type="text" name="url" maxlength="500" placeholder="页面文件路径或者完整的URL" v-model="pageConfig.url"/>
<p class="comment">页面文件是相对于节点安装目录的页面文件比如web/pages/40x.html,或者一个完整的URL。</p>
</td>
</tr>
<tr>
<td>新状态码</td>
<td>
<input type="text" name="newStatus" size="3" placeholder="状态码" maxlength="3" style="width:5.2em" v-model="newStatus"/>
<p class="comment">可以用来修改响应的状态码,不填表示不改变原有状态码。</p>
</td>
</tr>
</table>
<submit-btn></submit-btn>
</form>
@@ -1,8 +0,0 @@
Tea.context(function () {
this.success = NotifyPopup
this.newStatus = ""
if (this.pageConfig.newStatus > 0) {
this.newStatus = this.pageConfig.newStatus
}
})
@@ -13,7 +13,7 @@
<tr>
<td class="title">Web目录</td>
<td>
<input type="text" name="root" v-model="webConfig.root"/>
<input type="text" name="root" v-model="webConfig.root" ref="focus"/>
</td>
</tr>
</table>
@@ -10,7 +10,7 @@
<tr>
<td class="title">Web目录</td>
<td>
<input type="text" name="root" v-model="webConfig.root"/>
<input type="text" name="root" v-model="webConfig.root" ref="focus"/>
</td>
</tr>
</table>