bfg-common 1.5.313 → 1.5.315

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.
@@ -226,7 +226,7 @@
226
226
  "clockTolerance": "Допуск по времени",
227
227
  "clone": "Клонировать",
228
228
  "cloneExistingVirtualMachine": "Клонирование существующей виртуальной машины",
229
- "cloneRole": "Копирование Роль",
229
+ "cloneRole": "Клонировать Роль",
230
230
  "cloneTemplate": "Клонировать в шаблон",
231
231
  "cloneTemplateToTemplate": "Клонировать шаблон в шаблон",
232
232
  "cloneVirtualMachine": "Клонировать виртуальную машину",
@@ -3197,7 +3197,7 @@
3197
3197
  },
3198
3198
  "role": {
3199
3199
  "roleManagement": "Управление ролями",
3200
- "selectRoleToViewItsDetails": "Выберите роль, чтобы просмотреть сведения о ней.",
3200
+ "selectRoleToViewItsDetails": "Выберите роль для просмотра сведений.",
3201
3201
  "roleUsage": "Использование ролей",
3202
3202
  "noPrivilegesAdded": "Привилегии не добавлены. Пожалуйста, добавьте их для просмотра.",
3203
3203
  "pleaseMakeSureSelectRoleViewDetails": "Пожалуйста, обязательно выберите роль, чтобы просмотреть ее подробную информацию.",
@@ -1,50 +1,61 @@
1
- <template>
2
- <div :class="['graph-content', ...hiddenButtons]">
3
- <template v-if="props.chartOptions">
4
- <client-only>
5
- <highchart
6
- :options="props.chartOptions"
7
- :modules="['exporting', 'export-data', 'offline-exporting']"
8
- class="graph-block"
9
- />
10
- </client-only>
11
- </template>
12
- </div>
13
- </template>
14
-
15
- <script setup lang="ts">
16
- const props = defineProps<{
17
- chartOptions: any
18
- }>()
19
-
20
- const hiddenButtons = computed<string[]>(() => {
21
- const result = []
22
- const chartOptions = props.chartOptions
23
- if (chartOptions) {
24
- const { openNewWindow } = chartOptions.exporting.menuItemDefinitions || {}
25
-
26
- if (openNewWindow.isHide) result.push('hide-new-window')
27
- }
28
-
29
- return result
30
- })
31
- </script>
32
-
33
- <style scoped lang="scss">
34
- .graph-content {
35
- width: 100%;
36
- //height: inherit;
37
- height: 100%;
38
-
39
- &.hide-new-window {
40
- :deep(.highcharts-menu) {
41
- .highcharts-menu-item:first-child {
42
- display: none;
43
- }
44
- }
45
- }
46
- .graph-block {
47
- height: 100%;
48
- }
49
- }
50
- </style>
1
+ <template>
2
+ <div :class="['graph-content', ...hiddenButtons]">
3
+ <template v-if="props.chartOptions">
4
+ <client-only>
5
+ <highchart
6
+ :options="props.chartOptions"
7
+ :modules="modules"
8
+ class="graph-block"
9
+ />
10
+ </client-only>
11
+ </template>
12
+ </div>
13
+ </template>
14
+
15
+ <script setup lang="ts">
16
+ import Highcharts from 'highcharts'
17
+
18
+ const props = defineProps<{
19
+ chartOptions: any
20
+ }>()
21
+
22
+ const modules = ref<string[]>([])
23
+ const hiddenButtons = computed<string[]>(() => {
24
+ const result = []
25
+ const chartOptions = props.chartOptions
26
+ if (chartOptions) {
27
+ const { openNewWindow } = chartOptions.exporting.menuItemDefinitions || {}
28
+
29
+ if (openNewWindow.isHide) result.push('hide-new-window')
30
+ }
31
+
32
+ return result
33
+ })
34
+
35
+ onMounted(() => {
36
+ modules.value.push('exporting', 'export-data')
37
+
38
+ if (typeof Highcharts.ajax === 'function') {
39
+ modules.value.push('offline-exporting')
40
+ }
41
+ })
42
+ </script>
43
+
44
+ <style scoped lang="scss">
45
+ .graph-content {
46
+ width: 100%;
47
+ //height: inherit;
48
+ height: 100%;
49
+
50
+ &.hide-new-window {
51
+ :deep(.highcharts-menu) {
52
+ .highcharts-menu-item:first-child {
53
+ display: none;
54
+ }
55
+ }
56
+ }
57
+ .graph-block {
58
+ height: 100%;
59
+ }
60
+ }
61
+ </style>
@@ -137,6 +137,7 @@ import type {
137
137
  import type { UI_I_Capabilities } from '~/components/common/vm/actions/common/lib/models/interfaces'
138
138
  import type { UI_I_ScheduleNewTasksForm } from '~/components/common/pages/scheduledTasks/modals/lib/models/interfaces'
139
139
  import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
140
+ import type { UI_I_VmtForm } from '~/components/common/vmt/actions/add/lib/models/interfaces'
140
141
  import {
141
142
  dynamicSteps,
142
143
  stepsSchemeInitial,
@@ -146,7 +147,6 @@ import Wizard from '~/components/atoms/wizard/lib/utils/utils'
146
147
  import { mapCapabilities } from '~/components/common/vm/actions/common/lib/utils/capabilities'
147
148
  import { scheduledTaskDefaultFormFunc } from '~/components/common/pages/scheduledTasks/modals/lib/config/createScheduledTask'
148
149
  import { capabilities } from '~/components/common/vm/actions/common/lib/config/capabilities'
149
- import type {UI_I_VmtForm} from "~/components/common/vmt/actions/add/lib/models/interfaces";
150
150
 
151
151
  const props = defineProps<{
152
152
  project: UI_T_Project
@@ -163,7 +163,7 @@ const props = defineProps<{
163
163
  validateSendDataFunc: any
164
164
  passthroughDevices: UI_I_PciDevice[]
165
165
  mediatedDevices: UI_I_MediatedDevice[]
166
- vmNameInWizard: string
166
+ vmtNameInWizard: string
167
167
  capabilities?: UI_I_Capabilities
168
168
  schedulerTask?: any // TODO надо interface переместить глобално
169
169
  }>()
@@ -460,7 +460,7 @@ const onChangeBootOrder = (data: UI_T_ChangeBootOrder): void => {
460
460
  const isPowerOnByDefault = ref<boolean>(true)
461
461
 
462
462
  watch(
463
- () => props.vmNameInWizard,
463
+ () => props.vmtNameInWizard,
464
464
  (newValue) => {
465
465
  vmtForm.value.name = newValue
466
466
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.5.313",
4
+ "version": "1.5.315",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",
@@ -231,52 +231,81 @@ wdi.RasterEngine = $.spcExtend(wdi.EventObject.prototype, {
231
231
  },
232
232
 
233
233
  handleMjpegStream: function (spiceMessage) {
234
- var imageData = spiceMessage.args.data //jpeg string encoded
235
- var stream = wdi.Stream.getStream(spiceMessage.args.id) //recover the stream
236
- var context = this.clientGui.getContext(stream.surface_id)
237
- var img = wdi.GlobalPool.create('Image') //auto-release pool
238
- wdi.ExecutionControl.sync = true
239
- var url
240
- img.onload = function () {
241
- URL.revokeObjectURL(url)
242
- var box = stream.computedBox
243
- // we only rotate the stream if spice tells us so through the TOP_DOWN flag mask
244
- if (!stream.flags & wdi.SpiceStreamFlags.SPICE_STREAM_FLAGS_TOP_DOWN) {
245
- var offsetX = box.x + this.width / 2
246
- var offsetY = box.y + this.height / 2
247
- context.save()
248
- context.translate(offsetX, offsetY)
249
- context.rotate(Math.PI)
250
- context.scale(-1, 1)
251
- context.drawImage(
252
- this,
253
- box.x - offsetX,
254
- box.y - offsetY,
255
- box.width,
256
- box.height
257
- )
258
- context.restore()
259
- } else {
260
- context.drawImage(this, box.x, box.y, box.width, box.height)
261
- }
262
- }
234
+ const imageData = spiceMessage.args.data;
235
+ const stream = wdi.Stream.getStream(spiceMessage.args.id);
236
+ const context = this.clientGui.getContext(stream.surface_id);
237
+ const box = stream.computedBox;
263
238
 
264
- img.onerror = function () {
265
- URL.revokeObjectURL(url)
266
- }
239
+ this.pushWholeMjpegFrame(new Uint8Array(imageData));
267
240
 
268
-
269
- // Здесь предполагается, что imageData – это двоичные данные в виде Uint8Array
270
- const byteData = new Uint8Array(imageData); // Преобразование в Uint8Array
271
- this.pushWholeMjpegFrame(byteData);
272
-
273
- // Проверяем, был ли сформирован полный JPEG-кадр
274
241
  if (this.jpegInst) {
275
- url = wdi.SpiceObject.bytesToURI(this.jpegInst);
276
- img.src = url;
277
- }
242
+ const blob = new Blob([this.jpegInst], { type: 'image/jpeg' });
243
+ createImageBitmap(blob).then(bitmap => {
244
+ const isTopDown = (stream.flags & wdi.SpiceStreamFlags.SPICE_STREAM_FLAGS_TOP_DOWN);
245
+ if (!isTopDown) {
246
+ const offsetX = box.x + bitmap.width / 2;
247
+ const offsetY = box.y + bitmap.height / 2;
248
+ context.save();
249
+ context.translate(offsetX, offsetY);
250
+ context.rotate(Math.PI);
251
+ context.scale(-1, 1);
252
+ context.drawImage(bitmap, box.x - offsetX, box.y - offsetY, box.width, box.height);
253
+ context.restore();
254
+ } else {
255
+ context.drawImage(bitmap, box.x, box.y, box.width, box.height);
256
+ }
257
+ }).catch(console.error);
278
258
 
259
+ this.jpegInst = null;
260
+ }
279
261
  },
262
+ // handleMjpegStream: function (spiceMessage) {
263
+ // var imageData = spiceMessage.args.data //jpeg string encoded
264
+ // var stream = wdi.Stream.getStream(spiceMessage.args.id) //recover the stream
265
+ // var context = this.clientGui.getContext(stream.surface_id)
266
+ // var img = wdi.GlobalPool.create('Image') //auto-release pool
267
+ // wdi.ExecutionControl.sync = true
268
+ // var url
269
+ // img.onload = function () {
270
+ // URL.revokeObjectURL(url)
271
+ // var box = stream.computedBox
272
+ // // we only rotate the stream if spice tells us so through the TOP_DOWN flag mask
273
+ // if (!stream.flags & wdi.SpiceStreamFlags.SPICE_STREAM_FLAGS_TOP_DOWN) {
274
+ // var offsetX = box.x + this.width / 2
275
+ // var offsetY = box.y + this.height / 2
276
+ // context.save()
277
+ // context.translate(offsetX, offsetY)
278
+ // context.rotate(Math.PI)
279
+ // context.scale(-1, 1)
280
+ // context.drawImage(
281
+ // this,
282
+ // box.x - offsetX,
283
+ // box.y - offsetY,
284
+ // box.width,
285
+ // box.height
286
+ // )
287
+ // context.restore()
288
+ // } else {
289
+ // context.drawImage(this, box.x, box.y, box.width, box.height)
290
+ // }
291
+ // }
292
+ //
293
+ // img.onerror = function () {
294
+ // URL.revokeObjectURL(url)
295
+ // }
296
+ //
297
+ //
298
+ // // Здесь предполагается, что imageData – это двоичные данные в виде Uint8Array
299
+ // const byteData = new Uint8Array(imageData); // Преобразование в Uint8Array
300
+ // this.pushWholeMjpegFrame(byteData);
301
+ //
302
+ // // Проверяем, был ли сформирован полный JPEG-кадр
303
+ // if (this.jpegInst) {
304
+ // url = wdi.SpiceObject.bytesToURI(this.jpegInst);
305
+ // img.src = url;
306
+ // }
307
+ //
308
+ // },
280
309
 
281
310
  handleH264Stream: function (spiceMessage) {
282
311
  var imageData = spiceMessage.args.data