summaryrefslogtreecommitdiff
path: root/src/views/SILA/RAID/Settings/TomeModal.vue
blob: c77f4c13519b0e77c2d29efd67438cf9c5bfd71f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
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/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>