From 8047ae3d83ba0718fb7a42907036157e5c680b85 Mon Sep 17 00:00:00 2001
From: "Andrey V.Kosteltsev" <AKosteltsev@IBS.RU>
Date: Mon, 4 Jul 2022 23:59:32 +0300
Subject: IBS: _sila UI theme

---
 src/views/_sila/Overview/OverviewNetwork.vue | 71 ++++++++++++++++++++++++++++
 1 file changed, 71 insertions(+)
 create mode 100644 src/views/_sila/Overview/OverviewNetwork.vue

(limited to 'src/views/_sila/Overview/OverviewNetwork.vue')

diff --git a/src/views/_sila/Overview/OverviewNetwork.vue b/src/views/_sila/Overview/OverviewNetwork.vue
new file mode 100644
index 00000000..b81e5c73
--- /dev/null
+++ b/src/views/_sila/Overview/OverviewNetwork.vue
@@ -0,0 +1,71 @@
+<template>
+  <overview-card
+    v-if="network"
+    :title="$t('pageOverview.networkInformation')"
+    :to="`/settings/network`"
+  >
+    <b-row class="mt-3">
+      <b-col sm="6">
+        <dl>
+          <dt>{{ $t('pageOverview.hostName') }}</dt>
+          <dd>{{ dataFormatter(network.hostname) }}</dd>
+        </dl>
+      </b-col>
+      <b-col sm="6">
+        <dl>
+          <dt>{{ $t('pageOverview.linkStatus') }}</dt>
+          <dd>
+            {{ dataFormatter(network.linkStatus) }}
+          </dd>
+        </dl>
+      </b-col>
+    </b-row>
+    <b-row>
+      <b-col>
+        <dl>
+          <dt>{{ $t('pageOverview.ipv4') }}</dt>
+          <dd>
+            {{ dataFormatter(network.staticAddress) }}
+          </dd>
+        </dl>
+      </b-col>
+      <b-col>
+        <dl>
+          <dt>{{ $t('pageOverview.dhcp') }}</dt>
+          <dd>
+            {{
+              dataFormatter(
+                network.dhcpAddress.length !== 0
+                  ? network.dhcpAddress[0].Address
+                  : null
+              )
+            }}
+          </dd>
+        </dl>
+      </b-col>
+    </b-row>
+  </overview-card>
+</template>
+
+<script>
+import OverviewCard from './OverviewCard';
+import DataFormatterMixin from '@/components/Mixins/DataFormatterMixin';
+
+export default {
+  name: 'Network',
+  components: {
+    OverviewCard,
+  },
+  mixins: [DataFormatterMixin],
+  computed: {
+    network() {
+      return this.$store.getters['network/globalNetworkSettings'][0];
+    },
+  },
+  created() {
+    this.$store.dispatch('network/getEthernetData').finally(() => {
+      this.$root.$emit('overview-network-complete');
+    });
+  },
+};
+</script>
-- 
cgit v1.2.3

