From 1272456ab2cb77f29b27f3839563b09a709cbc06 Mon Sep 17 00:00:00 2001
From: Vitalii Lysak <v.lysak@dunice.net>
Date: Wed, 13 Jul 2022 15:46:06 +0300
Subject: move sila-dev to _sila

---
 .../Info/InventoryTableSystem.vue                  | 81 ++++++++++++++++++++++
 1 file changed, 81 insertions(+)
 create mode 100644 src/views/_sila/SystemDescription/Info/InventoryTableSystem.vue

(limited to 'src/views/_sila/SystemDescription/Info/InventoryTableSystem.vue')

diff --git a/src/views/_sila/SystemDescription/Info/InventoryTableSystem.vue b/src/views/_sila/SystemDescription/Info/InventoryTableSystem.vue
new file mode 100644
index 00000000..0c32d2c0
--- /dev/null
+++ b/src/views/_sila/SystemDescription/Info/InventoryTableSystem.vue
@@ -0,0 +1,81 @@
+<template>
+  <page-section class="bootstrap-table__section">
+    <b-table
+      responsive="md"
+      show-empty
+      class="table-rounded"
+      no-border-collapse
+      :items="items"
+      :fields="fields"
+      :empty-text="$t('global.table.emptyMessage')"
+    >
+    </b-table>
+  </page-section>
+</template>
+
+<script>
+import BVToastMixin from '@/components/Mixins/BVToastMixin';
+import PageSection from '@/components/Global/PageSection';
+import LoadingBarMixin from '@/components/Mixins/LoadingBarMixin';
+import TableRowExpandMixin, {
+  expandRowLabel,
+} from '@/components/Mixins/TableRowExpandMixin';
+
+export default {
+  components: { PageSection },
+  mixins: [BVToastMixin, TableRowExpandMixin, LoadingBarMixin],
+  data() {
+    return {
+      fields: [
+        {
+          key: 'param',
+          label: 'Параметр',
+          formatter: this.dataFormatter,
+          thStyle: { width: '50%' },
+        },
+        {
+          key: 'value',
+          label: 'Значение',
+          formatter: this.dataFormatter,
+        },
+      ],
+      expandRowLabel: expandRowLabel,
+      items: null,
+    };
+  },
+  computed: {
+    systems() {
+      return this.$store.getters['system/systems'];
+    },
+  },
+  watch: {
+    systems() {
+      this.items = [
+        {
+          param: 'id',
+          value: this.id,
+        },
+        { param: 'Модель', value: this.systems[0].model },
+        { param: 'Производитель', value: '' },
+        { param: 'Операционная система', value: '' },
+        { param: 'Серийный номер', value: this.systems[0].serialNumber },
+        {
+          param: 'Свободное место на Flash-накопителе',
+          value: '1 024 000 Мб',
+        },
+      ];
+    },
+  },
+  created() {
+    this.$store.dispatch('system/getSystem').finally(() => {
+      // Emit initial data fetch complete to parent component
+      this.$root.$emit('hardware-status-system-complete');
+    });
+    this.startLoader();
+    const systemTablePromise = new Promise((resolve) => {
+      this.$root.$on('hardware-status-system-complete', () => resolve());
+    });
+    Promise.all([systemTablePromise]).finally(() => this.endLoader());
+  },
+};
+</script>
-- 
cgit v1.2.3

