mirror of
				https://github.com/TeaOSLab/EdgeAdmin.git
				synced 2025-11-04 05:00:25 +08:00 
			
		
		
		
	删除不需要的文件
This commit is contained in:
		@@ -1,4 +0,0 @@
 | 
			
		||||
<first-menu>
 | 
			
		||||
    <menu-item href="." code="index">IP地址</menu-item>
 | 
			
		||||
    <menu-item href=".logs" code="log">变更日志</menu-item>
 | 
			
		||||
</first-menu>
 | 
			
		||||
@@ -1,8 +0,0 @@
 | 
			
		||||
<first-menu>
 | 
			
		||||
    <menu-item href="/clusters/ip-addrs">全部地址</menu-item>
 | 
			
		||||
    <span class="item disabled">|</span>
 | 
			
		||||
    <menu-item :href="'.?addrId=' + addr.id" code="addr">"{{addr.ip}}"详情</menu-item>
 | 
			
		||||
    <menu-item :href="'.logs?addrId=' + addr.id" code="log">日志</menu-item>
 | 
			
		||||
    <menu-item :href="'.reports?addrId=' + addr.id" code="report">监控</menu-item>
 | 
			
		||||
    <menu-item :href="'.update?addrId=' + addr.id" code="update">修改</menu-item>
 | 
			
		||||
</first-menu>
 | 
			
		||||
@@ -1,10 +0,0 @@
 | 
			
		||||
h4 a {
 | 
			
		||||
  font-size: 0.8em;
 | 
			
		||||
  margin-left: 0.6em;
 | 
			
		||||
  font-weight: normal;
 | 
			
		||||
}
 | 
			
		||||
.chart-box {
 | 
			
		||||
  width: 30em;
 | 
			
		||||
  height: 20em;
 | 
			
		||||
}
 | 
			
		||||
/*# sourceMappingURL=index.css.map */
 | 
			
		||||
@@ -1 +0,0 @@
 | 
			
		||||
{"version":3,"sources":["index.less"],"names":[],"mappings":"AAAA,EACC;EACC,gBAAA;EACA,kBAAA;EACA,mBAAA;;AAKF;EACC,WAAA;EACA,YAAA","file":"index.css"}
 | 
			
		||||
@@ -1,61 +0,0 @@
 | 
			
		||||
{$layout}
 | 
			
		||||
{$template "/echarts"}
 | 
			
		||||
{$template "menu"}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
<table class="ui table definition selectable">
 | 
			
		||||
    <tr>
 | 
			
		||||
        <td class="title">IP地址</td>
 | 
			
		||||
        <td>
 | 
			
		||||
            {{addr.ip}}
 | 
			
		||||
        </td>
 | 
			
		||||
    </tr>
 | 
			
		||||
    <tr>
 | 
			
		||||
        <td>状态</td>
 | 
			
		||||
        <td>
 | 
			
		||||
            <span v-if="!addr.canAccess" class="red">不可访问</span>
 | 
			
		||||
            <span v-else-if="!addr.isOn" class="red">禁用</span>
 | 
			
		||||
            <span v-else-if="addr.isUp && addr.backupIP.length > 0" class="orange">备用
 | 
			
		||||
                  <a href="" @click.prevent="restoreBackup(addr.id)"><span class="small">[恢复]</span></a>
 | 
			
		||||
                <br/><span class="grey small">{{addr.backupIP}}</span>
 | 
			
		||||
            </span>
 | 
			
		||||
            <span v-else-if="addr.isUp" class="green">在线   <a href="" @click.prevent="updateUp(addr.id, false)"><span class="small">[下线]</span></a></span>
 | 
			
		||||
            <span v-else class="red">离线   <a href="" @click.prevent="updateUp(addr.id, true)"><span class="small">[上线]</span></a>
 | 
			
		||||
            </span>
 | 
			
		||||
        </td>
 | 
			
		||||
    </tr>
 | 
			
		||||
    <tr>
 | 
			
		||||
        <td>所属集群</td>
 | 
			
		||||
        <td><link-icon :href="'/clusters/cluster?clusterId=' + addr.cluster.id">{{addr.cluster.name}}</link-icon></td>
 | 
			
		||||
    </tr>
 | 
			
		||||
    <tr>
 | 
			
		||||
        <td>所属节点</td>
 | 
			
		||||
        <td>
 | 
			
		||||
            <link-icon :href="'/clusters/cluster/node?clusterId=' + addr.cluster.id + '&nodeId=' + addr.node.id">{{addr.node.name}}</link-icon>
 | 
			
		||||
        </td>
 | 
			
		||||
    </tr>
 | 
			
		||||
    <tr>
 | 
			
		||||
        <td>名称</td>
 | 
			
		||||
        <td>
 | 
			
		||||
            <span v-if="addr.name.length > 0">{{addr.name}}</span>
 | 
			
		||||
            <span v-else class="disabled">-</span>
 | 
			
		||||
        </td>
 | 
			
		||||
    </tr>
 | 
			
		||||
    <tr>
 | 
			
		||||
        <td>阈值设置</td>
 | 
			
		||||
        <td>
 | 
			
		||||
            <div v-if="addr.thresholds.length > 0">
 | 
			
		||||
                <node-ip-address-thresholds-view :v-thresholds="addr.thresholds"></node-ip-address-thresholds-view>
 | 
			
		||||
            </div>
 | 
			
		||||
            <span v-else class="disabled">没有设置阈值。</span>
 | 
			
		||||
        </td>
 | 
			
		||||
    </tr>
 | 
			
		||||
