dashboard-shell-shell 3.0.5-test.1 → 3.0.5-test.10

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.
Files changed (50) hide show
  1. package/assets/styles/base/_variables.scss +3 -3
  2. package/assets/styles/global/_button.scss +7 -7
  3. package/assets/styles/global/_tooltip.scss +4 -4
  4. package/assets/styles/themes/_light.scss +3 -1
  5. package/assets/translations/zh-hans.yaml +76 -0
  6. package/components/ActionDropdown.vue +1 -1
  7. package/components/CopyToClipboard.vue +15 -0
  8. package/components/Drawer/Chrome.vue +2 -2
  9. package/components/Drawer/ResourceDetailDrawer/ConfigTab.vue +22 -22
  10. package/components/Drawer/ResourceDetailDrawer/YamlTab.vue +1 -1
  11. package/components/Drawer/ResourceDetailDrawer/index.vue +2 -1
  12. package/components/ExplorerMembers.vue +18 -3
  13. package/components/PodSecurityAdmission.vue +1 -1
  14. package/components/Resource/Detail/Metadata/IdentifyingInformation/index.vue +1 -3
  15. package/components/Resource/Detail/Metadata/KeyValue.vue +8 -4
  16. package/components/Resource/Detail/Metadata/index.vue +3 -1
  17. package/components/Resource/Detail/TitleBar/Title.vue +4 -3
  18. package/components/Resource/Detail/TitleBar/Top.vue +2 -0
  19. package/components/Resource/Detail/TitleBar/index.vue +109 -24
  20. package/components/ResourceDetail/Masthead/legacy.vue +235 -164
  21. package/components/ResourceDetail/legacy.vue +29 -13
  22. package/components/ResourceList/Masthead.vue +22 -14
  23. package/components/SortableTable/index.vue +2 -2
  24. package/components/Tabbed/Tab.vue +1 -1
  25. package/components/Tabbed/index.vue +51 -32
  26. package/components/auth/Principal.vue +35 -11
  27. package/components/breadcrumb/index.vue +316 -0
  28. package/components/form/LabeledSelect.vue +3 -2
  29. package/components/form/NameNsDescription.vue +5 -5
  30. package/components/form/Taints.vue +2 -1
  31. package/components/form/WorkloadPorts.vue +143 -123
  32. package/components/nav/Header.vue +3 -4
  33. package/components/nav/NamespaceFilter.vue +1 -2
  34. package/edit/workload/index.vue +3 -3
  35. package/package.json +1 -1
  36. package/pages/account/index.vue +25 -79
  37. package/pages/c/_cluster/auth/roles/index.vue +38 -5
  38. package/pkg/tsconfig.json +9 -9
  39. package/pkg/vue.config.js +2 -2
  40. package/plugins/dashboard-store/resource-class.js +28 -27
  41. package/rancher-components/BadgeState/BadgeState.vue +33 -52
  42. package/rancher-components/Banner/Banner.vue +2 -2
  43. package/rancher-components/RcDropdown/RcDropdownMenu.vue +8 -7
  44. package/scripts/publish-shell.sh +1 -1
  45. package/store/i18n.js +3 -0
  46. package/store/type-map.js +1 -1
  47. package/types/shell/index.d.ts +4 -30
  48. package/utils/error.js +3 -1
  49. package/utils/errorTranslate.json +15 -0
  50. package/vue.config.js +5 -5
package/pkg/tsconfig.json CHANGED
@@ -27,25 +27,25 @@
27
27
  ],
