<template>
  <div class="app-container">
    <el-descriptions class="margin-top" title="基础信息" :column="3" border labelClassName="info-foundation">
      <template slot="extra">
        
      </template>
      <el-descriptions-item>
        <template slot="label">
          <i class="el-icon-setting"></i>
          系统版本
        </template>
        <span>导航: {{ info.versionNavigation }}</span>
        <span style="margin-left: 10px;">镜像: {{ info.versionImages }}</span>
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          <i class="el-icon-time"></i>
          运行时间
        </template>
        {{ info.versionNavigation }} h
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          <i class="el-icon-paperclip"></i>
          设备id
        </template>
        {{ info.device }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          <i class="el-icon-monitor"></i>
          硬件安全
        </template>
        <el-tag size="small" v-if="info.hardware == 1">状态正常</el-tag>
        <el-tag size="small" type="danger" v-else>状态异常</el-tag>
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          <i class="el-icon-monitor"></i>
          硬件安全
        </template>
        <el-tag size="small" v-if="info.soft == 1">状态正常</el-tag>
        <el-tag size="small" type="danger" v-else>状态异常</el-tag>
        <el-button type="text" plain size="mini" style="padding: 5px 9px;margin-left: 15px;">测试</el-button>
      </el-descriptions-item>
    </el-descriptions>
    <div style="margin-top: 15px;margin-bottom: 35px;">
      <el-row :gutter="10" class="mb8">
        <el-col :span="1.5">
          <el-button type="primary" plain icon="el-icon-plus" size="mini">导出配置</el-button>
        </el-col>
        <el-col :span="1.5">
          <el-button type="primary" plain icon="el-icon-edit" size="mini" :disabled="single">重启容器</el-button>
        </el-col>
        <el-col :span="1.5">
          <el-button type="warning" plain icon="el-icon-edit" size="mini" :disabled="single">系统重启</el-button>
        </el-col>
        <el-col :span="1.5">
          <el-button type="danger" plain icon="el-icon-edit" size="mini" :disabled="single">系统关机</el-button>
        </el-col>
      </el-row>
    </div>
    <div style="margin-bottom: 30px;">
      <h4 style="font-weight: bold;color: #303133;">节点信息</h4>
      <div class="node-info">
        <el-card class="box-card" shadow="always">
          <div v-for="item in nodeList" :key="o" class="text-item-node">
            {{ item }}
          </div>
        </el-card>
      </div>
    </div>
    <div>
      <h4 style="font-weight: bold;color: #303133;">网络配置</h4>
      <div class="node-info">
        <el-card class="box-card" shadow="always">
          <el-input type="textarea" :rows="15" placeholder="请输入内容" v-model="networkInfo">
          </el-input>
        </el-card>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      info: {
        versionNavigation: '1.5',
        versionImages: '1.6',
        runTime: 6,
        device: '3661eba3339598131dd4044e68a67923',
        hardware: 0,
        soft: 0
      },
      nodeList: [
        "/area_loader",
        "/fake_robot_node",
        "/gdnw_location_current",
        "/gfkd_data_record_node",
        "/gfkd_dependency_test_node",
        "/gfkd_mqtt_ros_bridge_node",
        "/joystick",
        "/mid_trans",
        "/move_base",
        "/mqtt_ros_bridge_node",
        "/node_monitor",
        "/point_server_node",
        "/pointcloud_cache",
        "/rosout",
        "/route_map_node",
        "/route_map_server",
        "/route_planner_node",
        "/slam_server_proxy",
        "/task_manager",
        "/traffic_node",
        "/weather_commander"
      ],
      networkInfo: `
      eth0      Link encap:Ethernet  HWaddr 02:42:ac:11:00:03  
                inet addr:172.17.0.3  Bcast:172.17.255.255  Mask:255.255.0.0
                UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
                RX packets:6184267 errors:0 dropped:0 overruns:0 frame:0
                TX packets:6135144 errors:0 dropped:0 overruns:0 carrier:0
                collisions:0 txqueuelen:0 
                RX bytes:1418261552 (1.4 GB)  TX bytes:4468555614 (4.4 GB)

      lo        Link encap:Local Loopback  
                inet addr:127.0.0.1  Mask:255.0.0.0
                UP LOOPBACK RUNNING  MTU:65536  Metric:1
                RX packets:566397544 errors:0 dropped:0 overruns:0 frame:0
                TX packets:566397544 errors:0 dropped:0 overruns:0 carrier:0
                collisions:0 txqueuelen:1000 
                RX bytes:317459554443 (317.4 GB)  TX bytes:317459554443 (317.4 GB)
    `
    }
  },
  methods: {

  }
}
</script>

<style scoped>
::v-deep .el-table .el-table__header-wrapper th,
.el-table .el-table__fixed-header-wrapper th {
  background-color: #f6f6f6 !important;
}

::v-deep .node-info .el-card {
  border-radius: 8px;
}

::v-deep .node-info .el-card.is-always-shadow,
.el-card.is-hover-shadow:focus,
.el-card.is-hover-shadow:hover {
  box-shadow: 0 2px 12px 0 rgba(161, 161, 161, 0.1);
}

.text-item-node {
  padding: 7px 15px;
  background-color: #F2F2F2;
  margin-bottom: 5px;
  border-radius: 5px;
}
</style>
