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.
Files changed (124) hide show
  1. package/assets/styles/base/_functions.scss +0 -0
  2. package/assets/styles/base/_mixins.scss +1 -1
  3. package/assets/styles/global/_button.scss +10 -17
  4. package/assets/styles/global/_form.scss +2 -2
  5. package/assets/styles/global/_labeled-input.scss +2 -6
  6. package/assets/styles/global/_select.scss +7 -6
  7. package/assets/styles/global/_table.scss +2 -3
  8. package/assets/styles/global/_tooltip.scss +1 -8
  9. package/assets/styles/themes/_dark.scss +0 -2
  10. package/assets/styles/themes/_light.scss +2 -5
  11. package/assets/styles/vendor/vue-select.scss +1 -2
  12. package/assets/translations/en-us.yaml +3 -1
  13. package/assets/translations/zh-hans.yaml +28 -51
  14. package/components/ActionDropdown.vue +0 -1
  15. package/components/ActionMenuShell.vue +3 -6
  16. package/components/BrandImage.vue +0 -22
  17. package/components/ClusterIconMenu.vue +1 -1
  18. package/components/CodeMirror.vue +0 -1
  19. package/components/CruResource.vue +1 -1
  20. package/components/CruResourceFooter.vue +1 -1
  21. package/components/ExplorerProjectsNamespaces.vue +24 -4
  22. package/components/GlobalRoleBindings.vue +48 -112
  23. package/components/IndentedPanel.vue +10 -4
  24. package/components/PromptRemove.vue +3 -3
  25. package/components/ResourceDetail/Masthead.vue +242 -190
  26. package/components/ResourceDetail/index.vue +5 -20
  27. package/components/ResourceList/Masthead.vue +84 -146
  28. package/components/ResourceList/ResourceLoadingIndicator.vue +2 -5
  29. package/components/ResourceTable.vue +1 -76
  30. package/components/SideNav.vue +29 -66
  31. package/components/SortableTable/THead.vue +0 -6
  32. package/components/SortableTable/index.vue +388 -481
  33. package/components/Tabbed/index.vue +5 -4
  34. package/components/auth/Principal.vue +2 -3
  35. package/components/auth/RoleDetailEdit.vue +5 -58
  36. package/components/auth/SelectPrincipal.vue +0 -1
  37. package/components/form/BannerSettings.vue +16 -18
  38. package/components/form/ChangePassword.vue +4 -4
  39. package/components/form/ColorInput.vue +8 -32
  40. package/components/form/Footer.vue +1 -1
  41. package/components/form/InputWithSelect.vue +0 -2
  42. package/components/form/KeyValue.vue +7 -31
  43. package/components/form/LabeledSelect.vue +178 -178
  44. package/components/form/Members/ClusterPermissionsEditor.vue +2 -1
  45. package/components/form/Members/MembershipEditor.vue +1 -1
  46. package/components/form/NameNsDescription.vue +11 -24
  47. package/components/form/Password.vue +2 -6
  48. package/components/form/ResourceQuota/Namespace.vue +1 -1
  49. package/components/form/ResourceQuota/NamespaceRow.vue +10 -13
  50. package/components/form/ResourceQuota/ProjectRow.vue +1 -0
  51. package/components/form/Select.vue +2 -2
  52. package/components/nav/Favorite.vue +1 -5
  53. package/components/nav/Group.vue +23 -69
  54. package/components/nav/Header.vue +17 -82
  55. package/components/nav/HeaderPageActionMenu.vue +0 -1
  56. package/components/nav/NamespaceFilter.vue +3 -0
  57. package/components/nav/TopLevelMenu.vue +119 -182
  58. package/components/nav/Type.vue +11 -48
  59. package/components/rancherResourceDetail/Masthead.vue +769 -0
  60. package/components/rancherResourceDetail/__tests__/Masthead.test.ts +65 -0
  61. package/components/rancherResourceDetail/index.vue +591 -0
  62. package/components/rancherResourceList/Masthead.vue +375 -0
  63. package/components/rancherResourceList/ResourceLoadingIndicator.vue +140 -0
  64. package/components/rancherResourceList/index.vue +307 -0
  65. package/components/rancherResourceList/resource-list.config.js +7 -0
  66. package/components/rancherResourceTable.vue +783 -0
  67. package/components/rancherSortableTable/THead.vue +561 -0
  68. package/components/rancherSortableTable/actions.js +153 -0
  69. package/components/rancherSortableTable/advanced-filtering.js +272 -0
  70. package/components/rancherSortableTable/debug.js +117 -0
  71. package/components/rancherSortableTable/filtering.js +290 -0
  72. package/components/rancherSortableTable/grouping.js +48 -0
  73. package/components/rancherSortableTable/index.vue +2712 -0
  74. package/components/rancherSortableTable/paging.js +155 -0
  75. package/components/rancherSortableTable/selection.js +629 -0
  76. package/components/rancherSortableTable/sortable-config.ts +4 -0
  77. package/components/rancherSortableTable/sorting.js +129 -0
  78. package/composables/useClickOutside.ts +1 -1
  79. package/config/product/auth.js +7 -16
  80. package/config/product/explorer.js +1 -1
  81. package/config/product/settings.js +8 -17
  82. package/config/settings.ts +0 -28
  83. package/edit/management.cattle.io.user.vue +4 -17
  84. package/edit/networking.k8s.io.ingress/RulePath.vue +1 -1
  85. package/edit/token.vue +1 -1
  86. package/list/harvesterhci.io.management.cluster.vue +0 -17
  87. package/list/management.cattle.io.setting.vue +13 -22
  88. package/list/management.cattle.io.user.vue +14 -25
  89. package/list/provisioning.cattle.io.cluster.vue +7 -6
  90. package/mixins/brand.js +0 -17
  91. package/package.json +1 -1
  92. package/pages/auth/login.vue +29 -84
  93. package/pages/c/_cluster/auth/roles/index.vue +14 -61
  94. package/pages/c/_cluster/settings/banners.vue +101 -174
  95. package/pages/c/_cluster/settings/brand.vue +301 -348
  96. package/pages/c/_cluster/settings/performance.vue +38 -61
  97. package/pages/home.vue +21 -70
  98. package/pages/prefs.vue +23 -25
  99. package/pkg/tsconfig.json +9 -9
  100. package/pkg/vue.config.js +1 -1
  101. package/promptRemove/mixin/roleDeletionCheck.js +2 -2
  102. package/scripts/clean +0 -0
  103. package/scripts/extension/bundle +0 -0
  104. package/scripts/extension/helm/scripts/package +0 -0
  105. package/scripts/extension/helm/scripts/patch +0 -0
  106. package/scripts/extension/helm/scripts/version +0 -0
  107. package/scripts/extension/helmpatch +0 -0
  108. package/scripts/extension/parse-tag-name +0 -0
  109. package/scripts/extension/publish +0 -0
  110. package/scripts/publish-shell.sh +60 -86
  111. package/scripts/serve-pkgs +0 -0
  112. package/scripts/sync-shell-deps +0 -0
  113. package/scripts/typegen.sh +28 -44
  114. package/store/i18n.js +5 -5
  115. package/store/prefs.js +5 -17
  116. package/store/type-map.js +1 -2
  117. package/types/cloud-shell/index.d.ts +11014 -0
  118. package/types/shell/index.d.ts +1 -1
  119. package/utils/error.js +0 -4
  120. package/utils/router.js +3 -3
  121. package/vue.config.js +6 -1
  122. package/assets/images/action.svg +0 -6
  123. package/assets/images/pl/logo.png +0 -0
  124. /package/components/{ResourceList → rancherResourceList}/Masthead-btn.vue +0 -0
