summaryrefslogtreecommitdiff
path: root/src/views/_sila/Operations/ConsoleSettings/ConsoleSettings.vue
blob: ecc2150fc6f75066028e8e281aff65a3554e4848 (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
<template>
  <b-container
    :style="{ display: 'flex', 'flex-direction': 'column' }"
    fluid="xxl pt-0 m-0"
  >
    <page-title />
    <page-section class="bootstrap-table__section">
      <b-table
        responsive="md"
        show-empty
        class="table-rounded"
        no-border-collapse
        :items="systems"
        :fields="fields"
        :empty-text="$t('global.table.emptyMessage')"
      >
        <template #cell(value)="data">
          <b-row v-if="typeof data.value === 'boolean'">
            <b-col>
              <span v-if="systems[data.index].value">
                {{ $t('global.status.enabled') }}
              </span>
              <span v-else>
                {{ $t('global.status.disabled') }}
              </span>
            </b-col>
            <b-col>
              <b-form-checkbox v-model="systems[data.index].value" switch>
              </b-form-checkbox>
            </b-col>
          </b-row>
          <b-row
            v-else-if="data.index === 1 || data.index === 6 || data.index === 8"
          >
            <b-col>
              <span>
                {{ data.value }}
              </span>
            </b-col>
            <b-col>
              <img :is="iconChevron" class="icon-chevron" />
            </b-col>
          </b-row>
          <b-row v-else-if="data.index === 3">
            <b-col>
              <span>
                {{ data.value }}
              </span>
            </b-col>
            <b-col>
              <img src="@/assets/images/icon-edit.svg" class="icon-chevron" />
            </b-col>
          </b-row>
          <b-row v-else>
            <span>{{ data.value }}</span></b-row
          >
        </template>
      </b-table>
      <div class="save-button">
        <b-button variant="primary" class="console-settings__save-button">
          {{ $t('global.action.saveChanges') }}
        </b-button>
      </div>
    </page-section>
  </b-container>
</template>

<script>
import PageTitle from '@/components/Global/PageTitle';
import PageSection from '@/components/Global/PageSection';
import BVToastMixin from '@/components/Mixins/BVToastMixin';
import TableRowExpandMixin, {
  expandRowLabel,
} from '@/components/Mixins/TableRowExpandMixin';
import iconChevron from '@carbon/icons-vue/es/chevron--down/16';

export default {
  components: {
    PageTitle,
    PageSection,
  },
  mixins: [BVToastMixin, TableRowExpandMixin],
  data() {
    return {
      text: '',
      isBusy: true,
      fields: [
        {
          key: 'attributes',
          label: 'Атрибуты',
          formatter: this.dataFormatter,
        },
        {
          key: 'value',
          label: 'Значение',
          formatter: this.dataFormatter,
          thStyle: { width: '30%' },
        },
      ],
      iconChevron,
      expandRowLabel: expandRowLabel,
      systems: [
        { attributes: 'Состояние', value: true },
        { attributes: 'Максимальное количество сеансов', value: '6' },
        { attributes: 'Активные сеансы', value: '0' },
        { attributes: 'Порт удаленного доступа', value: '5900' },
        { attributes: 'Статус шифрования видео', value: true },
        { attributes: 'Видео с локального сервера', value: true },
        {
          attributes:
            'Действие по умолчанию при истечении времени ожидания запроса на общий доступ к сеансу',
          value: 'Полный доступ',
        },
        {
          attributes: 'Автоматическая блокировка системы',
          value: false,
        },
        {
          attributes: 'Состояние подключения клавиатуры/мыши',
          value: 'Автоматическое',
        },
      ],
      // iconChevronUp: iconChevronUp,
    };
  },
};
</script>
<style lang="scss" scoped>
.row {
  margin: 0px;
  height: 15px;
  flex-wrap: nowrap;
  align-items: center;
}
.col {
  padding: 0;
}

.icon-chevron {
  margin: 0 0 0 85%;
  cursor: pointer;
}

.save-button {
  display: flex;
  justify-content: flex-end;
}

.console-settings__save-button {
  width: 241px;
  height: 36px;
  margin-right: 0.5rem;
}
</style>