doum
2025-09-26 9057e04efad1b7d61c77a72e5c37a504d0aee935
admin/src/views/system/monitor.vue
@@ -181,19 +181,25 @@
    }
  },
  methods: {
    // 切换自动刷新
    changeAutoRefresh (value) {
    /**
     * 切换自动刷新
     *
     * @param autoRefresh 是否自动刷新
     */
    changeAutoRefresh (autoRefresh) {
      if (this.interval != null) {
        clearInterval(this.interval)
      }
      if (value) {
      if (autoRefresh) {
        this.getSystemInfo()
        this.interval = setInterval(() => {
          this.getSystemInfo()
        }, 3000)
      }
    },
    // 获取系统信息
    /**
     * 获取系统信息
     */
    getSystemInfo () {
      if (this.loading) {
        return
@@ -210,11 +216,21 @@
          this.loading = false
        })
    },
    // 单位转为G
    /**
     * 单位转为G
     *
     * @param value 转换值
     * @returns {number}
     */
    toG (value) {
      return Math.round(value / 1024 * 100) / 100
    },
    // 转为比率
    /**
     * 转为比率
     *
     * @param value 转换值
     * @returns {number}
     */
    keep2decimals (value) {
      return Math.round(value * 100) / 100
    }