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

(limited to 'src/views/_sila/Operations/Firmware/Firmware.vue')

diff --git a/src/views/_sila/Operations/Firmware/Firmware.vue b/src/views/_sila/Operations/Firmware/Firmware.vue
new file mode 100644
index 00000000..a2acb9b0
--- /dev/null
+++ b/src/views/_sila/Operations/Firmware/Firmware.vue
@@ -0,0 +1,93 @@
+<template>
+  <b-container fluid="xl">
+    <page-title />
+    <alerts-server-power
+      v-if="isServerPowerOffRequired"
+      :is-server-off="isServerOff"
+    />
+
+    <!-- Firmware cards -->
+    <b-row>
+      <b-col xl="10">
+        <!-- BMC Firmware -->
+        <bmc-cards :is-page-disabled="isPageDisabled" />
+
+        <!-- Host Firmware -->
+        <host-cards v-if="!isSingleFileUploadEnabled" />
+      </b-col>
+    </b-row>
+
+    <!-- Update firmware-->
+    <page-section
+      :section-title="$t('pageFirmware.sectionTitleUpdateFirmware')"
+    >
+      <b-row>
+        <b-col sm="8" md="6" xl="4">
+          <!-- Update form -->
+          <form-update
+            :is-server-off="isServerOff"
+            :is-page-disabled="isPageDisabled"
+          />
+        </b-col>
+      </b-row>
+    </page-section>
+  </b-container>
+</template>
+
+<script>
+import AlertsServerPower from './FirmwareAlertServerPower';
+import BmcCards from './FirmwareCardsBmc';
+import FormUpdate from './FirmwareFormUpdate';
+import HostCards from './FirmwareCardsHost';
+import PageSection from '@/components/Global/PageSection';
+import PageTitle from '@/components/Global/PageTitle';
+
+import LoadingBarMixin, { loading } from '@/components/Mixins/LoadingBarMixin';
+
+export default {
+  name: 'FirmwareSingleImage',
+  components: {
+    AlertsServerPower,
+    BmcCards,
+    FormUpdate,
+    HostCards,
+    PageSection,
+    PageTitle,
+  },
+  mixins: [LoadingBarMixin],
+  beforeRouteLeave(to, from, next) {
+    this.hideLoader();
+    next();
+  },
+  data() {
+    return {
+      loading,
+      isServerPowerOffRequired:
+        process.env.VUE_APP_SERVER_OFF_REQUIRED === 'true',
+    };
+  },
+  computed: {
+    serverStatus() {
+      return this.$store.getters['global/serverStatus'];
+    },
+    isServerOff() {
+      return this.serverStatus === 'off' ? true : false;
+    },
+    isSingleFileUploadEnabled() {
+      return this.$store.getters['firmware/isSingleFileUploadEnabled'];
+    },
+    isPageDisabled() {
+      if (this.isServerPowerOffRequired) {
+        return !this.isServerOff || this.loading || this.isOperationInProgress;
+      }
+      return this.loading || this.isOperationInProgress;
+    },
+  },
+  created() {
+    this.startLoader();
+    this.$store
+      .dispatch('firmware/getFirmwareInformation')
+      .finally(() => this.endLoader());
+  },
+};
+</script>
-- 
cgit v1.2.3

