dashboard-shell-shell 1.0.1000000083 → 1.0.1000000090
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/components/ExplorerProjectsNamespaces.vue +1 -0
- package/components/ResourceDetail/Masthead.vue +1 -1
- package/components/ResourceList/Masthead.vue +1 -21
- package/components/SideNav.vue +1 -1
- package/components/SortableTable/index.vue +2 -17
- package/components/rancherResourceDetail/Masthead.vue +1 -1
- package/components/rancherResourceList/Masthead-btn.vue +1 -1
- package/components/rancherResourceList/Masthead.vue +1 -1
- package/config/product/auth.js +1 -1
- package/config/router/navigation-guards/index.js +42 -5
- package/models/management.cattle.io.setting.js +1 -1
- package/package.json +1 -1
- package/pages/auth/login.vue +1 -1
- package/pages/auth copy/login.vue +1 -1
- package/pages/prefs.vue +1 -1
- package/plugins/dashboard-store/resource-class.js +2 -2
- package/store/type-map.js +0 -7
- package/types/cloud-shell/index.d.ts +0 -6
- package/types/shell/index.d.ts +2 -2
|
@@ -86,15 +86,12 @@ export default {
|
|
|
86
86
|
data() {
|
|
87
87
|
const params = { ...this.$route.params };
|
|
88
88
|
|
|
89
|
-
params.resource =
|
|
89
|
+
params.resource = params.resource
|
|
90
90
|
|
|
91
91
|
const formRoute = { name: `${ cloud2harvesterhci(this.$route.name) }-create`, params };
|
|
92
92
|
|
|
93
93
|
const hasEditComponent = this.$store.getters['type-map/hasCustomEdit'](this.resource);
|
|
94
94
|
|
|
95
|
-
console.log(hasEditComponent, ' hasEditComponent------------------------------------1');
|
|
96
|
-
|
|
97
|
-
|
|
98
95
|
const yamlRoute = {
|
|
99
96
|
name: `${ cloud2harvesterhci(this.$route.name) }-create`,
|
|
100
97
|
params,
|
|
@@ -189,23 +186,6 @@ export default {
|
|
|
189
186
|
_createButtonlabel() {
|
|
190
187
|
return this.createButtonLabel || this.t('resourceList.head.create');
|
|
191
188
|
},
|
|
192
|
-
|
|
193
|
-
canCreateCustom() {
|
|
194
|
-
return this.hasEditComponent && this._isCreatable;
|
|
195
|
-
},
|
|
196
|
-
},
|
|
197
|
-
|
|
198
|
-
watch: {
|
|
199
|
-
canCreateCustom: {
|
|
200
|
-
immediate: true,
|
|
201
|
-
handler(newVal) {
|
|
202
|
-
|
|
203
|
-
console.log(newVal, ' newVal---------------------------');
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
this.$store.commit('type-map/setMastheadCreatable', newVal);
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
189
|
}
|
|
210
190
|
};
|
|
211
191
|
</script>
|
package/components/SideNav.vue
CHANGED
|
@@ -418,28 +418,13 @@ export default {
|
|
|
418
418
|
let isCreatable = false;
|
|
419
419
|
const lastPath = cloud2harvesterhci(this.$route.path.split('/').pop());
|
|
420
420
|
|
|
421
|
-
if (lastPath
|
|
421
|
+
if (lastPath.includes('.')) {
|
|
422
422
|
isCreatable = this.$store.getters['type-map/optionsFor'](lastPath).isCreatable;
|
|
423
423
|
} else if (lastPath === 'namespace') {
|
|
424
424
|
isCreatable = this.$store.getters['type-map/optionsFor'](this.$route.name).isCreatable;
|
|
425
425
|
}
|
|
426
426
|
|
|
427
|
-
const resource = cloud2harvesterhci(this.$route.params.resource);
|
|
428
|
-
|
|
429
|
-
let hasEditComponent = false
|
|
430
|
-
|
|
431
|
-
if (lastPath?.includes('.')) {
|
|
432
|
-
hasEditComponent = this.$store.getters['type-map/hasCustomEdit'](lastPath);
|
|
433
|
-
} else if (lastPath === 'namespace') {
|
|
434
|
-
hasEditComponent = this.$store.getters['type-map/hasCustomEdit'](this.$route.name);
|
|
435
|
-
} else {
|
|
436
|
-
hasEditComponent = this.$store.getters['type-map/hasCustomEdit'](resource);
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
console.log(hasEditComponent, ' hasEditComponent------------------------------------2');
|
|
440
|
-
|
|
441
427
|
return {
|
|
442
|
-
hasEditComponent,
|
|
443
428
|
refreshButtonPhase: isLoading ? ASYNC_BUTTON_STATES.WAITING : ASYNC_BUTTON_STATES.ACTION,
|
|
444
429
|
expanded: {},
|
|
445
430
|
searchQuery,
|
|
@@ -1242,7 +1227,7 @@ export default {
|
|
|
1242
1227
|
<div
|
|
1243
1228
|
:class="{'titled': $slots.title && $slots.title.length, 'mb-40': isFilterLabel, 'mb-20': search || isCreatable}"
|
|
1244
1229
|
class="sortable-table-header "
|
|
1245
|
-
:style="{marginTop: search&& !isBanner ? marginTopValue + 'px' : '0px',marginLeft: isCreatable
|
|
1230
|
+
:style="{marginTop: search&& !isBanner ? marginTopValue + 'px' : '0px',marginLeft: isCreatable ? '100px' : '-10px',maxHeight: '32px'}"
|
|
1246
1231
|
>
|
|
1247
1232
|
<slot name="title" />
|
|
1248
1233
|
<div
|
|
@@ -70,7 +70,7 @@ export default {
|
|
|
70
70
|
data() {
|
|
71
71
|
const params = { ...this.$route.params };
|
|
72
72
|
|
|
73
|
-
params.resource =
|
|
73
|
+
params.resource = params.resource
|
|
74
74
|
|
|
75
75
|
const formRoute = { name: `${ cloud2harvesterhci(this.$route.name) }-create`, params };
|
|
76
76
|
|
|
@@ -91,7 +91,7 @@ export default {
|
|
|
91
91
|
data() {
|
|
92
92
|
const params = { ...this.$route.params };
|
|
93
93
|
|
|
94
|
-
params.resource =
|
|
94
|
+
params.resource = params.resource
|
|
95
95
|
|
|
96
96
|
const formRoute = { name: `${ cloud2harvesterhci(this.$route.name) }-create`, params };
|
|
97
97
|
|
package/config/product/auth.js
CHANGED
|
@@ -24,7 +24,7 @@ export function init(store) {
|
|
|
24
24
|
spoofedType,
|
|
25
25
|
virtualType,
|
|
26
26
|
} = DSL(store, NAME);
|
|
27
|
-
|
|
27
|
+
console.log('------------------------------------------------2')
|
|
28
28
|
product({
|
|
29
29
|
ifHaveType: new RegExp(`${ MANAGEMENT.USER }|${ MANAGEMENT.AUTH_CONFIG }`, 'i'),
|
|
30
30
|
ifHaveVerb: 'GET',
|
|
@@ -9,15 +9,52 @@ import { install as installClusters } from '@shell/config/router/navigation-guar
|
|
|
9
9
|
import { install as installHandleInstallRedirect } from '@shell/config/router/navigation-guards/install-redirect';
|
|
10
10
|
import { install as installPageTitle } from '@shell/config/router/navigation-guards/page-title';
|
|
11
11
|
import { install as installServerUpgradeGrowl } from '@shell/config/router/navigation-guards/server-upgrade-growl';
|
|
12
|
+
import { harvester2cloud } from '@shell/utils/router';
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
|
-
* Install
|
|
15
|
+
* Install router navigation guards
|
|
16
|
+
* 1. 保留原有导航守卫顺序
|
|
17
|
+
* 2. 不在 beforeEach 改 params,只在 push/replace & afterEach 改 URL
|
|
15
18
|
*/
|
|
16
19
|
export function installNavigationGuards(router, context) {
|
|
17
|
-
//
|
|
18
|
-
|
|
20
|
+
// 最早执行:保证进入逻辑时 params 始终是 harvester
|
|
21
|
+
router.beforeEach((to, from, next) => {
|
|
22
|
+
// 内部逻辑统一用 harvesterManager
|
|
23
|
+
if (to?.params?.product) {
|
|
24
|
+
to.params.product = to.params.product.replace(/cloud/g, 'harvester')
|
|
25
|
+
}
|
|
19
26
|
|
|
20
|
-
|
|
27
|
+
if (to?.params?.cluster) {
|
|
28
|
+
to.params.cluster = to.params.cluster.replace(/cloud/g, 'harvester')
|
|
29
|
+
}
|
|
21
30
|
|
|
22
|
-
|
|
31
|
+
next();
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
const navigationGuardInstallers = [
|
|
35
|
+
installLoadInitialSettings,
|
|
36
|
+
installAttemptFirstLogin,
|
|
37
|
+
installAuthentication,
|
|
38
|
+
installProducts,
|
|
39
|
+
installClusters,
|
|
40
|
+
installRuntimeExtensionRoute,
|
|
41
|
+
installI18N,
|
|
42
|
+
installHandleInstallRedirect,
|
|
43
|
+
installPageTitle,
|
|
44
|
+
installRecordLastRoute,
|
|
45
|
+
installServerUpgradeGrowl
|
|
46
|
+
];
|
|
47
|
+
|
|
48
|
+
navigationGuardInstallers.forEach(installer => installer(router, context));
|
|
49
|
+
|
|
50
|
+
// 🔹 最后执行:只改地址栏,不改内部
|
|
51
|
+
router.afterEach((to) => {
|
|
52
|
+
const cloudPath = to.fullPath
|
|
53
|
+
.replace(/harvester/g, 'cloud')
|
|
54
|
+
|
|
55
|
+
if (cloudPath !== to.fullPath) {
|
|
56
|
+
window.history.replaceState({}, '', cloudPath);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
23
59
|
}
|
|
60
|
+
|
|
@@ -55,7 +55,7 @@ export default class Setting extends HybridModel {
|
|
|
55
55
|
goToEdit(moreQuery = {}) {
|
|
56
56
|
if (this.$rootGetters['currentProduct'].inStore === HARVESTER) {
|
|
57
57
|
location.name = `${ HARVESTER }-c-cluster-brand`;
|
|
58
|
-
location.params = { cluster: this.$rootGetters['currentCluster'].id, product:
|
|
58
|
+
location.params = { cluster: this.$rootGetters['currentCluster'].id, product: HARVESTER };
|
|
59
59
|
|
|
60
60
|
location.query = {
|
|
61
61
|
...location.query,
|
package/package.json
CHANGED
package/pages/auth/login.vue
CHANGED
package/pages/prefs.vue
CHANGED
|
@@ -45,7 +45,7 @@ export default {
|
|
|
45
45
|
...mapGetters({ hasMultipleLocales: 'i18n/hasMultipleLocales' }),
|
|
46
46
|
|
|
47
47
|
isHarvester() {
|
|
48
|
-
return this.isSingleProduct?.productName ===
|
|
48
|
+
return this.isSingleProduct?.productName === HARVESTER;
|
|
49
49
|
},
|
|
50
50
|
|
|
51
51
|
theme: {
|
|
@@ -1270,7 +1270,7 @@ export default class Resource {
|
|
|
1270
1270
|
params: {
|
|
1271
1271
|
product: this.$rootGetters['productId'],
|
|
1272
1272
|
cluster: this.$rootGetters['clusterId'],
|
|
1273
|
-
resource:
|
|
1273
|
+
resource: this.type,
|
|
1274
1274
|
}
|
|
1275
1275
|
};
|
|
1276
1276
|
}
|
|
@@ -1285,7 +1285,7 @@ export default class Resource {
|
|
|
1285
1285
|
params: {
|
|
1286
1286
|
product: this.$rootGetters['productId'],
|
|
1287
1287
|
cluster: this.$rootGetters['clusterId'],
|
|
1288
|
-
resource:
|
|
1288
|
+
resource: this.type,
|
|
1289
1289
|
namespace: this.metadata?.namespace,
|
|
1290
1290
|
id,
|
|
1291
1291
|
}
|
package/store/type-map.js
CHANGED
|
@@ -432,13 +432,10 @@ export const state = function() {
|
|
|
432
432
|
'cloud-credential': {}
|
|
433
433
|
|
|
434
434
|
},
|
|
435
|
-
mastheadCreatable: true,
|
|
436
435
|
};
|
|
437
436
|
};
|
|
438
437
|
|
|
439
438
|
export const getters = {
|
|
440
|
-
mastheadCreatable: (state) => state.mastheadCreatable,
|
|
441
|
-
|
|
442
439
|
// ----------------------------------------------------------------------------
|
|
443
440
|
// 1 ) Getting info
|
|
444
441
|
// ----------------------------------------------------------------------------
|
|
@@ -1487,10 +1484,6 @@ export const getters = {
|
|
|
1487
1484
|
};
|
|
1488
1485
|
|
|
1489
1486
|
export const mutations = {
|
|
1490
|
-
setMastheadCreatable(state, value) {
|
|
1491
|
-
state.mastheadCreatable = value;
|
|
1492
|
-
},
|
|
1493
|
-
|
|
1494
1487
|
schemaChanged(state) {
|
|
1495
1488
|
state.schemaGeneration = state.schemaGeneration + 1;
|
|
1496
1489
|
},
|
|
@@ -3858,10 +3858,8 @@ export function state(): {
|
|
|
3858
3858
|
'machine-config': {};
|
|
3859
3859
|
'cloud-credential': {};
|
|
3860
3860
|
};
|
|
3861
|
-
mastheadCreatable: boolean;
|
|
3862
3861
|
};
|
|
3863
3862
|
export namespace getters {
|
|
3864
|
-
function mastheadCreatable(state: any): any;
|
|
3865
3863
|
function labelFor(state: any, getters: any, rootState: any, rootGetters: any): (schema: any, count?: number, language?: any) => any;
|
|
3866
3864
|
function groupLabelFor(state: any): (schemaOrName: any) => any;
|
|
3867
3865
|
function groupForBasicType(state: any): (product: any, schemaId: any) => any;
|
|
@@ -3924,7 +3922,6 @@ export namespace getters {
|
|
|
3924
3922
|
function productByName(state: any): (productName: any) => any;
|
|
3925
3923
|
}
|
|
3926
3924
|
export namespace mutations {
|
|
3927
|
-
function setMastheadCreatable(state: any, value: any): void;
|
|
3928
3925
|
function schemaChanged(state: any): void;
|
|
3929
3926
|
function remove(state: any, { product, plugin }: {
|
|
3930
3927
|
product: any;
|
|
@@ -9410,10 +9407,8 @@ export function state(): {
|
|
|
9410
9407
|
'machine-config': {};
|
|
9411
9408
|
'cloud-credential': {};
|
|
9412
9409
|
};
|
|
9413
|
-
mastheadCreatable: boolean;
|
|
9414
9410
|
};
|
|
9415
9411
|
export namespace getters {
|
|
9416
|
-
function mastheadCreatable(state: any): any;
|
|
9417
9412
|
function labelFor(state: any, getters: any, rootState: any, rootGetters: any): (schema: any, count?: number, language?: any) => any;
|
|
9418
9413
|
function groupLabelFor(state: any): (schemaOrName: any) => any;
|
|
9419
9414
|
function groupForBasicType(state: any): (product: any, schemaId: any) => any;
|
|
@@ -9476,7 +9471,6 @@ export namespace getters {
|
|
|
9476
9471
|
function productByName(state: any): (productName: any) => any;
|
|
9477
9472
|
}
|
|
9478
9473
|
export namespace mutations {
|
|
9479
|
-
function setMastheadCreatable(state: any, value: any): void;
|
|
9480
9474
|
function schemaChanged(state: any): void;
|
|
9481
9475
|
function remove(state: any, { product, plugin }: {
|
|
9482
9476
|
product: any;
|
package/types/shell/index.d.ts
CHANGED
|
@@ -4161,9 +4161,9 @@ export function setPromiseResult(promise: any, obj: any, key: any, label: any):
|
|
|
4161
4161
|
// @shell/utils/router
|
|
4162
4162
|
|
|
4163
4163
|
declare module '@shell/utils/router' {
|
|
4164
|
-
export function
|
|
4164
|
+
export function str: any: any;
|
|
4165
4165
|
export function cloud2harvesterhci(str: any): any;
|
|
4166
|
-
export function
|
|
4166
|
+
export function str: any: any;
|
|
4167
4167
|
export function cloud2harvester(str: any): any;
|
|
4168
4168
|
export function queryParamsFor(current: any, qp: any, defaults?: {}): any;
|
|
4169
4169
|
export function getClusterFromRoute(to: any): any;
|