@rancher/shell 0.3.17 → 0.3.19

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 (118) hide show
  1. package/assets/translations/en-us.yaml +8 -4
  2. package/assets/translations/zh-hans.yaml +64 -8
  3. package/components/AsyncButton.vue +1 -1
  4. package/components/Inactivity.vue +10 -0
  5. package/components/LazyImage.vue +2 -2
  6. package/components/PromptRestore.vue +8 -6
  7. package/components/ResourceDetail/Masthead.vue +1 -1
  8. package/components/ResourceDetail/index.vue +4 -2
  9. package/components/__tests__/PromptRestore.test.ts +142 -0
  10. package/components/auth/AzureWarning.vue +1 -1
  11. package/components/auth/RoleDetailEdit.vue +2 -0
  12. package/components/fleet/FleetResources.vue +3 -64
  13. package/components/form/FileImageSelector.vue +9 -0
  14. package/components/form/FileSelector.vue +2 -1
  15. package/components/form/MatchExpressions.vue +1 -3
  16. package/components/form/__tests__/FileImageSelector.test.ts +42 -0
  17. package/components/form/__tests__/FileSelector.test.ts +76 -0
  18. package/components/formatter/ClusterProvider.vue +3 -1
  19. package/components/formatter/__tests__/ClusterProvider.test.ts +24 -0
  20. package/components/nav/WindowManager/ContainerShell.vue +60 -36
  21. package/components/nav/WindowManager/__tests__/ContainerShell.test.ts +561 -0
  22. package/config/labels-annotations.js +2 -1
  23. package/config/persistentVolume.ts +108 -0
  24. package/config/product/manager.js +5 -1
  25. package/config/types.js +2 -0
  26. package/core/plugin-helpers.js +19 -3
  27. package/core/types.ts +4 -0
  28. package/detail/fleet.cattle.io.gitrepo.vue +10 -2
  29. package/detail/pod.vue +36 -3
  30. package/detail/workload/index.vue +40 -9
  31. package/dialog/DiagnosticTimingsDialog.vue +1 -0
  32. package/edit/__tests__/ui.cattle.io.navlink.test.ts +110 -0
  33. package/edit/fleet.cattle.io.clustergroup.vue +14 -3
  34. package/edit/persistentvolume/__tests__/persistentvolume.test.ts +82 -0
  35. package/edit/persistentvolume/index.vue +2 -1
  36. package/edit/persistentvolume/plugins/csi.vue +3 -1
  37. package/edit/persistentvolume/plugins/longhorn.vue +12 -12
  38. package/edit/provisioning.cattle.io.cluster/RegistryConfigs.vue +15 -11
  39. package/edit/provisioning.cattle.io.cluster/index.vue +1 -1
  40. package/edit/provisioning.cattle.io.cluster/rke2.vue +5 -1
  41. package/edit/storage.k8s.io.storageclass/index.vue +1 -2
  42. package/edit/ui.cattle.io.navlink.vue +213 -186
  43. package/layouts/default.vue +1 -1
  44. package/list/group.principal.vue +1 -1
  45. package/middleware/authenticated.js +12 -4
  46. package/mixins/create-edit-view/impl.js +2 -2
  47. package/models/chart.js +1 -1
  48. package/models/etcdbackup.js +2 -1
  49. package/models/fleet.cattle.io.cluster.js +33 -4
  50. package/models/fleet.cattle.io.gitrepo.js +112 -38
  51. package/models/management.cattle.io.cluster.js +13 -3
  52. package/models/management.cattle.io.kontainerdriver.js +14 -0
  53. package/models/persistentvolume.js +2 -111
  54. package/models/pod.js +30 -0
  55. package/models/rke.cattle.io.etcdsnapshot.js +10 -7
  56. package/package.json +1 -1
  57. package/pages/c/_cluster/apps/charts/install.vue +74 -25
  58. package/pages/c/_cluster/auth/group.principal/assign-edit.vue +1 -1
  59. package/pages/c/_cluster/auth/roles/index.vue +1 -1
  60. package/pages/c/_cluster/explorer/index.vue +1 -1
  61. package/pages/c/_cluster/manager/cloudCredential/_id.vue +0 -1
  62. package/pages/c/_cluster/manager/cloudCredential/create.vue +0 -1
  63. package/pages/c/_cluster/settings/brand.vue +11 -8
  64. package/pages/c/_cluster/uiplugins/index.vue +9 -4
  65. package/pages/diagnostic.vue +5 -3
  66. package/pages/home.vue +1 -1
  67. package/plugins/dashboard-store/__tests__/actions.spec.ts +165 -0
  68. package/plugins/dashboard-store/__tests__/getters.spec.ts +100 -0
  69. package/plugins/dashboard-store/__tests__/{mutations.spec.js → mutations.spec.ts} +2 -2
  70. package/plugins/dashboard-store/actions.js +1 -1
  71. package/plugins/dashboard-store/resource-class.js +4 -0
  72. package/plugins/steve/__tests__/getters.spec.ts +93 -0
  73. package/plugins/steve/getters.js +21 -1
  74. package/plugins/steve/subscribe.js +1 -3
  75. package/rancher-components/components/BadgeState/BadgeState.spec.ts +12 -0
  76. package/rancher-components/components/BadgeState/BadgeState.vue +111 -0
  77. package/rancher-components/components/BadgeState/index.ts +1 -0
  78. package/rancher-components/components/Banner/Banner.test.ts +63 -0
  79. package/rancher-components/components/Banner/Banner.vue +244 -0
  80. package/rancher-components/components/Banner/index.ts +1 -0
  81. package/rancher-components/components/Card/Card.test.ts +37 -0
  82. package/rancher-components/components/Card/Card.vue +167 -0
  83. package/rancher-components/components/Card/index.ts +1 -0
  84. package/rancher-components/components/Form/Checkbox/Checkbox.test.ts +68 -0
  85. package/rancher-components/components/Form/Checkbox/Checkbox.vue +420 -0
  86. package/rancher-components/components/Form/Checkbox/index.ts +1 -0
  87. package/rancher-components/components/Form/LabeledInput/LabeledInput.test.ts +23 -0
  88. package/rancher-components/components/Form/LabeledInput/LabeledInput.vue +355 -0
  89. package/rancher-components/components/Form/LabeledInput/index.ts +1 -0
  90. package/rancher-components/components/Form/Radio/RadioButton.test.ts +31 -0
  91. package/rancher-components/components/Form/Radio/RadioButton.vue +287 -0
  92. package/rancher-components/components/Form/Radio/RadioGroup.vue +254 -0
  93. package/rancher-components/components/Form/Radio/index.ts +2 -0
  94. package/rancher-components/components/Form/TextArea/TextAreaAutoGrow.vue +170 -0
  95. package/rancher-components/components/Form/TextArea/index.ts +1 -0
  96. package/rancher-components/components/Form/ToggleSwitch/ToggleSwitch.test.ts +94 -0
  97. package/rancher-components/components/Form/ToggleSwitch/ToggleSwitch.vue +149 -0
  98. package/rancher-components/components/Form/ToggleSwitch/index.ts +1 -0
  99. package/rancher-components/components/Form/index.ts +5 -0
  100. package/rancher-components/components/LabeledTooltip/LabeledTooltip.vue +151 -0
  101. package/rancher-components/components/LabeledTooltip/index.ts +1 -0
  102. package/rancher-components/components/StringList/StringList.test.ts +484 -0
  103. package/rancher-components/components/StringList/StringList.vue +611 -0
  104. package/rancher-components/components/StringList/index.ts +1 -0
  105. package/scripts/extension/publish +54 -14
  106. package/scripts/typegen.sh +10 -2
  107. package/store/index.js +1 -3
  108. package/store/store-types.js +2 -0
  109. package/types/api.d.ts +1 -0
  110. package/types/fleet.d.ts +1 -0
  111. package/types/shell/index.d.ts +696 -2
  112. package/types/userPreferences.d.ts +1 -1
  113. package/utils/__mocks__/socket.js +21 -0
  114. package/utils/grafana.js +23 -11
  115. package/utils/selector.js +2 -1
  116. package/utils/socket.js +1 -0
  117. package/utils/validators/formRules/index.ts +3 -3
  118. package/plugins/steve/urloptions.js +0 -47