28
28
  "paths": {
29
29
  "@shell/core/*": [
30
- "../../node_modules/@rancher/shell/core/*"
30
+ "../../node_modules/dashboard-shell-shell/core/*"
31
31
  ],
32
32
  "@shell/config/*": [
33
- "../../node_modules/@rancher/shell/config/*"
33
+ "../../node_modules/dashboard-shell-shell/config/*"
34
34
  ],
35
35
  "@shell/store/*": [
36
- "../../node_modules/@rancher/shell/store/*"
36
+ "../../node_modules/dashboard-shell-shell/store/*"
37
37
  ],
38
38
  "@shell/plugins/*": [
39
- "../../node_modules/@rancher/shell/plugins/*"
39
+ "../../node_modules/dashboard-shell-shell/plugins/*"
40
40
  ],
41
41
  "@shell/utils/*": [
42
- "../../node_modules/@rancher/shell/utils/*"
42
+ "../../node_modules/dashboard-shell-shell/utils/*"
43
43
  ],
44
44
  "@shell/models/*": [
45
- "../../node_modules/@rancher/shell/models/*"
45
+ "../../node_modules/dashboard-shell-shell/models/*"
46
46
  ],
47
47
  "@shell/mixins/*": [
48
- "../../node_modules/@rancher/shell/mixins/*"
48
+ "../../node_modules/dashboard-shell-shell/mixins/*"
49
49
  ],
50
50
  "@pkg/*": [
51
51
  "./*"
@@ -56,8 +56,8 @@
56
56
  "**/*.ts",
57
57
  "**/*.tsx",
58
58
  "**/*.vue",
59
- "../../node_modules/@rancher/shell/types/*.d.ts",
60
- "../../node_modules/@rancher/shell/core/types.ts"
59
+ "../../node_modules/dashboard-shell-shell/types/*.d.ts",
60
+ "../../node_modules/dashboard-shell-shell/core/types.ts"
61
61
  ],
62
62
  "exclude": [
63
63
  "node_modules"
package/pkg/vue.config.js CHANGED
@@ -73,7 +73,7 @@ module.exports = function(dir) {
73
73
  });
74
74
 
75
75
  // Auto-generate module to import the types (model, detail, edit etc)
76
- const autoImportPlugin = new VirtualModulesPlugin({ 'node_modules/@rancher/auto-import': generateTypeImport('@pkg', dir) });
76
+ const autoImportPlugin = new VirtualModulesPlugin({ 'node_modules/dashboard-shell-shell/auto-import': generateTypeImport('@pkg', dir) });
77
77
 
78
78
  config.plugins.unshift(dynamicImporterOverride);
79
79
  config.plugins.unshift(modelLoaderImporterOverride);
@@ -117,7 +117,7 @@ module.exports = function(dir) {
117
117
  if (p.use) {
118
118
  p.use.forEach((u) => {
119
119
  if (u.loader.includes('babel-loader')) {
120
- p.exclude = /node_modules\/(?!@rancher\/shell\/).*/;
120
+ p.exclude = /node_modules\/(?!dashboard-shell-shell\/).*/;
121
121
  }
122
122
  });
123
123
  }
@@ -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
- 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
- },
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
- return this._detailLocation;
1325
+ let location = this._detailLocation;
1326
+ return location;
1326
1327
  }
1327
1328
 