</table>
 | 
			
		||||
 | 
			
		||||
<!-- 监控信息 -->
 | 
			
		||||
<div v-if="results.length > 0">
 | 
			
		||||
    <div class="margin"></div>
 | 
			
		||||
    <h4>区域监控 <a :href="Tea.url('.reports', {addrId: addr.id})"><span>[详情]</span></a></h4>
 | 
			
		||||
    <div class="ui divider"></div>
 | 
			
		||||
    <div class="chart-box" id="reports-chart-box"></div>
 | 
			
		||||
</div>
 | 
			
		||||
@@ -1,103 +0,0 @@
 | 
			
		||||
Tea.context(function () {
 | 
			
		||||
	this.$delay(function () {
 | 
			
		||||
		this.loadChart()
 | 
			
		||||
	})
 | 
			
		||||
 | 
			
		||||
	this.updateUp = function (addrId, isUp) {
 | 
			
		||||
		let status = isUp ? "在线" : "离线"
 | 
			
		||||
		teaweb.confirm("确定要手动将此IP设置为" + status + "吗?", function () {
 | 
			
		||||
			this.$post(".up")
 | 
			
		||||
				.params({
 | 
			
		||||
					addrId: addrId,
 | 
			
		||||
					isUp: isUp ? 1 : 0
 | 
			
		||||
				})
 | 
			
		||||
				.refresh()
 | 
			
		||||
		})
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	this.restoreBackup = function (addrId) {
 | 
			
		||||
		teaweb.confirm("确定要恢复IP地址吗?", function () {
 | 
			
		||||
			this.$post(".restoreBackup")
 | 
			
		||||
				.params({
 | 
			
		||||
					addrId: addrId
 | 
			
		||||
				})
 | 
			
		||||
				.refresh()
 | 
			
		||||
		})
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	this.loadChart = function () {
 | 
			
		||||
		if (this.results.length == 0) {
 | 
			
		||||
			return
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		let sumColor = "green"
 | 
			
		||||
		this.results.forEach(function (v) {
 | 
			
		||||
			switch (v.level) {
 | 
			
		||||
				case "good":
 | 
			
		||||
					v.color = "green"
 | 
			
		||||
					break
 | 
			
		||||
				case "normal":
 | 
			
		||||
					v.color = "blue"
 | 
			
		||||
					break
 | 
			
		||||
				case "bad":
 | 
			
		||||
					v.color = "orange"
 | 
			
		||||
					if (sumColor != "red") {
 | 
			
		||||
						sumColor = "orange"
 | 
			
		||||
					}
 | 
			
		||||
					break
 | 
			
		||||
				case "broken":
 | 
			
		||||
					v.color = "red"
 | 
			
		||||
					sumColor = "red"
 | 
			
		||||
					break
 | 
			
		||||
			}
 | 
			
		||||
		})
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		let chartBox = document.getElementById("reports-chart-box")
 | 
			
		||||
		if (chartBox == null || chartBox.offsetHeight == 0) {
 | 
			
		||||
			let that = this
 | 
			
		||||
			setTimeout(function () {
 | 
			
		||||
				that.loadChart()
 | 
			
		||||
			})
 | 
			
		||||
			return
 | 
			
		||||
		}
 | 
			
		||||
		let chart = teaweb.initChart(chartBox)
 | 
			
		||||
		chart.setOption({
 | 
			
		||||
			radar: [
 | 
			
		||||
				{
 | 
			
		||||
					splitNumber: 4,
 | 
			
		||||
					indicator: this.results.map(function (result) {
 | 
			
		||||
						return {
 | 
			
		||||
							name: result.node.name,
 | 
			
		||||
							color: result.color,
 | 
			
		||||
							max: 5000
 | 
			
		||||
						}
 | 
			
		||||
					})
 | 
			
		||||
				}
 | 
			
		||||
			],
 | 
			
		||||
			series: [{
 | 
			
		||||
				name: '',
 | 
			
		||||
				type: 'radar',
 | 
			
		||||
				data: [
 | 
			
		||||
					{
 | 
			
		||||
						value: this.results.map(function (result) {
 | 
			
		||||
							return result.costMs
 | 
			
		||||
						})
 | 
			
		||||
					}
 | 
			
		||||
				],
 | 
			
		||||
				lineStyle: {
 | 
			
		||||
					width: "1",
 | 
			
		||||
					color: sumColor,
 | 
			
		||||
					opacity: 0.2
 | 
			
		||||
				},
 | 
			
		||||
				itemStyle: {
 | 
			
		||||
					opacity: 0
 | 
			
		||||
				},
 | 
			
		||||
				areaStyle: {
 | 
			
		||||
					color: sumColor,
 | 
			
		||||
					opacity: 0.2
 | 
			
		||||
				}
 | 
			
		||||
			}]
 | 
			
		||||
		})
 | 
			
		||||
	}
 | 
			
		||||
})
 | 
			
		||||
@@ -1,13 +0,0 @@
 | 
			
		||||
h4 {
 | 
			
		||||
	a {
 | 
			
		||||
		font-size: 0.8em;
 | 
			
		||||
		margin-left: 0.6em;
 | 
			
		||||
		font-weight: normal;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
.chart-box {
 | 
			
		||||
	width: 30em;
 | 
			
		||||
	height: 20em;
 | 
			
		||||
}
 | 
			
		||||
@@ -1,37 +0,0 @@
 | 
			
		||||
{$layout}
 | 
			
		||||
{$template "menu"}
 | 
			
		||||
 | 
			
		||||
<p class="comment" v-if="logs.length == 0">暂时还没有日志。</p>
 | 
			
		||||
 | 
			
		||||
<div v-if="logs.length > 0">
 | 
			
		||||
   <div class="margin"></div>
 | 
			
		||||
   <table class="ui table selectable celled">
 | 
			
		||||
       <thead>
 | 
			
		||||
            <tr>
 | 
			
		||||
                <th class="two wide">操作人</th>
 | 
			
		||||
                <th class="two wide">状态</th>
 | 
			
		||||
                <th>描述</th>
 | 
			
		||||
                <th style="width: 12em">时间</th>
 | 
			
		||||
            </tr>
 | 
			
		||||
       </thead>
 | 
			
		||||
        <tr v-for="log in logs">
 | 
			
		||||
            <td>
 | 
			
		||||
                <span v-if="log.admin.id > 0">{{log.admin.name}}</span>
 | 
			
		||||
                <span v-else class="grey">{{log.admin.name}}</span>
 | 
			
		||||
            </td>
 | 
			
		||||
            <td>
 | 
			
		||||
                <span v-if="!log.isOn" class="red">停用</span>
 | 
			
		||||
                <span v-else-if="!log.canAccess" class="red">不可访问</span>
 | 
			
		||||
                <span v-else-if="log.isUp && log.backupIP.length > 0" class="orange">备用
 | 
			
		||||
                    <br/><span class="grey small">{{log.backupIP}}</span>
 | 
			
		||||
                </span>
 | 
			
		||||
                <span v-else-if="log.isUp" class="green">上线</span>
 | 
			
		||||
                <span v-else class="red">离线</span>
 | 
			
		||||
            </td>
 | 
			
		||||
            <td>{{log.description}}</td>
 | 
			
		||||
            <td>{{log.createdTime}}</td>
 | 
			
		||||
        </tr>
 | 
			
		||||
   </table>
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
<div class="page" v-html="page"></div>
 | 
			
		||||
@@ -1,37 +0,0 @@
 | 
			
		||||
{$layout}
 | 
			
		||||
{$template "menu"}
 | 
			
		||||
 | 
			
		||||
<p class="comment" v-if="results.length == 0">暂时还没有监控结果。</p>
 | 
			
		||||
<table class="ui table celled selectable" v-if="results.length > 0">
 | 
			
		||||
    <thead>
 | 
			
		||||
    <tr>
 | 
			
		||||
        <th class="three wide">监控节点</th>
 | 
			
		||||
        <th class="two wide">检测时间</th>
 | 
			
		||||
        <th class="four wide">对象</th>
 | 
			
		||||
        <th class="one wide">级别</th>
 | 
			
		||||
        <th class="two wide">耗时</th>
 | 
			
		||||
        <th>错误信息</th>
 | 
			
		||||
    </tr>
 | 
			
		||||
    </thead>
 | 
			
		||||
    <tr v-for="result in results">
 | 
			
		||||
        <td>
 | 
			
		||||
            {{result.node.name}}<link-icon :href="'/clusters/monitors/reporters/reporter?reporterId=' + result.node.id"></link-icon>
 | 
			
		||||
            <div v-if="result.node.location.length > 0 || result.node.isp.length > 0">
 | 
			
		||||
                <span class="grey small">{{result.node.location}}<span v-if="result.node.location.length > 0"> </span> {{result.node.isp}}</span>
 | 
			
		||||
            </div>
 | 
			
		||||
        </td>
 | 
			
		||||
        <td>{{result.updatedTime}}</td>
 | 
			
		||||
        <td>{{result.targetDesc}}</td>
 | 
			
		||||
        <td>
 | 
			
		||||
            <span :class="result.color">{{result.levelName}}</span>
 | 
			
		||||
        </td>
 | 
			
		||||
        <td>
 | 
			
		||||
            <span v-if="result.isOk" :class="result.color">{{result.costMs}}ms</span>
 | 
			
		||||
            <span v-else class="disabled">-</span>
 | 
			
		||||
        </td>
 | 
			
		||||
        <td>
 | 
			
		||||
            <span v-if="!result.isOk" class="red">{{result.error}}</span>
 | 
			
		||||
            <span v-else class="disabled">-</span>
 | 
			
		||||
        </td>
 | 
			
		||||
    </tr>
 | 
			
		||||
</table>
 | 
			
		||||
@@ -1,18 +0,0 @@
 | 
			
		||||
Tea.context(function () {
 | 
			
		||||
	this.results.forEach(function (v) {
 | 
			
		||||
		switch (v.level) {
 | 
			
		||||
			case "good":
 | 
			
		||||
				v.color = "green"
 | 
			
		||||
				break
 | 
			
		||||
			case "normal":
 | 
			
		||||
				v.color = "blue"
 | 
			
		||||
				break
 | 
			
		||||
			case "bad":
 | 
			
		||||
				v.color = "orange"
 | 
			
		||||
				break
 | 
			
		||||
			case "broken":
 | 
			
		||||
				v.color = "red"
 | 
			
		||||
				break
 | 
			
		||||
		}
 | 
			
		||||
	})
 | 
			
		||||
})
 | 
			
		||||
@@ -1,57 +0,0 @@
 | 
			
		||||
{$layout}
 | 
			
		||||
{$template "menu"}
 | 
			
		||||
 | 
			
		||||
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
 | 
			
		||||
    <csrf-token></csrf-token>
 | 
			
		||||
	<input type="hidden" name="addrId" :value="addr.id"/>
 | 
			
		||||
	<table class="ui table definition selectable">
 | 
			
		||||
		<tr>
 | 
			
		||||
			<td class="title">IP地址 *</td>
 | 
			
		||||
			<td>
 | 
			
		||||
				<input type="text" name="ip" maxlength="128" ref="focus" v-model="addr.ip"/>
 | 
			
		||||
			</td>
 | 
			
		||||
		</tr>
 | 
			
		||||
		<tr>
 | 
			
		||||
			<td>是否可以访问</td>
 | 
			
		||||
			<td>
 | 
			
		||||
				<div class="ui checkbox">
 | 
			
		||||
					<input type="checkbox" name="canAccess" value="1" v-model="addr.canAccess"/>
 | 
			
		||||
					<label></label>
 | 
			
		||||
				</div>
 | 
			
		||||
				<p class="comment">是否为可以公开访问的IP,如果选中,也会作为DNS解析记录的值使用。</p>
 | 
			
		||||
			</td>
 | 
			
		||||
		</tr>
 | 
			
		||||
        <tr>
 | 
			
		||||
            <td>是否启用</td>
 | 
			
		||||
            <td>
 | 
			
		||||
                <div class="ui checkbox">
 | 
			
		||||
                    <input type="checkbox" name="isOn" value="1" v-model="addr.isOn"/>
 | 
			
		||||
                    <label></label>
 | 
			
		||||
                </div>
 | 
			
		||||
                <p class="comment">选中表示当前IP有效。</p>
 | 
			
		||||
            </td>
 | 
			
		||||
        </tr>
 | 
			
		||||
        <tr>
 | 
			
		||||
            <td class="title">名称</td>
 | 
			
		||||
            <td>
 | 
			
		||||
                <input type="text" name="name" maxlength="50" v-model="addr.name"/>
 | 
			
		||||
            </td>
 | 
			
		||||
        </tr>
 | 
			
		||||
        <tr>
 | 
			
		||||
            <td>在线状态</td>
 | 
			
		||||
            <td>
 | 
			
		||||
                <select class="ui dropdown auto-width" name="isUp" v-model="addr.isUp">
 | 
			
		||||
                    <option value="1">在线</option>
 | 
			
		||||
                    <option value="0">离线</option>
 | 
			
		||||
                </select>
 | 
			
		||||
            </td>
 | 
			
		||||
        </tr>
 | 
			
		||||
        <tr v-if="teaIsPlus && supportThresholds">
 | 
			
		||||
            <td>阈值设置</td>
 | 
			
		||||
            <td>
 | 
			
		||||
                <node-ip-address-thresholds-box :v-thresholds="addr.thresholds"></node-ip-address-thresholds-box>
 | 
			
		||||
            </td>
 | 
			
		||||
        </tr>
 | 
			
		||||
	</table>
 | 
			
		||||
	<submit-btn></submit-btn>
 | 
			
		||||
</form>
 | 
			
		||||
@@ -1,5 +0,0 @@
 | 
			
		||||
Tea.context(function () {
 | 
			
		||||
	this.success = NotifySuccess("保存成功", Tea.url(".", {addrId: this.addr.id}))
 | 
			
		||||
 | 
			
		||||
	this.addr.isUp = this.addr.isUp ? 1 : 0
 | 
			
		||||
})
 | 
			
		||||
@@ -1,82 +0,0 @@
 | 
			
		||||
{$layout}
 | 
			
		||||
{$template "menu"}
 | 
			
		||||
 | 
			
		||||
<div class="margin"></div>
 | 
			
		||||
 | 
			
		||||
<form class="ui form" method="get" action="/clusters/ip-addrs">
 | 
			
		||||
    <div class="ui fields inline">
 | 
			
		||||
        <div class="ui field">
 | 
			
		||||
            <node-cluster-combo-box :v-cluster-id="clusterId"></node-cluster-combo-box>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="ui field">
 | 
			
		||||
            状态:
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="ui field">
 | 
			
		||||
            <select class="ui dropdown" name="upState" v-model="upState">
 | 
			
		||||
                <option value="0">[全部]</option>
 | 
			
		||||
                <option value="1">在线</option>
 | 
			
		||||
                <option value="2">离线</option>
 | 
			
		||||
            </select>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="ui field">
 | 
			
		||||
            <input type="text" placeholder="IP、名称..." name="keyword" v-model="keyword"/>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="ui field">
 | 
			
		||||
            <button class="ui button" type="submit">搜索</button>
 | 
			
		||||
             
 | 
			
		||||
            <a href="/clusters/ip-addrs" v-if="clusterId > 0 || upState > 0 || keyword.length > 0">[清除条件]</a>
 | 
			
		||||
        </div>
 | 
			
		||||
    </div>
 | 
			
		||||
</form>
 | 
			
		||||
 | 
			
		||||
<p class="comment" v-if="addrs.length == 0">暂时还没有IP地址。</p>
 | 
			
		||||
<div v-if="addrs.length > 0">
 | 
			
		||||
    <div class="margin"></div>
 | 
			
		||||
    <table class="ui table selectable celled">
 | 
			
		||||
        <thead>
 | 
			
		||||
            <tr>
 | 
			
		||||
                <th>IP</th>
 | 
			
		||||
                <th>所属集群</th>
 | 
			
		||||
                <th>所属节点</th>
 | 
			
		||||
                <th>名称</th>
 | 
			
		||||
                <th>阈值</th>
 | 
			
		||||
                <th>状态</th>
 | 
			
		||||
                <th class="two op">操作</th>
 | 
			
		||||
            </tr>
 | 
			
		||||
        </thead>
 | 
			
		||||
        <tr v-for="addr in addrs">
 | 
			
		||||
            <td>
 | 
			
		||||
                <a :href="'/clusters/ip-addrs/addr?addrId=' + addr.id"><keyword :v-word="keyword">{{addr.ip}}</keyword></a>
 | 
			
		||||
            </td>
 | 
			
		||||
            <td>
 | 
			
		||||
                <link-icon :href="'/clusters/cluster?clusterId=' + addr.cluster.id">{{addr.cluster.name}}</link-icon>
 | 
			
		||||
            </td>
 | 
			
		||||
            <td>
 | 
			
		||||
                <link-icon :href="'/clusters/cluster/node?clusterId=' + addr.cluster.id + '&nodeId=' + addr.node.id"><keyword :v-word="keyword">{{addr.node.name}}</keyword></link-icon>
 | 
			
		||||
            </td>
 | 
			
		||||
            <td>
 | 
			
		||||
                <span v-if="addr.name.length > 0"><keyword :v-word="keyword">{{addr.name}}</keyword></span>
 | 
			
		||||
                <span v-else class="disabled">-</span>
 | 
			
		||||
            </td>
 | 
			
		||||
            <td>
 | 
			
		||||
                <span v-if="addr.hasThresholds" class="green">Y</span>
 | 
			
		||||
                <span v-else class="disabled">N</span>
 | 
			
		||||
            </td>
 | 
			
		||||
            <td>
 | 
			
		||||
                <span v-if="!addr.isOn" class="red">禁用</span>
 | 
			
		||||
                <span v-else-if="!addr.canAccess" class="red">不可访问</span>
 | 
			
		||||
                <span v-else-if="addr.isUp && addr.backupIP.length > 0" class="orange">备用
 | 
			
		||||
                    <br/><span class="grey small">{{addr.backupIP}}</span>
 | 
			
		||||
                </span>
 | 
			
		||||
                <span v-else-if="addr.isUp" class="green">在线</span>
 | 
			
		||||
                <span v-else class="red">离线</span>
 | 
			
		||||
            </td>
 | 
			
		||||
            <td>
 | 
			
		||||
                <a :href="'/clusters/ip-addrs/addr?addrId=' + addr.id">详情</a>  
 | 
			
		||||
                <a href="" @click.prevent="deleteAddr(addr.id)">删除</a>
 | 
			
		||||
            </td>
 | 
			
		||||
        </tr>
 | 
			
		||||
    </table>
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
<div class="page" v-html="page"></div>
 | 
			
		||||
@@ -1,13 +0,0 @@
 | 
			
		||||
Tea.context(function () {
 | 
			
		||||
	this.deleteAddr = function (addrId) {
 | 
			
		||||
		teaweb.confirm("确定要删除这个IP地址吗?", function () {
 | 
			
		||||
			this.$post(".addr.delete")
 | 
			
		||||
				.params({
 | 
			
		||||
					addrId: addrId
 | 
			
		||||
				})
 | 
			
		||||
				.success(function () {
 | 
			
		||||
					teaweb.reload()
 | 
			
		||||
				})
 | 
			
		||||
		})
 | 
			
		||||
	}
 | 
			
		||||
})
 | 
			
		||||
@@ -1,42 +0,0 @@
 | 
			
		||||
{$layout}
 | 
			
		||||
{$template "menu"}
 | 
			
		||||
 | 
			
		||||
<p class="comment" v-if="logs.length == 0">暂时还没有日志。</p>
 | 
			
		||||
 | 
			
		||||
<div v-if="logs.length > 0">
 | 
			
		||||
   <div class="margin"></div>
 | 
			
		||||
   <table class="ui table selectable celled">
 | 
			
		||||
       <thead>
 | 
			
		||||
            <tr>
 | 
			
		||||
                <th class="two wide">操作人</th>
 | 
			
		||||
                <th>IP</th>
 | 
			
		||||
                <th class="two wide">状态</th>
 | 
			
		||||
                <th>描述</th>
 | 
			
		||||
                <th style="width: 12em">时间</th>
 | 
			
		||||
            </tr>
 | 
			
		||||
       </thead>
 | 
			
		||||
        <tr v-for="log in logs">
 | 
			
		||||
            <td>
 | 
			
		||||
                <span v-if="log.admin.id > 0">{{log.admin.name}}</span>
 | 
			
		||||
                <span v-else class="grey">{{log.admin.name}}</span>
 | 
			
		||||
            </td>
 | 
			
		||||
            <td>
 | 
			
		||||
                <span v-if="log.addr != null"><a :href="'/clusters/ip-addrs/addr?addrId=' + log.addr.id">{{log.addr.ip}}</a></span>
 | 
			
		||||
                <span v-else class="disabled">已删除</span>
 | 
			
		||||
            </td>
 | 
			
		||||
            <td>
 | 
			
		||||
                <span v-if="!log.isOn" class="red">停用</span>
 | 
			
		||||
                <span v-else-if="!log.canAccess" class="red">不可访问</span>
 | 
			
		||||
                <span v-else-if="log.isUp && log.backupIP.length > 0" class="orange">备用
 | 
			
		||||
                    <br/><span class="grey small">{{log.backupIP}}</span>
 | 
			
		||||
                </span>
 | 
			
		||||
                <span v-else-if="log.isUp" class="green">上线</span>
 | 
			
		||||
                <span v-else class="red">离线</span>
 | 
			
		||||
            </td>
 | 
			
		||||
            <td>{{log.description}}</td>
 | 
			
		||||
            <td>{{log.createdTime}}</td>
 | 
			
		||||
        </tr>
 | 
			
		||||
   </table>
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
<div class="page" v-html="page"></div>
 | 
			
		||||
		Reference in New Issue
	
	Block a user