Vue.component("ip-list-table", { props: ["v-items", "v-keyword", "v-show-search-button"], data: function () { return { items: this.vItems, keyword: (this.vKeyword != null) ? this.vKeyword : "", selectedAll: false, hasSelectedItems: false } }, methods: { updateItem: function (itemId) { this.$emit("update-item", itemId) }, deleteItem: function (itemId) { this.$emit("delete-item", itemId) }, viewLogs: function (itemId) { teaweb.popup("/servers/iplists/accessLogsPopup?itemId=" + itemId, { width: "50em", height: "30em" }) }, changeSelectedAll: function () { let boxes = this.$refs.itemCheckBox if (boxes == null) { return } let that = this boxes.forEach(function (box) { box.checked = that.selectedAll }) this.hasSelectedItems = this.selectedAll }, changeSelected: function (e) { let that = this that.hasSelectedItems = false let boxes = that.$refs.itemCheckBox if (boxes == null) { return } boxes.forEach(function (box) { if (box.checked) { that.hasSelectedItems = true } }) }, deleteAll: function () { let boxes = this.$refs.itemCheckBox if (boxes == null) { return } let itemIds = [] boxes.forEach(function (box) { if (box.checked) { itemIds.push(box.value) } }) if (itemIds.length == 0) { return } Tea.action("/servers/iplists/deleteItems") .post() .params({ itemIds: itemIds }) .success(function () { teaweb.successToast("批量删除成功", 1200, teaweb.reload) }) } }, template: `
| 
            		 | 
                IP | 类型 | 级别 | 过期时间 | 备注 | 操作 | 
|---|---|---|---|---|---|---|
| 
					 | 
				
					
					 
						添加于 {{item.createdTime}}
							
								@ 
								
								[黑白名单:{{item.list.name}}]
								[黑白名单:{{item.list.name}}
								
								
									
										[服务:{{item.policy.server.name}}]
										[服务:{{item.policy.server.name}}]
									
									
										[策略:{{item.policy.name}}]
									
								
							
						
					 
				 | 
				IPv4 IPv4 IPv6 所有IP | {{item.eventLevelName}} - | 
					 
						{{item.expiredTime}}
						 
					不过期
				
							已过期
						 
					 | 
				{{item.reason}} - | 日志 修改 删除 |