1328
1329
  goToDetail() {
@@ -63,60 +63,41 @@ export default defineComponent({
63
63
  </script>
64
64
 
65
65
  <template>
66
- <span :class="['badge-state', bg]">
67
- <i
68
- v-if="icon"
69
- class="icon"
70
- :class="{[icon]: true, 'mr-5': !!msg}"
71
- />{{ msg }}
72
- </span>
66
+ <div style="display: flex;flex-direction: row;align-items: center;font-size: 12px;">
67
+ <div :class="{ [bg]: true }"></div>
68
+ <span style="margin-left: 5px;">{{ msg }}</span>
69
+
70
+ </div>
73
71
  </template>
74
-
75
72
  <style lang="scss" scoped>
76
- .badge-state {
77
- align-items: center;
78
- display: inline-flex;
79
- padding: 2px 10px;
80
- border: 1px solid transparent;
81
- border-radius: 20px;
82
-
83
- &.bg-info {
84
- border-color: var(--info);
85
- }
86
-
87
- &.bg-error {
88
- border-color: var(--error);
89
- }
90
-
91
- &.bg-warning {
92
- border-color: var(--warning);
93
- }
94
-
95
- // Successful states are de-emphasized by using [text-]color instead of background-color
96
- &.bg-success {
97
- color: var(--success);
98
- background: transparent;
99
- border-color: var(--success);
100
- }
101
-
102
- // Added badge-disabled instead of bg-disabled since bg-disabled is used in other places with !important styling, an investigation is needed to make the naming consistent
103
- &.badge-disabled {
104
- color: var(--badge-state-disabled-text);
105
- background-color: var( --badge-state-disabled-bg);
106
- border: 1px solid var(--badge-state-disabled-border);
107
- }
73
+ .bg-error {
74
+ width: 10px; /* 圆点的宽度 */
75
+ height: 10px; /* 圆点的高度 */
76
+ background-color: #DD0C17; /* 圆点的颜色 */
77
+ border-radius: 50%; /* 设置为圆形 */
108
78
  }
109
- </style>
110
- <style lang="scss">
111
- // TODO: #6005
112
- // Investigate why this is here.. I don't think that styles for sortable table should belong here
113
- .sortable-table TD .badge-state {
114
- @include clip;
115
- display: inline-block;
116
- max-width: 100%;
117
- position: relative;
118
- max-width: 110px;
119
- font-size: .85em;
120
- vertical-align: middle;
79
+ .bg-darker {
80
+ width: 10px; /* 圆点的宽度 */
81
+ height: 10px; /* 圆点的高度 */
82
+ background-color: #DD0C17; /* 圆点的颜色 */
83
+ border-radius: 50%; /* 设置为圆形 */
84
+ }
85
+ .bg-success {
86
+ width: 10px; /* 圆点的宽度 */
87
+ height: 10px; /* 圆点的高度 */
88
+ background-color: #95F204 !important; /* 圆点的颜色 */
89
+ border-radius: 50%; /* 设置为圆形 */
90
+ }
91
+ .bg-warning {
92
+ width: 10px; /* 圆点的宽度 */
93
+ height: 10px; /* 圆点的高度 */
94
+ background-color: #DAC342; /* 圆点的颜色 */
95
+ border-radius: 50%; /* 设置为圆形 */
96
+ }
97
+ .bg-info {
98
+ width: 10px; /* 圆点的宽度 */
99
+ height: 10px; /* 圆点的高度 */
100
+ background-color: #1890FF; /* 圆点的颜色 */
101
+ border-radius: 50%; /* 设置为圆形 */
121
102
  }
122
103
  </style>
@@ -227,8 +227,8 @@ $icon-size: 24px;
227
227
  }
228
228
 
229
229
  .info & {
230
- background: var(--info-banner-bg);
231
- // background: #f2f2f2;
230
+ // background: var(--info-banner-bg);
231
+ background: #f2f2f2;
232
232
  border-color: var(--info);
233
233
  }
234
234
 
@@ -33,10 +33,10 @@ const hasOptions = (options: DropdownOption[]) => {
33
33
  :data-testid="dataTestid"
34
34
  :aria-label="buttonAriaLabel"
35
35
  >
36
- <div v-if="showIcon">
37
- <i class="icon icon-actions" />
38
- </div>
39
- <a v-else href="javascript:;">操作</a>
36
+ <div v-if="showIcon">
37
+ <i data-v-5db2c2c7="" class="icon icon-actions" alt="More actions icon"></i>
38
+ </div>
39
+ <a v-else href="javascript:;">操作</a>
40
40
  </rc-dropdown-trigger>
41
41
  <template #dropdownCollection>
42
42
  <template
@@ -58,15 +58,16 @@ const hasOptions = (options: DropdownOption[]) => {
58
58
  </template> -->
59
59
  {{ a.label }}
60
60
  </rc-dropdown-item>
61
- <rc-dropdown-separator
61
+ <!-- <rc-dropdown-separator
62
62
  v-else
63
- />
63
+ /> -->
64
64
  </template>
65
65
  <rc-dropdown-item
66
66
  v-if="!hasOptions(options)"
67
67
  disabled
68
68
  >
69
- 暂无可执行的操作。
69
+ <!-- No actions available -->
70
+ 暂无可执行的操作。
70
71
  </rc-dropdown-item>
71
72
  </template>
72
73
  </rc-dropdown>
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
3
  # 执行命令示例:
4
- # TAG=shell-pkg-v3.0.2-rc.105 ./shell/scripts/publish-shell.sh
4
+ # TAG=shell-pkg-v3.0.5-test.8 ./shell/scripts/publish-shell.sh
5
5
 
6
6
  set -euo pipefail
7
7
 
package/store/i18n.js CHANGED
@@ -231,6 +231,9 @@ export const actions = {
231
231
  if ( !selected || !exists) {
232
232
  selected = 'zh-hans';
233
233
  }
234
+
235
+ // selected = 'none'
236
+ selected = 'zh-hans'
234
237
 
235
238
  return dispatch('switchTo', selected);
236
239
  },
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.virtualTypes?.[product].find(item => item.name === name)?.icon;
518
+ return state?.virtualTypes?.[product]?.find(item => item.name === name)?.icon;
519
519
  };
520
520
  },
521
521
 
@@ -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.pattern.replace(/\$(.+)/g, (_, index) => matches[parseInt(index)]);
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": "无法连接到备份目标:网络不可达,请检查备份服务器地址与路由",
package/vue.config.js CHANGED
@@ -157,7 +157,7 @@ const getLoaders = (SHELL_ABS) => [
157
157
  test: /\.m?[tj]sx?$/,
158
158
  // This excludes no modules except for node_modules/@rancher/... so that plugins can properly compile
159
159
  // when referencing @rancher/shell
160
- exclude: /node_modules\/(?!(@rancher)\/).*/,
160
+ exclude: /node_modules\/(?!(dashboard-shell-shell)\/).*/,
161
161
  use: [
162
162
  {
163
163
  loader: 'cache-loader',
@@ -332,14 +332,14 @@ const getVirtualModules = (dir, includePkg) => {
332
332
  reqs += `$plugin.loadAsync('${ i }', '/pkg/${ i }/${ librariesIndex[i] }');`;
333
333
  });
334
334
 
335
- return new VirtualModulesPlugin({ 'node_modules/@rancher/dynamic.js': `export default function ($plugin) { ${ reqs } };` });
335
+ return new VirtualModulesPlugin({ 'node_modules/dashboard-shell-shell/dynamic.js': `export default function ($plugin) { ${ reqs } };` });
336
336
  };
337
337
 
338
- const getAutoImport = () => new webpack.NormalModuleReplacementPlugin(/^@rancher\/auto-import$/, (resource) => {
338
+ const getAutoImport = () => new webpack.NormalModuleReplacementPlugin(/^dashboard-shell-shell\/auto-import$/, (resource) => {
339
339
  const ctx = resource.context.split('/');
340
340
  const pkg = ctx[ctx.length - 1];
341
341
 
342
- resource.request = `@rancher/auto-import/${ pkg }`;
342
+ resource.request = `dashboard-shell-shell/auto-import/${ pkg }`;
343
343
  });
344
344
 
345
345
  /**
@@ -356,7 +356,7 @@ const getVirtualModulesAutoImport = (dir) => {
356
356
  fs.readdirSync(pkgFolder)
357
357
  .filter((name) => !name.startsWith('.')) // Ignore hidden folders
358
358
  .forEach((name) => {
359
- autoImportTypes[`node_modules/@rancher/auto-import/${ name }`] = generateDynamicTypeImport(`@pkg/${ name }`, path.join(dir, `pkg/${ name }`));
359
+ autoImportTypes[`node_modules/dashboard-shell-shell/auto-import/${ name }`] = generateDynamicTypeImport(`@pkg/${ name }`, path.join(dir, `pkg/${ name }`));
360
360
  });
361
361
  }
362
362