From 6facd12596ec8b55bab4be04b473de65e1f22018 Mon Sep 17 00:00:00 2001
From: Maksim Zakharov <m.zakharov@IBS.RU>
Date: Tue, 24 May 2022 09:43:34 +0300
Subject: Add depend: highcarts. Pages: power, analytical motherboard, memory,
 fans, event logs, Fix styles, add global components.

---
 .../DynamicInfo/ProcessorsDynamicPage.vue          | 373 +++++++++++++++++++++
 1 file changed, 373 insertions(+)
 create mode 100644 src/views/Processors/DynamicInfo/ProcessorsDynamicPage.vue

(limited to 'src/views/Processors/DynamicInfo/ProcessorsDynamicPage.vue')

diff --git a/src/views/Processors/DynamicInfo/ProcessorsDynamicPage.vue b/src/views/Processors/DynamicInfo/ProcessorsDynamicPage.vue
new file mode 100644
index 00000000..9ba32a4d
--- /dev/null
+++ b/src/views/Processors/DynamicInfo/ProcessorsDynamicPage.vue
@@ -0,0 +1,373 @@
+<template>
+  <b-container
+    :style="{ display: 'flex', 'flex-direction': 'column' }"
+    fluid="xxl pt-0 m-0"
+  >
+    <page-title />
+    <div class="notification-time__container">
+      <span class="semi-bold-12px">{{
+        $t('global.ariaLabel.notificationTime')
+      }}</span>
+      <div class="form-control notification-time">
+        <b-form-input
+          v-model="notificationInput"
+          type="number"
+          class="notification-time__input"
+        >
+        </b-form-input>
+        <button class="notification-button">
+          <img
+            class="notification-time__icon"
+            src="@/assets/images/refresh.svg"
+          />
+        </button>
+      </div>
+    </div>
+    <div class="main-container">
+      <date-switch
+        :switch-time-scale="switchTimeScale"
+        :time-scale="timeScale"
+      />
+      <!-- Temperature Section -->
+      <div class="page-collapse-decorator">
+        <b-button
+          v-b-toggle.toggle-collapse_1
+          variant="link"
+          class="collapse-button semi-bold-16px"
+        >
+          <img src="@/assets/images/temperature-icon.svg" />
+          <span class="bold-16px">{{ $t('subHeader.temperature') }}</span>
+          <component :is="iconChevronUp" class="icon-expand" />
+        </b-button>
+        <b-collapse id="toggle-collapse_1" class="nav-item__nav">
+          <!-- Temperature Limit Inputs -->
+          <div class="limit-container">
+            <div class="trmperature-limt">
+              <img src="@/assets/images/labels/non-normal.svg" />
+              <span class="semi-bold-12px">{{
+                $t('tablesDescription.nonNormalMode')
+              }}</span>
+              <b-form-input
+                v-model="temperatureNonNormalInput"
+                type="number"
+                :min="0"
+                :max="temperatureCriticalInput"
+                class="form-control medium-12px"
+              >
+              </b-form-input>
+            </div>
+            <div class="trmperature-limt">
+              <img src="@/assets/images/labels/critical.svg" />
+              <span class="semi-bold-12px">{{
+                $t('tablesDescription.criticalMode')
+              }}</span>
+              <b-form-input
+                v-model="temperatureCriticalInput"
+                type="number"
+                :min="temperatureNonNormalInput"
+                :max="temperatureWarningInput"
+                class="form-control medium-12px"
+              >
+              </b-form-input>
+            </div>
+            <div class="trmperature-limt">
+              <img src="@/assets/images/labels/warning.svg" />
+              <span class="semi-bold-12px">{{
+                $t('tablesDescription.temperatureWarning')
+              }}</span>
+              <b-form-input
+                v-model="temperatureWarningInput"
+                type="number"
+                :min="temperatureCriticalInput"
+                :max="100"
+                class="form-control medium-12px"
+              >
+              </b-form-input>
+            </div>
+            <b-button
+              class="save-button"
+              variant="primary"
+              @click="updateTemperature"
+            >
+              {{ $t('global.action.save') }}
+            </b-button>
+          </div>
+          <!-- Temperature Tables -->
+          <temperature-table
+            :time-scale="timeScale"
+            :warning="temperatureWarning"
+            :non-normal="temperatureNonNormal"
+            :critical-start="temperatureCritical"
+          />
+          <accessory-table :records="accessoryData.temperatureTable" />
+        </b-collapse>
+      </div>
+      <!-- Frequency Section -->
+      <div class="page-collapse-decorator">
+        <b-button
+          v-b-toggle.toggle-collapse_2
+          variant="link"
+          class="collapse-button semi-bold-16px"
+        >
+          <img src="@/assets/images/frequency-icon.svg" />
+          <span class="bold-16px">{{ $t('subHeader.frequency') }}</span>
+          <component :is="iconChevronUp" class="icon-expand" />
+        </b-button>
+        <b-collapse id="toggle-collapse_2" class="nav-item__nav">
+          <div class="limit-container">
+            <div class="frequency-limt">
+              <img src="@/assets/images/labels/warning.svg" />
+              <span class="semi-bold-12px">{{
+                $t('tablesDescription.frequencyWarning')
+              }}</span>
+              <b-form-input
+                v-model="frequencyWarningInput"
+                :min="0"
+                :max="1000"
+                type="number"
+                class="form-control medium-12px"
+              >
+              </b-form-input>
+            </div>
+            <b-button
+              class="save-button"
+              variant="primary"
+              @click="updateFrequency"
+            >
+              {{ $t('global.action.save') }}
+            </b-button>
+          </div>
+          <!-- Frequency Table -->
+          <frequency-table
+            :time-scale="timeScale"
+            :warning="frequencyWarning"
+          />
+          <accessory-table :records="accessoryData.frequencyTable" />
+          <!-- <frequency-table /> -->
+        </b-collapse>
+      </div>
+      <!-- Power Consumption Section -->
+      <div class="page-collapse-decorator">
+        <b-button
+          v-b-toggle.toggle-collapse_3
+          variant="link"
+          class="collapse-button semi-bold-16px"
+        >
+          <img src="@/assets/images/power-icon.svg" />
+          <span class="bold-16px">{{ $t('subHeader.powerConsumption') }}</span>
+          <component :is="iconChevronUp" class="icon-expand" />
+        </b-button>
+        <b-collapse id="toggle-collapse_3" class="nav-item__nav">
+          <div class="limit-container">
+            <div class="frequency-limt">
+              <img src="@/assets/images/labels/warning.svg" />
+              <span class="semi-bold-12px">{{
+                $t('tablesDescription.powerWarning')
+              }}</span>
+              <b-form-input
+                v-model="powerWarningInput"
+                type="number"
+                :min="0"
+                :max="100"
+                class="form-control medium-12px"
+              >
+              </b-form-input>
+            </div>
+            <div class="frequency-limt">
+              <img src="@/assets/images/labels/shutdown.svg" />
+              <span class="semi-bold-12px">{{
+                $t('tablesDescription.powerShutdown')
+              }}</span>
+              <b-form-input
+                v-model="powerShutdownInput"
+                type="number"
+                :min="0"
+                :max="100"
+                class="form-control medium-12px"
+              >
+              </b-form-input>
+            </div>
+            <b-button
+              class="save-button"
+              variant="primary"
+              @click="updatePower"
+            >
+              {{ $t('global.action.save') }}
+            </b-button>
+          </div>
+          <!-- Power Consumption Table -->
+          <power-table
+            :time-scale="timeScale"
+            :warning="powerWarning"
+            :shutdown="powerShutdown"
+          />
+          <!-- <power-table /> -->
+          <accessory-table :records="accessoryData.powerTable" />
+        </b-collapse>
+      </div>
+      <!-- <page-section class="bootstrap-table__section"> </page-section> -->
+    </div>
+  </b-container>
+</template>
+<script>
+import PageTitle from '@/components/Global/PageTitle';
+import PageSection from '@/components/Global/PageSection';
+import DateSwitch from '@/components/Global/SilaComponents/DateSwitch';
+import FrequencyTable from './FrequencyTable';
+import PowerTable from './PowerTable';
+import TemperatureTable from './TemperatureTable';
+import AccessoryTable from '@/components/Global/SilaComponents/Tables/AccessoryTablePower';
+
+import iconChevronUp from '@carbon/icons-vue/es/chevron--up/16';
+
+import { AccessoryData } from './helpers';
+
+export default {
+  components: {
+    PageTitle,
+    PageSection,
+    DateSwitch,
+    FrequencyTable,
+    TemperatureTable,
+    PowerTable,
+    AccessoryTable,
+  },
+  data() {
+    return {
+      timeScale: 'hour',
+      temperatureWarning: 72,
+      temperatureWarningInput: 72,
+      temperatureNonNormal: 44,
+      temperatureNonNormalInput: 44,
+      temperatureCritical: 55,
+      temperatureCriticalInput: 55,
+      frequencyWarning: 660,
+      frequencyWarningInput: 660,
+      powerWarning: 66,
+      powerWarningInput: 66,
+      powerShutdown: 88,
+      powerShutdownInput: 88,
+      notificationInput: 42,
+      accessoryData: AccessoryData,
+      iconChevronUp: iconChevronUp,
+    };
+  },
+  methods: {
+    switchTimeScale(period) {
+      this.timeScale = period;
+    },
+    updateTemperature() {
+      this.temperatureWarning = +this.temperatureWarningInput;
+      this.temperatureNonNormal = +this.temperatureNonNormalInput;
+      this.temperatureCritical = +this.temperatureCriticalInput;
+    },
+    updateFrequency() {
+      this.frequencyWarning = +this.frequencyWarningInput;
+    },
+    updatePower() {
+      this.powerWarning = +this.powerWarningInput;
+      this.powerShutdown = +this.powerShutdownInput;
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+//nav items style
+.nav-item,
+.nav-link {
+  padding: 0;
+}
+.nav-item {
+  list-style-type: none;
+}
+
+a {
+  color: $text-primary !important;
+  &:hover {
+    color: $text-primary !important;
+  }
+}
+
+.notification-time__container {
+  position: absolute;
+  top: calc(#{$header-height});
+  right: 0px;
+  display: flex;
+  flex-flow: row nowrap;
+  justify-content: flex-start;
+  align-items: center;
+}
+
+.notification-time {
+  display: flex;
+  flex-flow: row nowrap;
+  justify-content: flex-start;
+  align-items: center;
+  border: none;
+  box-shadow: none;
+  border-radius: 8px;
+  margin: 12px 32px 12px 8px;
+  width: 236px;
+  height: 40px;
+  z-index: 1001;
+}
+
+.notification-time__icon {
+  width: 20px;
+  height: 20px;
+}
+
+.notification-time__input {
+  border: none;
+  background: none;
+  box-shadow: none;
+}
+
+.notification-button {
+  border: none;
+  background: none;
+}
+
+.semi-bold-12px {
+  z-index: 1001;
+}
+// temperature limit comtainer
+.limit-container {
+  height: 85px;
+  width: 100%;
+  padding: 0 32px 10px 32px;
+  display: flex;
+  flex-flow: row nowrap;
+  justify-content: flex-start;
+  align-items: flex-end;
+  gap: 24px;
+}
+
+.trmperature-limt {
+  height: 60px;
+  width: 100%;
+  max-width: 270px;
+  display: flex;
+  align-items: baseline;
+  flex-flow: row wrap;
+  gap: 8px;
+}
+
+.form-control {
+  height: 36px;
+}
+.save-button {
+  width: 151px;
+  height: 36px;
+}
+
+.frequency-limt {
+  height: 60px;
+  width: 100%;
+  max-width: 288px;
+  display: flex;
+  align-items: baseline;
+  flex-flow: row wrap;
+  gap: 8px;
+}
+</style>
-- 
cgit v1.2.3

