dashboard-shell-shell 1.0.1000000118 → 1.0.10000011121

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.
@@ -388,17 +388,6 @@ export default {
388
388
  });
389
389
  }
390
390
 
391
- rows = rows.map((item) => {
392
- if (item.key.includes('harvester')) {
393
- item.key = item.key.replace('harvester', 'cloud');
394
- }
395
- if (item.value.includes('harvester')) {
396
- item.value = item.value.replace('harvester', 'cloud');
397
- }
398
-
399
- return item;
400
- });
401
-
402
391
  return rows;
403
392
  },
404
393
 
@@ -409,8 +398,6 @@ export default {
409
398
  [this.valueName]: value,
410
399
  };
411
400
 
412
- obj.key = obj.key.replace('harvester', 'cloud');
413
- obj.value = obj.value.replace('harvester', 'cloud');
414
401
  obj.binary = false;
415
402
  obj.canEncode = this.handleBase64;
416
403
  obj.supported = true;
@@ -484,8 +471,8 @@ export default {
484
471
  // let value = (row[valueName] || '');
485
472
  // const key = (row[keyName] || '').trim();
486
473
 
487
- const key = (row[keyName].replace('cloud', 'harvester') || '').trim();
488
- let value = (row[valueName].replace('cloud', 'harvester') || '').trim();
474
+ const key = (row[keyName] || '').trim();
475
+ let value = (row[valueName] || '').trim();
489
476
 
490
477
  if (value && typeOf(value) === 'object') {
491
478
  out[key] = JSON.parse(JSON.stringify(value));
@@ -289,7 +289,7 @@ export default {
289
289
  :data-testid="`input-match-type-field-${index}`"
290
290
  >
291
291
  <div v-if="isView">
292
- {{ row.matching.replace('harvester', 'cloud') }}
292
+ {{ row.matching }}
293
293
  <!-- {{ row.matching }} -->
294
294
  </div>
295
295
  <LabeledSelect
@@ -305,7 +305,7 @@ export default {
305
305
  :data-testid="`input-match-expression-key-${index}`"
306
306
  >
307
307
  <div v-if="isView" class="view-item-value">
308
- {{ row.key.replace('harvester', 'cloud') }}
308
+ {{ row.key }}
309
309
  </div>
310
310
  <input
311
311
  v-else-if="!hasKeySelectOptions"
@@ -252,7 +252,7 @@ export default {
252
252
  const options = namespaces
253
253
  .map((namespace) => ({ nameDisplay: namespace, id: namespace }))
254
254
  .map(props.namespaceMapper || ((obj) => ({
255
- label: obj.nameDisplay.replace('harvester', 'cloud'),
255
+ label: obj.nameDisplay,
256
256
  value: obj.id,
257
257
  })));
258
258
 
@@ -756,7 +756,7 @@ export default {
756
756
  :data-testid="`namespaces-value-${j}`"
757
757
  class="ns-value"
758
758
  >
759
- <div>{{ ns.label.replace('harvester', 'cloud') }}</div>
759
+ <div>{{ ns.label }}</div>
760
760
  <!-- block user from removing the last selection if ns forced filtering is on -->
761
761
  <i
762
762
  v-if="!namespaceFilterMode || value.length > 1"
@@ -867,7 +867,7 @@ export default {
867
867
  v-if="opt.kind === NAMESPACE_FILTER_KINDS.NAMESPACE"
868
868
  class="icon icon-folder"
869
869
  />
870
- <div>{{ opt.label.replace('harvester', 'cloud') }}</div>
870
+ <div>{{ opt.label }}</div>
871
871
  <i
872
872
  v-if="opt.selected"
873
873
  class="icon icon-checkmark"
@@ -64,14 +64,22 @@ export function installNavigationGuards(router, context) {
64
64
 
65
65
  // 🔹 最后执行:只改地址栏,不改内部
66
66
  router.afterEach((to) => {
67
+ const base = router.options.history?.base || ''; // 获取 router base,防止丢失
68
+ let cloudPath = to.fullPath.replace(/harvester/g, 'cloud');
67
69
 
68
- const cloudPath = to.fullPath
69
- .replace(/harvester/g, 'cloud')
70
+ // fullPath 可能已经不带 base,需要拼回去
71
+ if (!cloudPath.startsWith(base)) {
72
+ cloudPath = base + cloudPath;
73
+ }
74
+
75
+ // 获取当前地址栏完整 URL(path + search + hash)
76
+ const currentLocation = window.location.pathname + window.location.search + window.location.hash;
70
77
 
71
- if (cloudPath !== to.fullPath) {
78
+ // 只有在地址栏实际不同的时候才替换,避免死循环
79
+ if (cloudPath !== currentLocation) {
80
+ console.info('[URL Replace] Updating address bar:', currentLocation, '→', cloudPath);
72
81
  window.history.replaceState({}, '', cloudPath);
73
82
  }
74
-
75
83
  });
76
84
  }
77
85
 
@@ -162,7 +162,7 @@ export const NAMESPACE = {
162
162
  name: 'namespace',
163
163
  labelKey: 'tableHeaders.namespace',
164
164
  value: 'namespace',
165
- getValue: row => row && row.namespace && row.namespace.replace('harvester', 'cloud'),
165
+ getValue: row => row && row.namespace && row.namespace,
166
166
  sort: 'namespace',
167
167
  dashIfEmpty: true,
168
168
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dashboard-shell-shell",
3
- "version": "1.0.1000000118",
3
+ "version": "1.0.10000011121",
4
4
  "description": "Rancher Dashboard Shell",
5
5
  "repository": "https://github.com/rancherlabs/dashboard",
6
6
  "license": "Apache-2.0",
@@ -4162,7 +4162,7 @@ export function setPromiseResult(promise: any, obj: any, key: any, label: any):
4162
4162
 
4163
4163
  declare module '@shell/utils/router' {
4164
4164
  export function harvesterhci2cloud(str: any): any;
4165
- export function str: any: any;
4165
+ export function cloud2harvesterhci(str: any): any;
4166
4166
  export function harvester2cloud(str: any): any;
4167
4167
  export function cloud2harvester(str: any): any;
4168
4168
  export function queryParamsFor(current: any, qp: any, defaults?: {}): any;