dashboard-shell-shell 3.0.5-test.9 → 3.0.5-tsh.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 (213) hide show
  1. package/assets/brand/csp/favicon.png +0 -0
  2. package/assets/icons/iconfont.css +4 -1
  3. package/assets/iconsNew/demo.css +539 -0
  4. package/assets/iconsNew/demo.css:Zone.Identifier +0 -0
  5. package/assets/iconsNew/demo_index.html +303 -0
  6. package/assets/iconsNew/demo_index.html:Zone.Identifier +0 -0
  7. package/assets/iconsNew/iconfont.css +43 -0
  8. package/assets/iconsNew/iconfont.css:Zone.Identifier +0 -0
  9. package/assets/iconsNew/iconfont.js +1 -0
  10. package/assets/iconsNew/iconfont.js:Zone.Identifier +0 -0
  11. package/assets/iconsNew/iconfont.json +44 -0
  12. package/assets/iconsNew/iconfont.json:Zone.Identifier +0 -0
  13. package/assets/iconsNew/iconfont.ttf +0 -0
  14. package/assets/iconsNew/iconfont.ttf:Zone.Identifier +0 -0
  15. package/assets/iconsNew/iconfont.woff +0 -0
  16. package/assets/iconsNew/iconfont.woff2 +0 -0
  17. package/assets/iconsNew/iconfont.woff2:Zone.Identifier +0 -0
  18. package/assets/iconsNew/iconfont.woff:Zone.Identifier +0 -0
  19. package/assets/images/login-logo.svg +37 -12
  20. package/assets/images/logo.svg +47 -0
  21. package/assets/images/pl/dark/logo.png +0 -0
  22. package/assets/styles/all.scss +23 -3
  23. package/assets/styles/app.scss +1 -0
  24. package/assets/styles/base/_helpers.scss +1 -1
  25. package/assets/styles/base/_variables.scss +2 -2
  26. package/assets/styles/fonts/_icons.scss +3 -2
  27. package/assets/styles/global/_button.scss +1 -1
  28. package/assets/styles/global/_form.scss +1 -0
  29. package/assets/styles/global/_select.scss +1 -1
  30. package/assets/styles/global/_tooltip.scss +5 -1
  31. package/assets/styles/themes/_light.scss +3 -3
  32. package/assets/styles/vendor/vue-select.scss +2 -1
  33. package/assets/translations/en-us.yaml +64 -0
  34. package/assets/translations/zh-hans.yaml +221 -22
  35. package/components/ButtonDropdown.vue +3 -1
  36. package/components/ClusterIconMenu.vue +1 -1
  37. package/components/CodeMirror.vue +6 -4
  38. package/components/ConsumptionGauge.vue +1 -1
  39. package/components/ContainerResourceLimit.vue +2 -2
  40. package/components/CruResource.vue +3 -2
  41. package/components/Drawer/ResourceDetailDrawer/ConfigTab.vue +22 -19
  42. package/components/Drawer/ResourceDetailDrawer/index.vue +3 -3
  43. package/components/ExplorerMembers.vue +10 -1
  44. package/components/GlobalRoleBindings.vue +69 -114
  45. package/components/PodSecurityAdmission.vue +1 -1
  46. package/components/PromptRemove.vue +23 -1
  47. package/components/RelatedResources.vue +3 -0
  48. package/components/Resource/Detail/TitleBar/composables.ts +16 -1
  49. package/components/Resource/Detail/TitleBar/index.vue +37 -24
  50. package/components/ResourceDetail/Masthead/index.vue +1 -1
  51. package/components/ResourceDetail/Masthead/latest.vue +1 -1
  52. package/components/ResourceDetail/Masthead/legacy.vue +8 -7
  53. package/components/ResourceDetail/legacy.vue +15 -15
  54. package/components/ResourceList/Masthead.vue +11 -15
  55. package/components/ResourceTable.vue +16 -0
  56. package/components/SideNav.vue +21 -21
  57. package/components/SingleClusterInfo.vue +2 -1
  58. package/components/SortableTable/THead.vue +46 -1
  59. package/components/SortableTable/index.vue +54 -18
  60. package/components/Tabbed/index.vue +6 -1
  61. package/components/auth/Principal.vue +16 -8
  62. package/components/auth/RoleDetailEdit.vue +11 -7
  63. package/components/breadcrumb/index.vue +13 -210
  64. package/components/form/ArrayList.vue +164 -147
  65. package/components/form/ArrayListGrouped.vue +5 -3
  66. package/components/form/ChangePassword.vue +1 -1
  67. package/components/form/ClusterAppearance.vue +4 -3
  68. package/components/form/Command.vue +4 -5
  69. package/components/form/Conditions.vue +15 -1
  70. package/components/form/Footer.vue +1 -0
  71. package/components/form/HealthCheck.vue +0 -2
  72. package/components/form/HookOption.vue +87 -58
  73. package/components/form/InputWithSelect.vue +8 -7
  74. package/components/form/KeyValue.vue +20 -2
  75. package/components/form/LabeledSelect.vue +3 -1
  76. package/components/form/Labels.vue +2 -2
  77. package/components/form/MatchExpressions.vue +4 -4
  78. package/components/form/Members/ClusterMembershipEditor.vue +1 -1
  79. package/components/form/Members/ClusterPermissionsEditor.vue +60 -41
  80. package/components/form/Members/MembershipEditor.vue +4 -4
  81. package/components/form/Members/ProjectMembershipEditor.vue +1 -1
  82. package/components/form/NameNsDescription.vue +17 -1
  83. package/components/form/Networking.vue +6 -9
  84. package/components/form/NodeAffinity.vue +29 -28
  85. package/components/form/PodAffinity.vue +23 -23
  86. package/components/form/Probe.vue +15 -11
  87. package/components/form/ProjectMemberEditor.vue +66 -48
  88. package/components/form/ResourceQuota/Namespace.vue +4 -4
  89. package/components/form/ResourceQuota/NamespaceRow.vue +11 -9
  90. package/components/form/ResourceQuota/Project.vue +4 -4
  91. package/components/form/ResourceQuota/ProjectRow.vue +36 -30
  92. package/components/form/ResourceSelector.vue +1 -1
  93. package/components/form/SecretSelector.vue +24 -23
  94. package/components/form/Security.vue +1 -3
  95. package/components/form/Select.vue +7 -1
  96. package/components/form/ServiceNameSelect.vue +2 -5
  97. package/components/form/ServicePorts.vue +149 -75
  98. package/components/form/Tolerations.vue +13 -9
  99. package/components/form/ValueFromResource.vue +110 -96
  100. package/components/formatter/WorkloadHealthScale.vue +4 -3
  101. package/components/nav/Group.vue +8 -1
  102. package/components/nav/Header.vue +51 -174
  103. package/components/nav/NamespaceFilter.vue +14 -19
  104. package/components/nav/TopLevelMenu.vue +99 -125
  105. package/components/nav/Type.vue +11 -3
  106. package/config/menuRouteMap.js +10 -0
  107. package/config/private-label.js +2 -3
  108. package/config/product/explorer.js +32 -10
  109. package/config/product/manager.js +28 -17
  110. package/config/product/uiplugins.js +13 -10
  111. package/config/router/navigation-guards/index.js +61 -3
  112. package/detail/node.vue +28 -23
  113. package/dialog/AddCustomBadgeDialog.vue +17 -9
  114. package/dialog/RollbackWorkloadDialog.vue +1 -1
  115. package/edit/autoscaling.horizontalpodautoscaler/external-metric.vue +1 -1
  116. package/edit/autoscaling.horizontalpodautoscaler/hpa-scaling-rule.vue +9 -6
  117. package/edit/autoscaling.horizontalpodautoscaler/index.vue +3 -1
  118. package/edit/autoscaling.horizontalpodautoscaler/metric-identifier.vue +2 -2
  119. package/edit/autoscaling.horizontalpodautoscaler/metric-object-reference.vue +7 -5
  120. package/edit/autoscaling.horizontalpodautoscaler/metric-target.vue +5 -3
  121. package/edit/autoscaling.horizontalpodautoscaler/metrics-row.vue +2 -2
  122. package/edit/autoscaling.horizontalpodautoscaler/object-metric.vue +2 -2
  123. package/edit/autoscaling.horizontalpodautoscaler/pod-metric.vue +1 -1
  124. package/edit/autoscaling.horizontalpodautoscaler/resource-metric.vue +2 -2
  125. package/edit/configmap.vue +4 -0
  126. package/edit/logging-flow/index.vue +1 -2
  127. package/edit/logging.banzaicloud.io.output/providers/awsElasticsearch.vue +3 -3
  128. package/edit/logging.banzaicloud.io.output/providers/azurestorage.vue +19 -19
  129. package/edit/logging.banzaicloud.io.output/providers/cloudwatch.vue +23 -23
  130. package/edit/logging.banzaicloud.io.output/providers/datadog.vue +19 -19
  131. package/edit/logging.banzaicloud.io.output/providers/elasticsearch.vue +14 -14
  132. package/edit/logging.banzaicloud.io.output/providers/forward.vue +12 -12
  133. package/edit/logging.banzaicloud.io.output/providers/gcs.vue +23 -23
  134. package/edit/logging.banzaicloud.io.output/providers/gelf.vue +6 -6
  135. package/edit/logging.banzaicloud.io.output/providers/kafka.vue +10 -10
  136. package/edit/logging.banzaicloud.io.output/providers/kinesisStream.vue +8 -8
  137. package/edit/logging.banzaicloud.io.output/providers/logdna.vue +17 -17
  138. package/edit/logging.banzaicloud.io.output/providers/logz.vue +7 -7
  139. package/edit/logging.banzaicloud.io.output/providers/loki.vue +12 -12
  140. package/edit/logging.banzaicloud.io.output/providers/newrelic.vue +3 -3
  141. package/edit/logging.banzaicloud.io.output/providers/opensearch.vue +14 -14
  142. package/edit/logging.banzaicloud.io.output/providers/redis.vue +6 -6
  143. package/edit/logging.banzaicloud.io.output/providers/s3.vue +23 -23
  144. package/edit/logging.banzaicloud.io.output/providers/splunkHec.vue +13 -13
  145. package/edit/logging.banzaicloud.io.output/providers/sumologic.vue +2 -2
  146. package/edit/logging.banzaicloud.io.output/providers/syslog.vue +54 -54
  147. package/edit/monitoring.coreos.com.alertmanagerconfig/receiverConfig.vue +32 -8
  148. package/edit/monitoring.coreos.com.alertmanagerconfig/types/dingding.vue +32 -0
  149. package/edit/monitoring.coreos.com.alertmanagerconfig/types/message.vue +52 -0
  150. package/edit/monitoring.coreos.com.alertmanagerconfig/types/snmp.vue +45 -0
  151. package/edit/monitoring.coreos.com.alertmanagerconfig/types/work.vue +31 -0
  152. package/edit/networking.k8s.io.ingress/Certificate.vue +14 -5
  153. package/edit/networking.k8s.io.ingress/DefaultBackend.vue +2 -2
  154. package/edit/networking.k8s.io.ingress/Rule.vue +5 -11
  155. package/edit/networking.k8s.io.ingress/RulePath.vue +105 -96
  156. package/edit/networking.k8s.io.networkpolicy/PolicyRule.vue +3 -3
  157. package/edit/networking.k8s.io.networkpolicy/PolicyRulePort.vue +4 -2
  158. package/edit/networking.k8s.io.networkpolicy/PolicyRuleTarget.vue +12 -11
  159. package/edit/networking.k8s.io.networkpolicy/index.vue +1 -1
  160. package/edit/persistentvolume/index.vue +3 -1
  161. package/edit/persistentvolumeclaim.vue +2 -0
  162. package/edit/provisioning.cattle.io.cluster/tabs/Basics.vue +1 -1
  163. package/edit/secret/index.vue +2 -2
  164. package/edit/service.vue +4 -1
  165. package/edit/storage.k8s.io.storageclass/index.vue +10 -8
  166. package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/aws-ebs.vue +34 -27
  167. package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/gce-pd.vue +15 -13
  168. package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/vsphere-volume.vue +41 -39
  169. package/edit/workload/Job.vue +31 -34
  170. package/edit/workload/Upgrading.vue +5 -5
  171. package/edit/workload/index.vue +19 -15
  172. package/edit/workload/storage/Mount.vue +1 -0
  173. package/edit/workload/storage/awsElasticBlockStore.vue +9 -7
  174. package/edit/workload/storage/azureDisk.vue +14 -10
  175. package/edit/workload/storage/azureFile.vue +9 -7
  176. package/edit/workload/storage/csi/index.vue +6 -9
  177. package/edit/workload/storage/emptyDir.vue +7 -5
  178. package/edit/workload/storage/gcePersistentDisk.vue +9 -7
  179. package/edit/workload/storage/hostPath.vue +7 -5
  180. package/edit/workload/storage/nfs.vue +8 -6
  181. package/edit/workload/storage/persistentVolumeClaim/index.vue +12 -10
  182. package/edit/workload/storage/persistentVolumeClaim/persistentvolumeclaim.vue +20 -15
  183. package/edit/workload/storage/secret.vue +9 -6
  184. package/edit/workload/storage/vsphereVolume.vue +11 -7
  185. package/initialize/app-extended.js +7 -1
  186. package/list/management.cattle.io.podsecurityadmissionconfigurationtemplate.vue +8 -6
  187. package/mixins/create-edit-view/impl.js +10 -0
  188. package/models/provisioning.cattle.io.cluster.js +19 -18
  189. package/models/workload.js +2 -2
  190. package/package.json +1 -1
  191. package/pages/account/index.vue +93 -58
  192. package/pages/auth/login.vue +24 -27
  193. package/pages/auth/setup.vue +36 -17
  194. package/pages/c/_cluster/auth/roles/index.vue +27 -3
  195. package/pages/c/_cluster/explorer/ConfigBadge.vue +1 -1
  196. package/pages/c/_cluster/explorer/index.vue +2 -1
  197. package/pages/c/_cluster/explorer/tools/index.vue +6 -6
  198. package/pages/home.vue +55 -13
  199. package/plugins/dashboard-store/actions.js +1 -1
  200. package/public/index.html +1 -1
  201. package/rancher-components/Banner/Banner.vue +14 -2
  202. package/rancher-components/Form/Radio/RadioGroup.vue +9 -1
  203. package/rancher-components/LabeledTooltip/LabeledTooltip.vue +31 -2
  204. package/scripts/build-pkg.sh +18 -23
  205. package/scripts/publish-shell.sh +1 -1
  206. package/store/i18n.js +1 -0
  207. package/store/type-map.js +0 -2
  208. package/types/shell/index.d.ts +8 -0
  209. package/utils/error.js +23 -3
  210. package/utils/errorTranslate.json +397 -8
  211. package/utils/errorTranslateNew.json +39 -0
  212. package/utils/roleFiltering.js +33 -0
  213. package/utils/title.ts +1 -1