@@ -2,7 +2,6 @@
2
2
 
3
3
  SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
4
4
  BASE_DIR="$(pwd)"
5
- BASE_EXT=$(basename ${BASE_DIR})
6
5
 
7
6
  CYAN="\033[96m"
8
7
  YELLOW="\033[93m"
@@ -17,6 +16,7 @@ REGISTRY_ORG=""
17
16
  IMAGE_PREFIX="ui-extension-"
18
17
  FORCE="false"
19
18
  GITHUB_BUILD="true"
19
+ GITHUB_RELEASE_TAG=""
20
20
 
21
21
  GITHUB_SOURCE=$(git config --get remote.origin.url | sed -e 's/^git@.*:\([[:graph:]]*\).git/\1/')
22
22
  GITHUB_BRANCH="main"
@@ -24,18 +24,19 @@ GITHUB_BRANCH="main"
24
24
  usage() {
25
25
  echo "Usage: $0 [<options>] [plugins]"
26
26
  echo " options:"
27
- echo " -p Push container images on build"
27
+ echo " -s <repo> Specify destination GitHub repository (org/name) - defaults to the git origin"
28
+ echo " -b <branch> Specify destination GitHub branch"
29
+ echo " -t <tag> Specify the Github release tag to build when a release has been tagged and published"
28
30
  echo " -f Force building the chart even if it already exists"
31
+ echo " -c Build as a container image rather than publishing to Github"
32
+ echo " -p Push container images on build"
29
33
  echo " -r <name> Specify destination container registry for built images"
30
34
  echo " -o <name> Specify destination container registry organization for built images"
31
35
  echo " -i <prefix> Specify prefix for the built container image (default: 'ui-extension-')"
32
- echo " -c Build as a container image rather than publishing to Github"
33
- echo " -s <repo> Specify destination GitHub repository (org/name) - defaults to the git origin"
34
- echo " -b <branch> Specify destination GitHub branch"
35
36
  exit 1
36
37
  }
