bfg-common 1.4.451 → 1.4.453

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (23) hide show
  1. package/assets/localization/local_be.json +1 -4
  2. package/assets/localization/local_en.json +1 -4
  3. package/assets/localization/local_hy.json +1 -4
  4. package/assets/localization/local_kk.json +1 -4
  5. package/assets/localization/local_ru.json +1 -4
  6. package/assets/localization/local_zh.json +1 -4
  7. package/components/common/layout/theHeader/feedback/Feedback.vue +1 -1
  8. package/components/common/layout/theHeader/feedback/lib/config/sendFeedback.ts +0 -8
  9. package/components/common/layout/theHeader/feedback/new/New.vue +90 -141
  10. package/components/common/layout/theHeader/feedback/new/additionalDetails/AdditionalDetails.vue +12 -494
  11. package/components/common/layout/theHeader/feedback/new/additionalDetails/Headline.vue +7 -10
  12. package/components/common/layout/theHeader/feedback/new/description/Description.vue +2 -2
  13. package/components/common/layout/theHeader/feedback/new/email/Email.vue +2 -2
  14. package/components/common/layout/theHeader/feedback/new/subtitle/Subtitle.vue +3 -6
  15. package/components/common/layout/theHeader/feedback/new/tabs/Tabs.vue +8 -24
  16. package/components/common/layout/theHeader/feedback/new/tabs/lib/config/tabs.ts +2 -2
  17. package/components/common/layout/theHeader/feedback/new/tabs/lib/models/interfaces.ts +17 -0
  18. package/components/common/pages/home/resource/Resource.vue +29 -0
  19. package/components/common/pages/home/resource/ResourceNew.vue +10 -0
  20. package/components/common/{home/ResourceBlock.vue → pages/home/resource/ResourceOld.vue} +4 -2
  21. package/package.json +1 -1
  22. package/components/common/layout/theHeader/feedback/new/lib/models/interfaces.ts +0 -4
  23. package/components/common/layout/theHeader/feedback/new/tabs/lib/models/enums.ts +0 -6
@@ -2832,9 +2832,6 @@
2832
2832
  },
2833
2833
  "feedback": {
2834
2834
  "additionalDetailsHelp": "Даведка па дадатковых звестках",
2835
- "additionalDetailsTooltip": "Каб атрымаць дадатковую інфармацыю, вы можаце альбо зрабіць скрыншот экрана, альбо загрузіць выяву ў фармаце .png або .jpeg.",
2836
- "annotate": "Анатаваць",
2837
- "annotateScreenshot": "Анатаваць скрыншот",
2838
- "annotateImage": "Анатаваць малюнак"
2835
+ "additionalDetailsTooltip": "Каб атрымаць дадатковую інфармацыю, вы можаце альбо зрабіць скрыншот экрана, альбо загрузіць выяву ў фармаце .png або .jpeg."
2839
2836
  }
2840
2837
  }
@@ -2836,9 +2836,6 @@
2836
2836
  },
2837
2837
  "feedback": {
2838
2838
  "additionalDetailsHelp": "Additional Details Help",
2839
- "additionalDetailsTooltip": "For additional details, you can either take a screenshot of your screen or upload an image in .png or .jpeg format.",
2840
- "annotate": "Annotate",
2841
- "annotateScreenshot": "Annotate Screenshot",
2842
- "annotateImage": "Annotate Image"
2839
+ "additionalDetailsTooltip": "For additional details, you can either take a screenshot of your screen or upload an image in .png or .jpeg format."
2843
2840
  }
2844
2841
  }
@@ -2836,9 +2836,6 @@
2836
2836
  },
2837
2837
  "feedback": {
2838
2838
  "additionalDetailsHelp": "Լրացուցիչ մանրամասներ Օգնություն",
2839
- "additionalDetailsTooltip": "Լրացուցիչ մանրամասների համար կարող եք կամ լուսանկարել ձեր էկրանը կամ վերբեռնել պատկեր .png կամ .jpeg ձևաչափով:",
2840
- "annotate": "Նշում",
2841
- "annotateScreenshot": "Նշել սքրինշոթը",
2842
- "annotateImage": "Նշել պատկերը"
2839
+ "additionalDetailsTooltip": "Լրացուցիչ մանրամասների համար կարող եք կամ լուսանկարել ձեր էկրանը կամ վերբեռնել պատկեր .png կամ .jpeg ձևաչափով:"
2843
2840
  }
2844
2841
  }
@@ -2835,9 +2835,6 @@
2835
2835
  },
2836
2836
  "feedback": {
2837
2837
  "additionalDetailsHelp": "Қосымша мәліметтер анықтамасы",
2838
- "additionalDetailsTooltip": "Қосымша мәліметтер алу үшін экранның скриншотын түсіруге немесе суретті .png немесе .jpeg пішімінде жүктеп салуға болады.",
2839
- "annotate": "Аннотация жазу",
2840
- "annotateScreenshot": "Скриншотқа түсініктеме жазу",
2841
- "annotateImage": "Суретке түсініктеме жазу"
2838
+ "additionalDetailsTooltip": "Қосымша мәліметтер алу үшін экранның скриншотын түсіруге немесе суретті .png немесе .jpeg пішімінде жүктеп салуға болады."
2842
2839
  }
2843
2840
  }
@@ -2837,9 +2837,6 @@
2837
2837
  },
2838
2838
  "feedback": {
2839
2839
  "additionalDetailsHelp": "Дополнительная информация Помощь",
2840
- "additionalDetailsTooltip": "Для получения дополнительной информации вы можете сделать снимок экрана или загрузить изображение в формате .png или .jpeg.",
2841
- "annotate": "Аннотировать",
2842
- "annotateScreenshot": "Аннотировать снимок экрана",
2843
- "annotateImage": "Аннотировать изображение"
2840
+ "additionalDetailsTooltip": "Для получения дополнительной информации вы можете сделать снимок экрана или загрузить изображение в формате .png или .jpeg."
2844
2841
  }
