实现基础的IP地址阈值

This commit is contained in:
GoEdgeLab
2021-09-12 20:21:32 +08:00
parent 40c5c78d6e
commit d4494d0191
31 changed files with 788 additions and 267 deletions

View File

@@ -31,6 +31,10 @@
</div>
</td>
</tr>
<tr v-if="domainId == 0">
<td>线路</td>
<td><span class="disabled">当前集群没有选择域名。</span></td>
</tr>
</table>
<submit-btn></submit-btn>

View File

@@ -11,6 +11,8 @@
</div>
<div class="ui field">
<button class="ui button" type="submit">搜索</button>
&nbsp;
<a :href="Tea.url('.')" v-if="keyword.length > 0">[清除条件]</a>
</div>
</div>
</form>

View File

@@ -11,7 +11,8 @@
<tr>
<td>状态</td>
<td>
<label-on :v-is-on="addr.isOn" v-if="!addr.isOn"></label-on>
<span v-if="!addr.canAccess" class="red">不可访问</span>
<span v-else-if="!addr.isOn" class="red">禁用</span>
<span v-else-if="addr.isUp" class="green">在线</span>
<span v-else class="red">离线</span>
</td>
@@ -33,20 +34,11 @@
<span v-else class="disabled">-</span>
</td>
</tr>
<tr>
<td>是否可以访问</td>
<td>
<span v-if="addr.canAccess" class="green">Y</span>
<span v-else class="disabled">N</span>
</td>
</tr>
<tr>
<td>阈值</td>
<td>
<div v-if="addr.thresholds.length > 0">
<span v-for="threshold in addr.thresholds" class="ui basic tiny label">
{{threshold.item}} {{threshold.operator}} {{threshold.value}}
</span>
<node-ip-address-thresholds-view :v-thresholds="addr.thresholds"></node-ip-address-thresholds-view>
</div>
<span v-else class="disabled">没有设置阈值。</span>
</td>

View File

@@ -42,7 +42,7 @@
<td>
<a :href="Tea.url('.reporter', {reporterId: reporter.id})"><keyword :v-word="keyword">{{reporter.name}}</keyword></a>
<div v-if="reporter.groups.length > 0" style="margin-top: 0.5em">
<div class="ui label basic tiny" v-for="group in reporter.groups"><span class="small">{{group.name}}</span></div>
<grey-label v-for="group in reporter.groups">{{group.name}}</grey-label>
</div>
<div v-if="reporter.shouldUpgrade">
<span class="red small" title="需要升级">v{{reporter.status.buildVersion}} -&gt; v{{reporter.newVersion}}</span>

View File

@@ -9,6 +9,8 @@
</div>
<div class="ui field">
<button class="ui button" type="submit">搜索</button>
&nbsp;
<a href="/dns" v-if="keyword.length > 0">[清除条件]</a>
</div>
</div>
</form>

View File

@@ -31,6 +31,10 @@
</div>
</td>
</tr>
<tr v-if="domainId == 0">
<td>线路</td>
<td><span class="disabled">当前集群没有选择域名。</span></td>
</tr>
</table>
<submit-btn></submit-btn>

View File

@@ -13,6 +13,8 @@
</div>
<div class="ui field">
<button class="ui button" type="submit">搜索</button>
&nbsp;
<a :href="Tea.url('.')" v-if="keyword.length > 0">[清除条件]</a>
</div>
</div>
</form>

View File

@@ -30,8 +30,17 @@
<input type="text" name="name" maxlength="50"/>
</td>
</tr>
<tr>
<td>在线状态</td>
<td>
<select class="ui dropdown auto-width" name="isUp">
<option value="1">在线</option>
<option value="0">离线</option>
</select>
</td>
</tr>
<tr v-if="teaIsPlus && supportThresholds">
<td>上线阈值</td>
<td>阈值设置</td>
<td>
<node-ip-address-thresholds-box></node-ip-address-thresholds-box>
</td>

View File

@@ -41,8 +41,17 @@
<input type="text" name="name" maxlength="50" v-model="address.name"/>
</td>
</tr>
<tr>
<td>在线状态</td>
<td>
<select class="ui dropdown auto-width" name="isUp" v-model="address.isUp">
<option value="1">在线</option>
<option value="0">离线</option>
</select>
</td>
</tr>
<tr v-if="teaIsPlus && supportThresholds">
<td>上线阈值</td>
<td>阈值设置</td>
<td>
<node-ip-address-thresholds-box :v-thresholds="address.thresholds"></node-ip-address-thresholds-box>
</td>

View File

@@ -2,4 +2,7 @@ Tea.context(function () {
this.success = NotifyPopup;
this.address = window.parent.UPDATING_NODE_IP_ADDRESS
});
if (this.address != null) {
this.address.isUp = (this.address.isUp ? 1 : 0)
}
})

View File

@@ -21,6 +21,8 @@
</div>
<div class="ui field">
<button class="ui button" type="submit">搜索</button>
&nbsp;
<a :href="Tea.url('.')" v-if="clusterId > 0 || userId > 0 || keyword.length > 0">[清除条件]</a>
</div>
</div>
</form>

View File