37
38
 
38
- while getopts "hvr:o:pi:fcb:s:" opt; do
39
+ while getopts "hvr:o:pi:fcb:t:s:" opt; do
39
40
  case $opt in
40
41
  h)
41
42
  usage
@@ -66,6 +67,9 @@ while getopts "hvr:o:pi:fcb:s:" opt; do
66
67
  GITHUB_BUILD="true"
67
68
  GITHUB_BRANCH="${OPTARG}"
68
69
  ;;
70
+ t)
71
+ GITHUB_RELEASE_TAG="${OPTARG}"
72
+ ;;
69
73
  *)
70
74
  usage
71
75
  ;;
@@ -90,6 +94,10 @@ if [ "${GITHUB_BUILD}" == "true" ]; then
90
94
 
91
95
  echo -e "${CYAN}GitHub Repository: ${GITHUB_SOURCE}${RESET}"
92
96
  echo -e "${CYAN}GitHub Branch : ${GITHUB_BRANCH}${RESET}"
97
+
98
+ if [[ -n "${GITHUB_RELEASE_TAG}" ]]; then
99
+ echo -e "${CYAN}GitHub Release : ${GITHUB_RELEASE_TAG}${RESET}"
100
+ fi
93
101
  else
94
102
  echo -e ${CYAN}"Image prefix: ${IMAGE_PREFIX}${RESET}"
95
103
  fi
@@ -116,7 +124,11 @@ if ! [[ -d ${BASE_DIR}/node_modules ]]; then
116
124
  exit 1
117
125
  fi
118
126
 
119
- COMMANDS=("node" "jq" "yq" "git" "docker" "helm" "yarn")
127
+ COMMANDS=("node" "jq" "yq" "git" "helm" "yarn")
128
+ if [ "${GITHUB_BUILD}" == "false" ]; then
129
+ COMMANDS+=("docker")
130
+ fi
131
+
120
132
  HAVE_COMMANDS="true"
121
133
  for CMD in "${COMMANDS[@]}"
122
134
  do
@@ -132,7 +144,15 @@ fi
132
144
 
133
145
  # --------------------------------------------------------------------------------
134
146
  # Only do conatiner args checks if not GitHub publish
147
+ # --------------------------------------------------------------------------------
135
148
  if [ "${GITHUB_BUILD}" == "false" ]; then
149
+ BASE_EXT=$(jq -r .name ${BASE_DIR}/package.json)
150
+ EXT_VERSION=$(jq -r .version ${BASE_DIR}/package.json)
151
+
152
+ if [ -z ${EXT_VERSION} ]; then
153
+ EXT_VERSION="0.0.0"
154
+ fi
155
+
136
156
  if [[ -z ${REGISTRY_ORG} ]]; then