2845
2842
  }
@@ -2834,9 +2834,6 @@
2834
2834
  },
2835
2835
  "feedback": {
2836
2836
  "additionalDetailsHelp": "其他详细信息帮助",
2837
- "additionalDetailsTooltip": "有关更多详细信息,您可以截取屏幕截图或上传 .png 或 .jpeg 格式的图像。",
2838
- "annotate": "注释",
2839
- "annotateScreenshot": "注释屏幕截图",
2840
- "annotateImage": "注释图像"
2837
+ "additionalDetailsTooltip": "有关更多详细信息,您可以截取屏幕截图或上传 .png 或 .jpeg 格式的图像。"
2841
2838
  }
2842
2839
  }
@@ -96,7 +96,7 @@ const onHide = (): void => {
96
96
  const onSubmit = async (data: UI_I_FeedbackForm): Promise<void> => {
97
97
  onHide()
98
98
 
99
- const sendForm: UI_I_FeedbackForm = isNewView.value ? feedbackForm.value : data
99
+ const sendForm: UI_I_FeedbackForm = isNewView ? feedbackForm.value : data
100
100
  const isValid = await handleRequest(sendForm)
101
101
 
102
102
  if (isValid) showNotification(msgSuccess.value)
@@ -1,5 +1,4 @@
1
1
  import type { UI_I_FeedbackForm } from '~/components/common/feedback/lib/models/interfaces'
2
- // import type { UI_I_FeedbackCanvasOptions } from '~/components/common/layout/theHeader/feedback/new/lib/models/interfaces'
3
2
  export const feedbackDefaultFormFunc = (): UI_I_FeedbackForm => {
4
3
  return {
5
4
  description: '',
@@ -8,10 +7,3 @@ export const feedbackDefaultFormFunc = (): UI_I_FeedbackForm => {
8
7
  image: '', // base64
9
8
  }
10
9
  }
11
-
12
- // export const feedbackCanvasDefaultOptions = (): UI_I_FeedbackCanvasOptions => {
13
- // return {
14
- // isAnnotateImage: false,
15
- // hasTakeScreenshot: false,
16
- // }
17
- // }
@@ -1,86 +1,78 @@
1
1
  <template>
2
2
  <Teleport to="body">
3
- <div id="feedback-dialog">
4
- <ui-modal
5
- show
6
- :width="!options.isAnnotateImage ? '560px' : '880px'"
7
- test-id="feedback-modal"
8
- :title="title"
9
- class="feedback"
10
- @hide="onHideModal"
11
- >
12
- <template #content>
13
- <ui-modal-block-standard>
14
- <template v-if="!options.isAnnotateImage">
15
- <common-layout-the-header-feedback-new-subtitle />
16
-
17
- <common-layout-the-header-feedback-new-tabs
18
- v-model="selectedTab"
19
- class="metrics-tabs"
20
- />
21
-
22
- <div
23
- v-if="selectedTab === 'light-bulb'"
24
- class="feedback__visit-portal"
25
- >
26
- {{ localization.common.useOurExternalIdeasPortal }}
27
- </div>
28
- </template>
29
-
30
- <template v-if="selectedTab !== 'light-bulb'">
31
- <template v-if="!options.isAnnotateImage">
32
- <common-layout-the-header-feedback-new-description
33
- v-model="feedbackForm.description"
34
- v-model:is-valid="isValidForm"
35
- :selected-tab="selectedTab"
36
- />
37
-
38
- <common-layout-the-header-feedback-new-email
39
- v-model="feedbackForm.email"
40
- />
41
- </template>
42
-
43
- <common-layout-the-header-feedback-new-additional-details
44
- v-model="options"
45
- />
46
- </template>
47
- </ui-modal-block-standard>
48
- </template>
49
-
50
- <template #footerLeftContent><span /></template>
51
-
52
- <template #footerContent>
53
- <div class="flex gap-4">
54
- <ui-button
55
- v-if="selectedTab !== 'light-bulb'"
56
- test-id="feedback-modal-hide-btn"
57
- size="md"
58
- variant="outline"
59
- min-width="96px"
60
- @click="onHideModal"
61
- >
62
- {{ localization.common.cancel }}
63
- </ui-button>
64
- <ui-button
65
- test-id="feedback-modal-submit-btn"
66
- size="md"
67
- :disabled="isDisabledButton"
68
- min-width="96px"
69
- @click="onSubmit"
70
- >
71
- <ui-icon
72
- v-if="selectedTab === 'light-bulb'"
73
- name="new-tab"
74
- width="20"
75
- height="20"
76
- class="feedback__btn-icon"
77
- />
78
- {{ modalFooterButtonNames }}
79
- </ui-button>
3
+ <ui-modal
4
+ show
5
+ width="560px"
6
+ test-id="feedback-modal"
7
+ :title="localization.common.sendFeedback"
8
+ class="feedback"
9
+ @hide="onHideModal"
10
+ >
11
+ <template #content>
12
+ <ui-modal-block-standard>
13
+ <common-layout-the-header-feedback-new-subtitle />
14
+
15
+ <common-layout-the-header-feedback-new-tabs
16
+ v-model="selectedTab"
17
+ class="metrics-tabs"
18
+ />
19
+
20
+ <div
21
+ v-if="selectedTab === 'light-bulb'"
22
+ class="feedback__visit-portal"
23
+ >
24
+ {{ localization.common.useOurExternalIdeasPortal }}
80
25
  </div>
81
- </template>
82
- </ui-modal>
83
- </div>
26
+
27
+ <template v-else>
28
+ <common-layout-the-header-feedback-new-description
29
+ v-model="feedbackForm.description"
30
+ v-model:is-valid="isValidForm"
31
+ :selected-tab="selectedTab"
32
+ />
33
+
34
+ <common-layout-the-header-feedback-new-email
35
+ v-model="feedbackForm.email"
36
+ />
37
+
38
+ <common-layout-the-header-feedback-new-additional-details />
39
+ </template>
40
+ </ui-modal-block-standard>
41
+ </template>
42
+
43
+ <template #footerLeftContent><span /></template>
44
+
45
+ <template #footerContent>
46
+ <div class="flex gap-4">
47
+ <ui-button
48
+ v-if="selectedTab !== 'light-bulb'"
49
+ test-id="feedback-modal-hide-btn"
50
+ size="md"
51
+ variant="outline"
52
+ min-width="96px"
53
+ @click="onHideModal"
54
+ >
55
+ {{ localization.common.cancel }}
56
+ </ui-button>
57
+ <ui-button
58
+ test-id="feedback-modal-submit-btn"
59
+ size="md"
60
+ :disabled="!selectedTab"
61
+ min-width="96px"
62
+ @click="onSubmit"
63
+ >
64
+ <ui-icon
65
+ v-if="selectedTab === 'light-bulb'"
66
+ name="new-tab"
67
+ width="20"
68
+ height="20"
69
+ class="feedback__btn-icon"
70
+ />
71
+ {{ modalFooterButtonNames }}
72
+ </ui-button>
73
+ </div>
74
+ </template>
75
+ </ui-modal>
84
76
  </Teleport>
85
77
  </template>
86
78
 
@@ -88,8 +80,6 @@
88
80
  import type { UI_I_Localization } from '~/lib/models/interfaces'
89
81
  import type { UI_I_FeedbackForm } from '~/components/common/feedback/lib/models/interfaces'
90
82
  import type { UI_T_FeedbackTab } from '~/components/common/layout/theHeader/feedback/new/tabs/lib/models/types'
91
- import type { UI_I_FeedbackCanvasOptions } from '~/components/common/layout/theHeader/feedback/new/lib/models/interfaces'
92
- import { UI_E_FeedbackType } from '~/components/common/layout/theHeader/feedback/new/tabs/lib/models/enums'
93
83
 
94
84
  const feedbackForm = defineModel<UI_I_FeedbackForm>({ required: true })
95
85
  const emits = defineEmits<{
@@ -99,47 +89,19 @@ const emits = defineEmits<{
99
89
 
100
90
  const localization = computed<UI_I_Localization>(() => useLocal())
101
91
 
102
- const selectedTab = ref<UI_T_FeedbackTab>()
103
92
  const isValidForm = ref<boolean>(true)
104
- const options = ref<UI_I_FeedbackCanvasOptions>({
105
- isAnnotateImage: false,
106
- hasTakeScreenshot: false,
107
- })
108
-
109
- const title = computed<string>(() => {
110
- const { common, feedback } = localization.value
111
-
112
- return !options.value.isAnnotateImage
113
- ? common.sendFeedback
114
- : options.value.hasTakeScreenshot
115
- ? feedback.annotateScreenshot
116
- : feedback.annotateImage
117
- })
118
- const modalFooterButtonNames = computed<string>(() => {
119
- const { visitIdeasPortal, send, save } = localization.value.common
120
-
121
- return options.value.isAnnotateImage
122
- ? save
123
- : selectedTab.value === 'light-bulb'
124
- ? visitIdeasPortal
125
- : send
126
- })
93
+ const selectedTab = ref<UI_T_FeedbackTab>()
127
94
 
128
- const isDisabledButton = computed<boolean>(() => {
129
- return !options.value.isAnnotateImage && !selectedTab.value
95
+ const modalFooterButtonNames = computed(() => {
96
+ return selectedTab.value === 'light-bulb'
97
+ ? localization.value.common.visitIdeasPortal
98
+ : localization.value.common.send
130
99
  })
131
100
 
132
101
  const onHideModal = (): void => {
133
- !options.value.isAnnotateImage
134
- ? emits('hide')
135
- : (options.value.isAnnotateImage = false)
102
+ emits('hide')
136
103
  }
137
104
  const onSubmit = (): void => {
138
- if (options.value.isAnnotateImage) {
139
- options.value.isAnnotateImage = false
140
- return
141
- }
142
-
143
105
  if (selectedTab.value === 'light-bulb') {
144
106
  const targetUrl = 'https://customer.aobfg.ru/' // Ваш URL
145
107
  window.open(targetUrl, '_blank')
@@ -149,25 +111,24 @@ const onSubmit = (): void => {
149
111
  isValidForm.value = !!feedbackForm.value.description
150
112
 
151
113
  if (!isValidForm.value) return
152
- const canvasData = (
153
- document.getElementById('feedbackImg') as HTMLCanvasElement
154
- ).toDataURL()
155
- const canvasBlankData = (
156
- document.getElementById('feedbackImgBlank') as HTMLCanvasElement
157
- ).toDataURL()
158
-
159
- const image = canvasData.match(/base64,(.+)/)?.[1] || ''
160
- feedbackForm.value.image = canvasData === canvasBlankData ? '' : image
161
- feedbackForm.value.type = UI_E_FeedbackType[selectedTab.value]
162
-
163
114
  emits('submit')
164
115
  }
165
116
  </script>
166
117
 
167
- <style lang="scss" scoped>
118
+ <style lang="scss">
119
+ :root {
120
+ --description-color: #414b57;
121
+ --link-visited-color: #5659b8;
122
+ }
123
+
124
+ :root.dark-theme {
125
+ --description-color: #adbbc4;
126
+ --link-visited-color: #49afd9;
127
+ }
128
+
168
129
  .feedback {
169
130
  &__visit-portal {
170
- color: var(--feedback-text-color);
131
+ color: #4d5d69;
171
132
  font-size: 13px;
172
133
  font-weight: 400;
173
134
  line-height: 15.73px;
@@ -178,15 +139,3 @@ const onSubmit = (): void => {
178
139
  }
179
140
  }
180
141
  </style>
181
- <style lang="scss">
182
- :root {
183
- --feedback-text-color: #4d5d69;
184
- --feedback-tooltip-close-color: #213444;
185
- --feedback-tab-active-bg-color: #008fd60f;
186
- }
187
- :root.dark-theme {
188
- --feedback-text-color: #e9eaec;
189
- --feedback-tooltip-close-color: #e9eaec;
190
- --feedback-tab-active-bg-color: #2ba2de14;
191
- }
192
- </style>
@@ -1,29 +1,14 @@
1
1
  <template>
2
2
  <div class="additional-details">
3
- <template v-if="!optionsModel.isAnnotateImage">
4
- <common-layout-the-header-feedback-new-additional-details-headline />
3
+ <common-layout-the-header-feedback-new-additional-details-headline />
5
4
 
6
- <ui-alert
7
- v-if="optionsModel.hasTakeScreenshot"
8
- test-id="additional-details-info-alert"
9
- :messages="[localization.common.screenshotQualityMayVary]"
10
- type="info"
11
- class="additional-details__alert"
12
- ></ui-alert>
13
- </template>
14
-
15
- <div
16
- v-if="!optionsModel.hasTakeScreenshot"
17
- class="flex gap-4 button-container"
18
- >
5
+ <div class="flex gap-4 button-container">
19
6
  <ui-button
20
7
  test-id="feedback-take-screenshot-btn"
21
8
  size="md"
22
- type="default"
23
- variant="outline"
9
+ type="grey"
24
10
  min-width="96px"
25
11
  class="take-screenshot"
26
- @click="onTakeScreenshot"
27
12
  >
28
13
  <ui-icon
29
14
  name="take-screenshot"
@@ -37,8 +22,7 @@
37
22
  <ui-button
38
23
  test-id="feedback-upload-file-btn"
39
24
  size="md"
40
- type="default"
41
- variant="outline"
25
+ type="grey"
42
26
  min-width="96px"
43
27
  class="upload-image"
44
28
  >
@@ -57,410 +41,30 @@
57
41
  type="file"
58
42
  accept=".png, .jpeg"
59
43
  data-id="feedback-file-load-input"
60
- @change="onUploadFile"
61
44
  />
62
45
  </ui-button>
63
46
  </div>
64
-
65
- <div v-if="optionsModel.isAnnotateImage" class="drawer-btn-container">
66
- <div>
67
- <ui-button
68
- test-id="feedback-use-red-marker-button"
69
- size="sm"
70
- type="default"
71
- variant="outline"
72
- class="btn marker"
73
- :class="drawerMarker === 'marker' && 'active'"
74
- @click="onUseRedMarker"
75
- >
76
- <ui-icon
77
- name="marker"
78
- width="16"
79
- height="16"
80
- class="feedback__btn-icon"
81
- />
82
- {{ localization.common.useRedMarker }}
83
- </ui-button>
84
-
85
- <ui-button
86
- test-id="feedback-use-grey-marker-button"
87
- size="sm"
88
- type="default"
89
- variant="outline"
90
- class="btn eraser"
91
- :class="drawerMarker === 'eraser' && 'active'"
92
- @click="onUseGrayEraser"
93
- >
94
- <ui-icon
95
- name="grey-eraser"
96
- width="16"
97
- height="16"
98
- class="feedback__btn-icon"
99
- />
100
- {{ localization.common.useGrayEraser }}
101
- </ui-button>
102
- <div class="separator-line"></div>
103
- <ui-button
104
- test-id="feedback-undo-button"
105
- size="sm"
106
- type="default"
107
- variant="outline"
108
- class="btn undo"
109
- :disabled="isDisabledButton"
110
- @click="onUndoLast"
111
- >
112
- <ui-icon
113
- name="reset"
114
- width="16"
115
- height="16"
116
- class="feedback__btn-icon"
117
- />
118
- {{ localization.common.undo }}
119
- </ui-button>
120
- </div>
121
-
122
- <ui-button
123
- test-id="feedback-clear-all-button"
124
- size="sm"
125
- type="default"
126
- variant="outline"
127
- class="btn clear-all"
128
- :disabled="isDisabledButton"
129
- @click="clearAll"
130
- >
131
- <ui-icon
132
- name="delete"
133
- width="16"
134
- height="16"
135
- class="feedback__btn-icon"
136
- />
137
- {{ localization.common.clearAll }}
138
- </ui-button>
139
- </div>
140
-
141
- <div
142
- id="feedbackImgWrap"
143
- ref="feedbackImgWrap"
144
- class="preview-container"
145
- :class="{
146
- disabled: !optionsModel.hasTakeScreenshot,
147
- annotate: optionsModel.isAnnotateImage,
148
- }"
149
- >
150
- <div class="preview-container__backdrop">
151
- <div>
152
- <ui-button
153
- test-id="feedback-image-annotate-btn"
154
- size="md"
155
- type="default"
156
- variant="outline"
157
- class=""
158
- @click="onAnnotateImage"
159
- >
160
- <ui-icon
161
- name="annotate-icon"
162
- width="16"
163
- height="16"
164
- class="feedback__btn-icon"
165
- />
166
- {{ localization.feedback.annotate }}
167
- </ui-button>
168
-
169
- <ui-button
170
- test-id="feedback-image-remove-btn"
171
- size="md"
172
- type="default"
173
- variant="outline"
174
- class=""
175
- @click="onRemoveScreenshot"
176
- >
177
- <ui-icon
178
- name="delete"
179
- width="16"
180
- height="16"
181
- class="feedback__btn-icon"
182
- />
183
- {{ localization.common.remove }}
184
- </ui-button>
185
- </div>
186
- </div>
187
- <canvas
188
- id="feedbackImg"
189
- ref="feedbackImg"
190
- class="preview-container__image"
191
- ></canvas>
192
- <canvas id="feedbackImgBlank" style="display: none"></canvas>
193
- </div>
194
47
  </div>
195
48
  </template>
196
49
 
197
50
  <script lang="ts" setup>
198
- import html2canvas from 'html2canvas'
199
51
  import type { UI_I_Localization } from '~/lib/models/interfaces'
200
- import type { UI_I_FeedbackCanvasOptions } from '~/components/common/layout/theHeader/feedback/new/lib/models/interfaces'
201
-
202
- const optionsModel = defineModel<UI_I_FeedbackCanvasOptions>({ required: true })
203
52
 
204
53
  const localization = computed<UI_I_Localization>(() => useLocal())
205
-
206
- const drawerMarker = ref<'marker' | 'eraser' | null>(null)
207
- const isFileLoad = ref(null)
208
- const feedbackImgWrap = ref()
209
- const feedbackImg = ref()
210
- const memoryParentModalDialog = ref<string>('')
211
- const memoryParentMain = ref<string>('')
212
-
213
- let drawingArray: any = []
214
- const indexArray = ref<number>(0) // index of feedbackImg itself
215
- let isDrawing = false
216
- let startDrawingX: number | null = null
217
- let startDrawingY: number | null = null
218
- let drawColor = ''
219
- let drawWidth = ''
220
-
221
- const isDisabledButton = computed<boolean>(() => indexArray.value === 0)
222
-
223
- const onTakeScreenshot = (): void => {
224
- optionsModel.value.hasTakeScreenshot = true
225
-
226
- const feedbackDialog = document.getElementById('feedback-dialog')
227
- if (!feedbackDialog) return
228
-
229
- const display = feedbackDialog.style.display
230
- feedbackDialog.style.display = 'none'
231
- html2canvas(document.body).then(function (thisCanvas) {
232
- feedbackDialog.style.display = display
233
-
234
- const context = feedbackImg.value.getContext('2d')
235
- feedbackImg.value.width = thisCanvas.width
236
- feedbackImg.value.height = thisCanvas.height
237
-
238
- feedbackImg.value.style.width = '500px'
239
- feedbackImg.value.style.height =
240
- thisCanvas.height / (thisCanvas.width / 500) + 'px'
241
-
242
- context.drawImage(
243
- thisCanvas,
244
- 0,
245
- 0,
246
- feedbackImg.value.width,
247
- feedbackImg.value.height
248
- )
249
- drawingArray.length = 0
250
- indexArray.value = 0
251
- drawingArray.push(
252
- context.getImageData(
253
- 0,
254
- 0,
255
- feedbackImg.value.width,
256
- feedbackImg.value.height
257
- )
258
- )
259
- })
260
- }
261
- const onUploadFile = (): void => {
262
- optionsModel.value.hasTakeScreenshot = true
263
- if (!isFileLoad.value) return
264
-
265
- const isFileRead = new FileReader()
266
- if (!isFileRead) return
267
-
268
- isFileRead.readAsDataURL(isFileLoad.value.files[0])
269
- isFileRead.onload = (): void => {
270
- const img = new Image()
271
- if (!feedbackImg.value) return
272
-
273
- const context = feedbackImg.value.getContext('2d')
274
- img.onload = (): void => {
275
- feedbackImg.value.width = img.width
276
- feedbackImg.value.height = img.height
277
-
278
- updateFeedbackImageDimensions()
279
-
280
- context.drawImage(img, 0, 0, img.width, img.height)
281
- drawingArray.length = 0
282
- indexArray.value = 0
283
- drawingArray.push(
284
- context.getImageData(
285
- 0,
286
- 0,
287
- feedbackImg.value.width,
288
- feedbackImg.value.height
289
- )
290
- )
291
- }
292
- img.src = isFileRead.result
293
- }
294
- }
295
-
296
- const start = (event: MouseEvent): void => {
297
- if (!drawColor) return
298
- const context = feedbackImg.value.getContext('2d')
299
- const canvasCoordinates = feedbackImg.value.getBoundingClientRect()
300
- startDrawingX = event.pageX - canvasCoordinates.left
301
- startDrawingY = event.pageY - canvasCoordinates.top
302
- isDrawing = true
303
- context.beginPath()
304
- context.moveTo(
305
- event.pageX - canvasCoordinates.left,
306
- event.pageY - canvasCoordinates.top
307
- )
308
- event.preventDefault()
309
- }
310
- const draw = (event: MouseEvent): void => {
311
- if (!drawColor) return
312
- const context = feedbackImg.value.getContext('2d')
313
- const canvasCoordinates = feedbackImg.value.getBoundingClientRect()
314
- if (!isDrawing) return
315
- context.lineTo(
316
- event.pageX - canvasCoordinates.left,
317
- event.pageY - canvasCoordinates.top
318
- )
319
- context.strokeStyle = drawColor
320
- context.lineWidth = drawWidth
321
- context.lineCap = 'round'
322
- context.lineJoin = 'round'
323
- context.stroke()
324
- event.preventDefault()
325
- }
326
-
327
- const stop = (event: MouseEvent): void => {
328
- if (!drawColor) return
329
-
330
- const context = feedbackImg.value.getContext('2d')
331
- const canvasCoordinates = feedbackImg.value.getBoundingClientRect()
332
- if (!isDrawing) return
333
-
334
- context.stroke()
335
- context.closePath()
336
- isDrawing = false
337
- event.preventDefault()
338
- if (
339
- startDrawingX !== event.pageX - canvasCoordinates.left &&
340
- startDrawingY !== event.pageY - canvasCoordinates.top
341
- ) {
342
- drawingArray.push(
343
- context.getImageData(
344
- 0,
345
- 0,
346
- feedbackImg.value.width,
347
- feedbackImg.value.height
348
- )
349
- )
350
- indexArray.value += 1
351
- }
352
- }
353
- const onRemoveScreenshot = (): void => {
354
- optionsModel.value.hasTakeScreenshot = false
355
- const parentMain = document.getElementById('feedback-dialog')
356
- const parentModalDialog = document.getElementById('feedback-modal-dialog-Id')
357
- if (!parentMain || !parentModalDialog) return
358
-
359
- parentMain.style.width = memoryParentMain.value
360
- parentModalDialog.style.width = memoryParentModalDialog.value
361
- const context = feedbackImg.value.getContext('2d')
362
- context.fillStyle = 'green'
363
- context.fillRect(0, 0, feedbackImg.value.width, feedbackImg.value.height)
364
- feedbackImg.value.width = 0
365
- feedbackImg.value.height = 0
366
- feedbackImgWrap.value.style.width = 0 + 'px'
367
- feedbackImgWrap.value.style.height = 0 + 'px'
368
- // const value = {
369
- // width: memoryParentModalDialog.value,
370
- // }
371
- // emits('screen-shot', value)
372
- clearAll()
373
- }
374
- const onUseRedMarker = (): void => {
375
- drawerMarker.value = 'marker'
376
- drawColor = '#f76945'
377
- drawWidth = '5'
378
- }
379
- const onUseGrayEraser = (): void => {
380
- drawerMarker.value = 'eraser'
381
- drawColor = 'lightgray'
382
- drawWidth = '14'
383
- }
384
-
385
- const onUndoLast = (): void => {
386
- drawColor = ''
387
- drawWidth = ''
388
- drawerMarker.value = null
389
- const context = feedbackImg.value.getContext('2d')
390
- if (indexArray.value > 0) {
391
- indexArray.value -= 1
392
- drawingArray.pop()
393
- context.putImageData(drawingArray[indexArray.value], 0, 0)
394
- }
395
- }
396
- const clearAll = (): void => {
397
- const context = feedbackImg.value.getContext('2d')
398
- drawColor = ''
399
- drawWidth = ''
400
- drawerMarker.value = null
401
- if (indexArray.value <= 0) return
402
- while (indexArray.value > 0) {
403
- drawingArray.pop()
404
- indexArray.value -= 1
405
- context.putImageData(drawingArray[indexArray.value], 0, 0)
406
- }
407
- }
408
-
409
- onMounted(() => {
410
- feedbackImg.value.addEventListener('touchstart', start, false)
411
- feedbackImg.value.addEventListener('touchmove', draw, false)
412
- feedbackImg.value.addEventListener('mousedown', start, false)
413
- feedbackImg.value.addEventListener('mousemove', draw, false)
414
- feedbackImg.value.addEventListener('touchend', stop, false)
415
- feedbackImg.value.addEventListener('mouseup', stop, false)
416
- feedbackImg.value.addEventListener('mouseout', stop, false)
417
- })
418
-
419
- onBeforeUnmount(() => {
420
- onRemoveScreenshot()
421
- feedbackImg.value.removeEventListener('touchstart', start, false)
422
- feedbackImg.value.removeEventListener('touchmove', draw, false)
423
- feedbackImg.value.removeEventListener('mousedown', start, false)
424
- feedbackImg.value.removeEventListener('mousemove', draw, false)
425
- feedbackImg.value.removeEventListener('touchend', stop, false)
426
- feedbackImg.value.removeEventListener('mouseup', stop, false)
427
- feedbackImg.value.removeEventListener('mouseout', stop, false)
428
- })
429
- const onAnnotateImage = (): void => {
430
- feedbackImg.value.style.width = feedbackImg.value.width + 'px'
431
- feedbackImg.value.style.height = feedbackImg.value.height + 'px'
432
-
433
- optionsModel.value.isAnnotateImage = true
434
- }
435
-
436
- const updateFeedbackImageDimensions = (): void => {
437
- if (feedbackImg.value) {
438
- feedbackImg.value.style.width = '500px'
439
- feedbackImg.value.style.height =
440
- feedbackImg.value.height / (feedbackImg.value.width / 500) + 'px'
441
- }
442
- }
443
- const resetDrawingState = (): void => {
444
- drawingArray = [drawingArray.at(-1)]
445
- indexArray.value = 0
446
- }
447
-
448
- watch(
449
- optionsModel,
450
- (newValue: UI_I_FeedbackCanvasOptions) => {
451
- if (!newValue.isAnnotateImage) {
452
- updateFeedbackImageDimensions()
453
- resetDrawingState()
454
- }
455
- },
456
- { deep: true, immediate: true }
457
- )
458
54
  </script>
459
55
 
460
56
  <style lang="scss" scoped>
461
57
  @import 'assets/scss/common/mixins.scss';
462
58
  .additional-details {
463
59
  .button-container {
60
+ margin-top: 16px;
61
+ .upload-image,
62
+ .take-screenshot {
63
+ color: #4d5d69;
64
+ gap: 8px;
65
+ border: 1px solid #e9ebed;
66
+ }
67
+
464
68
  .upload-image {
465
69
  label {
466
70
  @include flex($align: center, $just: center);
@@ -476,91 +80,5 @@ watch(
476
80
  }
477
81
  }
478
82
  }
479
- .drawer-btn-container {
480
- @include flex($align: center, $just: space-between);
481
- margin-bottom: 12px;
482
- & > div {
483
- @include flex($align: center, $just: space-between);
484
- gap: 15px;
485
-
486
- .separator-line {
487
- width: 1px;
488
- height: 24px;
489
- background: #e9ebed;
490
- margin: 0;
491
- }
492
- }
493
-
494
- .ui-btn {
495
- width: initial;
496
-
497
- &.clear-all {
498
- color: #ea3223;
499
- }
500
-
501
- &.active {
502
- background: var(--feedback-tab-active-bg-color);
503
- color: var(--feedback-tab-active-text-color);
504
- border: 1.4px solid var(--feedback-tab-active-text-color);
505
- }
506
- }
507
- }
508
-
509
- &__alert {
510
- margin-bottom: 16px;
511
- }
512
- }
513
- .preview-container {
514
- width: 500px;
515
- height: 280px;
516
- position: relative;
517
- &.annotate {
518
- width: 100%;
519
- height: 460px;
520
- overflow: auto;
521
- }
522
- &.disabled {
523
- display: none;
524
- }
525
-
526
- &__backdrop {
527
- display: none;
528
- position: absolute;
529
- top: 0;
530
- left: 0;
531
- width: 100%;
532
- height: 100%;
533
- background: rgba(27, 42, 55, 0.32);
534
- backdrop-filter: blur(1.5px);
535
- border-radius: 8px;
536
- transition: opacity 0.3s ease;
537
- opacity: 0;
538
-
539
- & > div {
540
- @include flex($align: center);
541
- gap: 12px;
542
- .ui-btn {
543
- width: initial;
544
-
545
- &:last-child {
546
- color: #ea3223;
547
- }
548
- }
549
- }
550
- }
551
-
552
- &__image {
553
- width: inherit;
554
- height: inherit;
555
- border-radius: 8px;
556
- .disabled & {
557
- display: none;
558
- }
559
- }
560
-
561
- &:hover:not(&.annotate) &__backdrop {
562
- @include flex($align: center, $just: center);
563
- opacity: 1;
564
- }
565
83
  }
566
84
  </style>
@@ -18,7 +18,7 @@
18
18
  :elem-id="'feedback-additional-details-info-icon'"
19
19
  >
20
20
  <div class="common-widget-info">
21
- <div class="justify-between flex-align-center">
21
+ <div class="headline justify-between flex-align-center">
22
22
  <div class="flex-align-center">
23
23
  <ui-icon-icon3 name="info-2" width="16px" height="16px" />
24
24
  <span class="title">
@@ -54,34 +54,31 @@ const isShowInfo = ref<boolean>(false)
54
54
  @import 'assets/scss/common/mixins.scss';
55
55
  .headline {
56
56
  @include flex($align: center);
57
- margin: 32px 0 16px;
57
+ margin-top: 16px;
58
58
  &__label {
59
- line-height: 19.36px;
59
+ line-height: 38px;
60
60
  font-size: 16px;
61
61
  font-weight: 500;
62
- color: var(--feedback-text-color);
62
+ color: #4d5d69;
63
63
  margin-right: 8px;
64
64
  }
65
65
  .common-widget-info {
66
66
  padding: 16px;
67
+
67
68
  .title {
68
69
  font-size: 14px;
69
70
  font-weight: 500;
70
71
  line-height: 16.94px;
71
- color: var(--feedback-text-color);
72
+ color: var(--zabbix-text-color);
72
73
  margin-left: 8px;
73
74
  }
74
75
 
75
76
  .common-widget-info-description {
76
77
  font-size: 13px;
77
78
  line-height: 15.73px;
78
- color: var(--feedback-text-color);
79
+ color: var(--zabbix-text-color);
79
80
  margin-top: 12px;
80
81
  }
81
-
82
- svg {
83
- color: var(--feedback-tooltip-close-color);
84
- }
85
82
  }
86
83
  }
87
84
  </style>
@@ -44,11 +44,11 @@ const descriptionErrorText = computed<boolean>(() => {
44
44
  .description {
45
45
  margin-top: 32px;
46
46
  &__title {
47
- line-height: 19.36px;
47
+ line-height: 38px;
48
48
  margin-bottom: 16px;
49
49
  font-size: 16px;
50
50
  font-weight: 500;
51
- color: var(--feedback-text-color);
51
+ color: #4d5d69;
52
52
  }
53
53
  :deep(.ui-main-textarea) {
54
54
  resize: none;
@@ -33,11 +33,11 @@ const emailErrorText = computed<string>(() => {
33
33
  .email {
34
34
  margin-top: 32px;
35
35
  &__title {
36
- line-height: 19.36px;
36
+ line-height: 38px;
37
37
  margin-bottom: 16px;
38
38
  font-size: 16px;
39
39
  font-weight: 500;
40
- color: var(--feedback-text-color);
40
+ color: #4d5d69;
41
41
  }
42
42
  }
43
43
  </style>
@@ -63,24 +63,21 @@ const isShowInfo = ref<boolean>(false)
63
63
  }
64
64
  .common-widget-info {
65
65
  padding: 16px;
66
+
66
67
  .title {
67
68
  font-size: 14px;
68
69
  font-weight: 500;
69
70
  line-height: 16.94px;
70
- color: var(--feedback-text-color);
71
+ color: var(--zabbix-text-color);
71
72
  margin-left: 8px;
72
73
  }
73
74
 
74
75
  .common-widget-info-description {
75
76
  font-size: 13px;
76
77
  line-height: 15.73px;
77
- color: var(--feedback-text-color);
78
+ color: var(--zabbix-text-color);
78
79
  margin-top: 12px;
79
80
  }
80
-
81
- svg {
82
- color: var(--feedback-tooltip-close-color);
83
- }
84
81
  }
85
82
  }
86
83
  </style>
@@ -20,12 +20,13 @@
20
20
 
21
21
  <script setup lang="ts">
22
22
  import type { UI_I_Localization } from '~/lib/models/interfaces'
23
- import type { UI_T_FeedbackTab } from '~/components/common/layout/theHeader/feedback/new/tabs/lib/models/types'
23
+ import type { T_FeedbackTab } from '~/components/common/layout/theHeader/feedback/new/tabs/lib/models/types'
24
+ // import type { I_Metric } from '~/components/layout/new/tabs/lib/models/interfaces'
24
25
  import { tabsFunc } from '~/components/common/layout/theHeader/feedback/new/tabs/lib/config/tabs'
25
26
 
26
27
  const localization = computed<UI_I_Localization>(() => useLocal())
27
28
 
28
- const selectedTab = defineModel<UI_T_FeedbackTab>({ required: true })
29
+ const selectedTab = defineModel<T_FeedbackTab>({ required: true })
29
30
  const tabs = computed<any[]>(() =>
30
31
  tabsFunc(localization.value, selectedTab.value)
31
32
  )
@@ -39,7 +40,7 @@ const tabs = computed<any[]>(() =>
39
40
  margin-bottom: 16px;
40
41
  font-size: 16px;
41
42
  font-weight: 500;
42
- color: var(--feedback-text-color);
43
+ color: #4d5d69;
43
44
  }
44
45
  &__container {
45
46
  display: flex;
@@ -49,21 +50,17 @@ const tabs = computed<any[]>(() =>
49
50
  :deep(.block) {
50
51
  width: max-content;
51
52
  padding: 10px 12px;
52
- color: var(--feedback-text-color);
53
- background: var(--feedback-tab-bg-color);
54
- border: 1px solid var(--feedback-tab-border-color);
55
- box-shadow: none;
53
+ color: #4d5d69;
56
54
  cursor: pointer;
57
55
  }
58
-
59
56
  :deep(.block.selected) {
60
- border: 1.5px solid var(--feedback-tab-active-text-color);
61
- color: var(--feedback-tab-active-text-color);
57
+ border: 1.5px solid #008fd6;
58
+ color: #008fd6;
62
59
  cursor: default;
63
60
 
64
61
  .main-info,
65
62
  .main-info-label {
66
- color: var(--feedback-tab-active-text-color);
63
+ color: #008fd6;
67
64
  }
68
65
  }
69
66
 
@@ -80,16 +77,3 @@ const tabs = computed<any[]>(() =>
80
77
  }
81
78
  }
82
79
  </style>
83
- <style lang="scss">
84
- :root {
85
- --feedback-tab-bg-color: #ffffff;
86
- --feedback-tab-border-color: #e9ebed;
87
- --feedback-tab-active-text-color: #008fd6;
88
- }
89
-
90
- :root.dark-theme {
91
- --feedback-tab-bg-color: #1b2a373d;
92
- --feedback-tab-border-color: #e9ebed1f;
93
- --feedback-tab-active-text-color: #2ba2de;
94
- }
95
- </style>
@@ -1,9 +1,9 @@
1
1
  import type { UI_I_Localization } from '~/lib/models/interfaces'
2
- import type { UI_T_FeedbackTab } from '~/components/common/layout/theHeader/feedback/new/tabs/lib/models/types'
2
+ import type { T_FeedbackTab } from '~/components/common/layout/theHeader/feedback/new/tabs/lib/models/types'
3
3
 
4
4
  export const tabsFunc = (
5
5
  localization: UI_I_Localization,
6
- selectedTab: UI_T_FeedbackTab
6
+ selectedTab: T_FeedbackTab
7
7
  ): any[] => {
8
8
  return [
9
9
  {
@@ -0,0 +1,17 @@
1
+ import type {
2
+ T_MetricTab
3
+ } from '~/components/common/pages/integration/zabbix/content/hosts/details/metrics/lib/models/types'
4
+
5
+ export interface I_Metric {
6
+ iconName: T_MetricTab
7
+ label: string
8
+ isSelected: boolean
9
+ on: {
10
+ label: string
11
+ color: '#239332' | '#BDC3C7'
12
+ }
13
+ off: {
14
+ label: string
15
+ color: '#EA3223' | '#BDC3C7'
16
+ }
17
+ }
@@ -0,0 +1,29 @@
1
+ <template>
2
+ <div class="home-resource">
3
+ <common-pages-home-resource-new
4
+ v-if="isNewView"
5
+ ></common-pages-home-resource-new>
6
+
7
+ <common-pages-home-resource-old
8
+ v-else
9
+ :items="props.items"
10
+ ></common-pages-home-resource-old>
11
+ </div>
12
+ </template>
13
+
14
+ <script lang="ts" setup>
15
+ import type {
16
+ UI_I_ResourceMeter,
17
+ UI_I_MeterBlockItem,
18
+ } from '~/components/common/home/lib/models/interfaces'
19
+
20
+ const props = defineProps<{
21
+ items: UI_I_ResourceMeter<UI_I_MeterBlockItem>[]
22
+ }>()
23
+
24
+ const { $store }: any = useNuxtApp()
25
+
26
+ const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
27
+ </script>
28
+
29
+ <style lang="scss" scoped></style>
@@ -0,0 +1,10 @@
1
+ <template>
2
+ <div></div>
3
+ </template>
4
+
5
+ <script lang="ts" setup>
6
+ </script>
7
+
8
+ <style lang="scss" scoped>
9
+
10
+ </style>
@@ -21,8 +21,10 @@
21
21
  :value="item.used.value"
22
22
  />
23
23
  <div class="capacity-entity-used">
24
- {{ item.used.text }} {{ localization.common.used?.toLowerCase() }} |
25
- {{ item.capacity.text }} {{ localization.common.total?.toLowerCase() }}
24
+ {{ item.used.text }}
25
+ {{ localization.common.used?.toLowerCase() }} |
26
+ {{ item.capacity.text }}
27
+ {{ localization.common.total?.toLowerCase() }}
26
28
  </div>
27
29
  </div>
28
30
  </div>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.4.451",
4
+ "version": "1.4.453",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",
@@ -1,4 +0,0 @@
1
- export interface UI_I_FeedbackCanvasOptions {
2
- isAnnotateImage: boolean
3
- hasTakeScreenshot: boolean
4
- }
@@ -1,6 +0,0 @@
1
- export enum UI_E_FeedbackType {
2
- 'warning-outline',
3
- 'heart-outline',
4
- WARNING,
5
- 'light-bulb',
6
- }