From bc19883f4b3d366538adb486fcbdb5927e31973a Mon Sep 17 00:00:00 2001
From: zhangtianqi <ztq17634040974@163.com>
Date: Wed, 25 Oct 2023 10:57:23 +0800
Subject: [PATCH] 腾讯云展示租户详情页

---
 hg-monitor-web-base/src/main/resources/static/src/controller/commonDetail.js                           |  7 ++++---
 hg-monitor-web-base/src/main/resources/static/src/views/template/detail/tencent_cloud_plat_tenant.html | 25 +++++++++++++++++++++++++
 hg-monitor-web-zj/src/main/resources/static/vue3/public/css/tencentCloud.css                           | 97 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----
 hg-monitor-web-zj/src/main/resources/static/vue3/src/assets/images/machineRoom/RES_CKAFKA.png          | Bin 0 -> 65923 bytes
 hg-monitor-web-zj/src/main/resources/static/vue3/src/assets/images/machineRoom/RES_DISK.png            | Bin 0 -> 66987 bytes
 hg-monitor-web-zj/src/main/resources/static/vue3/src/assets/images/machineRoom/RES_LOAD_BALANCE.png    | Bin 0 -> 58480 bytes
 hg-monitor-web-zj/src/main/resources/static/vue3/src/assets/images/machineRoom/RES_MARIADB.png         | Bin 0 -> 71627 bytes
 hg-monitor-web-zj/src/main/resources/static/vue3/src/assets/images/machineRoom/RES_REDIS.png           | Bin 0 -> 67244 bytes
 hg-monitor-web-zj/src/main/resources/static/vue3/src/assets/images/machineRoom/RES_TDSQLMYSQL.png      | Bin 0 -> 64182 bytes
 hg-monitor-web-zj/src/main/resources/static/vue3/src/assets/images/machineRoom/VIRTUALHOST.png         | Bin 0 -> 61233 bytes
 hg-monitor-web-zj/src/main/resources/static/vue3/src/router/index.js                                   |  4 ++++
 hg-monitor-web-zj/src/main/resources/static/vue3/src/views/tencentCloud/tencentCloudTenant.html        | 30 ++++++++++++++++++++++++++++++
 hg-monitor-web-zj/src/main/resources/static/vue3/src/views/tencentCloud/tencentCloudTenant.js          | 31 +++++++++++++++++++++++++++++++
 13 files changed, 187 insertions(+), 7 deletions(-)
 create mode 100644 hg-monitor-web-base/src/main/resources/static/src/views/template/detail/tencent_cloud_plat_tenant.html
 create mode 100644 hg-monitor-web-zj/src/main/resources/static/vue3/src/assets/images/machineRoom/RES_CKAFKA.png
 create mode 100644 hg-monitor-web-zj/src/main/resources/static/vue3/src/assets/images/machineRoom/RES_DISK.png
 create mode 100644 hg-monitor-web-zj/src/main/resources/static/vue3/src/assets/images/machineRoom/RES_LOAD_BALANCE.png
 create mode 100644 hg-monitor-web-zj/src/main/resources/static/vue3/src/assets/images/machineRoom/RES_MARIADB.png
 create mode 100644 hg-monitor-web-zj/src/main/resources/static/vue3/src/assets/images/machineRoom/RES_REDIS.png
 create mode 100644 hg-monitor-web-zj/src/main/resources/static/vue3/src/assets/images/machineRoom/RES_TDSQLMYSQL.png
 create mode 100644 hg-monitor-web-zj/src/main/resources/static/vue3/src/assets/images/machineRoom/VIRTUALHOST.png
 create mode 100644 hg-monitor-web-zj/src/main/resources/static/vue3/src/views/tencentCloud/tencentCloudTenant.html
 create mode 100644 hg-monitor-web-zj/src/main/resources/static/vue3/src/views/tencentCloud/tencentCloudTenant.js

diff --git a/hg-monitor-web-base/src/main/resources/static/src/controller/commonDetail.js b/hg-monitor-web-base/src/main/resources/static/src/controller/commonDetail.js
index 51c7a1f..e67b499 100644
--- a/hg-monitor-web-base/src/main/resources/static/src/controller/commonDetail.js
+++ b/hg-monitor-web-base/src/main/resources/static/src/controller/commonDetail.js
@@ -4008,10 +4008,11 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele
                             layer.alert('该资源只对接TRAP告警信息!',{icon:0});
                             return;
                         }
