dashboard-shell-shell 1.0.1000000116 → 1.0.1000000117
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/images/action.svg +6 -0
- package/assets/images/pl/logo.png +0 -0
- package/assets/styles/base/_functions.scss +0 -0
- package/assets/styles/base/_mixins.scss +1 -1
- package/assets/styles/global/_button.scss +17 -10
- package/assets/styles/global/_form.scss +2 -2
- package/assets/styles/global/_labeled-input.scss +6 -2
- package/assets/styles/global/_select.scss +6 -7
- package/assets/styles/global/_table.scss +3 -2
- package/assets/styles/global/_tooltip.scss +8 -1
- package/assets/styles/themes/_dark.scss +2 -0
- package/assets/styles/themes/_light.scss +5 -2
- package/assets/styles/vendor/vue-select.scss +2 -1
- package/assets/translations/en-us.yaml +1 -3
- package/assets/translations/zh-hans.yaml +51 -28
- package/components/ActionDropdown.vue +1 -0
- package/components/ActionMenuShell.vue +6 -3
- package/components/BrandImage.vue +22 -0
- package/components/ClusterIconMenu.vue +1 -1
- package/components/CodeMirror.vue +1 -0
- package/components/CruResource.vue +1 -1
- package/components/CruResourceFooter.vue +1 -1
- package/components/ExplorerProjectsNamespaces.vue +4 -24
- package/components/GlobalRoleBindings.vue +112 -48
- package/components/IndentedPanel.vue +4 -10
- package/components/PromptRemove.vue +3 -3
- package/components/ResourceDetail/Masthead.vue +190 -242
- package/components/ResourceDetail/index.vue +20 -5
- package/components/ResourceList/Masthead.vue +146 -84
- package/components/ResourceList/ResourceLoadingIndicator.vue +5 -2
- package/components/ResourceTable.vue +76 -1
- package/components/SideNav.vue +66 -29
- package/components/SortableTable/THead.vue +6 -0
- package/components/SortableTable/index.vue +481 -388
- package/components/Tabbed/index.vue +4 -5
- package/components/auth/Principal.vue +3 -2
- package/components/auth/RoleDetailEdit.vue +58 -5
- package/components/auth/SelectPrincipal.vue +1 -0
- package/components/form/BannerSettings.vue +18 -16
- package/components/form/ChangePassword.vue +4 -4
- package/components/form/ColorInput.vue +32 -8
- package/components/form/Footer.vue +1 -1
- package/components/form/InputWithSelect.vue +2 -0
- package/components/form/KeyValue.vue +31 -7
- package/components/form/LabeledSelect.vue +178 -178
- package/components/form/Members/ClusterPermissionsEditor.vue +1 -2
- package/components/form/Members/MembershipEditor.vue +1 -1
- package/components/form/NameNsDescription.vue +24 -11
- package/components/form/Password.vue +6 -2
- package/components/form/ResourceQuota/Namespace.vue +1 -1
- package/components/form/ResourceQuota/NamespaceRow.vue +13 -10
- package/components/form/ResourceQuota/ProjectRow.vue +0 -1
- package/components/form/Select.vue +2 -2
- package/components/nav/Favorite.vue +5 -1
- package/components/nav/Group.vue +69 -23
- package/components/nav/Header.vue +82 -17
- package/components/nav/HeaderPageActionMenu.vue +1 -0
- package/components/nav/NamespaceFilter.vue +0 -3
- package/components/nav/TopLevelMenu.vue +182 -119
- package/components/nav/Type.vue +48 -11
- package/composables/useClickOutside.ts +1 -1
- package/config/product/auth.js +16 -7
- package/config/product/explorer.js +1 -1
- package/config/product/settings.js +17 -8
- package/config/settings.ts +28 -0
- package/edit/management.cattle.io.user.vue +17 -4
- package/edit/networking.k8s.io.ingress/RulePath.vue +1 -1
- package/edit/token.vue +1 -1
- package/list/harvesterhci.io.management.cluster.vue +17 -0
- package/list/management.cattle.io.setting.vue +22 -13
- package/list/management.cattle.io.user.vue +25 -14
- package/list/provisioning.cattle.io.cluster.vue +6 -7
- package/mixins/brand.js +17 -0
- package/package.json +1 -1
- package/pages/auth/login.vue +84 -29
- package/pages/c/_cluster/auth/roles/index.vue +61 -14
- package/pages/c/_cluster/settings/banners.vue +174 -101
- package/pages/c/_cluster/settings/brand.vue +348 -301
- package/pages/c/_cluster/settings/performance.vue +61 -38
- package/pages/home.vue +70 -21
- package/pages/prefs.vue +25 -23
- package/pkg/tsconfig.json +9 -9
- package/pkg/vue.config.js +1 -1
- package/promptRemove/mixin/roleDeletionCheck.js +2 -2
- package/scripts/clean +0 -0
- package/scripts/extension/bundle +0 -0
- package/scripts/extension/helm/scripts/package +0 -0
- package/scripts/extension/helm/scripts/patch +0 -0
- package/scripts/extension/helm/scripts/version +0 -0
- package/scripts/extension/helmpatch +0 -0
- package/scripts/extension/parse-tag-name +0 -0
- package/scripts/extension/publish +0 -0
- package/scripts/publish-shell.sh +86 -60
- package/scripts/serve-pkgs +0 -0
- package/scripts/sync-shell-deps +0 -0
- package/scripts/typegen.sh +44 -28
- package/store/i18n.js +5 -5
- package/store/prefs.js +17 -5
- package/store/type-map.js +2 -1
- package/types/shell/index.d.ts +1 -1
- package/utils/error.js +4 -0
- package/utils/router.js +3 -3
- package/vue.config.js +1 -6
- package/components/rancherResourceDetail/Masthead.vue +0 -769
- package/components/rancherResourceDetail/__tests__/Masthead.test.ts +0 -65
- package/components/rancherResourceDetail/index.vue +0 -591
- package/components/rancherResourceList/Masthead.vue +0 -375
- package/components/rancherResourceList/ResourceLoadingIndicator.vue +0 -140
- package/components/rancherResourceList/index.vue +0 -307
- package/components/rancherResourceList/resource-list.config.js +0 -7
- package/components/rancherResourceTable.vue +0 -783
- package/components/rancherSortableTable/THead.vue +0 -561
- package/components/rancherSortableTable/actions.js +0 -153
- package/components/rancherSortableTable/advanced-filtering.js +0 -272
- package/components/rancherSortableTable/debug.js +0 -117
- package/components/rancherSortableTable/filtering.js +0 -290
- package/components/rancherSortableTable/grouping.js +0 -48
- package/components/rancherSortableTable/index.vue +0 -2712
- package/components/rancherSortableTable/paging.js +0 -155
- package/components/rancherSortableTable/selection.js +0 -629
- package/components/rancherSortableTable/sortable-config.ts +0 -4
- package/components/rancherSortableTable/sorting.js +0 -129
- package/types/cloud-shell/index.d.ts +0 -11014
- /package/components/{rancherResourceList → ResourceList}/Masthead-btn.vue +0 -0
package/scripts/publish-shell.sh
CHANGED
|
@@ -1,110 +1,136 @@
|
|
|
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
5
|
|
|
5
|
-
set -
|
|
6
|
+
set -euo pipefail
|
|
6
7
|
|
|
8
|
+
# --------------------------
|
|
9
|
+
# 基础路径
|
|
10
|
+
# --------------------------
|
|
7
11
|
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
|
|
8
|
-
BASE_DIR="$(cd $SCRIPT_DIR && cd ../.. && pwd)"
|
|
12
|
+
BASE_DIR="$(cd "$SCRIPT_DIR" && cd ../.. && pwd)"
|
|
9
13
|
echo "BASE_DIR is ${BASE_DIR}"
|
|
10
14
|
echo "SCRIPT_DIR is ${SCRIPT_DIR}"
|
|
11
15
|
echo "PWD is $(pwd)"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
CREATORS_DIR
|
|
16
|
+
|
|
17
|
+
SHELL_DIR="$BASE_DIR/shell/"
|
|
18
|
+
CREATORS_DIR="$BASE_DIR/creators/extension"
|
|
19
|
+
|
|
15
20
|
FORCE_PUBLISH_TO_NPM="false"
|
|
16
21
|
DEFAULT_NPM_REGISTRY="https://registry.npmjs.org"
|
|
17
22
|
|
|
18
|
-
#
|
|
19
|
-
|
|
23
|
+
# --------------------------
|
|
24
|
+
# TAG 必须存在
|
|
25
|
+
# --------------------------
|
|
26
|
+
if [ -z "${TAG:-}" ]; then
|
|
20
27
|
echo "You need to set the TAG variable first!"
|
|
21
28
|
exit 1
|
|
22
29
|
fi
|
|
23
30
|
|
|
24
|
-
|
|
31
|
+
# --------------------------
|
|
32
|
+
# node_modules 检查
|
|
33
|
+
# --------------------------
|
|
34
|
+
if [[ ! -d "$BASE_DIR/node_modules" ]]; then
|
|
25
35
|
echo "You need to run 'yarn install' first"
|
|
26
36
|
exit 1
|
|
27
37
|
fi
|
|
28
38
|
|
|
29
|
-
echo "Publishing
|
|
39
|
+
echo "Publishing Shell Packages"
|
|
30
40
|
|
|
31
|
-
|
|
41
|
+
# --------------------------
|
|
42
|
+
# NPM 发布参数
|
|
43
|
+
# --------------------------
|
|
44
|
+
if [[ "${1:-}" == "--npm" ]]; then
|
|
32
45
|
FORCE_PUBLISH_TO_NPM="true"
|
|
33
46
|
fi
|
|
34
47
|
|
|
35
|
-
if [ "$FORCE_PUBLISH_TO_NPM" == "true" ]; then
|
|
36
|
-
export NPM_REGISTRY
|
|
48
|
+
if [[ "$FORCE_PUBLISH_TO_NPM" == "true" ]]; then
|
|
49
|
+
export NPM_REGISTRY="$DEFAULT_NPM_REGISTRY"
|
|
37
50
|
fi
|
|
38
51
|
|
|
39
|
-
PUBLISH_ARGS="--no-git-tag-version --access public --registry $NPM_REGISTRY"
|
|
40
|
-
|
|
41
|
-
pushd ${CLOUD_SHELL_DIR} >/dev/null
|
|
42
|
-
|
|
43
|
-
function publish() {
|
|
44
|
-
NAME=$1
|
|
45
|
-
FOLDER=$2
|
|
52
|
+
PUBLISH_ARGS="--no-git-tag-version --access public --registry ${NPM_REGISTRY:-$DEFAULT_NPM_REGISTRY}"
|
|
46
53
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
54
|
+
# --------------------------
|
|
55
|
+
# 解析 TAG
|
|
56
|
+
# --------------------------
|
|
57
|
+
if [[ "$TAG" =~ ^([a-zA-Z-]+)-pkg-v(.+)$ ]]; then
|
|
58
|
+
PKG_NAME="${BASH_REMATCH[1]}"
|
|
59
|
+
PKG_V="${BASH_REMATCH[2]}"
|
|
60
|
+
else
|
|
61
|
+
echo "TAG format invalid: $TAG. Must be like 'shell-pkg-v3.0.2-rc.105'"
|
|
62
|
+
exit 1
|
|
63
|
+
fi
|
|
50
64
|
|
|
51
|
-
|
|
52
|
-
|
|
65
|
+
echo "PKG_NAME=${PKG_NAME}"
|
|
66
|
+
echo "PKG_V=${PKG_V}"
|
|
67
|
+
|
|
68
|
+
# --------------------------
|
|
69
|
+
# publish 函数
|
|
70
|
+
# --------------------------
|
|
71
|
+
publish() {
|
|
72
|
+
local NAME="$1"
|
|
73
|
+
local FOLDER="$2"
|
|
74
|
+
local VERSION="${3:-$PKG_V}"
|
|
75
|
+
|
|
76
|
+
if [[ "${DRY_RUN:-false}" == "true" ]]; then
|
|
77
|
+
local ARGS="$PUBLISH_ARGS --dry-run"
|
|
78
|
+
else
|
|
79
|
+
local ARGS="$PUBLISH_ARGS"
|
|
53
80
|
fi
|
|
54
81
|
|
|
55
|
-
echo "Publish to NPM - arguments ::: ${
|
|
82
|
+
echo "Publish to NPM - arguments ::: ${ARGS}"
|
|
83
|
+
echo "Publishing ${NAME} version ${VERSION} from ${FOLDER}"
|
|
56
84
|
|
|
57
|
-
|
|
58
|
-
pushd ${FOLDER} >/dev/null
|
|
85
|
+
pushd "$FOLDER" >/dev/null || exit 1
|
|
59
86
|
|
|
60
|
-
#
|
|
61
|
-
if [ "$NAME" == "
|
|
87
|
+
# 复制 rancher-components
|
|
88
|
+
if [[ "$NAME" == "Shell" ]]; then
|
|
62
89
|
echo "Adding Rancher Components"
|
|
63
90
|
rm -rf ./rancher-components
|
|
64
|
-
cp -R $
|
|
91
|
+
cp -R "$BASE_DIR/pkg/rancher-components/src/components" ./rancher-components/
|
|
65
92
|
fi
|
|
66
93
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
94
|
+
# 记录依赖
|
|
95
|
+
node "$SCRIPT_DIR/record-deps.js" || {
|
|
96
|
+
echo "record-deps.js failed"
|
|
97
|
+
popd >/dev/null
|
|
98
|
+
exit 1
|
|
99
|
+
}
|
|
70
100
|
|
|
71
|
-
|
|
72
|
-
|
|
101
|
+
# NPM 发布
|
|
102
|
+
echo "Publishing to registry: ${NPM_REGISTRY:-$DEFAULT_NPM_REGISTRY}"
|
|
103
|
+
npm publish $ARGS || {
|
|
104
|
+
echo "Error publishing package ${NAME}"
|
|
105
|
+
popd >/dev/null
|
|
106
|
+
exit 1
|
|
107
|
+
}
|
|
73
108
|
|
|
74
109
|
popd >/dev/null
|
|
75
|
-
|
|
76
|
-
if [ $RET -ne 0 ]; then
|
|
77
|
-
echo "Error publishing package ${NAME}"
|
|
78
|
-
exit $RET
|
|
79
|
-
fi
|
|
80
110
|
}
|
|
81
111
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
#
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
echo "PKG_NAME ${PKG_NAME}"
|
|
89
|
-
echo "PKG_V ${PKG_V}"
|
|
90
|
-
|
|
91
|
-
# Generate the type definitions for the cloud-shell
|
|
92
|
-
if [ ${PKG_NAME} == "cloud-shell" ]; then
|
|
93
|
-
${SCRIPT_DIR}/typegen.sh
|
|
112
|
+
# --------------------------
|
|
113
|
+
# 生成 TypeScript 类型
|
|
114
|
+
# --------------------------
|
|
115
|
+
if [[ "$PKG_NAME" == "shell" ]]; then
|
|
116
|
+
echo "Generating TypeScript definitions..."
|
|
117
|
+
bash "$SCRIPT_DIR/typegen.sh" || { echo "Type generation failed"; exit 1; }
|
|
94
118
|
fi
|
|
95
119
|
|
|
96
|
-
#
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
120
|
+
# --------------------------
|
|
121
|
+
# 根据 TAG 发布
|
|
122
|
+
# --------------------------
|
|
123
|
+
case "$PKG_NAME" in
|
|
124
|
+
"shell")
|
|
125
|
+
echo "Publishing only Shell pkg via tagged release"
|
|
126
|
+
publish "Shell" "$SHELL_DIR" "$PKG_V"
|
|
101
127
|
;;
|
|
102
128
|
"creators")
|
|
103
129
|
echo "Publishing only Creators pkg via tagged release"
|
|
104
|
-
publish "Extension creator" $
|
|
130
|
+
publish "Extension creator" "$CREATORS_DIR" "$PKG_V"
|
|
105
131
|
;;
|
|
106
132
|
*)
|
|
107
|
-
echo "
|
|
133
|
+
echo "Something went wrong with the tagging name => TAG: ${TAG}, PKG_NAME: ${PKG_NAME}. Admissible names are 'shell' and 'creators'"
|
|
108
134
|
exit 1
|
|
109
135
|
;;
|
|
110
136
|
esac
|
package/scripts/serve-pkgs
CHANGED
|
File without changes
|
package/scripts/sync-shell-deps
CHANGED
|
File without changes
|
package/scripts/typegen.sh
CHANGED
|
@@ -2,53 +2,69 @@
|
|
|
2
2
|
|
|
3
3
|
SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
|
4
4
|
BASE_DIR="$(git rev-parse --show-toplevel)"
|
|
5
|
-
|
|
5
|
+
SHELL_DIR=$BASE_DIR/shell
|
|
6
6
|
|
|
7
|
-
echo "Generating typescript definitions
|
|
7
|
+
echo "Generating typescript definitions"
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
mkdir -p ${CLOUD_SHELL_DIR}/tmp
|
|
9
|
+
rm -rf ${SHELL_DIR}/tmp
|
|
10
|
+
mkdir -p ${SHELL_DIR}/tmp
|
|
12
11
|
|
|
13
12
|
echo "Generating ..."
|
|
14
13
|
|
|
15
14
|
# utils
|
|
16
|
-
${BASE_DIR}/node_modules/.bin/tsc ${
|
|
17
|
-
${BASE_DIR}/node_modules/.bin/tsc ${
|
|
18
|
-
${BASE_DIR}/node_modules/.bin/tsc ${
|
|
15
|
+
${BASE_DIR}/node_modules/.bin/tsc ${SHELL_DIR}/utils/*.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/utils > /dev/null
|
|
16
|
+
${BASE_DIR}/node_modules/.bin/tsc ${SHELL_DIR}/utils/validators/*.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/utils/validators > /dev/null
|
|
17
|
+
${BASE_DIR}/node_modules/.bin/tsc ${SHELL_DIR}/utils/crypto/*.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/utils/crypto > /dev/null
|
|
19
18
|
|
|
20
19
|
# config
|
|
21
|
-
${BASE_DIR}/node_modules/.bin/tsc ${
|
|
20
|
+
${BASE_DIR}/node_modules/.bin/tsc ${SHELL_DIR}/config/query-params.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/config > /dev/null
|
|
21
|
+
${BASE_DIR}/node_modules/.bin/tsc ${SHELL_DIR}/config/table-headers.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/config > /dev/null
|
|
22
|
+
${BASE_DIR}/node_modules/.bin/tsc ${SHELL_DIR}/config/types.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/config > /dev/null
|
|
23
|
+
${BASE_DIR}/node_modules/.bin/tsc ${SHELL_DIR}/config/labels-annotations.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/config > /dev/null
|
|
24
|
+
${BASE_DIR}/node_modules/.bin/tsc ${SHELL_DIR}/config/version.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/config > /dev/null
|
|
22
25
|
|
|
23
|
-
# store
|
|
24
|
-
${BASE_DIR}/node_modules/.bin/tsc ${
|
|
26
|
+
# # store
|
|
27
|
+
${BASE_DIR}/node_modules/.bin/tsc ${SHELL_DIR}/store/features.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/store > /dev/null
|
|
28
|
+
${BASE_DIR}/node_modules/.bin/tsc ${SHELL_DIR}/store/prefs.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/store > /dev/null
|
|
29
|
+
${BASE_DIR}/node_modules/.bin/tsc ${SHELL_DIR}/store/plugins.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/store > /dev/null
|
|
25
30
|
|
|
26
|
-
# plugins
|
|
27
|
-
${BASE_DIR}/node_modules/.bin/tsc ${
|
|
28
|
-
${BASE_DIR}/node_modules/.bin/tsc ${
|
|
31
|
+
# # plugins
|
|
32
|
+
${BASE_DIR}/node_modules/.bin/tsc ${SHELL_DIR}/plugins/dashboard-store/normalize.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/plugins/dashboard-store/ > /dev/null
|
|
33
|
+
${BASE_DIR}/node_modules/.bin/tsc ${SHELL_DIR}/plugins/dashboard-store/resource-class.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/plugins/dashboard-store/ > /dev/null
|
|
34
|
+
${BASE_DIR}/node_modules/.bin/tsc ${SHELL_DIR}/plugins/dashboard-store/classify.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/plugins/dashboard-store/ > /dev/null
|
|
35
|
+
${BASE_DIR}/node_modules/.bin/tsc ${SHELL_DIR}/plugins/dashboard-store/actions.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/plugins/dashboard-store/ > /dev/null
|
|
36
|
+
${BASE_DIR}/node_modules/.bin/tsc ${SHELL_DIR}/plugins/steve/steve-class.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/plugins/steve/ > /dev/null
|
|
37
|
+
${BASE_DIR}/node_modules/.bin/tsc ${SHELL_DIR}/plugins/steve/hybrid-class.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/plugins/steve/ > /dev/null
|
|
29
38
|
|
|
30
|
-
# mixins
|
|
31
|
-
${BASE_DIR}/node_modules/.bin/tsc ${
|
|
39
|
+
# # mixins
|
|
40
|
+
${BASE_DIR}/node_modules/.bin/tsc ${SHELL_DIR}/mixins/create-edit-view/index.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/mixins/create-edit-view > /dev/null
|
|
41
|
+
${BASE_DIR}/node_modules/.bin/tsc ${SHELL_DIR}/mixins/resource-fetch.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/mixins > /dev/null
|
|
32
42
|
|
|
33
|
-
# models
|
|
34
|
-
${BASE_DIR}/node_modules/.bin/tsc ${
|
|
43
|
+
# # models
|
|
44
|
+
${BASE_DIR}/node_modules/.bin/tsc ${SHELL_DIR}/models/namespace.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/models/ > /dev/null
|
|
45
|
+
${BASE_DIR}/node_modules/.bin/tsc ${SHELL_DIR}/models/networking.k8s.io.ingress.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/models/ > /dev/null
|
|
46
|
+
${BASE_DIR}/node_modules/.bin/tsc ${SHELL_DIR}/models/catalog.cattle.io.clusterrepo.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/models/ > /dev/null
|
|
35
47
|
|
|
36
|
-
|
|
37
|
-
|
|
48
|
+
#./node_modules/.bin/tsc ${SHELL_DIR}/plugins/dashboard-store/*.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/plugins/dashboard-store
|
|
49
|
+
|
|
50
|
+
# Go through all of the folders and combine by wrapping with 'declare module'
|
|
51
|
+
|
|
52
|
+
echo "Contents of ${SHELL_DIR}/tmp after tsc commands:"
|
|
53
|
+
find ${SHELL_DIR}/tmp
|
|
38
54
|
|
|
39
55
|
echo "Combining type definitions ..."
|
|
40
56
|
|
|
41
|
-
DEST=${
|
|
57
|
+
DEST=${SHELL_DIR}/types/shell
|
|
42
58
|
mkdir -p ${DEST}
|
|
43
59
|
|
|
44
60
|
INDEX=${DEST}/index.d.ts
|
|
45
61
|
rm -rf ${INDEX}
|
|
46
62
|
|
|
47
|
-
echo "// Auto-generated type definitions for
|
|
63
|
+
echo "// Auto-generated type definitions for shell" > ${INDEX}
|
|
48
64
|
echo "// Do not modify this file as changes will get overwritten" >> ${INDEX}
|
|
49
65
|
|
|
50
|
-
echo "/// <reference types=\"@rancher/
|
|
51
|
-
echo "/// <reference types=\"@rancher/
|
|
66
|
+
echo "/// <reference types=\"@rancher/shell/types/vue-shim\" />" >> ${INDEX}
|
|
67
|
+
echo "/// <reference types=\"@rancher/shell/types/global-vue\" />" >> ${INDEX}
|
|
52
68
|
|
|
53
69
|
function processDir() {
|
|
54
70
|
local dir=$1
|
|
@@ -62,7 +78,9 @@ function processDir() {
|
|
|
62
78
|
processDir $entry $basePkg/$filename
|
|
63
79
|
else
|
|
64
80
|
if [[ $filename == *.d.ts ]]; then
|
|
81
|
+
# We use convoluted mechanism here to ensure this works on mac with bash 3.x
|
|
65
82
|
local name=$(echo $filename | rev | cut -c6- | rev)
|
|
83
|
+
|
|
66
84
|
local module=${basePkg}/${name}
|
|
67
85
|
if [ "${name}" == "index" ]; then
|
|
68
86
|
module=${basePkg}
|
|
@@ -77,8 +95,6 @@ function processDir() {
|
|
|
77
95
|
done
|
|
78
96
|
}
|
|
79
97
|
|
|
80
|
-
processDir ${
|
|
81
|
-
|
|
82
|
-
rm -rf ${CLOUD_SHELL_DIR}/tmp
|
|
98
|
+
processDir ${SHELL_DIR}/tmp @shell
|
|
83
99
|
|
|
84
|
-
|
|
100
|
+
rm -rf ${SHELL_DIR}/tmp
|
package/store/i18n.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import merge from 'lodash/merge';
|
|
2
2
|
import IntlMessageFormat from 'intl-messageformat';
|
|
3
3
|
import { get } from '@shell/utils/object';
|
|
4
|
-
import
|
|
4
|
+
import en from '@shell/assets/translations/en-us.yaml';
|
|
5
5
|
import { getProduct, getVendor, DOCS_BASE } from '@shell/config/private-label';
|
|
6
6
|
import { loadTranslation } from '@shell/utils/dynamic-importer';
|
|
7
7
|
|
|
8
8
|
const NONE = 'none';
|
|
9
|
-
const DEFAULT_LOCALE = '
|
|
9
|
+
const DEFAULT_LOCALE = 'en-us';
|
|
10
10
|
|
|
11
11
|
// Formatters can't be serialized into state
|
|
12
12
|
const intlCache = {};
|
|
@@ -18,14 +18,14 @@ export const state = function() {
|
|
|
18
18
|
// const available = translationContext.keys().map(path => path.replace(/^.*\/([^\/]+)\.[^.]+$/, '$1'));
|
|
19
19
|
// Using require.context() forces them to all be in the same webpack chunk name... just hardcode the list for now so zh-hans
|
|
20
20
|
// gets generated as it's own chunk instead of being loaded all the time.
|
|
21
|
-
const available = [
|
|
21
|
+
const available = ['zh-hans', DEFAULT_LOCALE ];
|
|
22
22
|
|
|
23
23
|
const out = {
|
|
24
24
|
default: DEFAULT_LOCALE,
|
|
25
25
|
selected: null,
|
|
26
26
|
previous: null,
|
|
27
27
|
available,
|
|
28
|
-
translations: { [DEFAULT_LOCALE]:
|
|
28
|
+
translations: { [DEFAULT_LOCALE]: en },
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
return out;
|
|
@@ -229,7 +229,7 @@ export const actions = {
|
|
|
229
229
|
const exists = !!state.available.find((loc) => loc === selected);
|
|
230
230
|
|
|
231
231
|
if ( !selected || !exists) {
|
|
232
|
-
selected =
|
|
232
|
+
selected = 'zh-hans';
|
|
233
233
|
}
|
|
234
234
|
|
|
235
235
|
return dispatch('switchTo', selected);
|
package/store/prefs.js
CHANGED
|
@@ -57,14 +57,16 @@ export const PINNED_CLUSTERS = create('pinned-clusters', [], { parseJSON });
|
|
|
57
57
|
export const GROUP_RESOURCES = create('group-by', 'namespace');
|
|
58
58
|
export const DIFF = create('diff', 'unified', { options: ['unified', 'split'] });
|
|
59
59
|
export const THEME = create('theme', 'auto', {
|
|
60
|
-
options: ['light', 'auto', 'dark'],
|
|
60
|
+
// options: ['light', 'auto', 'dark'],
|
|
61
|
+
options: ['light'],
|
|
61
62
|
asCookie,
|
|
62
63
|
parseJSON,
|
|
63
64
|
mangleRead: (x) => x.replace(/^ui-/, ''),
|
|
64
|
-
mangleWrite: (x) => `ui-${ x }`,
|
|
65
|
+
// mangleWrite: (x) => `ui-${ x }`,
|
|
66
|
+
mangleWrite: (x) => `ui-light`, // 接口同时修改为 白色
|
|
65
67
|
});
|
|
66
68
|
export const PREFERS_SCHEME = create('pcs', '', { asCookie, asUserPreference: false });
|
|
67
|
-
export const LOCALE = create('locale', '
|
|
69
|
+
export const LOCALE = create('locale', 'zh-hans', { asCookie });
|
|
68
70
|
export const KEYMAP = create('keymap', 'sublime', { options: ['sublime', 'emacs', 'vim'] });
|
|
69
71
|
export const ROWS_PER_PAGE = create('per-page', 100, { options: [10, 25, 50, 100], parseJSON });
|
|
70
72
|
export const LOGS_WRAP = create('logs-wrap', true, { parseJSON });
|
|
@@ -103,7 +105,10 @@ export const THEME_SHORTCUT = create('theme-shortcut', false, { parseJSON, inher
|
|
|
103
105
|
export const LAST_VISITED = create('last-visited', 'home', { parseJSON });
|
|
104
106
|
export const SEEN_WHATS_NEW = create('seen-whatsnew', '', { parseJSON });
|
|
105
107
|
export const READ_WHATS_NEW = create('read-whatsnew', '', { parseJSON });
|
|
106
|
-
export const AFTER_LOGIN_ROUTE = create('after-login-route', 'home', {
|
|
108
|
+
export const AFTER_LOGIN_ROUTE = create('after-login-route', 'home', {
|
|
109
|
+
parseJSON,
|
|
110
|
+
// mangleWrite: (x) => `ui-light`, // 接口同时修改为 白色
|
|
111
|
+
} );
|
|
107
112
|
export const HIDE_HOME_PAGE_CARDS = create('home-page-cards', {}, { parseJSON } );
|
|
108
113
|
export const PLUGIN_DEVELOPER = create('plugin-developer', false, { parseJSON, inheritFrom: DEV }); // Is the user a plugin developer?
|
|
109
114
|
|
|
@@ -149,6 +154,11 @@ export const getters = {
|
|
|
149
154
|
}
|
|
150
155
|
|
|
151
156
|
const def = clone(definition.def);
|
|
157
|
+
|
|
158
|
+
if (key === THEME) {
|
|
159
|
+
// 无论 state 里存的是什么,都强制返回 light
|
|
160
|
+
return 'light';
|
|
161
|
+
}
|
|
152
162
|
|
|
153
163
|
return def;
|
|
154
164
|
},
|
|
@@ -471,7 +481,9 @@ export const actions = {
|
|
|
471
481
|
try {
|
|
472
482
|
value = JSON.parse(value);
|
|
473
483
|
} catch (err) {
|
|
474
|
-
|
|
484
|
+
// 容错处理:如果后端返回 map[...] 这样的字符串,直接忽略或重置为空
|
|
485
|
+
console.warn(`Pref ${ key } has invalid JSON, resetting`, value);
|
|
486
|
+
value = definition.defaultValue || null;
|
|
475
487
|
continue;
|
|
476
488
|
}
|
|
477
489
|
}
|
package/store/type-map.js
CHANGED
|
@@ -513,7 +513,7 @@ export const getters = {
|
|
|
513
513
|
|
|
514
514
|
groupsForVirTypes(state) {
|
|
515
515
|
return (product, name) => {
|
|
516
|
-
return state.virtualTypes?.[product]
|
|
516
|
+
return state.virtualTypes?.[product]?.find(item => item.name === name)?.icon || '';
|
|
517
517
|
};
|
|
518
518
|
},
|
|
519
519
|
|
|
@@ -718,6 +718,7 @@ export const getters = {
|
|
|
718
718
|
route.params = route.params || {};
|
|
719
719
|
route.params.cluster = clusterId;
|
|
720
720
|
route.params.product = productId;
|
|
721
|
+
route.params.resource = route.params.resource;
|
|
721
722
|
}
|
|
722
723
|
|
|
723
724
|
group.children.push({
|
package/types/shell/index.d.ts
CHANGED
|
@@ -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;
|
package/utils/error.js
CHANGED
|
@@ -138,6 +138,10 @@ export const normalizeError = (err) => {
|
|
|
138
138
|
};
|
|
139
139
|
};
|
|
140
140
|
export function translateError(error) {
|
|
141
|
+
error = typeof error === 'string'
|
|
142
|
+
? error
|
|
143
|
+
: error?.message || error?.toString() || '';
|
|
144
|
+
|
|
141
145
|
const originError = error;
|
|
142
146
|
error = error?.toLowerCase().replace(/admission webhook(.*?)denied the request:/g, (match, p1) => {
|
|
143
147
|
return '';
|
package/utils/router.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { INSTALL_REDIRECT_META_KEY } from '@shell/config/router/navigation-guards/install-redirect';
|
|
2
2
|
|
|
3
3
|
export function harvesterhci2cloud(str) {
|
|
4
|
-
|
|
4
|
+
return str?.replace('harvesterhci.io', 'cloudhci.io')
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
export function cloud2harvesterhci(str) {
|
|
@@ -14,11 +14,11 @@ export function cloud2harvesterhci(str) {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export function harvester2cloud(str) {
|
|
17
|
-
|
|
17
|
+
return str?.replace(/harvester/g, 'cloud');
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
export function cloud2harvester(str) {
|
|
21
|
-
|
|
21
|
+
return str?.replace(/cloud/g, 'harvester');
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
export function queryParamsFor(current, qp, defaults = {}) {
|
package/vue.config.js
CHANGED
|
@@ -58,11 +58,6 @@ const getShellPaths = (dir) => {
|
|
|
58
58
|
COMPONENTS_DIR = path.join(dir, 'pkg', 'rancher-components', 'src', 'components');
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
if (fs.existsSync(path.join(dir, 'cloud-shell'))) {
|
|
62
|
-
SHELL_ABS = path.join(dir, 'cloud-shell');
|
|
63
|
-
COMPONENTS_DIR = path.join(dir, 'pkg', 'rancher-components', 'src', 'components');
|
|
64
|
-
}
|
|
65
|
-
|
|
66
61
|
return { SHELL_ABS, COMPONENTS_DIR };
|
|
67
62
|
};
|
|
68
63
|
|
|
@@ -162,7 +157,7 @@ const getLoaders = (SHELL_ABS) => [
|
|
|
162
157
|
test: /\.m?[tj]sx?$/,
|
|
163
158
|
// This excludes no modules except for node_modules/@rancher/... so that plugins can properly compile
|
|
164
159
|
// when referencing @rancher/shell
|
|
165
|
-
exclude: /node_modules\/(?!(
|
|
160
|
+
exclude: /node_modules\/(?!(@rancher)\/).*/,
|
|
166
161
|
use: [
|
|
167
162
|
{
|
|
168
163
|
loader: 'cache-loader',
|