summaryrefslogtreecommitdiff
path: root/src/views/_sila/SILA/RAID/Settings/RAIDSettingsPage.vue
diff options
context:
space:
mode:
Diffstat (limited to 'src/views/_sila/SILA/RAID/Settings/RAIDSettingsPage.vue')
-rw-r--r--src/views/_sila/SILA/RAID/Settings/RAIDSettingsPage.vue288
1 files changed, 288 insertions, 0 deletions
diff --git a/src/views/_sila/SILA/RAID/Settings/RAIDSettingsPage.vue b/src/views/_sila/SILA/RAID/Settings/RAIDSettingsPage.vue
new file mode 100644
index 00000000..19caafe0
--- /dev/null
+++ b/src/views/_sila/SILA/RAID/Settings/RAIDSettingsPage.vue
@@ -0,0 +1,288 @@
+<template>
+ <b-container
+ :style="{ display: 'flex', 'flex-direction': 'column' }"
+ fluid="xxl pt-0 m-0"
+ >
+ <page-title :description="$t('appNavigation.settings')" />
+ <data-tabs
+ :slots="raidSlots"
+ :switch-tab="switchRaidSlot"
+ :current-tab="currentRaidSlot"
+ :slot-width="100"
+ :slider-width="79"
+ style="margin-top: 16px"
+ />
+ <page-section class="bootstrap-table__section" style="margin-top: 0px">
+ <div class="settings-container">
+ <span class="bold-16px">{{ $t('appNavigation.settings') }}</span>
+ <apply-settings-popover
+ :appaly-on-reload="appalyOnReload"
+ :appaly-option1="appalyOption1"
+ :appaly-option2="appalyOption2"
+ :apply-type="applyType"
+ />
+ <b-button variant="primary" class="apply-button">
+ {{ $t('global.action.acceptChanges') }}
+ </b-button>
+ </div>
+ <b-table
+ responsive="md"
+ show-empty
+ class="table-rounded"
+ no-border-collapse
+ :items="items"
+ :fields="fields"
+ :empty-text="$t('global.table.emptyMessage')"
+ >
+ <template #cell(action)="data">
+ <b-row v-if="data.index <= 5">
+ <b-col>
+ <span>
+ {{ data.value }}
+ </span>
+ </b-col>
+ <b-col>
+ <b-button
+ :id="`popover-action-${data.index}`"
+ class="popover-action-ractive"
+ variant="toogle-popover"
+ >
+ <img :is="iconChevron" class="icon-chevron" />
+ </b-button>
+ <action-settings-popover
+ :id="data.index"
+ :appaly-on-reload="appalyOnReload"
+ :appaly-option1="appalyOption1"
+ :appaly-option2="appalyOption2"
+ :apply-type="applyType"
+ />
+ </b-col>
+ </b-row>
+ <b-row v-else>
+ <b-col>
+ <span>
+ {{ data.value }}
+ </span>
+ </b-col>
+ <b-col>
+ <img
+ src="@/assets/images/icon-edit.svg"
+ class="icon-chevron icon-edit"
+ />
+ </b-col>
+ </b-row>
+ </template>
+ </b-table>
+ </page-section>
+ <page-section class="bootstrap-table__section">
+ <div class="settings-container">
+ <span class="bold-16px">{{ $t('RAID.lun') }}</span>
+ <b-button
+ variant="primary"
+ class="apply-button apply-button__lun"
+ @click="$bvModal.show('add-tome-images')"
+ >
+ {{ $t('global.action.addNew') }}
+ </b-button>
+ </div>
+ <b-table
+ id="table-raid-settings"
+ responsive="md"
+ show-empty
+ class="table-rounded"
+ no-border-collapse
+ :items="items_2"
+ :fields="fields_2"
+ :empty-text="$t('global.table.emptyMessage')"
+ >
+ <template #cell(action)="data">
+ <b-row>
+ <b-col>
+ <span>
+ {{ data.value }}
+ </span>
+ </b-col>
+ <b-col>
+ <b-button
+ :id="`popover-option-${data.index}`"
+ class="popover-option-ractive"
+ variant="toogle-popover"
+ >
+ <img
+ src="@/assets/images/icon-options.svg"
+ class="icon-chevron icon-options"
+ />
+ </b-button>
+ <options-popover :id="data.index" />
+ <tome-modal
+ :id="`edit-tome${data.index}`"
+ :title="'Настройка виртуального тома'"
+ :action="editTome"
+ :index="data.index"
+ :item="items_2[data.index]"
+ />
+ </b-col>
+ </b-row>
+ </template>
+ </b-table>
+ <div class="microcode-container">
+ <span class="bold-16px">{{ $t('RAID.microcode') }}</span>
+ <popover
+ id="popover-reactive-1"
+ description="RAID.microcode_update"
+ popup="RAID.microcode_popoveer"
+ button="global.action.refresh"
+ :is-microcode-drivers="true"
+ />
+ </div>
+ </page-section>
+ <tome-modal
+ :id="'add-tome-images'"
+ :title="'Новый виртуальный том'"
+ :action="createTome"
+ />
+ </b-container>
+</template>
+
+<script>
+import PageTitle from '@/components/Global/PageTitle';
+import PageSection from '@/components/Global/PageSection';
+import Popover from '@/components/Global/Popover';
+import ApplySettingsPopover from '@/components/Global/SilaComponents/ApplySettingsPopover';
+import DataTabs from '@/components/Global/SilaComponents/DataTabs';
+
+import iconChevron from '@carbon/icons-vue/es/chevron--down/16';
+import ActionSettingsPopover from './ActionSettingsPopover';
+import OptionsPopover from './OptionsPopover';
+import TomeModal from './TomeModal';
+import { items, items_2 } from './helpers';
+
+export default {
+ components: {
+ PageTitle,
+ PageSection,
+ DataTabs,
+ Popover,
+ ApplySettingsPopover,
+ ActionSettingsPopover,
+ OptionsPopover,
+ TomeModal,
+ },
+ data() {
+ return {
+ items,
+ items_2,
+ iconChevron,
+ applyType: 'reload',
+ currentRaidSlot: 1,
+ titleModal: '',
+ editIndex: null,
+ raidSlots: [
+ { id: 1, name: 'Контроллер 1' },
+ { id: 2, name: 'Контроллер 2' },
+ { id: 3, name: 'Контроллер 3' },
+ ],
+ fields: [
+ {
+ key: 'parametr',
+ label: 'Имя',
+ formatter: this.dataFormatter,
+ thStyle: { width: '35%' },
+ },
+ {
+ key: 'value',
+ label: 'Текущее значение',
+ formatter: this.dataFormatter,
+ },
+ {
+ key: 'action',
+ label: 'Действие',
+ formatter: this.dataFormatter,
+ },
+ ],
+ fields_2: [
+ {
+ key: 'name',
+ label: 'Параметр',
+ formatter: this.dataFormatter,
+ },
+ {
+ key: 'type',
+ label: 'Значение',
+ formatter: this.dataFormatter,
+ },
+ {
+ key: 'size',
+ label: 'Значение',
+ formatter: this.dataFormatter,
+ },
+ {
+ key: 'action',
+ label: 'Значение',
+ formatter: this.dataFormatter,
+ },
+ ],
+ };
+ },
+ methods: {
+ switchRaidSlot(period) {
+ this.currentRaidSlot = period;
+ },
+ appalyOnReload() {
+ this.applyType = 'reload';
+ },
+ appalyOption1() {
+ this.applyType = 'option1';
+ },
+ appalyOption2() {
+ this.applyType = 'option2';
+ },
+ createTome() {
+ console.log('Новый том создан');
+ },
+ editTome(index) {
+ console.log('Том изменен');
+ console.log(index);
+ },
+ },
+};
+</script>
+<style lang="scss" scoped>
+.bold-16px {
+ display: block;
+ margin: 25px 0 16px 0;
+}
+
+.settings-container {
+ display: flex;
+ align-items: center;
+ justify-content: flex-start;
+}
+
+.apply-button {
+ width: 245px;
+ height: 36px;
+}
+
+.popover-action-ractive {
+ margin: 0 0 0 83%;
+}
+
+.popover-option-ractive {
+ margin: 0 0 0 70%;
+}
+
+.apply-button__lun {
+ width: 245px;
+ height: 36px;
+ margin-left: auto;
+}
+
+.microcode-container {
+ display: flex;
+ flex-direction: row;
+ flex-wrap: nowrap;
+ align-items: baseline;
+ justify-content: space-between;
+}
+</style>