summaryrefslogtreecommitdiff
path: root/src/components/_sila/Global/SilaComponents/NtpPopover.vue
blob: 0b476f721d7e904125983dd4aa80fa3ca4490f1e (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
<template>
  <div id="my-container">
    <span :id="id" class="regular-12px underline" variant="primary">
      {{ $t(description) }}
    </span>
    <!-- Our popover title and content render container -->
    <b-popover
      :target="id"
      placement="auto"
      container="my-container"
      :show.sync="popoverShow"
      @show="onShow"
    >
      <template #title>
        <div class="popup-title">
          <span class="bold-16px__caps">{{ $t(description) }}</span>
          <b-button class="popup-title__button_close" @click="onClose">
            <img src="@/assets/images/_sila/popups/x-icon.svg" />
          </b-button>
        </div>
      </template>

      <div class="popup-body">
        <div class="popup-body__input-container">
          <span class="regular-12px tretiatry"
            >Введите адрес сервера (IP, FQDM)</span
          >
          <b-form-input
            id="popover-input-1"
            v-model="input1"
            class="medium-12px"
          ></b-form-input>
        </div>
        <b-button class="popup-button" variant="primary" @click="onClose">
          {{ $t('global.action.save') }}
        </b-button>
      </div>
    </b-popover>
  </div>
</template>

<script>
export default {
  props: {
    description: {
      type: String,
      default: '',
    },
    id: {
      type: String,
      default: '',
    },
    button: {
      type: String,
      default: 'Reload',
    },
  },
  data() {
    return {
      input1: '',
      popoverShow: false,
    };
  },
  methods: {
    onShow() {
      this.$root.$emit('bv::hide::popover');
    },
    onClose() {
      this.popoverShow = false;
    },
  },
};
</script>
<style lang="scss" scoped>
.form-group {
  margin: 0;
}

.popup-title {
  display: flex;
  flex-flow: row nowrap;
  align-items: baseline;
}

.popup-title__button_close {
  margin: 0 28px 0 auto;
  background: none;
  border: none;
  &:active {
    background-color: $faint-secondary-primary-5-hover !important;
    box-shadow: none !important;
    border-radius: 8px;
  }
  &:focus-visible {
    border: none !important;
    border-radius: 8px;
  }
  &:focus {
    box-shadow: none;
    border-radius: 8px;
  }
}

.popup-body {
  display: flex;
  flex-direction: column;
  align-content: center;
  justify-content: center;
}

.form-control {
  width: 341px;
  height: 52px;
  margin: -25px auto;
  padding-top: 30px;
}

.popup-button {
  width: 341px;
  height: 40px;
  margin: 0 auto 10px;
}

.popup-body__input-container {
  height: 52px;
  margin: 24px auto 16px auto;
}

.tretiatry {
  margin-left: 12px;
}
</style>