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/OverviewInventory.vue | 57 ++++++++++++++++++++++++++
 1 file changed, 57 insertions(+)
 create mode 100644 src/views/_sila/Overview/OverviewInventory.vue

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

diff --git a/src/views/_sila/Overview/OverviewInventory.vue b/src/views/_sila/Overview/OverviewInventory.vue
new file mode 100644
index 00000000..575cb7b7
--- /dev/null
+++ b/src/views/_sila/Overview/OverviewInventory.vue
@@ -0,0 +1,57 @@
+<template>
+  <overview-card
+    :title="$t('pageOverview.inventory')"
+    :to="`/hardware-status/inventory`"
+  >
+    <b-row class="mt-3">
+      <b-col sm="6">
+        <dl sm="6">
+          <dt>{{ $t('pageOverview.systemIdentifyLed') }}</dt>
+          <dd>
+            <b-form-checkbox
+              id="identifyLedSwitch"
+              v-model="systems.locationIndicatorActive"
+              data-test-id="overviewInventory-checkbox-identifyLed"
+              switch
+              @change="toggleIdentifyLedSwitch"
+            >
+              <span v-if="systems.locationIndicatorActive">
+                {{ $t('global.status.on') }}
+              </span>
+              <span v-else>{{ $t('global.status.off') }}</span>
+            </b-form-checkbox>
+          </dd>
+        </dl>
+      </b-col>
+    </b-row>
+  </overview-card>
+</template>
+
+<script>
+import OverviewCard from './OverviewCard';
+
+export default {
+  name: 'Inventory',
+  components: {
+    OverviewCard,
+  },
+  computed: {
+    systems() {
+      let systemData = this.$store.getters['system/systems'][0];
+      return systemData ? systemData : {};
+    },
+  },
+  created() {
+    this.$store.dispatch('system/getSystem').finally(() => {
+      this.$root.$emit('overview-inventory-complete');
+    });
+  },
+  methods: {
+    toggleIdentifyLedSwitch(state) {
+      this.$store
+        .dispatch('system/changeIdentifyLedState', state)
+        .catch(({ message }) => this.errorToast(message));
+    },
+  },
+};
+</script>
-- 
cgit v1.2.3