@@ -14,12 +14,15 @@
</second-menu>
<form class="ui form">
<input type="hidden" name="type" :value="type"/>
<div class="ui fields inline">
<div class="ui field">
<input type="text" name="keyword" placeholder="关键词" style="width:10em" v-model="keyword"/>
</div>
<div class="ui field">
<button type="submit" class="ui button">搜索</button>
&nbsp;
<a :href="Tea.url('.', { 'type':type })" v-if="keyword.length > 0">[清除条件]</a>
</div>
</div>
</form>
@@ -39,7 +42,7 @@
</tr>
</thead>
<tr v-for="(cert, index) in certs">
<td>{{cert.name}}
<td><keyword :v-word="keyword">{{cert.name}}</keyword>
<div v-if="cert.isCA" style="margin-top:0.5em">
<micro-basic-label :class="olive">CA</micro-basic-label>
</div>
@@ -52,7 +55,7 @@
</td>
<td>
<div v-for="dnsName in cert.dnsNames" style="margin-bottom:0.4em">
<span class="ui label tiny basic">{{dnsName}}</span>
<span class="ui label tiny basic"><keyword :v-word="keyword">{{dnsName}}</keyword></span>
</div>
</td>
<td>{{certInfos[index].beginDay}}</td>

View File

@@ -15,6 +15,8 @@
</div>
<div class="ui field">
<button type="submit" class="ui button">搜索</button>
&nbsp;
<a :href="Tea.url('.')" v-if="keyword.length > 0">[清除条件]</a>
</div>
</div>
</form>

View File

@@ -39,7 +39,7 @@
<tbody v-for="set in sets" :data-set-id="set.id">
<tr>
<td style="text-align: center;"><i class="icon bars handle grey"></i> </td>
<td nowrap=""><span :class="{disabled:!set.isOn}">{{set.name}}</span>
<td nowrap=""><a href="" @click.prevent="updateSet(set.id)"><span :class="{disabled:!set.isOn}">{{set.name}}</span></a>
<p style="margin-top:0.5em">
<label-on :v-is-on="set.isOn"></label-on>
</p>

View File

@@ -20,9 +20,9 @@
<tbody v-for="group in groups" :data-group-id="group.id">
<tr>
<td style="text-align: center;"><i class="icon bars handle grey" title="拖动排序"></i> </td>
<td><span :class="{disabled:!group.isOn}">{{group.name}}</span>
<td><a :href="'/servers/components/waf/group?firewallPolicyId=' + firewallPolicyId + '&type=' + type + '&groupId=' + group.id"><span :class="{disabled:!group.isOn}">{{group.name}}</span></a>
<p class="comment" v-if="group.description.length > 0" style="padding-bottom:0">{{group.description}}</p>
<p>
<p style="margin-top: 0.5em">
<span v-if="group.isOn" class="ui label tiny basic green">启用</span>
<span v-if="!group.isOn" class="ui label tiny basic red">停用</span>
<span v-if="group.code.length > 0" class="ui label basic tiny">预置</span>

View File

@@ -15,6 +15,8 @@
</div>
<div class="ui field">
<button type="submit" class="ui button">搜索</button>
&nbsp;
<a :href="Tea.url('.')" v-if="keyword.length > 0">[清除条件]</a>
</div>
</div>
</form>

View File

@@ -47,8 +47,10 @@
</div>
<div class="ui field">
<button type="submit" class="ui button">搜索</button>
&nbsp;
<a href="/servers" v-if="clusterId > 0 || groupId > 0 || keyword.length > 0">[清除条件]</a>
</div>
<div class="ui field" v-if="latestServers.length > 0">
<div class="ui field" v-if="clusterId == 0 && groupId == 0 && keyword.length == 0 && latestServers.length > 0">
<a href="" @click.prevent="showLatest()">常用<i class="icon angle" :class="{down: !latestVisible, up: latestVisible}"></i> </a>
</div>
</div>

View File

@@ -41,7 +41,7 @@
<tbody v-for="set in sets" :data-set-id="set.id">
<tr>
<td style="text-align: center;"><i class="icon bars handle grey"></i> </td>
<td nowrap=""><span :class="{disabled:!set.isOn}">{{set.name}}</span>
<td nowrap=""><a href="" @click.prevent="updateSet(set.id)"><span :class="{disabled:!set.isOn}">{{set.name}}</span></a>
<p style="margin-top:0.5em">
<label-on :v-is-on="set.isOn"></label-on>
</p>

View File

@@ -24,9 +24,9 @@
<tbody v-for="group in groups" :data-group-id="group.id">
<tr>
<td style="text-align: center;"><i class="icon bars handle grey" title="拖动排序"></i> </td>
<td><span :class="{disabled:!group.isOn}">{{group.name}}</span>
<td><a :href="'/servers/server/settings/waf/group?serverId=' + serverId + '&firewallPolicyId=' + firewallPolicyId + '&type=' + type + '&groupId=' + group.id"><span :class="{disabled:!group.isOn}">{{group.name}}</span></a>
<p class="comment" v-if="group.description.length > 0" style="padding-bottom:0">{{group.description}}</p>
<p>
<p style="margin-top: 0.5em">
<span v-if="group.isOn" class="ui label tiny basic green">启用</span>
<span v-if="!group.isOn" class="ui label tiny basic red">停用</span>
<span v-if="group.code.length > 0" class="ui label basic tiny">预置</span>