dashboard-shell-shell 1.0.1000000117 → 1.0.1000000118
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/styles/base/_functions.scss +0 -0
- package/assets/styles/base/_mixins.scss +1 -1
- package/assets/styles/global/_button.scss +10 -17
- package/assets/styles/global/_form.scss +2 -2
- package/assets/styles/global/_labeled-input.scss +2 -6
- package/assets/styles/global/_select.scss +7 -6
- package/assets/styles/global/_table.scss +2 -3
- package/assets/styles/global/_tooltip.scss +1 -8
- package/assets/styles/themes/_dark.scss +0 -2
- package/assets/styles/themes/_light.scss +2 -5
- package/assets/styles/vendor/vue-select.scss +1 -2
- package/assets/translations/en-us.yaml +3 -1
- package/assets/translations/zh-hans.yaml +28 -51
- package/components/ActionDropdown.vue +0 -1
- package/components/ActionMenuShell.vue +3 -6
- package/components/BrandImage.vue +0 -22
- package/components/ClusterIconMenu.vue +1 -1
- package/components/CodeMirror.vue +0 -1
- package/components/CruResource.vue +1 -1
- package/components/CruResourceFooter.vue +1 -1
- package/components/ExplorerProjectsNamespaces.vue +24 -4
- package/components/GlobalRoleBindings.vue +48 -112
- package/components/IndentedPanel.vue +10 -4
- package/components/PromptRemove.vue +3 -3
- package/components/ResourceDetail/Masthead.vue +242 -190
- package/components/ResourceDetail/index.vue +5 -20
- package/components/ResourceList/Masthead.vue +84 -146
- package/components/ResourceList/ResourceLoadingIndicator.vue +2 -5
- package/components/ResourceTable.vue +1 -76
- package/components/SideNav.vue +29 -66
- package/components/SortableTable/THead.vue +0 -6
- package/components/SortableTable/index.vue +388 -481
- package/components/Tabbed/index.vue +5 -4
- package/components/auth/Principal.vue +2 -3
- package/components/auth/RoleDetailEdit.vue +5 -58
- package/components/auth/SelectPrincipal.vue +0 -1
- package/components/form/BannerSettings.vue +16 -18
- package/components/form/ChangePassword.vue +4 -4
- package/components/form/ColorInput.vue +8 -32
- package/components/form/Footer.vue +1 -1
- package/components/form/InputWithSelect.vue +0 -2
- package/components/form/KeyValue.vue +7 -31
- package/components/form/LabeledSelect.vue +178 -178
- package/components/form/Members/ClusterPermissionsEditor.vue +2 -1
- package/components/form/Members/MembershipEditor.vue +1 -1
- package/components/form/NameNsDescription.vue +11 -24
- package/components/form/Password.vue +2 -6
- package/components/form/ResourceQuota/Namespace.vue +1 -1
- package/components/form/ResourceQuota/NamespaceRow.vue +10 -13
- package/components/form/ResourceQuota/ProjectRow.vue +1 -0
- package/components/form/Select.vue +2 -2
- package/components/nav/Favorite.vue +1 -5
- package/components/nav/Group.vue +23 -69
- package/components/nav/Header.vue +17 -82
- package/components/nav/HeaderPageActionMenu.vue +0 -1
- package/components/nav/NamespaceFilter.vue +3 -0
- package/components/nav/TopLevelMenu.vue +119 -182
- package/components/nav/Type.vue +11 -48
- package/components/rancherResourceDetail/Masthead.vue +769 -0
- package/components/rancherResourceDetail/__tests__/Masthead.test.ts +65 -0
- package/components/rancherResourceDetail/index.vue +591 -0
- package/components/rancherResourceList/Masthead.vue +375 -0
- package/components/rancherResourceList/ResourceLoadingIndicator.vue +140 -0
- package/components/rancherResourceList/index.vue +307 -0
- package/components/rancherResourceList/resource-list.config.js +7 -0
- package/components/rancherResourceTable.vue +783 -0
- package/components/rancherSortableTable/THead.vue +561 -0
- package/components/rancherSortableTable/actions.js +153 -0
- package/components/rancherSortableTable/advanced-filtering.js +272 -0
- package/components/rancherSortableTable/debug.js +117 -0
- package/components/rancherSortableTable/filtering.js +290 -0
- package/components/rancherSortableTable/grouping.js +48 -0
- package/components/rancherSortableTable/index.vue +2712 -0
- package/components/rancherSortableTable/paging.js +155 -0
- package/components/rancherSortableTable/selection.js +629 -0
- package/components/rancherSortableTable/sortable-config.ts +4 -0
- package/components/rancherSortableTable/sorting.js +129 -0
- package/composables/useClickOutside.ts +1 -1
- package/config/product/auth.js +7 -16
- package/config/product/explorer.js +1 -1
- package/config/product/settings.js +8 -17
- package/config/settings.ts +0 -28
- package/edit/management.cattle.io.user.vue +4 -17
- package/edit/networking.k8s.io.ingress/RulePath.vue +1 -1
- package/edit/token.vue +1 -1
- package/list/harvesterhci.io.management.cluster.vue +0 -17
- package/list/management.cattle.io.setting.vue +13 -22
- package/list/management.cattle.io.user.vue +14 -25
- package/list/provisioning.cattle.io.cluster.vue +7 -6
- package/mixins/brand.js +0 -17
- package/package.json +1 -1
- package/pages/auth/login.vue +29 -84
- package/pages/c/_cluster/auth/roles/index.vue +14 -61
- package/pages/c/_cluster/settings/banners.vue +101 -174
- package/pages/c/_cluster/settings/brand.vue +301 -348
- package/pages/c/_cluster/settings/performance.vue +38 -61
- package/pages/home.vue +21 -70
- package/pages/prefs.vue +23 -25
- 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 +60 -86
- package/scripts/serve-pkgs +0 -0
- package/scripts/sync-shell-deps +0 -0
- package/scripts/typegen.sh +28 -44
- package/store/i18n.js +5 -5
- package/store/prefs.js +5 -17
- package/store/type-map.js +1 -2
- package/types/cloud-shell/index.d.ts +11014 -0
- package/types/shell/index.d.ts +1 -1
- package/utils/error.js +0 -4
- package/utils/router.js +3 -3
- package/vue.config.js +6 -1
- package/assets/images/action.svg +0 -6
- package/assets/images/pl/logo.png +0 -0
- /package/components/{ResourceList → rancherResourceList}/Masthead-btn.vue +0 -0
package/scripts/publish-shell.sh
CHANGED
|
@@ -1,136 +1,110 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
|
|
3
|
-
#
|
|
4
|
-
# TAG=shell-pkg-v3.0.2-rc.105 ./shell/scripts/publish-shell.sh
|
|
3
|
+
# 执行命令:TAG=cloud-shell-pkg-v{版本号} ./cloud-shell/scripts/publish-shell.sh
|
|
5
4
|
|
|
6
|
-
set -
|
|
5
|
+
set -eo pipefail
|
|
7
6
|
|
|
8
|
-
# --------------------------
|
|
9
|
-
# 基础路径
|
|
10
|
-
# --------------------------
|
|
11
7
|
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
|
|
12
|
-
BASE_DIR="$(cd
|
|
8
|
+
BASE_DIR="$(cd $SCRIPT_DIR && cd ../.. && pwd)"
|
|
13
9
|
echo "BASE_DIR is ${BASE_DIR}"
|
|
14
10
|
echo "SCRIPT_DIR is ${SCRIPT_DIR}"
|
|
15
11
|
echo "PWD is $(pwd)"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
CREATORS_DIR
|
|
19
|
-
|
|
12
|
+
CLOUD_SHELL_DIR=$BASE_DIR/cloud-shell/
|
|
13
|
+
echo "CLOUD_SHELL_DIR is ${CLOUD_SHELL_DIR}"
|
|
14
|
+
CREATORS_DIR=$BASE_DIR/creators/extension
|
|
20
15
|
FORCE_PUBLISH_TO_NPM="false"
|
|
21
16
|
DEFAULT_NPM_REGISTRY="https://registry.npmjs.org"
|
|
22
17
|
|
|
23
|
-
#
|
|
24
|
-
|
|
25
|
-
# --------------------------
|
|
26
|
-
if [ -z "${TAG:-}" ]; then
|
|
18
|
+
# if TAG doesn't exist, we can exit as it's needed for any type of publish.
|
|
19
|
+
if [ -z "$TAG" ]; then
|
|
27
20
|
echo "You need to set the TAG variable first!"
|
|
28
21
|
exit 1
|
|
29
22
|
fi
|
|
30
23
|
|
|
31
|
-
|
|
32
|
-
# node_modules 检查
|
|
33
|
-
# --------------------------
|
|
34
|
-
if [[ ! -d "$BASE_DIR/node_modules" ]]; then
|
|
24
|
+
if [ ! -d "${BASE_DIR}/node_modules" ]; then
|
|
35
25
|
echo "You need to run 'yarn install' first"
|
|
36
26
|
exit 1
|
|
37
27
|
fi
|
|
38
28
|
|
|
39
|
-
echo "Publishing Shell Packages"
|
|
29
|
+
echo "Publishing Cloud Shell Packages"
|
|
40
30
|
|
|
41
|
-
|
|
42
|
-
# NPM 发布参数
|
|
43
|
-
# --------------------------
|
|
44
|
-
if [[ "${1:-}" == "--npm" ]]; then
|
|
31
|
+
if [ "$1" == "--npm" ]; then
|
|
45
32
|
FORCE_PUBLISH_TO_NPM="true"
|
|
46
33
|
fi
|
|
47
34
|
|
|
48
|
-
if [
|
|
49
|
-
export NPM_REGISTRY
|
|
35
|
+
if [ "$FORCE_PUBLISH_TO_NPM" == "true" ]; then
|
|
36
|
+
export NPM_REGISTRY=$DEFAULT_NPM_REGISTRY
|
|
50
37
|
fi
|
|
51
38
|
|
|
52
|
-
PUBLISH_ARGS="--no-git-tag-version --access public --registry $
|
|
39
|
+
PUBLISH_ARGS="--no-git-tag-version --access public --registry $NPM_REGISTRY"
|
|
53
40
|
|
|
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
|
|
41
|
+
pushd ${CLOUD_SHELL_DIR} >/dev/null
|
|
64
42
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
if [[ "${DRY_RUN:-false}" == "true" ]]; then
|
|
77
|
-
local ARGS="$PUBLISH_ARGS --dry-run"
|
|
78
|
-
else
|
|
79
|
-
local ARGS="$PUBLISH_ARGS"
|
|
43
|
+
function publish() {
|
|
44
|
+
NAME=$1
|
|
45
|
+
FOLDER=$2
|
|
46
|
+
|
|
47
|
+
if [ -n "$3" ]; then
|
|
48
|
+
PKG_VERSION=$3
|
|
49
|
+
fi
|
|
50
|
+
|
|
51
|
+
if [ ${DRY_RUN} == "true" ]; then
|
|
52
|
+
PUBLISH_ARGS="$PUBLISH_ARGS --dry-run"
|
|
80
53
|
fi
|
|
81
54
|
|
|
82
|
-
echo "Publish to NPM - arguments ::: ${
|
|
83
|
-
echo "Publishing ${NAME} version ${VERSION} from ${FOLDER}"
|
|
55
|
+
echo "Publish to NPM - arguments ::: ${PUBLISH_ARGS}"
|
|
84
56
|
|
|
85
|
-
|
|
57
|
+
echo "Publishing ${NAME} from ${FOLDER}"
|
|
58
|
+
pushd ${FOLDER} >/dev/null
|
|
86
59
|
|
|
87
|
-
#
|
|
88
|
-
if [
|
|
60
|
+
# For now, copy the rancher components into the shell and ship them with it
|
|
61
|
+
if [ "$NAME" == "Cloud Shell" ]; then
|
|
89
62
|
echo "Adding Rancher Components"
|
|
90
63
|
rm -rf ./rancher-components
|
|
91
|
-
cp -R
|
|
64
|
+
cp -R ${BASE_DIR}/pkg/rancher-components/src/components ./rancher-components/
|
|
92
65
|
fi
|
|
93
66
|
|
|
94
|
-
|
|
95
|
-
node "$SCRIPT_DIR/record-deps.js" || {
|
|
96
|
-
echo "record-deps.js failed"
|
|
97
|
-
popd >/dev/null
|
|
98
|
-
exit 1
|
|
99
|
-
}
|
|
67
|
+
node ${SCRIPT_DIR}/record-deps.js
|
|
100
68
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
npm publish $
|
|
104
|
-
|
|
105
|
-
popd >/dev/null
|
|
106
|
-
exit 1
|
|
107
|
-
}
|
|
69
|
+
echo "Publishing to registry: $NPM_REGISTRY"
|
|
70
|
+
|
|
71
|
+
npm publish ${PUBLISH_ARGS}
|
|
72
|
+
RET=$?
|
|
108
73
|
|
|
109
74
|
popd >/dev/null
|
|
75
|
+
|
|
76
|
+
if [ $RET -ne 0 ]; then
|
|
77
|
+
echo "Error publishing package ${NAME}"
|
|
78
|
+
exit $RET
|
|
79
|
+
fi
|
|
110
80
|
}
|
|
111
81
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
#
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
82
|
+
echo "TAG ${TAG}"
|
|
83
|
+
|
|
84
|
+
# let's get the package name and version from the tag
|
|
85
|
+
PKG_NAME=$(sed 's/-pkg-v.*//' <<< "$TAG")
|
|
86
|
+
PKG_V=$(sed 's/.*-pkg-v//'<<< "$TAG")
|
|
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
|
|
118
94
|
fi
|
|
119
95
|
|
|
120
|
-
#
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
echo "Publishing only Shell pkg via tagged release"
|
|
126
|
-
publish "Shell" "$SHELL_DIR" "$PKG_V"
|
|
96
|
+
# version comparison checks
|
|
97
|
+
case $PKG_NAME in
|
|
98
|
+
"cloud-shell")
|
|
99
|
+
echo "Publishing only Cloud Shell pkg via tagged release"
|
|
100
|
+
publish "Cloud Shell" ${CLOUD_SHELL_DIR} ${PKG_V}
|
|
127
101
|
;;
|
|
128
102
|
"creators")
|
|
129
103
|
echo "Publishing only Creators pkg via tagged release"
|
|
130
|
-
publish "Extension creator"
|
|
104
|
+
publish "Extension creator" ${CREATORS_DIR} ${PKG_V}
|
|
131
105
|
;;
|
|
132
106
|
*)
|
|
133
|
-
echo "
|
|
107
|
+
echo "something went wrong with the tagging name => TAG: ${TAG} , PKG_NAME: ${PKG_NAME}. Admissable names are 'cloud-shell' and 'creators'"
|
|
134
108
|
exit 1
|
|
135
109
|
;;
|
|
136
110
|
esac
|
package/scripts/serve-pkgs
CHANGED
|
File without changes
|
package/scripts/sync-shell-deps
CHANGED
|
File without changes
|
package/scripts/typegen.sh
CHANGED
|
@@ -2,69 +2,53 @@
|
|
|
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
|
+
CLOUD_SHELL_DIR=$BASE_DIR/cloud-shell
|
|
6
6
|
|
|
7
|
-
echo "Generating typescript definitions"
|
|
7
|
+
echo "Generating typescript definitions in ${CLOUD_SHELL_DIR}"
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
# 清理 tmp 并创建目录
|
|
10
|
+
rm -rf ${CLOUD_SHELL_DIR}/tmp
|
|
11
|
+
mkdir -p ${CLOUD_SHELL_DIR}/tmp
|
|
11
12
|
|
|
12
13
|
echo "Generating ..."
|
|
13
14
|
|
|
14
15
|
# utils
|
|
15
|
-
${BASE_DIR}/node_modules/.bin/tsc ${
|
|
16
|
-
${BASE_DIR}/node_modules/.bin/tsc ${
|
|
17
|
-
${BASE_DIR}/node_modules/.bin/tsc ${
|
|
16
|
+
${BASE_DIR}/node_modules/.bin/tsc ${CLOUD_SHELL_DIR}/utils/*.js --declaration --allowJs --emitDeclarationOnly --outDir ${CLOUD_SHELL_DIR}/tmp/utils > /dev/null
|
|
17
|
+
${BASE_DIR}/node_modules/.bin/tsc ${CLOUD_SHELL_DIR}/utils/validators/*.js --declaration --allowJs --emitDeclarationOnly --outDir ${CLOUD_SHELL_DIR}/tmp/utils/validators > /dev/null
|
|
18
|
+
${BASE_DIR}/node_modules/.bin/tsc ${CLOUD_SHELL_DIR}/utils/crypto/*.js --declaration --allowJs --emitDeclarationOnly --outDir ${CLOUD_SHELL_DIR}/tmp/utils/crypto > /dev/null
|
|
18
19
|
|
|
19
20
|
# config
|
|
20
|
-
${BASE_DIR}/node_modules/.bin/tsc ${
|
|
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
|
|
21
|
+
${BASE_DIR}/node_modules/.bin/tsc ${CLOUD_SHELL_DIR}/config/*.js --declaration --allowJs --emitDeclarationOnly --outDir ${CLOUD_SHELL_DIR}/tmp/config > /dev/null
|
|
25
22
|
|
|
26
|
-
#
|
|
27
|
-
${BASE_DIR}/node_modules/.bin/tsc ${
|
|
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
|
|
23
|
+
# store
|
|
24
|
+
${BASE_DIR}/node_modules/.bin/tsc ${CLOUD_SHELL_DIR}/store/*.js --declaration --allowJs --emitDeclarationOnly --outDir ${CLOUD_SHELL_DIR}/tmp/store > /dev/null
|
|
30
25
|
|
|
31
|
-
#
|
|
32
|
-
${BASE_DIR}/node_modules/.bin/tsc ${
|
|
33
|
-
${BASE_DIR}/node_modules/.bin/tsc ${
|
|
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
|
|
26
|
+
# plugins
|
|
27
|
+
${BASE_DIR}/node_modules/.bin/tsc ${CLOUD_SHELL_DIR}/plugins/dashboard-store/*.js --declaration --allowJs --emitDeclarationOnly --outDir ${CLOUD_SHELL_DIR}/tmp/plugins/dashboard-store/ > /dev/null
|
|
28
|
+
${BASE_DIR}/node_modules/.bin/tsc ${CLOUD_SHELL_DIR}/plugins/steve/*.js --declaration --allowJs --emitDeclarationOnly --outDir ${CLOUD_SHELL_DIR}/tmp/plugins/steve/ > /dev/null
|
|
38
29
|
|
|
39
|
-
#
|
|
40
|
-
${BASE_DIR}/node_modules/.bin/tsc ${
|
|
41
|
-
${BASE_DIR}/node_modules/.bin/tsc ${SHELL_DIR}/mixins/resource-fetch.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/mixins > /dev/null
|
|
30
|
+
# mixins
|
|
31
|
+
${BASE_DIR}/node_modules/.bin/tsc ${CLOUD_SHELL_DIR}/mixins/**/*.js --declaration --allowJs --emitDeclarationOnly --outDir ${CLOUD_SHELL_DIR}/tmp/mixins > /dev/null
|
|
42
32
|
|
|
43
|
-
#
|
|
44
|
-
${BASE_DIR}/node_modules/.bin/tsc ${
|
|
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
|
|
33
|
+
# models
|
|
34
|
+
${BASE_DIR}/node_modules/.bin/tsc ${CLOUD_SHELL_DIR}/models/*.js --declaration --allowJs --emitDeclarationOnly --outDir ${CLOUD_SHELL_DIR}/tmp/models/ > /dev/null
|
|
47
35
|
|
|
48
|
-
|
|
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
|
|
36
|
+
echo "Contents of ${CLOUD_SHELL_DIR}/tmp after tsc commands:"
|
|
37
|
+
find ${CLOUD_SHELL_DIR}/tmp
|
|
54
38
|
|
|
55
39
|
echo "Combining type definitions ..."
|
|
56
40
|
|
|
57
|
-
DEST=${
|
|
41
|
+
DEST=${CLOUD_SHELL_DIR}/types/cloud-shell
|
|
58
42
|
mkdir -p ${DEST}
|
|
59
43
|
|
|
60
44
|
INDEX=${DEST}/index.d.ts
|
|
61
45
|
rm -rf ${INDEX}
|
|
62
46
|
|
|
63
|
-
echo "// Auto-generated type definitions for shell" > ${INDEX}
|
|
47
|
+
echo "// Auto-generated type definitions for cloud-shell" > ${INDEX}
|
|
64
48
|
echo "// Do not modify this file as changes will get overwritten" >> ${INDEX}
|
|
65
49
|
|
|
66
|
-
echo "/// <reference types=\"@rancher/shell/types/vue-shim\" />" >> ${INDEX}
|
|
67
|
-
echo "/// <reference types=\"@rancher/shell/types/global-vue\" />" >> ${INDEX}
|
|
50
|
+
echo "/// <reference types=\"@rancher/cloud-shell/types/vue-shim\" />" >> ${INDEX}
|
|
51
|
+
echo "/// <reference types=\"@rancher/cloud-shell/types/global-vue\" />" >> ${INDEX}
|
|
68
52
|
|
|
69
53
|
function processDir() {
|
|
70
54
|
local dir=$1
|
|
@@ -78,9 +62,7 @@ function processDir() {
|
|
|
78
62
|
processDir $entry $basePkg/$filename
|
|
79
63
|
else
|
|
80
64
|
if [[ $filename == *.d.ts ]]; then
|
|
81
|
-
# We use convoluted mechanism here to ensure this works on mac with bash 3.x
|
|
82
65
|
local name=$(echo $filename | rev | cut -c6- | rev)
|
|
83
|
-
|
|
84
66
|
local module=${basePkg}/${name}
|
|
85
67
|
if [ "${name}" == "index" ]; then
|
|
86
68
|
module=${basePkg}
|
|
@@ -95,6 +77,8 @@ function processDir() {
|
|
|
95
77
|
done
|
|
96
78
|
}
|
|
97
79
|
|
|
98
|
-
processDir ${
|
|
80
|
+
processDir ${CLOUD_SHELL_DIR}/tmp @cloud-shell
|
|
81
|
+
|
|
82
|
+
rm -rf ${CLOUD_SHELL_DIR}/tmp
|
|
99
83
|
|
|
100
|
-
|
|
84
|
+
echo "Type generation completed in ${CLOUD_SHELL_DIR}"
|
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 zh from '@shell/assets/translations/zh-hans.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 = 'zh-hans';
|
|
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 = ['zh-hans'
|
|
21
|
+
const available = [DEFAULT_LOCALE, 'zh-hans'];
|
|
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]: zh },
|
|
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 = state.default;
|
|
233
233
|
}
|
|
234
234
|
|
|
235
235
|
return dispatch('switchTo', selected);
|
package/store/prefs.js
CHANGED
|
@@ -57,16 +57,14 @@ 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
|
-
|
|
61
|
-
options: ['light'],
|
|
60
|
+
options: ['light', 'auto', 'dark'],
|
|
62
61
|
asCookie,
|
|
63
62
|
parseJSON,
|
|
64
63
|
mangleRead: (x) => x.replace(/^ui-/, ''),
|
|
65
|
-
|
|
66
|
-
mangleWrite: (x) => `ui-light`, // 接口同时修改为 白色
|
|
64
|
+
mangleWrite: (x) => `ui-${ x }`,
|
|
67
65
|
});
|
|
68
66
|
export const PREFERS_SCHEME = create('pcs', '', { asCookie, asUserPreference: false });
|
|
69
|
-
export const LOCALE = create('locale', '
|
|
67
|
+
export const LOCALE = create('locale', 'en-us', { asCookie });
|
|
70
68
|
export const KEYMAP = create('keymap', 'sublime', { options: ['sublime', 'emacs', 'vim'] });
|
|
71
69
|
export const ROWS_PER_PAGE = create('per-page', 100, { options: [10, 25, 50, 100], parseJSON });
|
|
72
70
|
export const LOGS_WRAP = create('logs-wrap', true, { parseJSON });
|
|
@@ -105,10 +103,7 @@ export const THEME_SHORTCUT = create('theme-shortcut', false, { parseJSON, inher
|
|
|
105
103
|
export const LAST_VISITED = create('last-visited', 'home', { parseJSON });
|
|
106
104
|
export const SEEN_WHATS_NEW = create('seen-whatsnew', '', { parseJSON });
|
|
107
105
|
export const READ_WHATS_NEW = create('read-whatsnew', '', { parseJSON });
|
|
108
|
-
export const AFTER_LOGIN_ROUTE = create('after-login-route', 'home', {
|
|
109
|
-
parseJSON,
|
|
110
|
-
// mangleWrite: (x) => `ui-light`, // 接口同时修改为 白色
|
|
111
|
-
} );
|
|
106
|
+
export const AFTER_LOGIN_ROUTE = create('after-login-route', 'home', { parseJSON } );
|
|
112
107
|
export const HIDE_HOME_PAGE_CARDS = create('home-page-cards', {}, { parseJSON } );
|
|
113
108
|
export const PLUGIN_DEVELOPER = create('plugin-developer', false, { parseJSON, inheritFrom: DEV }); // Is the user a plugin developer?
|
|
114
109
|
|
|
@@ -154,11 +149,6 @@ export const getters = {
|
|
|
154
149
|
}
|
|
155
150
|
|
|
156
151
|
const def = clone(definition.def);
|
|
157
|
-
|
|
158
|
-
if (key === THEME) {
|
|
159
|
-
// 无论 state 里存的是什么,都强制返回 light
|
|
160
|
-
return 'light';
|
|
161
|
-
}
|
|
162
152
|
|
|
163
153
|
return def;
|
|
164
154
|
},
|
|
@@ -481,9 +471,7 @@ export const actions = {
|
|
|
481
471
|
try {
|
|
482
472
|
value = JSON.parse(value);
|
|
483
473
|
} catch (err) {
|
|
484
|
-
//
|
|
485
|
-
console.warn(`Pref ${ key } has invalid JSON, resetting`, value);
|
|
486
|
-
value = definition.defaultValue || null;
|
|
474
|
+
console.error('Error parsing server pref', key, value, err); // eslint-disable-line no-console
|
|
487
475
|
continue;
|
|
488
476
|
}
|
|
489
477
|
}
|
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,7 +718,6 @@ 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;
|
|
722
721
|
}
|
|
723
722
|
|
|
724
723
|
group.children.push({
|