bfg-common 1.5.244 → 1.5.246
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.
- package/assets/scss/common/icons/icons-1.scss +2 -2
- package/assets/scss/common/icons/icons-5.scss +5 -5
- package/assets/scss/common/icons/icons-6.scss +1 -1
- package/assets/scss/common/theme.scss +6 -0
- package/components/atoms/table/dataGrid/DataGrid.vue +1 -1
- package/components/common/backup/actions/deleteBackup/DeleteBackup.vue +38 -0
- package/components/common/backup/storage/actions/add/Add.vue +3 -0
- package/components/common/backup/storage/actions/add/New.vue +2 -0
- package/components/common/backup/storage/actions/add/Old.vue +2 -0
- package/components/common/browse/BrowseNew.vue +8 -2
- package/components/common/vm/actions/add/Add.vue +3 -0
- package/components/common/vm/actions/add/New.vue +4 -0
- package/components/common/vm/actions/add/Old.vue +4 -0
- package/components/common/vm/actions/clone/Clone.vue +3 -0
- package/components/common/vm/actions/clone/toTemplate/ToTemplate.vue +3 -0
- package/components/common/vm/actions/common/customizeHardware/CustomizeHardware.vue +3 -0
- package/components/common/vm/actions/common/customizeHardware/CustomizeHardwareNew.vue +7 -2
- package/components/common/vm/actions/common/customizeHardware/CustomizeHardwareOld.vue +2 -0
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardware.vue +3 -0
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardwareNew.vue +9 -7
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardwareOld.vue +2 -0
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/bus/BusNew.vue +2 -0
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/CdDvdDriveNew.vue +4 -0
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/CpuNew.vue +5 -1
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/model/ModelNew.vue +11 -2
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/SharesNew.vue +6 -1
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/MemoryNew.vue +5 -1
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/hotPlug/HotPlugNew.vue +8 -2
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDisk.vue +3 -0
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDiskNew.vue +6 -0
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDiskOld.vue +2 -0
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/file/FileNew.vue +8 -3
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/location/Location.vue +3 -0
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/location/LocationNew.vue +2 -0
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/location/LocationOld.vue +2 -0
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/location/StorageModal.vue +3 -0
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/location/StorageModalNew.vue +2 -0
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/location/StorageModalOld.vue +2 -0
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/maximumSize/MaximumSizeNew.vue +8 -4
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/provisioning/ProvisioningNew.vue +6 -1
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/sharing/SharingNew.vue +6 -1
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/NewNetworkNew.vue +1 -1
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/location/new/New.vue +4 -3
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/location/new/table/Table.vue +1 -0
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newUsbController/NewUsbControllerNew.vue +1 -0
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/other/OtherNew.vue +8 -2
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/reservation/ReservationNew.vue +5 -2
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/VideoCardNew.vue +5 -2
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/BootOptionsNew.vue +5 -1
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/OrderNew.vue +4 -0
- package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptionsNew.vue +1 -0
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/New.vue +8 -2
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/Password.vue +1 -1
- package/components/common/vm/actions/common/customizeHardware/vmoptions/tools/ToolsNew.vue +5 -1
- package/components/common/vm/actions/common/select/storage/Old.vue +2 -0
- package/components/common/vm/actions/common/select/storage/Storage.vue +3 -0
- package/components/common/vm/actions/common/select/storage/new/New.vue +10 -5
- package/components/common/vm/actions/common/select/storage/new/lib/config/table.ts +2 -1
- package/components/common/vm/actions/editSettings/EditSettings.vue +3 -0
- package/components/common/vm/actions/editSettings/EditSettingsOld.vue +2 -0
- package/components/common/vm/actions/editSettings/new/New.vue +2 -0
- package/components/common/wizards/vm/migrate/select/computeResource/tableView/TableView.vue +1 -3
- package/lib/utils/utils.ts +14 -2
- package/package.json +2 -2
- package/plugins/cron.ts +75 -0
- package/plugins/helpers.ts +18 -0
- package/plugins/number.ts +18 -0
- package/plugins/panelStates.ts +70 -0
- package/plugins/text.ts +11 -0
- package/plugins/time.ts +17 -0
- /package/{components/common/split/horizontal/lib/models → lib/models/plugins/panelStates}/interfaces.ts +0 -0
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
:state="props.state"
|
|
51
51
|
:get-datastore-table-func="props.getDatastoreTableFunc"
|
|
52
52
|
:datastore="props.datastore"
|
|
53
|
+
:is-datastore-loading="props.isDatastoreLoading"
|
|
53
54
|
:customize-hardware-submit="props.customizeHardwareSubmit"
|
|
54
55
|
is-edit
|
|
55
56
|
@get-storage="emits('get-storage', $event)"
|
|
@@ -103,6 +104,7 @@ const props = defineProps<{
|
|
|
103
104
|
project: UI_T_Project
|
|
104
105
|
loading: boolean
|
|
105
106
|
datastore: UI_I_DatastoreTableItem[]
|
|
107
|
+
isDatastoreLoading: boolean
|
|
106
108
|
networksTable: UI_I_NetworkTableItem[]
|
|
107
109
|
selectedNavItem: UI_T_SelectedNavItem
|
|
108
110
|
vmCpuHelpTextSecond: string
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
:state="props.state"
|
|
54
54
|
:get-datastore-table-func="props.getDatastoreTableFunc"
|
|
55
55
|
:datastore="props.datastore"
|
|
56
|
+
:is-datastore-loading="props.isDatastoreLoading"
|
|
56
57
|
:customize-hardware-submit="props.customizeHardwareSubmit"
|
|
57
58
|
is-edit
|
|
58
59
|
@get-storage="emits('get-storage', $event)"
|
|
@@ -110,6 +111,7 @@ const props = defineProps<{
|
|
|
110
111
|
project: UI_T_Project
|
|
111
112
|
loading: boolean
|
|
112
113
|
datastore: UI_I_DatastoreTableItem[]
|
|
114
|
+
isDatastoreLoading: boolean
|
|
113
115
|
networksTable: UI_I_NetworkTableItem[]
|
|
114
116
|
selectedNavItem: UI_T_SelectedNavItem
|
|
115
117
|
vmCpuHelpTextSecond: string
|
|
@@ -105,9 +105,7 @@ watch(
|
|
|
105
105
|
const headItems = computed<UI_I_HeadItem[]>(() =>
|
|
106
106
|
table[props.type].headItems(localization.value)
|
|
107
107
|
)
|
|
108
|
-
const columnKeys = computed<UI_I_ColumnKey[]>(()
|
|
109
|
-
table[props.type].columnKeys(localization.value)
|
|
110
|
-
)
|
|
108
|
+
const columnKeys = computed<UI_I_ColumnKey[]>(table[props.type].columnKeys(localization.value))
|
|
111
109
|
watch(localization, () => {
|
|
112
110
|
columnKeys.value = table[props.type].columnKeys(localization.value)
|
|
113
111
|
})
|
package/lib/utils/utils.ts
CHANGED
|
@@ -10,9 +10,15 @@ export const enumKeyFromValue = (
|
|
|
10
10
|
return dataFromEnum ? dataFromEnum[0] : undefined
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
+
export const extractContentInBrackets = (inputString: string): string => {
|
|
14
|
+
const regex = /\[([^\]]+)\]/
|
|
15
|
+
const match = inputString.match(regex)
|
|
16
|
+
|
|
17
|
+
return match ? match[1] : ''
|
|
18
|
+
}
|
|
13
19
|
export const extractContentLastSlash = (
|
|
14
|
-
|
|
15
|
-
|
|
20
|
+
inputString: string,
|
|
21
|
+
after = false
|
|
16
22
|
): string => {
|
|
17
23
|
const regex = after ? /\/([^/]+)\/?$/ : /(.*)\//
|
|
18
24
|
|
|
@@ -21,6 +27,12 @@ export const extractContentLastSlash = (
|
|
|
21
27
|
return match ? match[1] : ''
|
|
22
28
|
}
|
|
23
29
|
|
|
30
|
+
export const removeLastSlash = (
|
|
31
|
+
inputString: string
|
|
32
|
+
): string => {
|
|
33
|
+
return inputString.endsWith('/') ? inputString.slice(0, -1) : inputString
|
|
34
|
+
}
|
|
35
|
+
|
|
24
36
|
export const intToIp = (value: number): string => {
|
|
25
37
|
return [
|
|
26
38
|
(value >> 24) & 0xff,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bfg-common",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.5.
|
|
4
|
+
"version": "1.5.246",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "nuxt build",
|
|
7
7
|
"dev": "nuxt dev --port=3002",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@vueuse/components": "^10.1.2",
|
|
36
36
|
"date-fns": "^2.29.3",
|
|
37
37
|
"bfg-nuxt-3-graph": "1.0.26",
|
|
38
|
-
"bfg-uikit": "1.0.
|
|
38
|
+
"bfg-uikit": "1.0.442",
|
|
39
39
|
"html2canvas": "^1.4.1",
|
|
40
40
|
"prettier-eslint": "^15.0.1"
|
|
41
41
|
}
|
package/plugins/cron.ts
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { defineNuxtPlugin } from '#app'
|
|
2
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
3
|
+
|
|
4
|
+
export default defineNuxtPlugin(() => {
|
|
5
|
+
const cron = function (): any {
|
|
6
|
+
const self: any = {}
|
|
7
|
+
|
|
8
|
+
self.cronToHumanReadable = (
|
|
9
|
+
cronString: string,
|
|
10
|
+
localization: UI_I_Localization
|
|
11
|
+
): string => {
|
|
12
|
+
const [minutes, hours, , , daysString] = cronString.split(' ')
|
|
13
|
+
|
|
14
|
+
const daysMap = {
|
|
15
|
+
0: localization.sundays,
|
|
16
|
+
1: localization.mondays,
|
|
17
|
+
2: localization.tuesdays,
|
|
18
|
+
3: localization.wednesdays,
|
|
19
|
+
4: localization.thursdays,
|
|
20
|
+
5: localization.fridays,
|
|
21
|
+
6: localization.saturdays,
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
let days = localization.everyDay
|
|
25
|
+
if (daysString !== '*') {
|
|
26
|
+
const daysArray = daysString
|
|
27
|
+
.split(',')
|
|
28
|
+
// @ts-ignore
|
|
29
|
+
.map((day: number) => daysMap[day])
|
|
30
|
+
days = `${localization.on2} ${daysArray.join(', ')}`
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Формирование строки времени
|
|
34
|
+
const time = `${String(hours).padStart(2, '0')}:${String(
|
|
35
|
+
minutes
|
|
36
|
+
).padStart(2, '0')}`
|
|
37
|
+
|
|
38
|
+
return `${days} ${localization.in} ${time}`
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
self.decodeCron = (cronString: string): any => {
|
|
42
|
+
const [minutes, hours, , , daysString] = cronString.split(' ')
|
|
43
|
+
|
|
44
|
+
const days =
|
|
45
|
+
daysString === '*'
|
|
46
|
+
? [0, 1, 2, 3, 4, 5, 6]
|
|
47
|
+
: daysString.split(',').map(Number)
|
|
48
|
+
|
|
49
|
+
const h = hours === '*' ? '00' : String(hours).padStart(2, '0')
|
|
50
|
+
const m = minutes === '*' ? '00' : String(minutes).padStart(2, '0')
|
|
51
|
+
const time = `${h}:${m}`
|
|
52
|
+
|
|
53
|
+
return [
|
|
54
|
+
days,
|
|
55
|
+
time,
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
self.encodeCron = (days: number[], time: string): string => {
|
|
60
|
+
const { 0: hours, 1: minutes } = time.split(':').map(Number)
|
|
61
|
+
|
|
62
|
+
const daysString = days.length === 7 ? '*' : days.join(',')
|
|
63
|
+
|
|
64
|
+
return `${minutes} ${hours} * * ${daysString}`
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return self
|
|
68
|
+
}.call({})
|
|
69
|
+
|
|
70
|
+
return {
|
|
71
|
+
provide: {
|
|
72
|
+
cron,
|
|
73
|
+
},
|
|
74
|
+
}
|
|
75
|
+
})
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { defineNuxtPlugin } from '#app'
|
|
2
|
+
export default defineNuxtPlugin(() => {
|
|
3
|
+
const isObjectEmpty = (obj: any): boolean => {
|
|
4
|
+
for (const i in obj) {
|
|
5
|
+
// eslint-disable-next-line no-prototype-builtins
|
|
6
|
+
if (obj.hasOwnProperty(i)) {
|
|
7
|
+
return false
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
return true
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
return {
|
|
14
|
+
provide: {
|
|
15
|
+
isObjectEmpty,
|
|
16
|
+
},
|
|
17
|
+
}
|
|
18
|
+
})
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { defineNuxtPlugin } from '#app'
|
|
2
|
+
export default defineNuxtPlugin(() => {
|
|
3
|
+
const number = function (): any {
|
|
4
|
+
const self: any = {}
|
|
5
|
+
self.format = function (n: number, format: string): string {
|
|
6
|
+
const formatter = new Intl.NumberFormat(format)
|
|
7
|
+
return formatter.format(n)
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
return self
|
|
11
|
+
}.call({})
|
|
12
|
+
|
|
13
|
+
return {
|
|
14
|
+
provide: {
|
|
15
|
+
number,
|
|
16
|
+
},
|
|
17
|
+
}
|
|
18
|
+
})
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { defineNuxtPlugin } from '#app'
|
|
2
|
+
import type { UI_I_PanelOptions } from '~/lib/models/plugins/panelStates/interfaces'
|
|
3
|
+
|
|
4
|
+
export default defineNuxtPlugin(() => {
|
|
5
|
+
const panelStates = function (): any {
|
|
6
|
+
const self: any = {}
|
|
7
|
+
let options: UI_I_PanelOptions = {
|
|
8
|
+
leftPanelWidth: 20,
|
|
9
|
+
topPanelHeight: 80,
|
|
10
|
+
isBottomPanelCollapsed: false,
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
self.setLeftPanelWidth = function (width: number): void {
|
|
14
|
+
options.leftPanelWidth = width
|
|
15
|
+
|
|
16
|
+
self.setPanelStatesInStorage()
|
|
17
|
+
}
|
|
18
|
+
self.setTopPanelHeight = function (height: number): void {
|
|
19
|
+
options.topPanelHeight = height
|
|
20
|
+
|
|
21
|
+
self.setPanelStatesInStorage()
|
|
22
|
+
}
|
|
23
|
+
self.bottomPanelCollapse = function (collapse: boolean): void {
|
|
24
|
+
options.isBottomPanelCollapsed = collapse
|
|
25
|
+
|
|
26
|
+
self.setPanelStatesInStorage()
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
self.setPanelStatesInStorage = function (): void {
|
|
30
|
+
useLocalStorage('panelStates', options)
|
|
31
|
+
self.emitChanges()
|
|
32
|
+
}
|
|
33
|
+
self.getPanelStatesOfStorage = function (): UI_I_PanelOptions {
|
|
34
|
+
let panelStates = useLocalStorage('panelStates')
|
|
35
|
+
|
|
36
|
+
if (!panelStates) {
|
|
37
|
+
// const parent = document.getElementById('default-layout-outer')
|
|
38
|
+
const parent = document.body
|
|
39
|
+
const parentHeight = parent?.clientHeight || 0
|
|
40
|
+
const onePercent = parentHeight / 100
|
|
41
|
+
const defaultRecentTasksHeight = 250
|
|
42
|
+
|
|
43
|
+
options.topPanelHeight =
|
|
44
|
+
(parentHeight - defaultRecentTasksHeight - 1.5) / onePercent
|
|
45
|
+
|
|
46
|
+
panelStates = options
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
options = panelStates
|
|
50
|
+
|
|
51
|
+
return panelStates
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
self.cb = (): void => {}
|
|
55
|
+
self.on = function (cb: () => any | void): void {
|
|
56
|
+
self.cb = cb
|
|
57
|
+
}
|
|
58
|
+
self.emitChanges = function (): void {
|
|
59
|
+
self.cb(options)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return self
|
|
63
|
+
}.call({})
|
|
64
|
+
|
|
65
|
+
return {
|
|
66
|
+
provide: {
|
|
67
|
+
panelStates,
|
|
68
|
+
},
|
|
69
|
+
}
|
|
70
|
+
})
|
package/plugins/text.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
2
|
+
|
|
1
3
|
export default defineNuxtPlugin(() => {
|
|
2
4
|
const text = function () {
|
|
3
5
|
const self: any = {}
|
|
@@ -36,6 +38,15 @@ export default defineNuxtPlugin(() => {
|
|
|
36
38
|
)
|
|
37
39
|
.join(' ')
|
|
38
40
|
}
|
|
41
|
+
self.replaceStringByLocalization = function (
|
|
42
|
+
str: string,
|
|
43
|
+
localization: UI_I_Localization
|
|
44
|
+
): string {
|
|
45
|
+
return str.replace(/\[\w+\]/g, (val) => {
|
|
46
|
+
const variable = val.replace(/\[|\]/g, '')
|
|
47
|
+
return localization.common[variable]
|
|
48
|
+
})
|
|
49
|
+
}
|
|
39
50
|
|
|
40
51
|
return self
|
|
41
52
|
}.call({})
|
package/plugins/time.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineNuxtPlugin } from '#app'
|
|
2
|
+
export default defineNuxtPlugin(() => {
|
|
3
|
+
const time = function (): any {
|
|
4
|
+
const self: any = {}
|
|
5
|
+
self.millisecondsToHour = function (ms: number): number {
|
|
6
|
+
return ~~(ms / 1000 / 60 / 60 / 24)
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
return self
|
|
10
|
+
}.call({})
|
|
11
|
+
|
|
12
|
+
return {
|
|
13
|
+
provide: {
|
|
14
|
+
time,
|
|
15
|
+
},
|
|
16
|
+
}
|
|
17
|
+
})
|
|
File without changes
|