summaryrefslogtreecommitdiff
path: root/src/views/_sila/SILA/RAID/Settings
diff options
context:
space:
mode:
Diffstat (limited to 'src/views/_sila/SILA/RAID/Settings')
-rw-r--r--src/views/_sila/SILA/RAID/Settings/ActionSettingsPopover.vue131
-rw-r--r--src/views/_sila/SILA/RAID/Settings/OptionsPopover.vue87
-rw-r--r--src/views/_sila/SILA/RAID/Settings/RAIDSettingsPage.vue288
-rw-r--r--src/views/_sila/SILA/RAID/Settings/TomeModal.vue179
-rw-r--r--src/views/_sila/SILA/RAID/Settings/helpers.js62
-rw-r--r--src/views/_sila/SILA/RAID/Settings/index.js1
6 files changed, 748 insertions, 0 deletions
diff --git a/src/views/_sila/SILA/RAID/Settings/ActionSettingsPopover.vue b/src/views/_sila/SILA/RAID/Settings/ActionSettingsPopover.vue
new file mode 100644
index 00000000..2f3093ab
--- /dev/null
+++ b/src/views/_sila/SILA/RAID/Settings/ActionSettingsPopover.vue
@@ -0,0 +1,131 @@
+<template>
+ <b-popover
+ placement="left"
+ triggers="focus"
+ :show.sync="show"
+ custom-class="apply-reload-popover"
+ :target="`popover-action-${id}`"
+ @hidden="onHidden"
+ >
+ <b-button
+ id="popover-apply-button"
+ variant="popover"
+ :class="{ 'hovered-apply-button': scale === topPosition }"
+ @mouseover="scale = topPosition"
+ @click="
+ () => {
+ show = false;
+ appalyOnReload();
+ }
+ "
+ >
+ При перезагрузке
+ </b-button>
+ <b-button
+ id="popover-apply-button"
+ variant="popover"
+ :class="{ 'hovered-apply-button': scale === middlePosition }"
+ @mouseover="scale = middlePosition"
+ @click="
+ () => {
+ show = false;
+ appalyOption1();
+ }
+ "
+ >
+ Опция 1
+ </b-button>
+ <b-button
+ id="popover-apply-button"
+ variant="popover"
+ :class="{ 'hovered-apply-button': scale === bottomPosition }"
+ @mouseover="scale = bottomPosition"
+ @click="
+ () => {
+ show = false;
+ appalyOption2();
+ }
+ "
+ >
+ Опция 2
+ </b-button>
+ <div class="slider" :style="`left: 5px; top: ${scale}px;`"></div>
+ </b-popover>
+</template>
+
+<script>
+export default {
+ props: {
+ id: {
+ type: Number,
+ default: null,
+ },
+ appalyOnReload: {
+ type: Function,
+ default: null,
+ },
+ appalyOption1: {
+ type: Function,
+ default: null,
+ },
+ appalyOption2: {
+ type: Function,
+ default: null,
+ },
+ applyType: {
+ type: String,
+ default: 'reload',
+ },
+ },
+ data() {
+ return {
+ topPosition: 5,
+ middlePosition: 33,
+ bottomPosition: 60,
+ show: false,
+ scale: 5,
+ };
+ },
+ methods: {
+ onHidden() {
+ if (this.applyType === 'reload') {
+ this.scale = this.topPosition;
+ } else if (this.applyType === 'option1') {
+ this.scale = this.middlePosition;
+ } else {
+ this.scale = this.bottomPosition;
+ }
+ },
+ },
+};
+</script>
+<style lang="scss">
+.analytical-table__status {
+ width: 10%;
+}
+
+#popover-apply-ractive {
+ padding-left: 5px;
+}
+
+.hovered-apply-button {
+ color: $white;
+}
+</style>
+<style lang="scss" scoped>
+#popover-apply-button {
+ justify-content: flex-start;
+ width: 240px;
+}
+
+.slider {
+ width: 240px;
+ height: 28px;
+ border-radius: 8px;
+ background-color: $red-brand-primary;
+ box-shadow: 1px 2px 4px -1px rgb(79 37 37 / 40%) inset;
+ position: absolute;
+ transition: ease-in 0.2s;
+ z-index: -1;
+}
+</style>
diff --git a/src/views/_sila/SILA/RAID/Settings/OptionsPopover.vue b/src/views/_sila/SILA/RAID/Settings/OptionsPopover.vue
new file mode 100644
index 00000000..d1b85754
--- /dev/null
+++ b/src/views/_sila/SILA/RAID/Settings/OptionsPopover.vue
@@ -0,0 +1,87 @@
+<template>
+ <b-popover
+ placement="left"
+ triggers="focus"
+ :show.sync="show"
+ custom-class="popover-heigth-100"
+ :target="`popover-option-${id}`"
+ >
+ <b-button
+ id="popover-option-button"
+ variant="popover"
+ @click="
+ () => {
+ show = false;
+ openModal();
+ }
+ "
+ >
+ <img
+ src="@/assets/images/icon-settings-red.svg"
+ class="icon-chevron icon-settings"
+ />
+ Настройки
+ </b-button>
+ <b-button
+ id="popover-option-button"
+ class="delete"
+ variant="popover"
+ @click="show = false"
+ >
+ <img
+ src="@/assets/images/icon-clear-red.svg"
+ class="icon-chevron icon-delete"
+ />
+ Удалить
+ </b-button>
+ </b-popover>
+</template>
+
+<script>
+export default {
+ props: {
+ id: {
+ type: Number,
+ default: null,
+ },
+ },
+ data() {
+ return {
+ show: false,
+ };
+ },
+ methods: {
+ openModal() {
+ this.$bvModal.show(`edit-tome${this.id}`);
+ },
+ },
+};
+</script>
+<style lang="scss" scoped>
+.popover-heigth-100 {
+ max-width: 120px;
+}
+
+#popover-option-button {
+ padding: 0 9px 0 10px;
+ font-size: 12px;
+ &:hover {
+ color: $red-brand-primary;
+ box-shadow: 1px 2px 4px -1px rgb(79 37 37 / 25%) inset;
+ }
+ &:active {
+ box-shadow: 1px 2px 4px -1px rgb(79 37 37 / 50%) inset;
+ }
+ &.delete {
+ padding: 0 26px 0 13px;
+ }
+}
+
+.icon-settings {
+ padding-right: 5px;
+}
+
+.icon-delete {
+ padding-right: 10px;
+}
+</style>
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>
diff --git a/src/views/_sila/SILA/RAID/Settings/TomeModal.vue b/src/views/_sila/SILA/RAID/Settings/TomeModal.vue
new file mode 100644
index 00000000..c245bd1b
--- /dev/null
+++ b/src/views/_sila/SILA/RAID/Settings/TomeModal.vue
@@ -0,0 +1,179 @@
+<template>
+ <b-modal :id="id" class="modal-images" hide-footer>
+ <template #modal-title>
+ <span class="semi-bold-20px">{{ title }}</span>
+ </template>
+ <div class="modal-body">
+ <label class="regular-12px tretiatry" for="name"> Имя </label>
+ <b-form-input
+ id="name"
+ v-model="tomeName"
+ placeholder="Название тома"
+ type="text"
+ class="form-control form-input"
+ >
+ </b-form-input>
+
+ <form-control>
+ <label class="regular-12px tretiatry type-select-label" for="type"
+ >Тип</label
+ >
+ <b-form-select
+ id="type"
+ v-model="tomeType"
+ :options="tomeTypes"
+ class="select-connection regular-14px"
+ />
+ </form-control>
+
+ <form-control>
+ <label class="regular-12px tretiatry driver-select-label" for="driver"
+ >Физический накопитель</label
+ >
+ <b-form-select
+ id="driver"
+ v-model="tomeDriver"
+ :options="tomeDrivers"
+ class="select-connection regular-14px"
+ />
+ </form-control>
+
+ <label class="regular-12px tretiatry" for="size"> Размер Мб </label>
+ <b-form-input
+ id="size"
+ v-model="tomeSize"
+ placeholder="Размер Тома"
+ type="text"
+ class="form-control form-input"
+ >
+ </b-form-input>
+ <b-button class="upload-button" variant="primary" @click="action(index)">
+ {{ item ? $t('global.action.save') : $t('global.action.addTome') }}
+ </b-button>
+ </div>
+ </b-modal>
+</template>
+<script>
+import { required } from 'vuelidate/lib/validators';
+import VuelidateMixin from '@/components/Mixins/VuelidateMixin.js';
+
+export default {
+ mixins: [VuelidateMixin],
+ props: {
+ id: {
+ type: String,
+ default: null,
+ },
+ title: {
+ type: String,
+ default: null,
+ },
+ index: {
+ type: Number,
+ default: null,
+ },
+ action: {
+ type: Function,
+ default: null,
+ },
+ item: {
+ type: Object,
+ default: null,
+ },
+ },
+ data() {
+ return {
+ tomeName: '',
+ tomeSize: '',
+ tomeType: 1,
+ tomeTypes: [
+ { value: 1, text: 'RAID-0' },
+ { value: 2, text: 'RAID-1' },
+ ],
+ tomeDriver: 1,
+ tomeDrivers: [
+ { value: 1, text: 'Накопитель 1' },
+ { value: 2, text: 'Накопитель 2' },
+ ],
+ };
+ },
+ mounted() {
+ this.tomeName = this.item.name;
+ this.tomeSize = this.item.size;
+ },
+ validations: {
+ userInfo: {
+ username: {
+ required,
+ },
+ password: {
+ required,
+ },
+ },
+ },
+};
+</script>
+<style lang="scss">
+.modal-content {
+ border-radius: 16px;
+ width: 480px;
+}
+.modal-header {
+ border-bottom: none;
+}
+</style>
+<style lang="scss" scoped>
+.form-input {
+ height: 56px;
+ padding-top: 30px;
+ font-family: 'Inter', sans-serif;
+ font-size: 14px;
+ font-weight: 500;
+ line-height: 20px;
+ letter-spacing: 0em;
+ margin: -30px 0 20px 0;
+}
+
+.modal-body {
+ width: 446px;
+}
+
+.caption-12px,
+.regular-12px {
+ padding-left: 10px;
+}
+
+.select-connection {
+ height: 56px;
+ padding-top: 30px;
+ border: none;
+ border-radius: 8px;
+ margin: -0px 0 18px 0;
+ background-color: $surface-secondary;
+ background-image: url('../../../../../assets/images/_sila/icon-chevron.svg');
+}
+
+.type-select-label {
+ position: absolute;
+ top: 25%;
+}
+
+.driver-select-label {
+ position: absolute;
+ top: 44%;
+ left: 4%;
+}
+
+.form-background .custom-select,
+.form-background .form-control {
+ border-radius: 8px;
+ border: none;
+ background-color: rgba(26, 62, 91, 0.05);
+}
+
+.upload-button {
+ width: 100%;
+ height: 40px;
+ margin: 0 auto 10px;
+}
+</style>
diff --git a/src/views/_sila/SILA/RAID/Settings/helpers.js b/src/views/_sila/SILA/RAID/Settings/helpers.js
new file mode 100644
index 00000000..5727102a
--- /dev/null
+++ b/src/views/_sila/SILA/RAID/Settings/helpers.js
@@ -0,0 +1,62 @@
+export const items = [
+ {
+ parametr: 'Режим контроллера',
+ value: 'RAID',
+ action: 'Автоматически',
+ },
+ {
+ parametr: 'Режим чтения патруля',
+ value: 'Автоматически',
+ action: 'Действие',
+ },
+ {
+ parametr: 'Действие в режиме ручного патрулирования',
+ value: 'Запущен',
+ action: 'Действие',
+ },
+ {
+ parametr: 'Название атрибута',
+ value: 'Запущен',
+ action: 'Действие',
+ },
+ {
+ parametr: 'Название атрибута',
+ value: 'Запущен',
+ action: 'Действие',
+ },
+ {
+ parametr: 'Название атрибута',
+ value: 'Запущен',
+ action: 'Действие',
+ },
+ {
+ parametr: 'Название атрибута',
+ value: '30%',
+ action: '30',
+ },
+ {
+ parametr: 'Название атрибута',
+ value: '30%',
+ action: '30',
+ },
+ {
+ parametr: 'Название атрибута',
+ value: '30%',
+ action: '30',
+ },
+];
+
+export const items_2 = [
+ {
+ name: 'Том 1',
+ type: 'RAID-0',
+ size: '100 125 Мб',
+ action: 'Загружен',
+ },
+ {
+ name: 'Том 2',
+ type: 'RAID-1',
+ size: '200 250 Мб',
+ action: 'Загружен',
+ },
+];
diff --git a/src/views/_sila/SILA/RAID/Settings/index.js b/src/views/_sila/SILA/RAID/Settings/index.js
new file mode 100644
index 00000000..535dbe3a
--- /dev/null
+++ b/src/views/_sila/SILA/RAID/Settings/index.js
@@ -0,0 +1 @@
+export { default } from './RAIDSettingsPage.vue';