-                        //如果是腾讯云平台且是租户,则没有详情页
+                        //如果是腾讯云平台且是租户,则跳转租户页面
                         if (res.resType === 'TENCENT_CLOUD_PLAT' && res.platUserType !== '0'){
-                            layer.alert('只有运营端有详情页!',{icon:0});
-                            return;
+                            // layer.alert('只有运营端有详情页!',{icon:0});
+                            // return;
+                            url = common.detailPath(res.resType+'_TENANT',res.resId,protocol);
                         }
                         //url(/src/style/img/shutdown.png)
                         title +=`<span id="title-shutdown" data-id=${resId} style="flex:1;padding:0 5px;width:600px;display: inline-block;position: relative;top: 0px;left:20px;"></span>`
diff --git a/hg-monitor-web-base/src/main/resources/static/src/views/template/detail/tencent_cloud_plat_tenant.html b/hg-monitor-web-base/src/main/resources/static/src/views/template/detail/tencent_cloud_plat_tenant.html
new file mode 100644
index 0000000..3af04c9
--- /dev/null
+++ b/hg-monitor-web-base/src/main/resources/static/src/views/template/detail/tencent_cloud_plat_tenant.html
@@ -0,0 +1,25 @@
+<style>
+</style>
+<article class="page-container template template_redis">
+    <div class="page-panel">
+        <div class="main">
+            <div class="layui-card">
+                <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
+                    <iframe src="/vue3/index.html#/vue3/tencentCloudTenant" class="layadmin-iframe"  style="height: 748px!important;border: none!important;"/>
+                </div>
+            </div>
+        </div>
+    </div>
+</article>
+<textarea id="tencent_cloud_plat_param_id" style="display: none;">{{d}}</textarea>
+<script>
+    layui.use('tencent_cloud_plat', function (fn) {
+        var $ = layui.$;
+        var parm = $("#tencent_cloud_plat_param_id").val();
+        if(parm.indexOf('{{d') != -1){
+            fn();
+        }else{
+            fn(JSON.parse(parm));
+        }
+    });
+</script>
\ No newline at end of file
diff --git a/hg-monitor-web-zj/src/main/resources/static/vue3/public/css/tencentCloud.css b/hg-monitor-web-zj/src/main/resources/static/vue3/public/css/tencentCloud.css
index 1dabc70..9703876 100644
--- a/hg-monitor-web-zj/src/main/resources/static/vue3/public/css/tencentCloud.css
+++ b/hg-monitor-web-zj/src/main/resources/static/vue3/public/css/tencentCloud.css
@@ -232,11 +232,100 @@
 .td-sql-ratio-box .res-ratio .progress{
     width: 40%;
 }
