dashboard-shell-shell 3.0.5-test.8 → 3.0.5-test.80
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/brand/csp/favicon.png +0 -0
- package/assets/icons/iconfont.css +4 -1
- package/assets/iconsNew/demo.css +539 -0
- package/assets/iconsNew/demo.css:Zone.Identifier +0 -0
- package/assets/iconsNew/demo_index.html +303 -0
- package/assets/iconsNew/demo_index.html:Zone.Identifier +0 -0
- package/assets/iconsNew/iconfont.css +43 -0
- package/assets/iconsNew/iconfont.css:Zone.Identifier +0 -0
- package/assets/iconsNew/iconfont.js +1 -0
- package/assets/iconsNew/iconfont.js:Zone.Identifier +0 -0
- package/assets/iconsNew/iconfont.json +44 -0
- package/assets/iconsNew/iconfont.json:Zone.Identifier +0 -0
- package/assets/iconsNew/iconfont.ttf +0 -0
- package/assets/iconsNew/iconfont.ttf:Zone.Identifier +0 -0
- package/assets/iconsNew/iconfont.woff +0 -0
- package/assets/iconsNew/iconfont.woff2 +0 -0
- package/assets/iconsNew/iconfont.woff2:Zone.Identifier +0 -0
- package/assets/iconsNew/iconfont.woff:Zone.Identifier +0 -0
- package/assets/images/login-logo.svg +110 -12
- package/assets/images/logo.svg +129 -0
- package/assets/images/pl/dark/logo.svg +129 -0
- package/assets/images/pl/logo.svg +129 -0
- package/assets/styles/all.scss +23 -3
- package/assets/styles/app.scss +1 -0
- package/assets/styles/base/_helpers.scss +1 -1
- package/assets/styles/base/_variables.scss +2 -2
- package/assets/styles/fonts/_icons.scss +3 -2
- package/assets/styles/global/_button.scss +1 -1
- package/assets/styles/global/_form.scss +1 -0
- package/assets/styles/global/_select.scss +1 -1
- package/assets/styles/global/_tooltip.scss +5 -1
- package/assets/styles/themes/_light.scss +3 -3
- package/assets/styles/vendor/vue-select.scss +2 -1
- package/assets/translations/en-us.yaml +67 -0
- package/assets/translations/zh-hans.yaml +226 -24
- package/components/ButtonDropdown.vue +3 -1
- package/components/ClusterIconMenu.vue +1 -1
- package/components/CodeMirror.vue +6 -4
- package/components/ConsumptionGauge.vue +1 -1
- package/components/ContainerResourceLimit.vue +2 -2
- package/components/CruResource.vue +3 -2
- package/components/Drawer/ResourceDetailDrawer/ConfigTab.vue +22 -19
- package/components/Drawer/ResourceDetailDrawer/index.vue +3 -3
- package/components/ExplorerMembers.vue +10 -1
- package/components/GlobalRoleBindings.vue +69 -114
- package/components/PodSecurityAdmission.vue +1 -1
- package/components/PromptRemove.vue +23 -1
- package/components/RelatedResources.vue +3 -0
- package/components/Resource/Detail/TitleBar/composables.ts +16 -1
- package/components/Resource/Detail/TitleBar/index.vue +37 -24
- package/components/ResourceDetail/Masthead/index.vue +1 -1
- package/components/ResourceDetail/Masthead/latest.vue +1 -1
- package/components/ResourceDetail/Masthead/legacy.vue +8 -7
- package/components/ResourceDetail/legacy.vue +15 -15
- package/components/ResourceList/Masthead.vue +16 -15
- package/components/ResourceTable.vue +16 -0
- package/components/SideNav.vue +21 -21
- package/components/SingleClusterInfo.vue +2 -1
- package/components/SortableTable/THead.vue +46 -1
- package/components/SortableTable/index.vue +54 -18
- package/components/Tabbed/index.vue +6 -1
- package/components/actionButton/index.vue +649 -0
- package/components/auth/Principal.vue +16 -8
- package/components/auth/RoleDetailEdit.vue +11 -7
- package/components/breadcrumb/index.vue +13 -210
- package/components/form/ArrayList.vue +164 -147
- package/components/form/ArrayListGrouped.vue +5 -3
- package/components/form/ChangePassword.vue +1 -1
- package/components/form/ClusterAppearance.vue +4 -3
- package/components/form/Command.vue +4 -5
- package/components/form/Conditions.vue +15 -1
- package/components/form/Footer.vue +1 -0
- package/components/form/HealthCheck.vue +0 -2
- package/components/form/HookOption.vue +87 -58
- package/components/form/InputWithSelect.vue +8 -7
- package/components/form/KeyValue.vue +20 -2
- package/components/form/LabeledSelect.vue +3 -1
- package/components/form/Labels.vue +2 -2
- package/components/form/MatchExpressions.vue +4 -4
- package/components/form/Members/ClusterMembershipEditor.vue +1 -1
- package/components/form/Members/ClusterPermissionsEditor.vue +60 -41
- package/components/form/Members/MembershipEditor.vue +4 -4
- package/components/form/Members/ProjectMembershipEditor.vue +1 -1
- package/components/form/NameNsDescription.vue +3 -2
- package/components/form/Networking.vue +6 -9
- package/components/form/NodeAffinity.vue +29 -28
- package/components/form/PodAffinity.vue +23 -23
- package/components/form/Probe.vue +15 -11
- package/components/form/ProjectMemberEditor.vue +66 -48
- package/components/form/ResourceQuota/Namespace.vue +4 -4
- package/components/form/ResourceQuota/NamespaceRow.vue +11 -9
- package/components/form/ResourceQuota/Project.vue +4 -4
- package/components/form/ResourceQuota/ProjectRow.vue +36 -30
- package/components/form/ResourceSelector.vue +1 -1
- package/components/form/SecretSelector.vue +24 -23
- package/components/form/Security.vue +1 -3
- package/components/form/Select.vue +7 -1
- package/components/form/ServiceNameSelect.vue +2 -5
- package/components/form/ServicePorts.vue +149 -75
- package/components/form/Tolerations.vue +13 -9
- package/components/form/ValueFromResource.vue +110 -96
- package/components/formatter/WorkloadHealthScale.vue +4 -3
- package/components/nav/Group.vue +8 -1
- package/components/nav/Header.vue +51 -174
- package/components/nav/NamespaceFilter.vue +14 -19
- package/components/nav/TopLevelMenu.vue +100 -126
- package/components/nav/Type.vue +11 -3
- package/config/menuRouteMap.js +10 -0
- package/config/private-label.js +2 -3
- package/config/product/explorer.js +32 -10
- package/config/product/manager.js +28 -17
- package/config/product/uiplugins.js +13 -10
- package/config/router/navigation-guards/index.js +61 -3
- package/detail/node.vue +28 -23
- package/dialog/AddCustomBadgeDialog.vue +17 -9
- package/dialog/RollbackWorkloadDialog.vue +1 -1
- package/edit/autoscaling.horizontalpodautoscaler/external-metric.vue +1 -1
- package/edit/autoscaling.horizontalpodautoscaler/hpa-scaling-rule.vue +9 -6
- package/edit/autoscaling.horizontalpodautoscaler/index.vue +3 -1
- package/edit/autoscaling.horizontalpodautoscaler/metric-identifier.vue +2 -2
- package/edit/autoscaling.horizontalpodautoscaler/metric-object-reference.vue +7 -5
- package/edit/autoscaling.horizontalpodautoscaler/metric-target.vue +5 -3
- package/edit/autoscaling.horizontalpodautoscaler/metrics-row.vue +2 -2
- package/edit/autoscaling.horizontalpodautoscaler/object-metric.vue +2 -2
- package/edit/autoscaling.horizontalpodautoscaler/pod-metric.vue +1 -1
- package/edit/autoscaling.horizontalpodautoscaler/resource-metric.vue +2 -2
- package/edit/configmap.vue +4 -0
- package/edit/logging-flow/index.vue +1 -2
- package/edit/logging.banzaicloud.io.output/providers/awsElasticsearch.vue +3 -3
- package/edit/logging.banzaicloud.io.output/providers/azurestorage.vue +19 -19
- package/edit/logging.banzaicloud.io.output/providers/cloudwatch.vue +23 -23
- package/edit/logging.banzaicloud.io.output/providers/datadog.vue +19 -19
- package/edit/logging.banzaicloud.io.output/providers/elasticsearch.vue +14 -14
- package/edit/logging.banzaicloud.io.output/providers/forward.vue +12 -12
- package/edit/logging.banzaicloud.io.output/providers/gcs.vue +23 -23
- package/edit/logging.banzaicloud.io.output/providers/gelf.vue +6 -6
- package/edit/logging.banzaicloud.io.output/providers/kafka.vue +10 -10
- package/edit/logging.banzaicloud.io.output/providers/kinesisStream.vue +8 -8
- package/edit/logging.banzaicloud.io.output/providers/logdna.vue +17 -17
- package/edit/logging.banzaicloud.io.output/providers/logz.vue +7 -7
- package/edit/logging.banzaicloud.io.output/providers/loki.vue +12 -12
- package/edit/logging.banzaicloud.io.output/providers/newrelic.vue +3 -3
- package/edit/logging.banzaicloud.io.output/providers/opensearch.vue +14 -14
- package/edit/logging.banzaicloud.io.output/providers/redis.vue +6 -6
- package/edit/logging.banzaicloud.io.output/providers/s3.vue +23 -23
- package/edit/logging.banzaicloud.io.output/providers/splunkHec.vue +13 -13
- package/edit/logging.banzaicloud.io.output/providers/sumologic.vue +2 -2
- package/edit/logging.banzaicloud.io.output/providers/syslog.vue +54 -54
- package/edit/monitoring.coreos.com.alertmanagerconfig/receiverConfig.vue +32 -8
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/dingding.vue +32 -0
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/message.vue +52 -0
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/snmp.vue +45 -0
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/work.vue +31 -0
- package/edit/networking.k8s.io.ingress/Certificate.vue +14 -5
- package/edit/networking.k8s.io.ingress/DefaultBackend.vue +2 -2
- package/edit/networking.k8s.io.ingress/Rule.vue +5 -11
- package/edit/networking.k8s.io.ingress/RulePath.vue +105 -96
- package/edit/networking.k8s.io.networkpolicy/PolicyRule.vue +3 -3
- package/edit/networking.k8s.io.networkpolicy/PolicyRulePort.vue +4 -2
- package/edit/networking.k8s.io.networkpolicy/PolicyRuleTarget.vue +12 -11
- package/edit/networking.k8s.io.networkpolicy/index.vue +1 -1
- package/edit/persistentvolume/index.vue +3 -1
- package/edit/persistentvolumeclaim.vue +2 -0
- package/edit/provisioning.cattle.io.cluster/tabs/Basics.vue +1 -1
- package/edit/secret/index.vue +2 -2
- package/edit/service.vue +4 -1
- package/edit/storage.k8s.io.storageclass/index.vue +10 -8
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/aws-ebs.vue +34 -27
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/gce-pd.vue +15 -13
- package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/vsphere-volume.vue +41 -39
- package/edit/workload/Job.vue +31 -34
- package/edit/workload/Upgrading.vue +5 -5
- package/edit/workload/index.vue +19 -15
- package/edit/workload/storage/Mount.vue +1 -0
- package/edit/workload/storage/awsElasticBlockStore.vue +9 -7
- package/edit/workload/storage/azureDisk.vue +14 -10
- package/edit/workload/storage/azureFile.vue +9 -7
- package/edit/workload/storage/csi/index.vue +6 -9
- package/edit/workload/storage/emptyDir.vue +7 -5
- package/edit/workload/storage/gcePersistentDisk.vue +9 -7
- package/edit/workload/storage/hostPath.vue +7 -5
- package/edit/workload/storage/nfs.vue +8 -6
- package/edit/workload/storage/persistentVolumeClaim/index.vue +12 -10
- package/edit/workload/storage/persistentVolumeClaim/persistentvolumeclaim.vue +20 -15
- package/edit/workload/storage/secret.vue +9 -6
- package/edit/workload/storage/vsphereVolume.vue +11 -7
- package/initialize/app-extended.js +7 -1
- package/list/management.cattle.io.podsecurityadmissionconfigurationtemplate.vue +8 -6
- package/mixins/create-edit-view/impl.js +10 -0
- package/models/provisioning.cattle.io.cluster.js +19 -18
- package/models/workload.js +2 -2
- package/package.json +1 -1
- package/pages/account/index.vue +93 -58
- package/pages/auth/login.vue +25 -28
- package/pages/auth/setup.vue +36 -17
- package/pages/c/_cluster/auth/roles/index.vue +27 -3
- package/pages/c/_cluster/explorer/ConfigBadge.vue +1 -1
- package/pages/c/_cluster/explorer/index.vue +2 -1
- package/pages/c/_cluster/explorer/tools/index.vue +6 -6
- package/pages/home.vue +55 -13
- package/pkg/tsconfig.json +9 -9
- package/pkg/vue.config.js +1 -1
- package/plugins/dashboard-store/actions.js +1 -1
- package/public/index.html +1 -1
- package/rancher-components/Banner/Banner.vue +14 -2
- package/rancher-components/Form/Radio/RadioGroup.vue +9 -1
- package/rancher-components/LabeledTooltip/LabeledTooltip.vue +31 -2
- package/scripts/build-pkg.sh +18 -23
- package/scripts/publish-shell.sh +1 -1
- package/store/i18n.js +1 -0
- package/store/index.js +4 -4
- package/store/type-map.js +0 -2
- package/types/shell/index.d.ts +8 -0
- package/utils/error.js +23 -3
- package/utils/errorTranslate.json +402 -8
- package/utils/errorTranslateNew.json +39 -0
- package/utils/roleFiltering.js +33 -0
- package/utils/title.ts +1 -1
- package/vue.config.js +1 -1
- /package/assets/images/{logo.png → pl/dark/logo.png} +0 -0
|
@@ -123,8 +123,8 @@ export default defineComponent({
|
|
|
123
123
|
&.null {
|
|
124
124
|
|
|
125
125
|
.status-icon {
|
|
126
|
-
top:
|
|
127
|
-
right:
|
|
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 {
|
package/scripts/build-pkg.sh
CHANGED
|
@@ -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
|
-
#
|
|
23
|
-
#
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
SHELL_DIR=$
|
|
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
|
-
#
|
|
50
|
-
if [ -e ".shell" ]; then
|
|
51
|
-
|
|
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
|
package/scripts/publish-shell.sh
CHANGED
package/store/i18n.js
CHANGED
package/store/index.js
CHANGED
|
@@ -519,10 +519,10 @@ export const getters = {
|
|
|
519
519
|
(!isAll && filteredMap && filteredMap[out] );
|
|
520
520
|
}
|
|
521
521
|
|
|
522
|
-
out = rootGetters['prefs/get'](LAST_NAMESPACE);
|
|
523
|
-
if ( isOk() ) {
|
|
524
|
-
|
|
525
|
-
}
|
|
522
|
+
// out = rootGetters['prefs/get'](LAST_NAMESPACE);
|
|
523
|
+
// if ( isOk() ) {
|
|
524
|
+
// return out;
|
|
525
|
+
// }
|
|
526
526
|
|
|
527
527
|
out = 'default';
|
|
528
528
|
if ( isOk() ) {
|
package/store/type-map.js
CHANGED
package/types/shell/index.d.ts
CHANGED
|
@@ -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(
|
|
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
|
|
211
|
+
for (const translation of translationsList) {
|
|
192
212
|
|
|
193
213
|
// if (error.includes(translation.pattern)) {
|
|
194
214
|
// error = error.replace(translation.pattern, translation.replacement);
|