dashboard-shell-shell 3.0.5-test.5 → 3.0.5-test.8
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/styles/base/_variables.scss +3 -3
- package/assets/styles/global/_button.scss +1 -1
- package/components/Drawer/ResourceDetailDrawer/ConfigTab.vue +16 -16
- package/components/Drawer/ResourceDetailDrawer/YamlTab.vue +1 -1
- package/components/Drawer/ResourceDetailDrawer/index.vue +4 -3
- package/components/Resource/Detail/Metadata/index.vue +1 -0
- package/components/Resource/Detail/TitleBar/Top.vue +2 -0
- package/components/Resource/Detail/TitleBar/index.vue +7 -1
- package/components/ResourceList/Masthead.vue +2 -2
- package/components/SortableTable/index.vue +1 -1
- package/components/Tabbed/index.vue +1 -1
- package/components/breadcrumb/index.vue +5 -29
- package/components/nav/NamespaceFilter.vue +1 -2
- package/package.json +1 -1
- package/pages/account/index.vue +25 -79
- package/pages/c/_cluster/auth/roles/index.vue +38 -5
- package/plugins/dashboard-store/resource-class.js +28 -27
- package/scripts/publish-shell.sh +1 -1
- package/store/type-map.js +1 -1
- package/types/shell/index.d.ts +4 -30
- package/utils/error.js +3 -1
- package/utils/errorTranslate.json +15 -0
|
@@ -39,13 +39,13 @@ $z-indexes: (
|
|
|
39
39
|
// ---- Boundary for central content (in `<main>`)
|
|
40
40
|
|
|
41
41
|
// This covers both relative and content modes of the loading indicator
|
|
42
|
-
loading:
|
|
42
|
+
loading: 16,
|
|
43
43
|
|
|
44
44
|
// Users can click on shell in header and show shell even with most loading indicators showing,
|
|
45
45
|
// so add it above them
|
|
46
|
-
windowsManager:
|
|
46
|
+
windowsManager: 17,
|
|
47
47
|
|
|
48
|
-
mainHeader:
|
|
48
|
+
mainHeader: 18,
|
|
49
49
|
|
|
50
50
|
cruFooter: 19,
|
|
51
51
|
|
|
@@ -16,32 +16,32 @@ const store = useStore();
|
|
|
16
16
|
const i18n = useI18n(store);
|
|
17
17
|
</script>
|
|
18
18
|
<template>
|
|
19
|
-
|
|
19
|
+
<Tab
|
|
20
20
|
class="config-tab"
|
|
21
21
|
name="config-tab"
|
|
22
22
|
:label="i18n.t('component.drawer.resourceDetailDrawer.configTab.title')"
|
|
23
23
|
>
|
|
24
|
-
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
</
|
|
24
|
+
<div class="container">
|
|
25
|
+
<component
|
|
26
|
+
:is="props.component"
|
|
27
|
+
:value="props.resource"
|
|
28
|
+
:liveValue="props.resource"
|
|
29
|
+
:resourceType="props.resourceType"
|
|
30
|
+
:mode="_VIEW"
|
|
31
|
+
:real-mode="_VIEW"
|
|
32
|
+
:initial-value="props.resource"
|
|
33
|
+
:use-tabbed-hash="false /* Have to disable hashing on child components or it modifies the url and closes the drawer */"
|
|
34
|
+
as="config"
|
|
35
|
+
/>
|
|
36
|
+
</div>
|
|
37
|
+
</Tab>
|
|
38
38
|
</template>
|
|
39
39
|
|
|
40
40
|
<style lang="scss" scoped>
|
|
41
41
|
.container {
|
|
42
42
|
background-color: var(--body-bg);
|
|
43
43
|
border-radius: var(--border-radius-md);
|
|
44
|
-
padding:
|
|
44
|
+
padding: 20px;
|
|
45
45
|
max-width: 100%;
|
|
46
46
|
width: 100%;
|
|
47
47
|
position: relative;
|
|
@@ -38,7 +38,7 @@ const yamlComponent: any = useTemplateRef('yaml');
|
|
|
38
38
|
:deep() .codemirror-container {
|
|
39
39
|
background-color: var(--body-bg);
|
|
40
40
|
border-radius: var(--border-radius-md);
|
|
41
|
-
padding:
|
|
41
|
+
padding: 20px;
|
|
42
42
|
|
|
43
43
|
.CodeMirror, .CodeMirror-gutter {
|
|
44
44
|
background-color: var(--body-bg);
|
|
@@ -27,6 +27,8 @@ const i18n = useI18n(store);
|
|
|
27
27
|
const yamlTabProps = ref<YamlProps | null>(null);
|
|
28
28
|
const configTabProps = useDefaultConfigTabProps(props.resource);
|
|
29
29
|
|
|
30
|
+
console.log(configTabProps, ' configTabProps---------------------------------2');
|
|
31
|
+
|
|
30
32
|
useDefaultYamlTabProps(props.resource).then((props) => {
|
|
31
33
|
yamlTabProps.value = props;
|
|
32
34
|
});
|
|
@@ -85,10 +87,10 @@ const canEdit = computed(() => {
|
|
|
85
87
|
v-if="configTabProps"
|
|
86
88
|
v-bind="configTabProps"
|
|
87
89
|
/>
|
|
88
|
-
|
|
90
|
+
<YamlTab
|
|
89
91
|
v-if="yamlTabProps"
|
|
90
92
|
v-bind="yamlTabProps"
|
|
91
|
-
/>
|
|
93
|
+
/>
|
|
92
94
|
</Tabbed>
|
|
93
95
|
</template>
|
|
94
96
|
<template #additional-actions>
|
|
@@ -116,7 +118,6 @@ const canEdit = computed(() => {
|
|
|
116
118
|
border: none;
|
|
117
119
|
border-top: 1px solid var(--border);
|
|
118
120
|
padding: 0;
|
|
119
|
-
padding-top: 24px;
|
|
120
121
|
}
|
|
121
122
|
}
|
|
122
123
|
}
|
|
@@ -14,6 +14,7 @@ import ButtonGroup from '@shell/components/ButtonGroup';
|
|
|
14
14
|
import { ExtensionPoint, PanelLocation } from '@shell/core/types';
|
|
15
15
|
import ExtensionPanel from '@shell/components/ExtensionPanel.vue';
|
|
16
16
|
import breadcrumb from '@shell/components/breadcrumb/index.vue'
|
|
17
|
+
import { useDefaultConfigTabProps } from '@shell/components/Drawer/ResourceDetailDrawer/composables';
|
|
17
18
|
|
|
18
19
|
export interface Badge {
|
|
19
20
|
color: 'bg-success' | 'bg-error' | 'bg-warning' | 'bg-info';
|
|
@@ -57,6 +58,12 @@ const emit = defineEmits(['show-configuration']);
|
|
|
57
58
|
const showConfigurationDataTestId = 'show-configuration-cta';
|
|
58
59
|
const showConfigurationReturnFocusSelector = computed(() => `[data-testid="${ showConfigurationDataTestId }"]`);
|
|
59
60
|
|
|
61
|
+
|
|
62
|
+
const configTabProps = useDefaultConfigTabProps(resource);
|
|
63
|
+
|
|
64
|
+
console.log(configTabProps, ' configTabProps---------------------------------1');
|
|
65
|
+
|
|
66
|
+
|
|
60
67
|
const currentView = ref(router?.currentRoute?.value?.query?.as || _CONFIG);
|
|
61
68
|
const viewOptions = computed(() => {
|
|
62
69
|
if (!showViewOptions) {
|
|
@@ -253,7 +260,6 @@ watch(
|
|
|
253
260
|
flex-direction: row;
|
|
254
261
|
justify-content: center;
|
|
255
262
|
align-items: center;
|
|
256
|
-
background-color: var(--primary);
|
|
257
263
|
|
|
258
264
|
a{
|
|
259
265
|
color: #fff;
|
|
@@ -325,7 +325,7 @@ export default {
|
|
|
325
325
|
<!-- 操作按钮区域 -->
|
|
326
326
|
<div
|
|
327
327
|
ref="actionsContainer"
|
|
328
|
-
v-if="!(tabList.includes(_typeDisplay))
|
|
328
|
+
v-if="!(tabList.includes(_typeDisplay))"
|
|
329
329
|
class="actions-container actions-positioning"
|
|
330
330
|
style="min-height: 32px;align-self: flex-end;"
|
|
331
331
|
>
|
|
@@ -419,6 +419,6 @@ export default {
|
|
|
419
419
|
.actions-positioning {
|
|
420
420
|
position: absolute;
|
|
421
421
|
bottom: -48px;
|
|
422
|
-
z-index:
|
|
422
|
+
z-index: 15;
|
|
423
423
|
}
|
|
424
424
|
</style>
|
|
@@ -2186,7 +2186,7 @@ export default {
|
|
|
2186
2186
|
border-collapse: collapse;
|
|
2187
2187
|
min-width: 400px;
|
|
2188
2188
|
border-radius: 5px 5px 0 0;
|
|
2189
|
-
border-bottom: 1px solid var(--border);
|
|
2189
|
+
border-bottom: 1px solid var(--border) !important;
|
|
2190
2190
|
/* outline: 1px solid var(--border); */
|
|
2191
2191
|
background: var(--sortable-table-bg);
|
|
2192
2192
|
border-radius: 4px;
|
|
@@ -1,20 +1,10 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import { KUBERNETES, PROJECT } from '@shell/config/labels-annotations';
|
|
3
|
-
import { FLEET, NAMESPACE, MANAGEMENT, HELM } from '@shell/config/types';
|
|
4
|
-
import ButtonGroup from '@shell/components/ButtonGroup';
|
|
5
|
-
// import { BadgeState } from '@components/BadgeState';
|
|
6
|
-
import DotState from '@shell/components/DotState.vue';
|
|
7
2
|
import { Banner } from '@components/Banner';
|
|
8
|
-
import { get } from '@shell/utils/object'
|
|
9
|
-
import { NAME as FLEET_NAME } from '@shell/config/product/fleet';
|
|
10
|
-
import { HIDE_SENSITIVE } from '@shell/store/prefs';
|
|
3
|
+
import { get } from '@shell/utils/object';;
|
|
11
4
|
import {
|
|
12
5
|
AS, _DETAIL, _CONFIG, _YAML, MODE, _CREATE, _EDIT, _VIEW, _UNFLAG, _GRAPH
|
|
13
6
|
} from '@shell/config/query-params';
|
|
14
7
|
import { ExtensionPoint, PanelLocation } from '@shell/core/types';
|
|
15
|
-
import ExtensionPanel from '@shell/components/ExtensionPanel';
|
|
16
|
-
import TabTitle from '@shell/components/TabTitle';
|
|
17
|
-
import ActionMenu from '@shell/components/ActionMenuShell.vue';
|
|
18
8
|
import { useRuntimeFlag } from '@shell/composables/useRuntimeFlag';
|
|
19
9
|
import { useStore } from 'vuex';
|
|
20
10
|
|
|
@@ -31,12 +21,7 @@ export default {
|
|
|
31
21
|
|
|
32
22
|
components: {
|
|
33
23
|
// BadgeState,
|
|
34
|
-
DotState,
|
|
35
24
|
Banner,
|
|
36
|
-
ButtonGroup,
|
|
37
|
-
ExtensionPanel,
|
|
38
|
-
TabTitle,
|
|
39
|
-
ActionMenu,
|
|
40
25
|
},
|
|
41
26
|
props: {
|
|
42
27
|
value: {
|
|
@@ -170,12 +155,11 @@ export default {
|
|
|
170
155
|
},
|
|
171
156
|
|
|
172
157
|
demoDisplay() {
|
|
173
|
-
const product = this.$store.getters['productId'];
|
|
174
|
-
|
|
175
|
-
const resources = this.location?.params?.resource || ''
|
|
176
158
|
|
|
159
|
+
const resources = this.$route.params?.resource || ''
|
|
160
|
+
|
|
177
161
|
const productId = this.$store.getters['type-map/groupForBasicType'](this.$store.getters['productId'], resources);
|
|
178
|
-
|
|
162
|
+
|
|
179
163
|
if (productId === undefined) {
|
|
180
164
|
return '';
|
|
181
165
|
}
|
|
@@ -192,13 +176,6 @@ export default {
|
|
|
192
176
|
|
|
193
177
|
return partsEn;
|
|
194
178
|
},
|
|
195
|
-
menuIcon() {
|
|
196
|
-
const product = this.$store.getters['productId'];
|
|
197
|
-
|
|
198
|
-
const resources = this.location?.params?.resource || ''
|
|
199
|
-
|
|
200
|
-
return this.$store.getters['type-map/groupsForVirTypes'](product, resources);
|
|
201
|
-
},
|
|
202
179
|
|
|
203
180
|
location() {
|
|
204
181
|
const { parent } = this;
|
|
@@ -217,9 +194,8 @@ export default {
|
|
|
217
194
|
<template>
|
|
218
195
|
<div class="masthead">
|
|
219
196
|
<div class="title">
|
|
220
|
-
<!--
|
|
197
|
+
<!-- 标题区域 -->
|
|
221
198
|
<div
|
|
222
|
-
v-if="!(parentRouteOverride === 'account' && resource=== 'token')"
|
|
223
199
|
class="excram-list"
|
|
224
200
|
>
|
|
225
201
|
<span
|
|
@@ -949,7 +949,6 @@ export default {
|
|
|
949
949
|
.ns-filter {
|
|
950
950
|
width: 280px;
|
|
951
951
|
display: inline-block;
|
|
952
|
-
border-radius: var(--border-radius);
|
|
953
952
|
|
|
954
953
|
.ns-glass {
|
|
955
954
|
top: 0;
|
|
@@ -968,9 +967,9 @@ export default {
|
|
|
968
967
|
}
|
|
969
968
|
|
|
970
969
|
.ns-clear {
|
|
971
|
-
padding: 0 5px;
|
|
972
970
|
&:hover {
|
|
973
971
|
color: var(--primary);
|
|
972
|
+
cursor: pointer;
|
|
974
973
|
}
|
|
975
974
|
}
|
|
976
975
|
|
package/package.json
CHANGED
package/pages/account/index.vue
CHANGED
|
@@ -3,8 +3,7 @@ import BackLink from '@shell/components/BackLink';
|
|
|
3
3
|
import { MANAGEMENT, NORMAN } from '@shell/config/types';
|
|
4
4
|
import { SETTING } from '@shell/config/settings';
|
|
5
5
|
import Loading from '@shell/components/Loading';
|
|
6
|
-
|
|
7
|
-
import Principal from './pri.vue';
|
|
6
|
+
import Principal from '@shell/components/auth/Principal';
|
|
8
7
|
import BackRoute from '@shell/mixins/back-link';
|
|
9
8
|
import { mapGetters } from 'vuex';
|
|
10
9
|
|
|
@@ -17,7 +16,7 @@ const API_ENDPOINT = '/v3';
|
|
|
17
16
|
|
|
18
17
|
export default {
|
|
19
18
|
components: {
|
|
20
|
-
CopyToClipboardText, BackLink, Banner,
|
|
19
|
+
CopyToClipboardText, BackLink, Banner, Loading, ResourceTable, Principal, TabTitle
|
|
21
20
|
},
|
|
22
21
|
mixins: [BackRoute],
|
|
23
22
|
async fetch() {
|
|
@@ -152,37 +151,21 @@ export default {
|
|
|
152
151
|
<template>
|
|
153
152
|
<Loading v-if="$fetchState.pending" />
|
|
154
153
|
<div v-else>
|
|
155
|
-
|
|
154
|
+
<BackLink :link="backLink" />
|
|
156
155
|
<h1>
|
|
157
156
|
<TabTitle breadcrumb="vendor-only">
|
|
158
157
|
{{ t('accountAndKeys.title') }}
|
|
159
158
|
</TabTitle>
|
|
160
|
-
</h1>
|
|
161
|
-
<div class="api-key-title mb-20">
|
|
162
|
-
{{ t('accountAndKeys.title') }}
|
|
163
|
-
</div>
|
|
159
|
+
</h1>
|
|
164
160
|
|
|
165
|
-
|
|
161
|
+
<h2 v-t="'accountAndKeys.account.title'" />
|
|
166
162
|
<div class="account">
|
|
167
|
-
<div class="account-title">
|
|
168
|
-
{{ t('accountAndKeys.account.title') }}
|
|
169
|
-
</div>
|
|
170
163
|
<Principal
|
|
171
164
|
:value="principal.id"
|
|
172
165
|
:use-muted="false"
|
|
173
166
|
:show-labels="true"
|
|
174
|
-
|
|
175
|
-
>
|
|
176
|
-
<template #edit>
|
|
177
|
-
<span
|
|
178
|
-
v-if="canChangePassword"
|
|
179
|
-
class="edit-pass-txt"
|
|
180
|
-
@click="$refs.promptChangePassword.show(true)"
|
|
181
|
-
>修改
|
|
182
|
-
</span>
|
|
183
|
-
</template>
|
|
184
|
-
</Principal>
|
|
185
|
-
<!-- <div>
|
|
167
|
+
/>
|
|
168
|
+
<div>
|
|
186
169
|
<button
|
|
187
170
|
v-if="canChangePassword"
|
|
188
171
|
role="button"
|
|
@@ -190,25 +173,17 @@ export default {
|
|
|
190
173
|
type="button"
|
|
191
174
|
class="btn role-primary"
|
|
192
175
|
data-testid="account_change_password"
|
|
193
|
-
@click="
|
|
176
|
+
@click="showChangePasswordDialog"
|
|
194
177
|
>
|
|
195
178
|
{{ t("accountAndKeys.account.change") }}
|
|
196
179
|
</button>
|
|
197
|
-
</div>
|
|
180
|
+
</div>
|
|
198
181
|
</div>
|
|
199
|
-
<PromptChangePassword ref="promptChangePassword" />
|
|
200
182
|
|
|
201
|
-
|
|
202
|
-
<div
|
|
203
|
-
style=" border: 1px solid #d7d7d7;padding: 20px 20px 0px 20px;"
|
|
204
|
-
class="mt-20">
|
|
183
|
+
<hr role="none">
|
|
205
184
|
<div class="keys-header">
|
|
206
185
|
<div>
|
|
207
|
-
|
|
208
|
-
<div
|
|
209
|
-
v-t="'accountAndKeys.apiKeys.title'"
|
|
210
|
-
class="account-title mb-20"
|
|
211
|
-
/>
|
|
186
|
+
<h2 v-t="'accountAndKeys.apiKeys.title'" />
|
|
212
187
|
<div class="api-url">
|
|
213
188
|
<span>{{ t("accountAndKeys.apiKeys.apiEndpoint") }}</span>
|
|
214
189
|
<CopyToClipboardText
|
|
@@ -217,10 +192,20 @@ export default {
|
|
|
217
192
|
/>
|
|
218
193
|
</div>
|
|
219
194
|
</div>
|
|
195
|
+
<button
|
|
196
|
+
v-if="apiKeySchema"
|
|
197
|
+
role="button"
|
|
198
|
+
:aria-label="t('accountAndKeys.apiKeys.add.label')"
|
|
199
|
+
class="btn role-primary add mb-20"
|
|
200
|
+
data-testid="account_create_api_keys"
|
|
201
|
+
@click="addKey"
|
|
202
|
+
>
|
|
203
|
+
{{ t('accountAndKeys.apiKeys.add.label') }}
|
|
204
|
+
</button>
|
|
220
205
|
</div>
|
|
221
206
|
<div
|
|
222
207
|
v-if="apiKeySchema"
|
|
223
|
-
class="keys
|
|
208
|
+
class="keys"
|
|
224
209
|
>
|
|
225
210
|
<ResourceTable
|
|
226
211
|
:schema="apiKeySchema"
|
|
@@ -231,20 +216,7 @@ export default {
|
|
|
231
216
|
:search="true"
|
|
232
217
|
:row-actions="true"
|
|
233
218
|
:table-actions="true"
|
|
234
|
-
|
|
235
|
-
<template #header-right>
|
|
236
|
-
<button
|
|
237
|
-
v-if="apiKeySchema"
|
|
238
|
-
role="button"
|
|
239
|
-
:aria-label="t('accountAndKeys.apiKeys.add.label')"
|
|
240
|
-
class="btn role-primary add mb-20"
|
|
241
|
-
data-testid="account_create_api_keys"
|
|
242
|
-
@click="addKey"
|
|
243
|
-
>
|
|
244
|
-
{{ t('accountAndKeys.apiKeys.add.label') }}
|
|
245
|
-
</button>
|
|
246
|
-
</template>
|
|
247
|
-
</ResourceTable>
|
|
219
|
+
/>
|
|
248
220
|
</div>
|
|
249
221
|
<div v-else>
|
|
250
222
|
<Banner
|
|
@@ -253,7 +225,6 @@ export default {
|
|
|
253
225
|
/>
|
|
254
226
|
</div>
|
|
255
227
|
</div>
|
|
256
|
-
</div>
|
|
257
228
|
</template>
|
|
258
229
|
|
|
259
230
|
<style lang='scss' scoped>
|
|
@@ -262,12 +233,8 @@ export default {
|
|
|
262
233
|
}
|
|
263
234
|
|
|
264
235
|
.account {
|
|
265
|
-
|
|
266
|
-
justify-content: space-between
|
|
267
|
-
border: 1px solid #D7D7D7;
|
|
268
|
-
padding: 20px;
|
|
269
|
-
box-sizing: border-box;
|
|
270
|
-
|
|
236
|
+
display: flex;
|
|
237
|
+
justify-content: space-between
|
|
271
238
|
}
|
|
272
239
|
|
|
273
240
|
.keys-header {
|
|
@@ -280,10 +247,8 @@ export default {
|
|
|
280
247
|
.keys {
|
|
281
248
|
display: flex;
|
|
282
249
|
flex-direction: column;
|
|
283
|
-
margin-top: 20px;
|
|
284
250
|
.add {
|
|
285
251
|
align-self: flex-end;
|
|
286
|
-
margin-left: 10px
|
|
287
252
|
}
|
|
288
253
|
}
|
|
289
254
|
|
|
@@ -294,23 +259,4 @@ export default {
|
|
|
294
259
|
margin-right: 6px;
|
|
295
260
|
}
|
|
296
261
|
}
|
|
297
|
-
.api-key-title{
|
|
298
|
-
font-size: 26px;
|
|
299
|
-
/* line-height: 20px; */
|
|
300
|
-
font-weight: 400;
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
.edit-pass-txt{
|
|
304
|
-
cursor: pointer;
|
|
305
|
-
color: var(--primary);
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
.table-account{
|
|
309
|
-
border: 1px solid #d7d7d7;
|
|
310
|
-
}
|
|
311
|
-
.account-title{
|
|
312
|
-
font-size: 14px;
|
|
313
|
-
line-height: 19px;
|
|
314
|
-
margin-bottom: 16px;
|
|
315
|
-
}
|
|
316
262
|
</style>
|
|
@@ -162,7 +162,7 @@ export default {
|
|
|
162
162
|
</h1>
|
|
163
163
|
<div style="margin: 20px 0;">支持管理员创建与管理不同角色,每个角色可预设特定权限集合,可简化用户权限分配流程,提升权限管理的灵活性与安全性。</div>
|
|
164
164
|
</div>
|
|
165
|
-
<div class="actions-container actions-container-box">
|
|
165
|
+
<!-- <div class="actions-container actions-container-box">
|
|
166
166
|
<div class="actions">
|
|
167
167
|
<router-link
|
|
168
168
|
v-if="canCreate"
|
|
@@ -172,7 +172,7 @@ export default {
|
|
|
172
172
|
{{ createLabel }}
|
|
173
173
|
</router-link>
|
|
174
174
|
</div>
|
|
175
|
-
</div>
|
|
175
|
+
</div> -->
|
|
176
176
|
</header>
|
|
177
177
|
<Tabbed>
|
|
178
178
|
<Tab
|
|
@@ -184,7 +184,18 @@ export default {
|
|
|
184
184
|
<ResourceTable
|
|
185
185
|
:schema="tabs[GLOBAL].schema"
|
|
186
186
|
:rows="globalResources"
|
|
187
|
-
|
|
187
|
+
>
|
|
188
|
+
<template #header-right>
|
|
189
|
+
<router-link
|
|
190
|
+
v-if="canCreate"
|
|
191
|
+
:to="createLocation"
|
|
192
|
+
style="margin-right: 10px;"
|
|
193
|
+
class="btn role-primary"
|
|
194
|
+
>
|
|
195
|
+
{{ createLabel }}
|
|
196
|
+
</router-link>
|
|
197
|
+
</template>
|
|
198
|
+
</ResourceTable>
|
|
188
199
|
</Tab>
|
|
189
200
|
|
|
190
201
|
<Tab
|
|
@@ -197,7 +208,18 @@ export default {
|
|
|
197
208
|
:schema="tabs[CLUSTER].schema"
|
|
198
209
|
:headers="tabs[CLUSTER].headers"
|
|
199
210
|
:rows="clusterResources"
|
|
200
|
-
|
|
211
|
+
>
|
|
212
|
+
<template #header-right>
|
|
213
|
+
<router-link
|
|
214
|
+
v-if="canCreate"
|
|
215
|
+
:to="createLocation"
|
|
216
|
+
style="margin-right: 10px;"
|
|
217
|
+
class="btn role-primary"
|
|
218
|
+
>
|
|
219
|
+
{{ createLabel }}
|
|
220
|
+
</router-link>
|
|
221
|
+
</template>
|
|
222
|
+
</ResourceTable>
|
|
201
223
|
</Tab>
|
|
202
224
|
|
|
203
225
|
<Tab
|
|
@@ -210,7 +232,18 @@ export default {
|
|
|
210
232
|
:schema="tabs[PROJECT].schema"
|
|
211
233
|
:headers="tabs[PROJECT].headers"
|
|
212
234
|
:rows="namespaceResources"
|
|
213
|
-
|
|
235
|
+
>
|
|
236
|
+
<template #header-right>
|
|
237
|
+
<router-link
|
|
238
|
+
v-if="canCreate"
|
|
239
|
+
:to="createLocation"
|
|
240
|
+
style="margin-right: 10px;"
|
|
241
|
+
class="btn role-primary"
|
|
242
|
+
>
|
|
243
|
+
{{ createLabel }}
|
|
244
|
+
</router-link>
|
|
245
|
+
</template>
|
|
246
|
+
</ResourceTable>
|
|
214
247
|
</Tab>
|
|
215
248
|
</Tabbed>
|
|
216
249
|
</div>
|
|
@@ -913,42 +913,42 @@ export default class Resource {
|
|
|
913
913
|
{
|
|
914
914
|
action: this.canUpdate ? 'goToEdit' : 'goToViewConfig',
|
|
915
915
|
label: this.t(this.canUpdate ? 'action.edit' : 'action.view'),
|
|
916
|
-
icon: 'icon icon-edit',
|
|
916
|
+
// icon: 'icon icon-edit',
|
|
917
917
|
enabled: this.canCustomEdit,
|
|
918
918
|
},
|
|
919
|
-
{
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
},
|
|
919
|
+
// {
|
|
920
|
+
// action: this.canEditYaml ? 'goToEditYaml' : 'goToViewYaml',
|
|
921
|
+
// label: this.t(this.canEditYaml ? 'action.editYaml' : 'action.viewYaml'),
|
|
922
|
+
// icon: 'icon icon-file',
|
|
923
|
+
// enabled: this.canYaml,
|
|
924
|
+
// },
|
|
925
925
|
{
|
|
926
926
|
action: (this.canCustomEdit ? 'goToClone' : 'cloneYaml'),
|
|
927
927
|
label: this.t('action.clone'),
|
|
928
|
-
icon: 'icon icon-copy',
|
|
929
|
-
enabled: this.canClone && this.canCreate && (this.canCustomEdit || this.canYaml),
|
|
930
|
-
},
|
|
931
|
-
{ divider: true },
|
|
932
|
-
{
|
|
933
|
-
action: 'download',
|
|
934
|
-
label: this.t('action.download'),
|
|
935
|
-
icon: 'icon icon-download',
|
|
936
|
-
bulkable: true,
|
|
937
|
-
bulkAction: 'downloadBulk',
|
|
938
|
-
enabled: this.canYaml,
|
|
939
|
-
weight: -9,
|
|
940
|
-
},
|
|
941
|
-
{
|
|
942
|
-
action: 'viewInApi',
|
|
943
|
-
label: this.t('action.viewInApi'),
|
|
944
|
-
icon: 'icon icon-external-link',
|
|
945
|
-
enabled: this.canViewInApi,
|
|
928
|
+
// icon: 'icon icon-copy',
|
|
929
|
+
enabled: this.canClone && this.canCreate && (this.canCustomEdit || this.canYaml)&& this.schema.id!=='event',
|
|
946
930
|
},
|
|
931
|
+
// { divider: true },
|
|
932
|
+
// {
|
|
933
|
+
// action: 'download',
|
|
934
|
+
// label: this.t('action.download'),
|
|
935
|
+
// icon: 'icon icon-download',
|
|
936
|
+
// bulkable: true,
|
|
937
|
+
// bulkAction: 'downloadBulk',
|
|
938
|
+
// enabled: this.canYaml,
|
|
939
|
+
// weight: -9,
|
|
940
|
+
// },
|
|
941
|
+
// {
|
|
942
|
+
// action: 'viewInApi',
|
|
943
|
+
// label: this.t('action.viewInApi'),
|
|
944
|
+
// icon: 'icon icon-external-link',
|
|
945
|
+
// enabled: this.canViewInApi,
|
|
946
|
+
// },
|
|
947
947
|
{
|
|
948
948
|
action: 'promptRemove',
|
|
949
949
|
altAction: 'remove',
|
|
950
950
|
label: this.t('action.remove'),
|
|
951
|
-
icon: 'icon icon-trash',
|
|
951
|
+
// icon: 'icon icon-trash',
|
|
952
952
|
bulkable: true,
|
|
953
953
|
enabled: this.canDelete,
|
|
954
954
|
bulkAction: 'promptRemove',
|
|
@@ -1322,7 +1322,8 @@ export default class Resource {
|
|
|
1322
1322
|
}
|
|
1323
1323
|
|
|
1324
1324
|
get detailLocation() {
|
|
1325
|
-
|
|
1325
|
+
let location = this._detailLocation;
|
|
1326
|
+
return location;
|
|
1326
1327
|
}
|
|
1327
1328
|
|
|
1328
1329
|
goToDetail() {
|
package/scripts/publish-shell.sh
CHANGED
package/store/type-map.js
CHANGED
|
@@ -515,7 +515,7 @@ export const getters = {
|
|
|
515
515
|
|
|
516
516
|
groupsForVirTypes(state) {
|
|
517
517
|
return (product, name) => {
|
|
518
|
-
return state
|
|
518
|
+
return state?.virtualTypes?.[product]?.find(item => item.name === name)?.icon;
|
|
519
519
|
};
|
|
520
520
|
},
|
|
521
521
|
|
package/types/shell/index.d.ts
CHANGED
|
@@ -3053,37 +3053,24 @@ export default class Resource {
|
|
|
3053
3053
|
divider: boolean;
|
|
3054
3054
|
action?: undefined;
|
|
3055
3055
|
label?: undefined;
|
|
3056
|
-
icon?: undefined;
|
|
3057
3056
|
enabled?: undefined;
|
|
3057
|
+
altAction?: undefined;
|
|
3058
3058
|
bulkable?: undefined;
|
|
3059
3059
|
bulkAction?: undefined;
|
|
3060
3060
|
weight?: undefined;
|
|
3061
|
-
altAction?: undefined;
|
|
3062
3061
|
} | {
|
|
3063
3062
|
action: string;
|
|
3064
3063
|
label: any;
|
|
3065
|
-
icon: string;
|
|
3066
3064
|
enabled: any;
|
|
3067
3065
|
divider?: undefined;
|
|
3066
|
+
altAction?: undefined;
|
|
3068
3067
|
bulkable?: undefined;
|
|
3069
3068
|
bulkAction?: undefined;
|
|
3070
3069
|
weight?: undefined;
|
|
3071
|
-
altAction?: undefined;
|
|
3072
|
-
} | {
|
|
3073
|
-
action: string;
|
|
3074
|
-
label: any;
|
|
3075
|
-
icon: string;
|
|
3076
|
-
bulkable: boolean;
|
|
3077
|
-
bulkAction: string;
|
|
3078
|
-
enabled: boolean;
|
|
3079
|
-
weight: number;
|
|
3080
|
-
divider?: undefined;
|
|
3081
|
-
altAction?: undefined;
|
|
3082
3070
|
} | {
|
|
3083
3071
|
action: string;
|
|
3084
3072
|
altAction: string;
|
|
3085
3073
|
label: any;
|
|
3086
|
-
icon: string;
|
|
3087
3074
|
bulkable: boolean;
|
|
3088
3075
|
enabled: any;
|
|
3089
3076
|
bulkAction: string;
|
|
@@ -3095,37 +3082,24 @@ export default class Resource {
|
|
|
3095
3082
|
divider: boolean;
|
|
3096
3083
|
action?: undefined;
|
|
3097
3084
|
label?: undefined;
|
|
3098
|
-
icon?: undefined;
|
|
3099
3085
|
enabled?: undefined;
|
|
3086
|
+
altAction?: undefined;
|
|
3100
3087
|
bulkable?: undefined;
|
|
3101
3088
|
bulkAction?: undefined;
|
|
3102
3089
|
weight?: undefined;
|
|
3103
|
-
altAction?: undefined;
|
|
3104
3090
|
} | {
|
|
3105
3091
|
action: string;
|
|
3106
3092
|
label: any;
|
|
3107
|
-
icon: string;
|
|
3108
3093
|
enabled: any;
|
|
3109
3094
|
divider?: undefined;
|
|
3095
|
+
altAction?: undefined;
|
|
3110
3096
|
bulkable?: undefined;
|
|
3111
3097
|
bulkAction?: undefined;
|
|
3112
3098
|
weight?: undefined;
|
|
3113
|
-
altAction?: undefined;
|
|
3114
|
-
} | {
|
|
3115
|
-
action: string;
|
|
3116
|
-
label: any;
|
|
3117
|
-
icon: string;
|
|
3118
|
-
bulkable: boolean;
|
|
3119
|
-
bulkAction: string;
|
|
3120
|
-
enabled: boolean;
|
|
3121
|
-
weight: number;
|
|
3122
|
-
divider?: undefined;
|
|
3123
|
-
altAction?: undefined;
|
|
3124
3099
|
} | {
|
|
3125
3100
|
action: string;
|
|
3126
3101
|
altAction: string;
|
|
3127
3102
|
label: any;
|
|
3128
|
-
icon: string;
|
|
3129
3103
|
bulkable: boolean;
|
|
3130
3104
|
enabled: any;
|
|
3131
3105
|
bulkAction: string;
|
package/utils/error.js
CHANGED
|
@@ -199,9 +199,11 @@ export function translateError(error) {
|
|
|
199
199
|
|
|
200
200
|
if (matches) {
|
|
201
201
|
if (matches.length == 1) {
|
|
202
|
+
console.log('00045', error);
|
|
202
203
|
error = error.replace(regex, translation.replacement);
|
|
203
204
|
} else {
|
|
204
|
-
error = translation.
|
|
205
|
+
error = error.replace(regex, (...args) => translation.replacement.replace(/\$([1-9]\d*)/g, (_, idx) => args[Number(idx)] || ''))
|
|
206
|
+
console.log('00046', error);
|
|
205
207
|
}
|
|
206
208
|
}
|
|
207
209
|
}
|
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"translations": [
|
|
3
|
+
{
|
|
4
|
+
"pattern": "subnet ([^\\s]+) cidr ([^\\s]+) is invalid, due to invalid cidr address: ([^\\s]+)",
|
|
5
|
+
"replacement": "子网 '$1' 的 CIDR 地址 '$2' 无效:不是合法的 CIDR 格式",
|
|
6
|
+
"flags": "gi"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"pattern": "validation failed in api: vpc.kubeovn.io \"([^\"]*)\" is invalid: metadata\\.name: invalid value: \"([^\"]*)\": a lowercase rfc 1123 subdomain must consist of lower case alphanumeric characters, '-' or '\\.', and must start and end with an alphanumeric character \\(e\\.g\\..*?\\)",
|
|
10
|
+
"replacement": "API 校验失败:VPC 名称 \"$1\" 不符合 RFC 1123 子域名规则,只能使用小写字母、数字、'-' 或 '.',且必须以字母/数字开头和结尾",
|
|
11
|
+
"flags": "gi"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"pattern": "validation 失败 in api",
|
|
15
|
+
"replacement": "API 校验失败",
|
|
16
|
+
"flags": "gi"
|
|
17
|
+
},
|
|
3
18
|
{
|
|
4
19
|
"pattern": "can't connect to backup target[\\s\\S]*no route to host",
|
|
5
20
|
"replacement": "无法连接到备份目标:网络不可达,请检查备份服务器地址与路由",
|