+.tencent-tenant-title{
+    padding: 20px 0px;
+    border-bottom: 1px solid #E3E3E3;
+}
+.tencent-tenant-items{
+    display: flex;
+    flex-wrap: wrap;
+    align-content: start;
+}
+.tencent-tenant-items .tencent-tenant-item{
+    width: calc((100% - 36px) / 3);
+    height: 154px;
+    background: linear-gradient(181deg, #EAF1FF, #FFFFFF);
+    box-shadow: -1px 4px 3px 0px rgba(71,71,71,0.05);
+    border-radius: 15px;
+    margin-right: 18px;
+    margin-top: 18px;
 
-
-
-
-
+    display: flex;
+    justify-content: space-around;
+    align-items: center;
+}
+.tencent-tenant-items .tencent-tenant-item:nth-of-type(3n){
+    margin-right: 0;
+}
+.tencent-tenant-img{
+    width: 90px;
+    height: 85px;
+}
+.tencent-tenant-info{
+    width: 330px;
+    height: 100%;
+}
+.tencent-tenant-name{
+    border-bottom: 1px solid #D5E3FA;
+    height: 72px;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+}
+.tencent-tenant-name .tencent-tenant-resTypeName{
+    font-weight: bold;
+    font-size: 16px;
+    margin-left: 18px;
+}
+.tencent-tenant-name .tencent-tenant-count{
+    font-size: 30px;
+    font-weight: bold;
+    color: #15162B;
+    margin-right: 50px;
+}
+.tencent-tenant-alarm{
+    width: 100%;
+    height: calc(100% - 72px);
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+}
+.tencent-tenant-normalCount{
+    color: #0BAC33;
+    margin-left: 18px;
+    font-weight: 500;
+    text-align: right;
+}
+.tencent-tenant-normalCount div:nth-of-type(1){
+    margin-bottom: 14px;
+}
+.tencent-tenant-normalCount div:nth-of-type(1):before{
+    content: '';
+    display: inline-block;
+    width: 12px;
+    height: 12px;
+    border-radius: 50%;
+    margin-right: 12px;
+    background-color: #0BAC33;
+}
+.tencent-tenant-alarmCount{
+    color: #D81E06;
+    margin-right: 50px;
+    font-weight: 500;
+    text-align: right;
+}
+.tencent-tenant-alarmCount div:nth-of-type(1){
+    margin-bottom: 14px;
+}
+.tencent-tenant-alarmCount div:nth-of-type(1):before{
+    content: '';
+    display: inline-block;
+    width: 12px;
+    height: 12px;
+    border-radius: 50%;
+    margin-right: 12px;
+    background-color: #D81E06;
+}
 
 
 
diff --git a/hg-monitor-web-zj/src/main/resources/static/vue3/src/assets/images/machineRoom/RES_CKAFKA.png b/hg-monitor-web-zj/src/main/resources/static/vue3/src/assets/images/machineRoom/RES_CKAFKA.png
new file mode 100644
index 0000000..8db5025
Binary files /dev/null and b/hg-monitor-web-zj/src/main/resources/static/vue3/src/assets/images/machineRoom/RES_CKAFKA.png differ
diff --git a/hg-monitor-web-zj/src/main/resources/static/vue3/src/assets/images/machineRoom/RES_DISK.png b/hg-monitor-web-zj/src/main/resources/static/vue3/src/assets/images/machineRoom/RES_DISK.png
new file mode 100644
index 0000000..240e52d
Binary files /dev/null and b/hg-monitor-web-zj/src/main/resources/static/vue3/src/assets/images/machineRoom/RES_DISK.png differ
diff --git a/hg-monitor-web-zj/src/main/resources/static/vue3/src/assets/images/machineRoom/RES_LOAD_BALANCE.png b/hg-monitor-web-zj/src/main/resources/static/vue3/src/assets/images/machineRoom/RES_LOAD_BALANCE.png
new file mode 100644
index 0000000..409f149
Binary files /dev/null and b/hg-monitor-web-zj/src/main/resources/static/vue3/src/assets/images/machineRoom/RES_LOAD_BALANCE.png differ
diff --git a/hg-monitor-web-zj/src/main/resources/static/vue3/src/assets/images/machineRoom/RES_MARIADB.png b/hg-monitor-web-zj/src/main/resources/static/vue3/src/assets/images/machineRoom/RES_MARIADB.png
new file mode 100644
index 0000000..25aca3d
Binary files /dev/null and b/hg-monitor-web-zj/src/main/resources/static/vue3/src/assets/images/machineRoom/RES_MARIADB.png differ
diff --git a/hg-monitor-web-zj/src/main/resources/static/vue3/src/assets/images/machineRoom/RES_REDIS.png b/hg-monitor-web-zj/src/main/resources/static/vue3/src/assets/images/machineRoom/RES_REDIS.png
new file mode 100644
index 0000000..c19876e
Binary files /dev/null and b/hg-monitor-web-zj/src/main/resources/static/vue3/src/assets/images/machineRoom/RES_REDIS.png differ
diff --git a/hg-monitor-web-zj/src/main/resources/static/vue3/src/assets/images/machineRoom/RES_TDSQLMYSQL.png b/hg-monitor-web-zj/src/main/resources/static/vue3/src/assets/images/machineRoom/RES_TDSQLMYSQL.png
new file mode 100644
index 0000000..8e36c27
Binary files /dev/null and b/hg-monitor-web-zj/src/main/resources/static/vue3/src/assets/images/machineRoom/RES_TDSQLMYSQL.png differ
diff --git a/hg-monitor-web-zj/src/main/resources/static/vue3/src/assets/images/machineRoom/VIRTUALHOST.png b/hg-monitor-web-zj/src/main/resources/static/vue3/src/assets/images/machineRoom/VIRTUALHOST.png
new file mode 100644
index 0000000..b66cade
Binary files /dev/null and b/hg-monitor-web-zj/src/main/resources/static/vue3/src/assets/images/machineRoom/VIRTUALHOST.png differ
diff --git a/hg-monitor-web-zj/src/main/resources/static/vue3/src/router/index.js b/hg-monitor-web-zj/src/main/resources/static/vue3/src/router/index.js
index ea9edb1..055c5dd 100644
--- a/hg-monitor-web-zj/src/main/resources/static/vue3/src/router/index.js
+++ b/hg-monitor-web-zj/src/main/resources/static/vue3/src/router/index.js
@@ -211,6 +211,10 @@ const routes = [{
 		path: '/vue3/tencentCloudTDSQL',   // 腾讯云--TDSQL-Msql资源
 		name: 'tencentCloudTDSQL',
 		component: ()=> myImport('views/tencentCloud/tencentCloudTDSQL')
+	},{
+		path: '/vue3/tencentCloudTenant',   // 腾讯云租户
+		name: 'tencentCloudTDSQL',
+		component: ()=> myImport('views/tencentCloud/tencentCloudTenant')
 	}
 ];
 
diff --git a/hg-monitor-web-zj/src/main/resources/static/vue3/src/views/tencentCloud/tencentCloudTenant.html b/hg-monitor-web-zj/src/main/resources/static/vue3/src/views/tencentCloud/tencentCloudTenant.html
new file mode 100644
index 0000000..e413f1b
--- /dev/null
+++ b/hg-monitor-web-zj/src/main/resources/static/vue3/src/views/tencentCloud/tencentCloudTenant.html
@@ -0,0 +1,30 @@
+<div>
+    <div class="cm-card" style="background: #f1f4fb;text-align: left;">
+        <div class="tencent-cloud-box">
+            <div class="tencent-tenant-title">
+                <span>资源统计信息</span>
+            </div>
+            <div class="tencent-tenant-items">
+                <div class="tencent-tenant-item" v-for="(item,index) in tenantList" :key="index">
+                    <img class="tencent-tenant-img" :src="'/vue3/src/assets/images/machineRoom/TENCENT_CLOUD_PLAT_'+item.type+'.png'" alt="">
+                    <div class="tencent-tenant-info">
+                        <div class="tencent-tenant-name">
+                            <div class="tencent-tenant-resTypeName">{{item.resTypeName}}</div>
+                            <div class="tencent-tenant-count">{{item.count}}</div>
+                        </div>
+                        <div class="tencent-tenant-alarm">
+                            <div class="tencent-tenant-normalCount">
+                                <div>正常量</div>
+                                <div>{{item.normalCount}}</div>
+                            </div>
+                            <div class="tencent-tenant-alarmCount">
+                                <div>异常量</div>
+                                <div>{{item.alarmCount}}</div>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
diff --git a/hg-monitor-web-zj/src/main/resources/static/vue3/src/views/tencentCloud/tencentCloudTenant.js b/hg-monitor-web-zj/src/main/resources/static/vue3/src/views/tencentCloud/tencentCloudTenant.js
new file mode 100644
index 0000000..deb2780
--- /dev/null
+++ b/hg-monitor-web-zj/src/main/resources/static/vue3/src/views/tencentCloud/tencentCloudTenant.js
@@ -0,0 +1,31 @@
+export default {
+    name: "tencentCloudTenant",
+    template: '',
+    components: {},
+    props: [],
+    setup(props,{attrs,slots,emit}){
+        const {proxy} = Vue.getCurrentInstance();
+        const resId = localStorage.getItem('resId');
+        let height = Vue.ref(window.innerHeight);
+
+        let tenantList = Vue.ref([])
+        let getList = ()=>{
+            proxy.$http.get(`/api-web/bResource/tenantStatistics`,{
+                resId:resId,
+            },(res)=>{
+                console.log(res.data);
+                tenantList.value = res.data;
+                tenantList.value.forEach(item=>{
+                    item.type='tencent-cloud-host';
+                })
+            },(err)=>{
+                console.log(err);
+            })
+        }
+        getList();
+
+        return {
+            tenantList,
+        }
+    }
+}
\ No newline at end of file
--
libgit2 0.24.0