@@ -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 -euo pipefail
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 "$SCRIPT_DIR" && cd ../.. && pwd)"
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
- SHELL_DIR="$BASE_DIR/shell/"
18
- CREATORS_DIR="$BASE_DIR/creators/extension"
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
- # TAG 必须存在
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 [[ "$FORCE_PUBLISH_TO_NPM" == "true" ]]; then
49
- export NPM_REGISTRY="$DEFAULT_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 ${NPM_REGISTRY:-$DEFAULT_NPM_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
- 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"
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 ::: ${ARGS}"
83
- echo "Publishing ${NAME} version ${VERSION} from ${FOLDER}"
55
+ echo "Publish to NPM - arguments ::: ${PUBLISH_ARGS}"
84
56
 
85
- pushd "$FOLDER" >/dev/null || exit 1
57
+ echo "Publishing ${NAME} from ${FOLDER}"
58
+ pushd ${FOLDER} >/dev/null
86
59
 
87
- # 复制 rancher-components
88
- if [[ "$NAME" == "Shell" ]]; then
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 "$BASE_DIR/pkg/rancher-components/src/components" ./rancher-components/
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
- # 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
- }
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
- # 生成 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; }
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
- # 根据 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"
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" "$CREATORS_DIR" "$PKG_V"
104
+ publish "Extension creator" ${CREATORS_DIR} ${PKG_V}
131
105
  ;;
132
106
  *)
133
- echo "Something went wrong with the tagging name => TAG: ${TAG}, PKG_NAME: ${PKG_NAME}. Admissible names are 'shell' and 'creators'"
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
File without changes
File without changes
@@ -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
- SHELL_DIR=$BASE_DIR/shell
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
- rm -rf ${SHELL_DIR}/tmp
10
- mkdir -p ${SHELL_DIR}/tmp
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 ${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
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 ${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
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
- # # 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
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
- # # 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
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
- # # 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
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
- # # 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
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
- #./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
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=${SHELL_DIR}/types/shell
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 ${SHELL_DIR}/tmp @shell
80
+ processDir ${CLOUD_SHELL_DIR}/tmp @cloud-shell
81
+
82
+ rm -rf ${CLOUD_SHELL_DIR}/tmp
99
83
 
100
- rm -rf ${SHELL_DIR}/tmp
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 en from '@shell/assets/translations/en-us.yaml';
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 = 'en-us';
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', DEFAULT_LOCALE ];
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]: en },
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 = 'zh-hans';
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
- // options: ['light', 'auto', 'dark'],
61
- options: ['light'],
60
+ options: ['light', 'auto', 'dark'],
62
61
  asCookie,
63
62
  parseJSON,
64
63
  mangleRead: (x) => x.replace(/^ui-/, ''),
65
- // mangleWrite: (x) => `ui-${ x }`,
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', 'zh-hans', { asCookie });
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
- // 容错处理:如果后端返回 map[...] 这样的字符串,直接忽略或重置为空
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]?.find(item => item.name === name)?.icon || '';
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({