137
157
  # Infer that the user has the same Docker registry org as their GitHub org
138
158
  GITHUB_REPO=$(git config --get remote.origin.url | sed -e 's/^git@.*:\([[:graph:]]*\).git/\1/')
@@ -146,6 +166,12 @@ if [ "${GITHUB_BUILD}" == "false" ]; then
146
166
  exit 1
147
167
  fi
148
168
 
169
+ if [ -n "${GITHUB_RELEASE_TAG}" ] && [[ ${GITHUB_RELEASE_TAG} != "${BASE_EXT}-${EXT_VERSION}" ]]; then
170
+ echo -e "${YELLOW}Github tagged release name does not match ${RESET}${BOLD}${BASE_EXT}-${EXT_VERSION}${RESET}"
171
+ echo -e "${YELLOW}Stopping build${RESET}"
172
+ exit 1
173
+ fi
174
+
149
175
  docker images > /dev/null
150
176
  if [ $? -ne 0 ]; then
151
177
  echo "docker is not running - this is required to build container images for the UI Plugins"
@@ -185,6 +211,13 @@ for d in pkg/*/ ; do
185
211
  PKG_NAME="${pkg}-${PKG_VERSION}"
186
212
  PKG_ASSET=${ASSETS}/${pkg}/${PKG_NAME}.tgz
187
213
 
214
+ # Skip the build for a package that does not match the tagged release name
215
+ if [[ -n "${GITHUB_RELEASE_TAG}" ]] && [ ${GITHUB_BUILD} == "true" ] && [[ ${GITHUB_RELEASE_TAG} != ${PKG_NAME} ]]; then
216
+ echo -e "${YELLOW}Github release tag ${RESET}${BOLD}${GITHUB_RELEASE_TAG}${RESET}${YELLOW} does not match asset name${RESET}"
217
+ echo -e "${YELLOW}Skipping ${RESET}${BOLD}${PKG_NAME}${RESET}"
218
+ continue
219
+ fi
220
+
188
221
  echo -e "${CYAN}${BOLD}Building plugin: ${pkg} (${PKG_VERSION}) ${RESET}"
189
222
 
190
223
  echo "Package version: ${PKG_VERSION}"
@@ -299,6 +332,15 @@ for d in pkg/*/ ; do
299
332
  fi
300
333
  done
301
334
 
335
+ if [ "${GITHUB_BUILD}" == "true" ] && [[ -n "${GITHUB_RELEASE_TAG}" ]] && [ "${BUILT}" == "false" ]; then
336
+ echo -e "${YELLOW}Github release tag ${RESET}${BOLD}${GITHUB_RELEASE_TAG}${RESET}${YELLOW} did not match any package name.${RESET}"
337
+ echo -e "${YELLOW}Stopping build${RESET}"
338
+
339
+ rm -rf ${CHART_TMP}
340
+ rm -rf ${TMP}
341
+ exit 1
342
+ fi
343
+
302
344
  if [ -f ${ROOT_INDEX} ] && [ "${GITHUB_BUILD}" == "false" ]; then
303
345
  UPDATE="--merge ${ROOT_INDEX}"
304
346
  helm repo index ${ASSETS} ${UPDATE}
@@ -309,12 +351,6 @@ if [ -f ${ASSETS}/index.yaml ] && ! [ -e "${ROOT_INDEX}" ]; then
309
351
  fi
310
352
 
311
353
  if [ "${GITHUB_BUILD}" == "false" ]; then
312
- EXT_VERSION=$(jq -r .version ${BASE_DIR}/package.json)
313
-
314
- if [ -z ${EXT_VERSION} ]; then
315
- EXT_VERSION="0.0.0"
316
- fi
317
-
318
354
  echo -e "${CYAN}Base extension: ${BASE_EXT}${RESET}"
319
355
  echo -e "${CYAN}Extension version: ${EXT_VERSION}${RESET}"
320
356
 
@@ -325,7 +361,11 @@ else
325
361
  fi
326
362
 
327
363
  if [ "${GITHUB_BUILD}" == "true" ] && [ -f ${ROOT_INDEX} ]; then
328
- cp ${ROOT_INDEX} tmp
364
+ if [[ -n "${GITHUB_RELEASE_TAG}" ]] && [ -f ${ASSETS}/index.yaml ]; then
365
+ cp ${ASSETS}/index.yaml tmp
366
+ else
367
+ cp ${ROOT_INDEX} tmp
368
+ fi
329
369
  fi
