diff --git a/threadpool/console/src/views/hippo4j/instance/index.vue b/threadpool/console/src/views/hippo4j/instance/index.vue index 398f7125..30897019 100755 --- a/threadpool/console/src/views/hippo4j/instance/index.vue +++ b/threadpool/console/src/views/hippo4j/instance/index.vue @@ -584,7 +584,7 @@ export default { created() { // this.fetchData() // 初始化项目 - this.initSelect(); + this.tenantSelectList(); }, methods: { onInput() { diff --git a/threadpool/console/src/views/hippo4j/monitor/index.vue b/threadpool/console/src/views/hippo4j/monitor/index.vue index d105c412..b338bec6 100644 --- a/threadpool/console/src/views/hippo4j/monitor/index.vue +++ b/threadpool/console/src/views/hippo4j/monitor/index.vue @@ -10,21 +10,35 @@
查询监控
- - +
+
-
{{ selectMonitor[0].label }}数量
-
- - {{ selectMonitor[0].children.length || "_" }} - 个 +
+
{{ listQuery.tenantId }}
+
租户:
+
{{ listQuery.tenantId }}
+
+
+
{{ listQuery.itemId }}
+
项目:
+
{{ listQuery.itemId }}
+
+
+
{{ listQuery.tpId }}
+
线程池:
+
{{ listQuery.tpId }}
+
+
+
{{ listQuery.identify }}
+
实例:
+
{{ listQuery.identify }}
+
+
{{ item.label }}
{{ item.name }}
{{ item.label }}
@@ -37,22 +51,23 @@ 筛选
-
- -
-
-
- -
-
- -
-
- -
-
- +
+
+
请选择实例~
+
+
+ +
+
+ +
+
+ +
+
+ +
@@ -73,6 +88,64 @@ export default { data() { let that = this; return { + props: { + lazy: true, + lazyLoad (node, resolve) { + const { level } = node; + setTimeout(() => { + if (level == 0) { + that.userName = that.$cookie.get('userName') + that.listQuery.tenantId = that?.tenantInfo?.tenantId || that.listQuery.tenantId + let isAllTenant = that.listQuery.tenantId == i18nConfig.messages.zh.common.allTenant || that.listQuery.tenantId == i18nConfig.messages.en.common.allTenant + that.listQuery.tenantId = isAllTenant ? '' : that.listQuery.tenantId + + //请求项目-线程池-实例 + itemApi.list(that.listQuery).then((itemRes) => { + let itemList = itemRes.records.map((item) => { + return { + ...item, + value: item.itemId, + label: item.itemId, + leaf: level >= 2 + } + }) + resolve(itemList) + }) + } else if (level == 1) { + that.listQuery.itemId = node.value + threadPoolApi.list(that.listQuery).then((tpRes) => { + let tpList = tpRes.records.map((tpItem) => { + return { + ...tpItem, + value: tpItem.tpId, + label: tpItem.tpId, + leaf: level >= 2 + } + }) + resolve(tpList) + }) + } else if (level == 2) { + that.listQuery.tpId = node.value + let param = [ + that.listQuery.itemId, + that.listQuery.tpId + ] + instanceApi.list(param).then((instanceRes) => { + let itList = instanceRes.map((itItem) => { + return { + ...itItem, + value: itItem.identify, + label: itItem.identify, + leaf: level >= 2 + } + }); + resolve(itList ? itList : [{value: '暂无实例', label: '暂无实例'}]) + }); + } + }, 1000); + } + }, + lineChartData: [], times: [], selectMonitorValue: { @@ -133,7 +206,7 @@ export default { return time.getTime() > this.getDayStartOrEnd(new Date(), "end"); } }, - itemValue: [], + itemList: [], selectMonitor: [], tableData: [], listQuery: { @@ -158,9 +231,14 @@ export default { watch: { listQuery:{ handler(newVal) { - this.fetchChartData(newVal) + this.getSelectMonitor() }, deep: true + }, + selectMonitorValue(newVal) { + this.listQuery.identify = newVal[2] + this.listQuery.instanceId = newVal[2] + this.fetchChartData(this.listQuery) } }, @@ -171,6 +249,7 @@ export default { this.listQuery.startTime = this.timeValue[0] this.listQuery.endTime = this.timeValue[1] this.fetchData() + this.fetchChartData(this.listQuery) }, methods: { @@ -180,82 +259,11 @@ export default { this.listQuery.tenantId = this?.tenantInfo?.tenantId || this.listQuery.tenantId let isAllTenant = this.listQuery.tenantId == i18nConfig.messages.zh.common.allTenant || this.listQuery.tenantId == i18nConfig.messages.en.common.allTenant this.listQuery.tenantId = isAllTenant ? '' : this.listQuery.tenantId - - //请求项目-线程池-实例 - itemApi.list(this.listQuery).then((itemRes) => { - this.itemList = itemRes.records.map((item) => { - this.listQuery.itemId = item.itemId - let tpList = [] - - threadPoolApi.list(this.listQuery).then((tpRes) => { - tpList = tpRes.records.map((tpItem) => { - this.listQuery.tpId = tpItem.tpId - let itList = [] - - instanceApi.list(param).then((instanceRes) => { - itList = instanceRes.records.map((itItem) => { - this.listQuery.identify = itItem.identify - this.listQuery.instanceId = itItem.identify - return { - ...itItem, - value: itItem.identify, - label: itItem.identify, - } - }); - return itList - }); - - return { - ...tpItem, - value: tpItem.tpId, - label: tpItem.tpId, - children: itList? itList : [{value: '暂无实例', label: '暂无实例'}] - } - }) - return tpList - }) - - return { - ...item, - value: item.itemId, - label: item.itemId, - // children: tpList ? tpList : [{value: '暂无线程池', label: '暂无线程池'}] - } - }) - - console.log('============jjjjjj', this.itemList) - }) - threadPoolApi.list(this.listQuery).then((res) => { - this.listQuery.itemId = res.records[0].itemId - this.listQuery.tpId = res.records[0].tpId - this.listQuery.tenantId = res.records[0].tenantId - this.getSelectMonitor(res.records[0].itemId,res.records[0].tpId) - - //查询租户所有项目 - }) }, - getSelectMonitor(itemId,tpId) { - this.selectMonitor = [{ - value: 0, - label: '实例', - children: [], - },] - let param = [ - itemId, - tpId - ] - instanceApi.list(param).then((res) => { - res.map((item) => { - item.value = item.identify - item.label = item.identify - }); - this.selectMonitor[0].children = res - this.selectMonitorValue = [0, res[0].identify] - this.listQuery.identify = res[0].identify - this.listQuery.instanceId = res[0].identify - }); + //获取面板信息 + getSelectMonitor() { threadPoolApi.info(this.listQuery).then((res) => { this.temp = res; this.tableData = [{ @@ -283,10 +291,10 @@ export default { name: '拒绝次数', label: this.rejectCount }] - console.log("sssss=========", this.rejectCount) }); }, + //监控数据 fetchChartData(value) { let query = value monitorApi.active({ ...query }).then(res => { @@ -318,10 +326,12 @@ export default { } },] this.rejectCount = res?.rejectCountList[res.rejectCountList.length - 1] - this.tableData[7].label = res?.rejectCountList[res.rejectCountList.length - 1] this.completedTaskCount = res?.completedTaskCountList[res.completedTaskCountList.length - 1] - this.tableData[5].label = res?.completedTaskCountList[res.completedTaskCountList.length - 1] - console.log("sssss=========", this.rejectCount) + if (this.tableData.length > 1) { + this.tableData[7].label = res?.rejectCountList[res.rejectCountList.length - 1] + this.tableData[5].label = res?.completedTaskCountList[res.completedTaskCountList.length - 1] + + } this.times = res?.times.map(item => { const list = item.split(':') list.pop() @@ -353,42 +363,6 @@ export default { }, handleChangeMonitorSelect(value) { - - //////////next - console.log('asasasasas', value, this.itemList) - let tpList = [] - threadPoolApi.list(this.listQuery).then((tpRes) => { - tpList = tpRes.records.map((tpItem) => { - this.listQuery.tpId = tpItem.tpId - let itList = [] - - // instanceApi.list(param).then((instanceRes) => { - // itList = instanceRes.records.map((itItem) => { - // this.listQuery.identify = itItem.identify - // this.listQuery.instanceId = itItem.identify - // return { - // ...itItem, - // value: itItem.identify, - // label: itItem.identify, - // } - // }); - // return itList - // }); - - return { - ...tpItem, - value: tpItem.tpId, - label: tpItem.tpId, - // children: itList? itList : [{value: '暂无实例', label: '暂无实例'}] - } - }) - return tpList - }) - this.$set(this.itemList[0], 'children', tpList) - console.log('asasasasas', value, this.itemList, tpList) - - - this.selectMonitor[value[0]].map((item) => { if (item.children.label == value[1]) { this.listQuery.identify = item.identify || this.listQuery.identify @@ -402,9 +376,9 @@ export default { changeMonitorData() { this.fullscreenLoading = true - console.log('this.timeVqlue:::',this.timeValue) this.listQuery.startTime = this.timeValue[0] this.listQuery.endTime = this.timeValue[1] + this.fetchChartData(this.listQuery) }, getBeforeDate(date = new Date(), days = 7) { @@ -536,16 +510,23 @@ export default { color: #fefefe; font-family: HelveticaNeue-Medium, Helvetica Medium, PingFangSC-Medium, STHeitiSC-Medium, Microsoft YaHei Bold, Arial, sans-serif; - .info-card-title, - .data-num { + .info-card-title, .data-num { font-size: 14px; font-weight: 500; padding-bottom: 10px; } - - .num { - font-family: DIDIFD-Regular; - font-size: 40px; + .info-card-show { + display: none; + } + .info-card-item:hover .info-card-show { + display: block; + position: absolute; + left: 30px; + background: #313131; + border-radius: 4px; + padding: 5px 8px 6px 8px; + box-shadow: 1px 1px 5px red($color: #efecec); + z-index: 9999; } .operation-list { @@ -574,6 +555,18 @@ export default { width: 600; } } + .info-card-show { + display: none; + } + .tp-item:hover .info-card-show { + display: block; + position: absolute; + background: #313131; + border-radius: 4px; + padding: 5px 8px 6px 8px; + box-shadow: 1px 1px 5px red($color: #efecec); + z-index: 9999; + } } } @@ -615,5 +608,17 @@ export default { } } + + .bottom-no-wraper { + width: 100%; + height: 100%; + display: flex; + align-items: center; + justify-content: center; + font-size: 20px; + font-weight: 600; + color: #818689; + font-family: 'Courier New', Courier, monospace; + } } diff --git a/threadpool/console/src/views/hippo4j/notify/index.vue b/threadpool/console/src/views/hippo4j/notify/index.vue index 62eac7ed..9fcf6349 100755 --- a/threadpool/console/src/views/hippo4j/notify/index.vue +++ b/threadpool/console/src/views/hippo4j/notify/index.vue @@ -406,7 +406,7 @@ export default { created() { this.fetchData(); // 初始化租户、项目 - this.initSelect(); + this.tenantSelectList(); }, methods: { fetchData() { diff --git a/threadpool/console/src/views/hippo4j/other/alibaba-dubbo/index.vue b/threadpool/console/src/views/hippo4j/other/alibaba-dubbo/index.vue index 89ba23ec..96152fe8 100755 --- a/threadpool/console/src/views/hippo4j/other/alibaba-dubbo/index.vue +++ b/threadpool/console/src/views/hippo4j/other/alibaba-dubbo/index.vue @@ -281,7 +281,7 @@ export default { }, created() { // 初始化租户、项目 - this.initSelect(); + this.tenantSelectList(); }, methods: { onInput() { diff --git a/threadpool/console/src/views/hippo4j/other/dubbo/index.vue b/threadpool/console/src/views/hippo4j/other/dubbo/index.vue index 002e7d11..44cccf71 100755 --- a/threadpool/console/src/views/hippo4j/other/dubbo/index.vue +++ b/threadpool/console/src/views/hippo4j/other/dubbo/index.vue @@ -281,7 +281,7 @@ export default { }, created() { // 初始化租户、项目 - this.initSelect(); + this.tenantSelectList(); }, methods: { onInput() { diff --git a/threadpool/console/src/views/hippo4j/other/hystrix/index.vue b/threadpool/console/src/views/hippo4j/other/hystrix/index.vue index 9a62d62a..5b56e00f 100755 --- a/threadpool/console/src/views/hippo4j/other/hystrix/index.vue +++ b/threadpool/console/src/views/hippo4j/other/hystrix/index.vue @@ -281,7 +281,7 @@ export default { }, created() { // 初始化租户、项目 - this.initSelect(); + this.tenantSelectList(); }, methods: { onInput() { diff --git a/threadpool/console/src/views/hippo4j/other/rabbitmq-stream/index.vue b/threadpool/console/src/views/hippo4j/other/rabbitmq-stream/index.vue index 009bfcf9..1d73e078 100755 --- a/threadpool/console/src/views/hippo4j/other/rabbitmq-stream/index.vue +++ b/threadpool/console/src/views/hippo4j/other/rabbitmq-stream/index.vue @@ -280,7 +280,7 @@ export default { }, created() { // 初始化租户、项目 - this.initSelect(); + this.tenantSelectList(); }, methods: { onInput() { diff --git a/threadpool/console/src/views/hippo4j/other/rabbitmq/index.vue b/threadpool/console/src/views/hippo4j/other/rabbitmq/index.vue index 93063672..480e6009 100755 --- a/threadpool/console/src/views/hippo4j/other/rabbitmq/index.vue +++ b/threadpool/console/src/views/hippo4j/other/rabbitmq/index.vue @@ -281,7 +281,7 @@ export default { }, created() { // 初始化租户、项目 - this.initSelect(); + this.tenantSelectList(); }, methods: { onInput() { diff --git a/threadpool/console/src/views/hippo4j/other/rocketmq-stream/index.vue b/threadpool/console/src/views/hippo4j/other/rocketmq-stream/index.vue index a96afac7..111fd261 100755 --- a/threadpool/console/src/views/hippo4j/other/rocketmq-stream/index.vue +++ b/threadpool/console/src/views/hippo4j/other/rocketmq-stream/index.vue @@ -280,7 +280,7 @@ export default { }, created() { // 初始化租户、项目 - this.initSelect(); + this.tenantSelectList(); }, methods: { onInput() { diff --git a/threadpool/console/src/views/hippo4j/other/rocketmq/index.vue b/threadpool/console/src/views/hippo4j/other/rocketmq/index.vue index 693c4917..85b9911a 100755 --- a/threadpool/console/src/views/hippo4j/other/rocketmq/index.vue +++ b/threadpool/console/src/views/hippo4j/other/rocketmq/index.vue @@ -281,7 +281,7 @@ export default { }, created() { // 初始化租户、项目 - this.initSelect(); + this.tenantSelectList(); }, methods: { onInput() { diff --git a/threadpool/console/src/views/hippo4j/server/jetty/index.vue b/threadpool/console/src/views/hippo4j/server/jetty/index.vue index 18b6b1bf..315f0816 100755 --- a/threadpool/console/src/views/hippo4j/server/jetty/index.vue +++ b/threadpool/console/src/views/hippo4j/server/jetty/index.vue @@ -369,7 +369,7 @@ export default { }, created() { // 初始化租户、项目 - this.initSelect(); + this.tenantSelectList(); }, mounted() { this.isEditDisabled = localStorage.getItem('USER_ROLE') !== 'ROLE_ADMIN'; diff --git a/threadpool/console/src/views/hippo4j/server/tomcat/index.vue b/threadpool/console/src/views/hippo4j/server/tomcat/index.vue index b1de42ea..4781959d 100755 --- a/threadpool/console/src/views/hippo4j/server/tomcat/index.vue +++ b/threadpool/console/src/views/hippo4j/server/tomcat/index.vue @@ -379,7 +379,7 @@ export default { }, created() { // 初始化租户、项目 - this.initSelect(); + this.tenantSelectList(); }, mounted() { this.isEditDisabled = localStorage.getItem('USER_ROLE') !== 'ROLE_ADMIN'; diff --git a/threadpool/console/src/views/hippo4j/server/undertow/index.vue b/threadpool/console/src/views/hippo4j/server/undertow/index.vue index 9b69a5a8..486411a6 100755 --- a/threadpool/console/src/views/hippo4j/server/undertow/index.vue +++ b/threadpool/console/src/views/hippo4j/server/undertow/index.vue @@ -379,7 +379,7 @@ export default { }, created() { // 初始化租户、项目 - this.initSelect(); + this.tenantSelectList(); }, mounted() { this.isEditDisabled = localStorage.getItem('USER_ROLE') !== 'ROLE_ADMIN'; diff --git a/threadpool/console/src/views/hippo4j/threadpool/index.vue b/threadpool/console/src/views/hippo4j/threadpool/index.vue index f5c70c22..a832b389 100755 --- a/threadpool/console/src/views/hippo4j/threadpool/index.vue +++ b/threadpool/console/src/views/hippo4j/threadpool/index.vue @@ -537,7 +537,7 @@ export default { created() { this.fetchData(); // 初始化租户、项目 - this.initSelect(); + this.tenantSelectList(); }, mounted() { this.isEditDisabled = @@ -757,6 +757,7 @@ export default { this.threadPoolOptions = []; const tenantId = { tenantId: this.listQuery.tenantId, size: this.size }; itemApi.list(tenantId).then((response) => { + console.log('--------OOOOOOO', tenantId, response) const { records = [] } = response; for (let i = 0; i < records.length; i++) { this.itemOptions.push({ diff --git a/threadpool/console/src/views/hippo4j/verify/index.vue b/threadpool/console/src/views/hippo4j/verify/index.vue index 8122d50b..db183093 100644 --- a/threadpool/console/src/views/hippo4j/verify/index.vue +++ b/threadpool/console/src/views/hippo4j/verify/index.vue @@ -489,7 +489,7 @@ export default { }, created() { this.fetchData(); - this.initSelect(); + this.tenantSelectList(); }, mounted() { this.isEditDisabled = localStorage.getItem('USER_ROLE') !== 'ROLE_ADMIN'; diff --git a/threadpool/console/vue.config.js b/threadpool/console/vue.config.js index cc65b92b..e8c52a02 100755 --- a/threadpool/console/vue.config.js +++ b/threadpool/console/vue.config.js @@ -35,7 +35,7 @@ module.exports = { }, proxy: { '/hippo4j/v1/cs': { - target: `http://console.hippo4j.cn:6691/hippo4j/v1/cs`, + target: `http://127.0.0.1:6691/hippo4j/v1/cs`, changOrigin: true, secure: false, pathRewrite: {