mirror of https://github.com/go-sonic/sonic.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
5.6 KiB
JavaScript
1 line
5.6 KiB
JavaScript
"use strict";(self["webpackChunkhalo_admin"]=self["webpackChunkhalo_admin"]||[]).push([[355],{26355:function(t,e,s){s.r(e),s.d(e,{default:function(){return n}});var a=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",[s("a-row",{attrs:{gutter:12}},[s("a-col",{staticClass:"mb-3",attrs:{lg:12,md:24,sm:24,xl:12,xs:24}},[s("a-card",{attrs:{bodyStyle:{padding:0},bordered:!1,hoverable:"",title:"服务器"}},[s("table",{staticClass:"w-full"},[s("tbody",{staticClass:"ant-table-tbody"},[s("tr",[s("td",[t._v("系统")]),s("td",[t._v(t._s(t.systemProperties["os.name"].value)+" "+t._s(t.systemProperties["os.version"].value))])]),s("tr",[s("td",[t._v("平台")]),s("td",[t._v(t._s(t.systemProperties["os.arch"].value))])]),s("tr",[s("td",[t._v("语言")]),s("td",[t._v(t._s(t.systemProperties["user.language"].value))])]),s("tr",[s("td",[t._v("时区")]),s("td",[t._v(t._s(t.systemProperties["user.timezone"].value))])]),s("tr",[s("td",[t._v("当前用户")]),s("td",[t._v(t._s(t.systemProperties["user.name"].value))])]),s("tr",[s("td",[t._v("用户目录")]),s("td",[t._v(t._s(t.systemProperties["user.home"].value))])])])])]),s("a-divider",{attrs:{dashed:""}})],1),s("a-col",{staticClass:"mb-3",attrs:{lg:12,md:24,sm:24,xl:12,xs:24}},[s("a-card",{attrs:{bodyStyle:{padding:0},bordered:!1,hoverable:"",title:"使用情况"}},[s("table",{staticClass:"w-full"},[s("tbody",{staticClass:"ant-table-tbody"},[s("tr",[s("td",[t._v("CPU 核心数")]),s("td",[t._v(t._s(t.system.cpu.count)+" 个")])]),s("tr",[s("td",[t._v("CPU 使用率")]),s("td",[t._v(t._s(t.system.cpu.usage)+" %")])]),s("tr",[s("td",[t._v("JVM 最大可用内存")]),s("td",[t._v(t._s(t._f("fileSizeFormat")(t.jvm.memory.max)))])]),s("tr",[s("td",[t._v("JVM 可用内存")]),s("td",[t._v(t._s(t._f("fileSizeFormat")(t.jvm.memory.committed)))])]),s("tr",[s("td",[t._v("JVM 已用内存")]),s("td",[t._v(t._s(t._f("fileSizeFormat")(t.jvm.memory.used)))])]),s("tr",[s("td",[t._v("GC 次数")]),s("td",[t._v(t._s(t.jvm.gc.pause.count)+" 次")])])])])]),s("a-divider",{attrs:{dashed:""}})],1),s("a-col",{staticClass:"mb-3",attrs:{lg:24,md:24,sm:24,xl:24,xs:24}},[s("a-card",{attrs:{bodyStyle:{padding:0},bordered:!1,hoverable:"",title:"环境"}},[s("table",{staticClass:"w-full"},[s("tbody",{staticClass:"ant-table-tbody"},[s("tr",[s("td",[t._v("Java 名称")]),s("td",[t._v(t._s(t.systemProperties["java.vm.name"].value))])]),s("tr",[s("td",[t._v("Java 版本")]),s("td",[t._v(t._s(t.systemProperties["java.version"].value))])]),s("tr",[s("td",[t._v("Java Home")]),s("td",[s("ellipsis",{attrs:{length:t.isMobile()?50:256,tooltip:""}},[t._v(" "+t._s(t.systemProperties["java.home"].value)+" ")])],1)])])])]),s("a-divider",{attrs:{dashed:""}})],1),s("a-col",{staticClass:"mb-3",attrs:{lg:24,md:24,sm:24,xl:24,xs:24}},[s("a-card",{attrs:{bodyStyle:{padding:0},bordered:!1,hoverable:"",title:"应用"}},[s("table",{staticClass:"w-full"},[s("tbody",{staticClass:"ant-table-tbody"},[s("tr",[s("td",[t._v("端口")]),s("td",[t._v(t._s(t.propertiesSourcesMap["server.ports"]["local.server.port"].value))])]),s("tr",[s("td",[t._v("PID")]),s("td",[t._v(t._s(t.systemProperties["PID"].value))])]),s("tr",[s("td",[t._v("启动时间")]),s("td",[t._v(t._s(t._f("moment")(t.system.process.startTime)))])]),s("tr",[s("td",[t._v("已启动时间")]),s("td",[t._v(t._s(t._f("dayTime")(t.system.process.uptime)))])]),s("tr",[s("td",[t._v("启动目录")]),s("td",[s("ellipsis",{attrs:{length:t.isMobile()?50:256,tooltip:""}},[t._v(" "+t._s(t.systemProperties["user.dir"].value)+" ")])],1)]),s("tr",[s("td",[t._v("日志目录")]),s("td",[s("ellipsis",{attrs:{length:t.isMobile()?50:256,tooltip:""}},[t._v(" "+t._s(t.systemProperties["LOG_FILE"].value)+" ")])],1)])])])])],1)],1),s("div",{staticStyle:{position:"fixed",bottom:"30px",right:"30px"}},[s("a-button",{attrs:{icon:"sync",shape:"circle",size:"large",type:"primary"},on:{click:t.handleRefresh}})],1)],1)},r=[],o=(s(31875),s(18482),s(21082),s(43938),s(12566),s(94370)),m=s(36591),i={name:"Environment",mixins:[o.jB,o.KT],data:function(){return{propertiesSourcesMap:{},systemProperties:[],interval:null,system:{cpu:{count:0,usage:0},process:{cpuUsage:0,uptime:0,startTime:0}},jvm:{memory:{max:0,committed:0,used:0},gc:{pause:{count:0}}}}},created:function(){this.loadEnv(),this.loadSystemInfo(),this.loadJvmInfo()},methods:{loadEnv:function(){var t=this;m.Z.actuator.getEnv().then((function(e){var s=e.propertySources;s.forEach((function(e){t.propertiesSourcesMap[e.name]=e.properties})),t.systemProperties=t.propertiesSourcesMap["systemProperties"]}))},loadSystemInfo:function(){var t=this;m.Z.actuator.getSystemCpuCount().then((function(e){t.system.cpu.count=e.measurements[0].value})),m.Z.actuator.getSystemCpuUsage().then((function(e){t.system.cpu.usage=Number(100*e.measurements[0].value).toFixed(2)})),m.Z.actuator.getProcessUptime().then((function(e){t.system.process.uptime=e.measurements[0].value})),m.Z.actuator.getProcessStartTime().then((function(e){t.system.process.startTime=1e3*e.measurements[0].value})),m.Z.actuator.getProcessCpuUsage().then((function(e){t.system.process.cpuUsage=e.measurements[0].value}))},loadJvmInfo:function(){var t=this;m.Z.actuator.getJvmMemoryMax().then((function(e){t.jvm.memory.max=e.measurements[0].value})),m.Z.actuator.getJvmMemoryCommitted().then((function(e){t.jvm.memory.committed=e.measurements[0].value})),m.Z.actuator.getJvmMemoryUsed().then((function(e){t.jvm.memory.used=e.measurements[0].value})),m.Z.actuator.getJvmGcPause().then((function(e){t.jvm.gc.pause.count=e.measurements[0].value}))},handleRefresh:function(){this.loadSystemInfo(),this.loadJvmInfo()}}},l=i,u=s(70739),d=(0,u.Z)(l,a,r,!1,null,null,null),n=d.exports}}]); |