330
370
 
331
371
  if [ "${GITHUB_BUILD}" == "true" ] && [ "${BUILT}" == "true" ]; then
@@ -13,6 +13,8 @@ echo "Generating ..."
13
13
 
14
14
  # utils
15
15
  ${BASE_DIR}/node_modules/.bin/tsc shell/utils/*.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/utils > /dev/null
16
+ ${BASE_DIR}/node_modules/.bin/tsc shell/utils/validators/*.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/utils/validators > /dev/null
17
+ ${BASE_DIR}/node_modules/.bin/tsc shell/utils/crypto/*.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/utils/crypto > /dev/null
16
18
 
17
19
  # config
18
20
  ${BASE_DIR}/node_modules/.bin/tsc shell/config/query-params.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/config > /dev/null
@@ -22,15 +24,21 @@ ${BASE_DIR}/node_modules/.bin/tsc shell/config/labels-annotations.js --declarati
22
24
 
23
25
  # store
24
26
  ${BASE_DIR}/node_modules/.bin/tsc shell/store/features.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/store > /dev/null
27
+ ${BASE_DIR}/node_modules/.bin/tsc shell/store/prefs.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/store > /dev/null
25
28
 
26
29
  # plugins
27
30
  ${BASE_DIR}/node_modules/.bin/tsc shell/plugins/dashboard-store/normalize.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/plugins/dashboard-store/ > /dev/null
28
31
  ${BASE_DIR}/node_modules/.bin/tsc shell/plugins/dashboard-store/resource-class.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/plugins/dashboard-store/ > /dev/null
32
+ ${BASE_DIR}/node_modules/.bin/tsc shell/plugins/dashboard-store/classify.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/plugins/dashboard-store/ > /dev/null
33
+ ${BASE_DIR}/node_modules/.bin/tsc shell/plugins/dashboard-store/actions.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/plugins/dashboard-store/ > /dev/null
29
34
 
30
-
31
- # mkixins
35
+ # mixins
32
36
  ${BASE_DIR}/node_modules/.bin/tsc shell/mixins/create-edit-view/index.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/mixins/create-edit-view > /dev/null
33
37
 
38
+ # models
39
+ ${BASE_DIR}/node_modules/.bin/tsc shell/models/namespace.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/models/ > /dev/null
40
+ ${BASE_DIR}/node_modules/.bin/tsc shell/models/networking.k8s.io.ingress.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/models/ > /dev/null
41
+
34
42
  #./node_modules/.bin/tsc shell/plugins/dashboard-store/*.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/plugins/dashboard-store > /dev/null
35
43
 
36
44
  # Go through all of the folders and combine by wrapping with 'declare module'
package/store/index.js CHANGED
@@ -33,15 +33,13 @@ import { allHash, allHashSettled } from '@shell/utils/promise';
33
33
  import { sortBy } from '@shell/utils/sort';
34
34
  import { addParam } from '@shell/utils/url';
35
35
  import semver from 'semver';
36
- import { STORE } from '@shell/store/store-types';
36
+ import { STORE, BLANK_CLUSTER } from '@shell/store/store-types';
37
37
  import { isDevBuild } from '@shell/utils/version';
38
38
 
39
39
  // Disables strict mode for all store instances to prevent warning about changing state outside of mutations
40
40
  // because it's more efficient to do that sometimes.
41
41
  export const strict = false;
42
42
 
43
- export const BLANK_CLUSTER = '_';
44
-
45
43
  export const plugins = [
46
44
  Steve({
47
45
  namespace: STORE.MANAGEMENT,
@@ -3,3 +3,5 @@ export const STORE = {
3
3
  RANCHER: 'rancher',
4
4
  MANAGEMENT: 'management',
5
5
  };
6
+
7
+ export const BLANK_CLUSTER = '_';
package/types/api.d.ts ADDED
@@ -0,0 +1 @@
1
+ export type Verbs = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'WATCH' | 'LIST' | 'CREATE' | 'UP'
@@ -0,0 +1 @@
1
+ export type WorkloadType = 'pods' | 'apps.deployments' | 'replicasets' | 'daemonsets' | 'statefulsets' | 'jobs' | 'cronjobs'