bfg-common 1.4.629 → 1.4.631
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/components/auth.scss +23 -2
- package/components/common/pages/home/widgets/services/ServicesNew.vue +1 -1
- package/components/common/pages/home/widgets/warnings/WarningsNew.vue +1 -1
- package/components/common/portlets/customAttributes/Portlet.vue +1 -1
- package/components/common/portlets/tag/Portlet.vue +2 -2
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/location/new/table/Table.vue +1 -1
- package/components/common/vm/actions/common/select/storage/new/lib/config/table.ts +1 -1
- package/modules/fixContentBuild/index.ts +1 -6
- package/modules/fixContentBuild/lib/utils/methods.ts +115 -118
- package/package.json +2 -2
|
@@ -154,10 +154,31 @@
|
|
|
154
154
|
margin-bottom: 48px;
|
|
155
155
|
}
|
|
156
156
|
&__input {
|
|
157
|
-
:deep(.ui-main-input)
|
|
158
|
-
:deep(.ui-main-input:not(:placeholder-shown) + .ui-input-label) {
|
|
157
|
+
:deep(.ui-main-input) {
|
|
159
158
|
background-color: #fafafa;
|
|
160
159
|
}
|
|
160
|
+
:deep(input.ui-main-input:-internal-autofill-selected),
|
|
161
|
+
:deep(input.ui-main-input:-internal-autofill-selected:hover),
|
|
162
|
+
:deep(input.ui-main-input:-internal-autofill-selected:active),
|
|
163
|
+
:deep(input.ui-main-input:-internal-autofill-selected:focus) {
|
|
164
|
+
appearance: menulist-button;
|
|
165
|
+
background-image: none !important;
|
|
166
|
+
background-color: #fafafa !important;
|
|
167
|
+
color: fieldtext !important;
|
|
168
|
+
-webkit-background-clip: text;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
:deep(input.ui-main-input:-internal-autofill-selected:focus) {
|
|
172
|
+
& + label.ui-input-label {
|
|
173
|
+
position: absolute;
|
|
174
|
+
font-size: 14px;
|
|
175
|
+
top: -8.85px;
|
|
176
|
+
|
|
177
|
+
& + .label-background {
|
|
178
|
+
display: block;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
161
182
|
&.password {
|
|
162
183
|
margin-top: 16px;
|
|
163
184
|
}
|
|
@@ -56,7 +56,7 @@ const props = defineProps<{
|
|
|
56
56
|
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
57
57
|
|
|
58
58
|
const data = computed<UI_I_DataTable>(() => ({
|
|
59
|
-
id: '
|
|
59
|
+
id: 'services',
|
|
60
60
|
header: resentTaskHeadItems.value,
|
|
61
61
|
body: resentTaskBodyItems.value,
|
|
62
62
|
}))
|
|
@@ -56,7 +56,7 @@ const props = defineProps<{
|
|
|
56
56
|
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
57
57
|
|
|
58
58
|
const data = computed<UI_I_DataTable>(() => ({
|
|
59
|
-
id: '
|
|
59
|
+
id: 'warnings',
|
|
60
60
|
header: resentTaskHeadItems.value,
|
|
61
61
|
body: resentTaskBodyItems.value,
|
|
62
62
|
}))
|
|
@@ -220,7 +220,7 @@ const tagsAssignBodyItems = ref<UI_I_DataTableBody[]>(
|
|
|
220
220
|
)
|
|
221
221
|
|
|
222
222
|
const data = computed<UI_I_DataTable>(() => ({
|
|
223
|
-
id: '
|
|
223
|
+
id: 'tags',
|
|
224
224
|
selectedRows: [],
|
|
225
225
|
isAllSelected: false,
|
|
226
226
|
title: '',
|
|
@@ -230,7 +230,7 @@ const data = computed<UI_I_DataTable>(() => ({
|
|
|
230
230
|
}))
|
|
231
231
|
|
|
232
232
|
const assignData = computed<UI_I_DataTable>(() => ({
|
|
233
|
-
id: '
|
|
233
|
+
id: 'tags-assign',
|
|
234
234
|
selectedRows: [],
|
|
235
235
|
isAllSelected: false,
|
|
236
236
|
title: '',
|
|
@@ -19,7 +19,6 @@ import {
|
|
|
19
19
|
// }
|
|
20
20
|
|
|
21
21
|
const npmGenerate = (): void => {
|
|
22
|
-
console.log('npmGenerate', 222);
|
|
23
22
|
// Правим путь к файлу
|
|
24
23
|
const filePath = path.join(
|
|
25
24
|
__dirname.replace('/bfg-common/modules/fixContentBuild', ''),
|
|
@@ -31,19 +30,17 @@ const npmGenerate = (): void => {
|
|
|
31
30
|
'composables',
|
|
32
31
|
'query.js'
|
|
33
32
|
)
|
|
34
|
-
console.log(333);
|
|
35
33
|
const searchString = '/query/${hash(params)}'
|
|
36
34
|
const replacementString = 'cache'
|
|
37
35
|
replaceFileContent(filePath, searchString, replacementString)
|
|
38
36
|
// End block
|
|
39
|
-
|
|
37
|
+
|
|
40
38
|
// Переносим весь контент и удаляем все файлы кроме картинок
|
|
41
39
|
const contentPath = path.join(
|
|
42
40
|
__dirname.replace('/node_modules/bfg-common/modules/fixContentBuild', ''),
|
|
43
41
|
'content',
|
|
44
42
|
'help'
|
|
45
43
|
)
|
|
46
|
-
console.log(contentPath, 555, !fs.existsSync(contentPath));
|
|
47
44
|
if (!fs.existsSync(contentPath)) return
|
|
48
45
|
|
|
49
46
|
const publicPath = path.join(
|
|
@@ -51,7 +48,6 @@ const npmGenerate = (): void => {
|
|
|
51
48
|
'public',
|
|
52
49
|
'images'
|
|
53
50
|
)
|
|
54
|
-
console.log(777);
|
|
55
51
|
fs.cp(contentPath, publicPath, { recursive: true }, () => {
|
|
56
52
|
// Удаляем все файлы кроме картинок
|
|
57
53
|
removeNonImageFiles(publicPath)
|
|
@@ -67,7 +63,6 @@ const npmGenerate = (): void => {
|
|
|
67
63
|
|
|
68
64
|
// @ts-ignore
|
|
69
65
|
export default defineNuxtModule(() => {
|
|
70
|
-
console.log(process.env.npm_command, 444);
|
|
71
66
|
switch (process.env.npm_command) {
|
|
72
67
|
case 'run-script':
|
|
73
68
|
// npmDev()
|
|
@@ -1,118 +1,115 @@
|
|
|
1
|
-
import path from 'path'
|
|
2
|
-
import fs from 'fs'
|
|
3
|
-
|
|
4
|
-
const isImage = (fileName: string) => {
|
|
5
|
-
const imageExtensions = ['.png', '.jpeg', '.jpg']
|
|
6
|
-
return imageExtensions.some(
|
|
7
|
-
(ext) => path.extname(fileName).toLowerCase() === ext
|
|
8
|
-
)
|
|
9
|
-
}
|
|
10
|
-
const isMdFile = (fileName: string) => {
|
|
11
|
-
return path.extname(fileName).toLowerCase() === '.md'
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export const removeNonImageFiles = (dirPath: string) => {
|
|
15
|
-
fs.readdirSync(dirPath).forEach((file: string) => {
|
|
16
|
-
const filePath = path.join(dirPath, file)
|
|
17
|
-
const isDir = fs.lstatSync(filePath).isDirectory()
|
|
18
|
-
|
|
19
|
-
if (isDir) {
|
|
20
|
-
removeNonImageFiles(filePath)
|
|
21
|
-
} else {
|
|
22
|
-
if (!isImage(file)) {
|
|
23
|
-
fs.unlinkSync(filePath)
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
})
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export const removeImagesFromContent = (dirPath: string) => {
|
|
30
|
-
fs.readdirSync(dirPath).forEach((file: string) => {
|
|
31
|
-
const filePath = path.join(dirPath, file)
|
|
32
|
-
const isDir = fs.lstatSync(filePath).isDirectory()
|
|
33
|
-
|
|
34
|
-
if (isDir) {
|
|
35
|
-
removeImagesFromContent(filePath)
|
|
36
|
-
} else {
|
|
37
|
-
// if (isImage(file)) { // закоментировал т.к. на проде долго загружалась документация(стр. /help)
|
|
38
|
-
if (!isMdFile(file)) {
|
|
39
|
-
fs.unlinkSync(filePath)
|
|
40
|
-
} else if (isMdFile(file) && filePath.includes('_index.md')) {
|
|
41
|
-
// Удаляем префикс "_" у индексных файлов
|
|
42
|
-
const filePathWidthOutPrefix = filePath.replace('_index.md', 'index.md')
|
|
43
|
-
fs.rename(filePath, filePathWidthOutPrefix, (err: any) => {
|
|
44
|
-
if (err) {
|
|
45
|
-
console.error(`Error renaming file: ${err}`)
|
|
46
|
-
}
|
|
47
|
-
})
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
})
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export const updateImagesPathAndCustomComponents = (dirPath: string) => {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
const
|
|
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
|
-
}
|
|
1
|
+
import path from 'path'
|
|
2
|
+
import fs from 'fs'
|
|
3
|
+
|
|
4
|
+
const isImage = (fileName: string) => {
|
|
5
|
+
const imageExtensions = ['.png', '.jpeg', '.jpg']
|
|
6
|
+
return imageExtensions.some(
|
|
7
|
+
(ext) => path.extname(fileName).toLowerCase() === ext
|
|
8
|
+
)
|
|
9
|
+
}
|
|
10
|
+
const isMdFile = (fileName: string) => {
|
|
11
|
+
return path.extname(fileName).toLowerCase() === '.md'
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const removeNonImageFiles = (dirPath: string) => {
|
|
15
|
+
fs.readdirSync(dirPath).forEach((file: string) => {
|
|
16
|
+
const filePath = path.join(dirPath, file)
|
|
17
|
+
const isDir = fs.lstatSync(filePath).isDirectory()
|
|
18
|
+
|
|
19
|
+
if (isDir) {
|
|
20
|
+
removeNonImageFiles(filePath)
|
|
21
|
+
} else {
|
|
22
|
+
if (!isImage(file)) {
|
|
23
|
+
fs.unlinkSync(filePath)
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
})
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const removeImagesFromContent = (dirPath: string) => {
|
|
30
|
+
fs.readdirSync(dirPath).forEach((file: string) => {
|
|
31
|
+
const filePath = path.join(dirPath, file)
|
|
32
|
+
const isDir = fs.lstatSync(filePath).isDirectory()
|
|
33
|
+
|
|
34
|
+
if (isDir) {
|
|
35
|
+
removeImagesFromContent(filePath)
|
|
36
|
+
} else {
|
|
37
|
+
// if (isImage(file)) { // закоментировал т.к. на проде долго загружалась документация(стр. /help)
|
|
38
|
+
if (!isMdFile(file)) {
|
|
39
|
+
fs.unlinkSync(filePath)
|
|
40
|
+
} else if (isMdFile(file) && filePath.includes('_index.md')) {
|
|
41
|
+
// Удаляем префикс "_" у индексных файлов
|
|
42
|
+
const filePathWidthOutPrefix = filePath.replace('_index.md', 'index.md')
|
|
43
|
+
fs.rename(filePath, filePathWidthOutPrefix, (err: any) => {
|
|
44
|
+
if (err) {
|
|
45
|
+
console.error(`Error renaming file: ${err}`)
|
|
46
|
+
}
|
|
47
|
+
})
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
})
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export const updateImagesPathAndCustomComponents = (dirPath: string) => {
|
|
54
|
+
fs.readdirSync(dirPath).forEach((file: string) => {
|
|
55
|
+
const filePath = path.join(dirPath, file)
|
|
56
|
+
const isDir = fs.lstatSync(filePath).isDirectory()
|
|
57
|
+
|
|
58
|
+
if (isDir) {
|
|
59
|
+
updateImagesPathAndCustomComponents(filePath)
|
|
60
|
+
} else {
|
|
61
|
+
if (isMdFile(file)) {
|
|
62
|
+
// @ts-ignore
|
|
63
|
+
// Правим путь к картинкам
|
|
64
|
+
const imagePath = filePath
|
|
65
|
+
.replaceAll('\\', '/')
|
|
66
|
+
.match(/\/content.+\//)[0]
|
|
67
|
+
.replace('/content/help', '/images')
|
|
68
|
+
replaceFileContent(
|
|
69
|
+
filePath,
|
|
70
|
+
/!\[(.*)\]\((.*?)\)/g,
|
|
71
|
+
``
|
|
72
|
+
).then(() => {
|
|
73
|
+
// Заменяем кастомные тэги
|
|
74
|
+
replaceFileContent(
|
|
75
|
+
filePath,
|
|
76
|
+
/\{\{ *< *hint *(info) *> *\}\}|\{\{ *< *\/hint *> *\}\}/g,
|
|
77
|
+
(_match: any, hintInfo: string) => {
|
|
78
|
+
return hintInfo ? '\n::hint\n' : '\n::\n'
|
|
79
|
+
}
|
|
80
|
+
)
|
|
81
|
+
})
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
})
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export const replaceFileContent = async (
|
|
88
|
+
filePath: string,
|
|
89
|
+
searchString: string | RegExp,
|
|
90
|
+
replacementString: any
|
|
91
|
+
): Promise<void> => {
|
|
92
|
+
return new Promise((resolve, reject) => {
|
|
93
|
+
fs.readFile(filePath, 'utf8', (err: any, data: string) => {
|
|
94
|
+
if (err) {
|
|
95
|
+
reject()
|
|
96
|
+
return console.log(err)
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if (data.match(replacementString)) {
|
|
100
|
+
resolve()
|
|
101
|
+
return
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const updatedContent = data.replace(searchString, replacementString)
|
|
105
|
+
|
|
106
|
+
fs.writeFile(filePath, updatedContent, 'utf8', (err: any) => {
|
|
107
|
+
if (err) {
|
|
108
|
+
reject()
|
|
109
|
+
return console.log(err)
|
|
110
|
+
}
|
|
111
|
+
resolve()
|
|
112
|
+
})
|
|
113
|
+
})
|
|
114
|
+
})
|
|
115
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bfg-common",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.4.
|
|
4
|
+
"version": "1.4.631",
|
|
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.15",
|
|
38
|
-
"bfg-uikit": "1.0.
|
|
38
|
+
"bfg-uikit": "1.0.275",
|
|
39
39
|
"html2canvas": "^1.4.1",
|
|
40
40
|
"prettier-eslint": "^15.0.1"
|
|
41
41
|
}
|