<template>
  <el-tabs v-model="activeName" @tab-click="handleClick">
    <el-tab-pane label="概览" name="first">
      <overview></overview>
    </el-tab-pane>
    <el-tab-pane label="APIServer监控" name="second">
      <el-card>
        <ApiServer></ApiServer>
      </el-card>
    </el-tab-pane>
    <!-- <el-tab-pane label="调度器监控" name="third">
      <el-card>
        <Scheduler></Scheduler>
      </el-card>
    </el-tab-pane> -->
    <el-tab-pane label="节点用量排行" name="fourth">
      <node-sort></node-sort>
    </el-tab-pane>

    <el-tab-pane label="物理资源监控" name="fifth">
      <el-card>
        <physical></physical>
      </el-card>
    </el-tab-pane>
    <el-tab-pane label="应用监控" name="sixth">
      <el-card>
        <application>
        </application>
      </el-card>
    </el-tab-pane>
  </el-tabs>
</template>

<script>
import Physical from "./components/physical.vue";
import Overview from "./components/overview.vue";
import NodeSort from "./components/nodesort.vue";
import ApiServer from "./components/apiServer.vue"
import Scheduler from './components/scheduler.vue';
import application from "./components/applications.vue";
import {
  getMetrics,
  getApiServer,
  getScheduler,
  getNodes,
  getPhysicalMonitor,
} from "@/utils/token";
export default {
  data() {
    return {
      activeName:'first'
    };
  },
  created() {
    getNodes();
    getMetrics();
    getApiServer();
    getScheduler();
    getPhysicalMonitor();
  },
  mounted() {},
  methods: {
    handleClick(tab, event) {
      this.$forceUpdate();
    },
  },
  components: {
    Overview,
    Physical,
    NodeSort,

    ApiServer,
    Scheduler,
    application
  },
};
</script>

<style lang="scss">
.mod-demo-echarts {
  > .el-alert {
    margin-bottom: 10px;
  }
  > .el-row {
    margin-top: -10px;
    margin-bottom: -10px;
    .el-col {
      padding-top: 10px;
      padding-bottom: 10px;
    }
  }
  .chart-box {
    min-height: 400px;
  }
}
</style>