package/pages/home.vue CHANGED
@@ -485,32 +485,24 @@ export default defineComponent({
485
485
  >
486
486
 
487
487
  <!-- 页签标题组件,不显示子页面标题和面包屑 -->
488
- <TabTitle
489
- v-if="topLevelPermissionsVis"
490
- :show-child="false"
491
- :breadcrumb="false"
492
- >
493
-
494
- <!-- 页面标题:{vendor} - 首页 -->
495
- {{ `${vendor} - ${t('landing.homepage')}` }}
496
- </TabTitle>
497
488
 
498
489
  <!-- 首页欢迎横幅 -->
499
- <BannerGraphic
490
+ <!-- <BannerGraphic
500
491
  v-if="topLevelPermissionsVis"
501
492
  :small="true"
502
493
  :title="t('landing.welcomeToRancher', {vendor})"
503
494
  :pref="HIDE_HOME_PAGE_CARDS"
504
495
  pref-key="welcomeBanner"
505
496
  data-testid="home-banner-graphic"
506
- />
497
+ /> -->
507
498
  <IndentedPanel class="mt-20 mb-20">
508
499
 
509
500
  <!-- 主面板布局 -->
510
501
  <div class="row home-panels">
511
502
  <div class="col main-panel">
512
503
  <h2 class="mb-20">
513
- {{ t('landing.clusters.title') }}
504
+ <!-- {{ t('landing.clusters.title') }} -->
505
+ 首页
514
506
  </h2>
515
507
 
516
508
  <!-- 集群列表面板 -->
@@ -548,7 +540,7 @@ export default defineComponent({
548
540
  v-if="canCreateCluster || !!provClusterSchema"
549
541
  #header-right
550
542
  >
551
- <div v-if="topLevelPermissionsVis" class="table-heading">
543
+ <div class="table-heading">
552
544
  <router-link
553
545
  v-if="!!provClusterSchema"
554
546
  :to="manageLocation"
@@ -669,6 +661,14 @@ export default defineComponent({
669
661
  </button>
670
662
  </template>
671
663
  </PaginatedResourceTable>
664
+ <div v-else class="home-prompt">
665
+ <div style="text-align: center;position: relative;">
666
+ <div class="left-border"></div>
667
+ <!-- <div class="right-border"></div> -->
668
+ <div class="home-prompt-title">欢 迎 登 录</div>
669
+ <div class="home-prompt-subtitle">企业级容器编排与管理解决方案,提供强大的Kubernetes集群管理、应用部署和服务治理能力。</div>
670
+ </div>
671
+ </div>
672
672
  </div>
673
673
 
674
674
  <!-- 单集群模式 -->
@@ -688,6 +688,48 @@ export default defineComponent({
688
688
  </template>
689
689
 
690
690
  <style lang='scss' scoped>
691
+ .home-prompt {
692
+ width: 100%;
693
+ height: 500px;
694
+ display: flex;
695
+ align-items: center;
696
+ justify-content: center;
697
+ .left-border,
698
+ .right-border {
699
+ position: absolute;
700
+ height: 1px;
701
+ width: 120px;
702
+ background: linear-gradient(90deg, transparent, #00a8ff, transparent);
703
+ bottom: 0px;
704
+ }
705
+ .left-border {
706
+ left: calc(50% - 60px);
707
+ }
708
+ .right-border {
709
+ right: 0;
710
+ }
711
+ .home-prompt-title {
712
+ font-size: 32px;
713
+ color: #1a1a1a;
714
+ font-weight: 700;
715
+ letter-spacing: -0.5px;
716
+ margin-bottom: 15px;
717
+ background: linear-gradient(135deg, #00a8ff, #0050b3);
718
+ -webkit-background-clip: text;
719
+ -webkit-text-fill-color: transparent;
720
+ background-clip: text;
721
+ display: inline-block;
722
+ }
723
+
724
+ .home-prompt-subtitle {
725
+ font-size: 18px;
726
+ color: #666666;
727
+ margin-bottom: 20px;
728
+ max-width: 800px;
729
+ margin-left: auto;
730
+ margin-right: auto;
731
+ }
732
+ }
691
733
  .banner-link:focus-visible {
692
734
  @include focus-outline;
693
735
  }
@@ -55,7 +55,7 @@ export async function loadSchemas(ctx, watch = true) {
55
55
  }
56
56
 
57
57
  res.data.forEach(addSchemaIndexFields);
58
-
58
+
59
59
  commit('loadAll', {
60
60
  ctx,
61
61
  type: SCHEMA,
package/public/index.html CHANGED
@@ -6,7 +6,7 @@
6
6
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
7
7
  <meta name="viewport" content="width=device-width,initial-scale=1.0">
8
8
  <link rel="shortcut icon" type="image/x-icon" href="/favicon.png">
9
- <title>HCI</title>
9
+ <title>云翼云管平台</title>
10
10
  </head>
11
11
 
12
12
  <body>
@@ -78,7 +78,16 @@ export default defineComponent({
78
78
  * Return message text as label.
79
79
  */
80
80
  messageLabel(): string | void {
81
- return !(typeof this.label === 'string') ? stringify(this.label) : undefined;
81
+
82
+ let labelStr = this.label
83
+
84
+ if (labelStr === 'waiting for api to be available') {
85
+ labelStr = '等待api可用'
86
+ } else if (labelStr === 'Cluster agent is not connected') {
87
+ labelStr = '集群agent未连接'
88
+ }
89
+
90
+ return !(typeof labelStr === 'string') ? stringify(labelStr) : undefined;
82
91
  },
83
92
  },
84
93
  methods: { nlToBr }
@@ -164,6 +173,7 @@ $icon-size: 24px;
164
173
  margin: 0px 0px 20px 0px;
165
174
  position: relative;
166
175
  width: 100%;
176
+ min-height: 32px;
167
177
  color: var(--body-text);
168
178
 
169
179
  &__icon {
@@ -201,13 +211,15 @@ $icon-size: 24px;
201
211
  }
202
212
 
203
213
  &__content {
204
- padding: 9px 10px;
214
+ padding: 2px 10px;
205
215
  transition: all 0.2s ease;
206
216
  line-height: 12px;
207
217
  width: 100%;
208
218
  border-left: solid $left-border-size transparent;
209
219
  display: flex;
210
220
  gap: 3px;
221
+ min-height: 32px;
222
+ align-items: center;
211
223
  word-wrap:break-word;
212
224
  word-break:break-all;
213
225
 
@@ -102,6 +102,11 @@ export default defineComponent({
102
102
  row: {
103
103
  type: Boolean,
104
104
  default: false
105
+ },
106
+
107
+ flexDirection: {
108
+ type: String,
109
+ default: 'row'
105
110
  }
106
111
  },
107
112
 
@@ -274,7 +279,7 @@ export default defineComponent({
274
279
  :aria-describedby="radioGroupAriaDescribedBy"
275
280
  :aria-activedescendant="ariaActiveDescendant"
276
281
  class="radio-group"
277
- :class="{'row':row}"
282
+ :class="{'row':row, 'flexDirection': flexDirection === 'column'}"
278
283
  :tabindex="isDisabled ? -1 : 0"
279
284
  :aria-disabled="isDisabled"
280
285
  @keydown.down.prevent.stop="clickNext(1)"
@@ -312,6 +317,9 @@ export default defineComponent({
312
317
  </template>
313
318
 
314
319
  <style lang='scss'>
320
+ .flexDirection {
321
+ flex-direction: column;
322
+ }
315
323
  .radio-group {
316
324
  &:focus, &:focus-visible {
317
325
  border: none;
@@ -123,8 +123,8 @@ export default defineComponent({
123
123
  &.null {
124
124
 
125
125
  .status-icon {
126
- top: 5px;
127
- right: -20px;
126
+ top: 8px !important;
127
+ right: 25px !important;
128
128
  }
129
129
  }
130
130
 
@@ -146,6 +146,35 @@ export default defineComponent({
146
146
  }
147
147
  }
148
148
 
149
+ .labeled-select{
150
+ .labeled-tooltip{
151
+ &.null {
152
+ .status-icon {
153
+ top: 10px !important;
154
+ right: 25px !important;
155
+ }
156
+ }
157
+
158
+ &.error {
159
+
160
+ .status-icon {
161
+ top: 9px !important;
162
+ right: 20px;
163
+ }
164
+ }
165
+ }
166
+ }
167
+ .labeled-input{
168
+ .labeled-tooltip{
169
+ &.null {
170
+ .status-icon {
171
+ top: 10px !important;
172
+ right: 10px !important;
173
+ }
174
+ }
175
+ }
176
+ }
177
+
149
178
  // Ensure code blocks inside tootips don't look awful
150
179
  .v-popper__popper.v-popper--theme-tooltip {
151
180
  .v-popper__inner {
@@ -2,7 +2,6 @@
2
2
 
3
3
  SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
4
4
  BASE_DIR="$( cd $SCRIPT_DIR && cd ../.. & pwd)"
5
- SHELL_DIR=$BASE_DIR/shell/
6
5
  EXIT_CODE=0
7
6
  FORMATS="umd-min"
8
7
 
@@ -19,12 +18,18 @@ done
19
18
 
20
19
  shift $((OPTIND-1))
21
20
 
22
- # Use shell folder in node modules when we have @rancher/shell installed as a node module
23
- # rather than the use-case of the mono-repo with the shell folder at the top-level
24
- if [ ! -d ${SHELL_DIR} ]; then
25
- SHELL_DIR=$BASE_DIR/node_modules/@rancher/shell/
26
- SHELL_DIR=$(cd -P ${SHELL_DIR} && pwd)
21
+ # ---- 修改这里 ----
22
+ # 优先使用顶级 shell 文件夹,如果不存在则使用 node_modules/dashboard-shell-shell
23
+ SHELL_DIR=$BASE_DIR/shell/
24
+ if [ ! -d "${SHELL_DIR}" ]; then
25
+ SHELL_DIR=$BASE_DIR/node_modules/dashboard-shell-shell/
26
+ if [ ! -d "${SHELL_DIR}" ]; then
27
+ echo "Error: dashboard-shell-shell not found in node_modules"
28
+ exit 1
29
+ fi
27
30
  fi
31
+ # 转为绝对路径,防止符号链接循环
32
+ SHELL_DIR=$(cd -P "${SHELL_DIR}" && pwd)
28
33
 
29
34
  CREATE_TARBALL=${2}
30
35
 
@@ -46,18 +51,14 @@ if [ -d "${BASE_DIR}/pkg/${1}" ]; then
46
51
 
47
52
  pushd pkg/${1}
48
53
 
49
- # Check that the .shell link exists and points to the correct place
50
- if [ -e ".shell" ]; then
51
- LINK=$(readlink .shell)
52
- if [ "${LINK}" != "${SHELL_DIR}" ]; then
53
- echo ".shell symlink exists but does not point to expected location - please check and fix"
54
- popd
55
- exit -1
56
- fi
57
- else
58
- ln -s ${SHELL_DIR} .shell
54
+ # 删除旧的 .shell,防止循环
55
+ if [ -L ".shell" ] || [ -e ".shell" ]; then
56
+ rm -rf .shell
59
57
  fi
60
58
 
59
+ # 创建新的符号链接
60
+ ln -s "${SHELL_DIR}" .shell
61
+
61
62
  FILE=index.js
62
63
  if [ -f ./index.ts ]; then
63
64
  FILE=index.ts
@@ -72,7 +73,7 @@ if [ -d "${BASE_DIR}/pkg/${1}" ]; then
72
73
  cp -f ./package.json ${PKG_DIST}/package.json
73
74
  node ${SCRIPT_DIR}/pkgfile.js ${PKG_DIST}/package.json
74
75
  rm -rf ${PKG_DIST}/*.bak
75
- rm .shell
76
+ rm -rf .shell
76
77
 
77
78
  popd
78
79
  fi
@@ -81,22 +82,16 @@ if [ $EXIT_CODE -ne 0 ]; then
81
82
  exit $EXIT_CODE
82
83
  fi
83
84
 
84
-
85
85
  if [ -n "${CREATE_TARBALL}" ]; then
86
86
  echo $COMMIT $COMMIT_BRANCH > ${PKG_DIST}/version-commit.txt
87
87
 
88
88
  TARBALL=${NAME}.tar.gz
89
89
 
90
90
  pushd ${PKG_DIST}
91
-
92
91
  rm -f ../$TARBALL
93
-
94
92
  echo "Compressing to ${TARBALL}..."
95
-
96
93
  tar -czf ../${TARBALL} .
97
-
98
94
  popd
99
-
100
95
  fi
101
96
 
102
97
  exit $EXIT_CODE
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
3
  # 执行命令示例:
4
- # TAG=shell-pkg-v3.0.5-test.8 ./shell/scripts/publish-shell.sh
4
+ # TAG=shell-pkg-v3.0.5-test.56 ./shell/scripts/publish-shell.sh
5
5
 
6
6
  set -euo pipefail
7
7
 
package/store/i18n.js CHANGED
@@ -108,6 +108,7 @@ export const getters = {
108
108
  ...args
109
109
  };
110
110
 
111
+ moreArgs['count'] = moreArgs['count'] !== undefined ? moreArgs['count'] : 1
111
112
  return formatter.format(moreArgs);
112
113
  } else {
113
114
  return '?';
package/store/type-map.js CHANGED
@@ -823,9 +823,7 @@ export const getters = {
823
823
  }
824
824
 
825
825
  if ( icon ) {
826
- console.log(icon)
827
826
  label = `<i class="icon icon-fw icon-${ icon }"></i>${ label }`;
828
- console.log(label)
829
827
  }
830
828
 
831
829
  return label;
@@ -4354,6 +4354,14 @@ export function deferred(name: any): {
4354
4354
  export function setPromiseResult(promise: any, obj: any, key: any, label: any): void;
4355
4355
  }
4356
4356
 
4357
+ // @shell/utils/roleFiltering
4358
+
4359
+ declare module '@shell/utils/roleFiltering' {
4360
+ export function globalRoleFilteringfn(ary: any): any;
4361
+ export function clusterRoleFilteringfn(ary: any): any;
4362
+ export function projectRoleFilteringfn(ary: any): any;
4363
+ }
4364
+
4357
4365
  // @shell/utils/router
4358
4366
 
4359
4367
  declare module '@shell/utils/router' {
package/utils/error.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { isArray } from '@shell/utils/array';
2
2
 
3
3
  import translations from './errorTranslate.json';
4
+ import errorTranslateNew from './errorTranslateNew.json';
4
5
 
5
6
  export class ClusterNotFoundError extends Error {
6
7
  static NAME = 'ClusterNotFoundError'
@@ -49,6 +50,7 @@ export class ApiError extends Error {
49
50
  }
50
51
 
51
52
  export function stringify(err) {
53
+
52
54
  let str;
53
55
  if ( typeof err === 'string' ) {
54
56
  str = err;
@@ -146,8 +148,25 @@ export function translateError(error) {
146
148
  }).replace('internal error occurred: ', "");
147
149
  console.log('00044', error);
148
150
 
151
+ // 1. 资源配额错误(最高优先级)
152
+ if (originError.includes('exceeded quota')) {
153
+ return '资源配额超限:请求的资源超过了命名空间的配额限制';
154
+ }
155
+
156
+ // 2. 权限不足错误
157
+ const permissionDeniedPatterns = [
158
+ /"\S+" is forbidden:.*cannot.*(patch|update|create|delete|get|list|watch).*resource/i,
159
+ /is forbidden:.*user.*cannot.*(patch|update|create|delete|get|list|watch)/i
160
+ ];
161
+
162
+ if (permissionDeniedPatterns.some(pattern => pattern.test(originError))) {
163
+ return "权限不足";
164
+ }
165
+
149
166
 
150
- if (error.includes('spec and status of disks on node') && error.includes('are being syncing and please retry later')) {
167
+ if (error.includes("a lowercase rfc 1123 label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character")) {
168
+ error = "无效的名称不符合 RFC 1123 命名规则。名称只能包含小写字母、数字或 '-',并且必须以字母或数字开头和结尾(例如 'my-name' 或 '123-abc')。"
169
+ } else if (error.includes('spec and status of disks on node') && error.includes('are being syncing and please retry later')) {
151
170
  error = error.replace('spec and status of disks on node','').replace('are being syncing and please retry later','')
152
171
  error = '节点' + error + '上的硬盘规格和状态正在同步,请稍后重试'
153
172
  } else if (error.includes('same granularity as schedule') && error.includes('and offset less than')) {
@@ -174,7 +193,7 @@ export function translateError(error) {
174
193
 
175
194
  error = `子网 '${subnetName}' 配置无效:1) 名称禁止以数字开头;2) 排除IP[${idx}] 不能为空且必须是合法 IPv4/IPv6 地址或地址段`;
176
195
  }
177
-
196
+
178
197
  // error = error.replace(/admission webhook(.*?)denied the request:/g, (match, p1) => {
179
198
  // return '';
180
199
  // })
@@ -187,8 +206,9 @@ export function translateError(error) {
187
206
  error = error.substring(errorIndex + 4);
188
207
  }
189
208
 
209
+ const translationsList = [...errorTranslateNew.translations, ...translations.translations]
190
210
 
191
- for (const translation of translations.translations) {
211
+ for (const translation of translationsList) {
192
212
 
193
213
  // if (error.includes(translation.pattern)) {
194
214
  // error = error.replace(translation.pattern, translation.replacement);