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
@@ -0,0 +1,307 @@
1
+ <script>
2
+ import ResourceTable from '@shell/components/ResourceTable';
3
+ import Loading from '@shell/components/Loading';
4
+ import Masthead from './Masthead';
5
+ import ResourceLoadingIndicator from './ResourceLoadingIndicator';
6
+ import ResourceFetch from '@shell/mixins/resource-fetch';
7
+ import IconMessage from '@shell/components/IconMessage.vue';
8
+ import { ResourceListComponentName } from './resource-list.config';
9
+ import { PanelLocation, ExtensionPoint } from '@shell/core/types';
10
+ import ExtensionPanel from '@shell/components/ExtensionPanel';
11
+ import { sameContents } from '@shell/utils/array';
12
+ import { cloud2harvesterhci } from '@shell/utils/router'
13
+
14
+ export default {
15
+ name: ResourceListComponentName,
16
+
17
+ components: {
18
+ Loading,
19
+ ResourceTable,
20
+ Masthead,
21
+ ResourceLoadingIndicator,
22
+ IconMessage,
23
+ ExtensionPanel
24
+ },
25
+ mixins: [ResourceFetch],
26
+
27
+ props: {
28
+ hasAdvancedFiltering: {
29
+ type: Boolean,
30
+ default: false
31
+ },
32
+ advFilterHideLabelsAsCols: {
33
+ type: Boolean,
34
+ default: false
35
+ },
36
+ advFilterPreventFilteringLabels: {
37
+ type: Boolean,
38
+ default: false
39
+ },
40
+ },
41
+
42
+ async fetch() {
43
+ const store = this.$store;
44
+ const resource = this.resource;
45
+
46
+ const schema = this.schema;
47
+
48
+ if ( this.hasListComponent ) {
49
+ // If you provide your own list then call its fetch
50
+ const importer = this.listComponent;
51
+
52
+ const component = await importer.__asyncLoader();
53
+
54
+ if ( component?.typeDisplay ) {
55
+ this.customTypeDisplay = component.typeDisplay.apply(this);
56
+ }
57
+
58
+ // Is the custom component responsible fetching the resources?
59
+ // - Component has a fetch method - legacy method. fetch will handle the requests
60
+ // - Component contains the PaginatedResourceTable component - go forward method. PaginatedResourceTable owns fetching the resources
61
+ if ( component?.fetch || component?.components?.['PaginatedResourceTable']) {
62
+ this.componentWillFetch = true;
63
+ }
64
+
65
+ // If the custom component supports it, ask it what resources it loads, so we can
66
+ // use the incremental loading indicator when enabled
67
+ if (component?.$loadingResources) {
68
+ const { loadResources, loadIndeterminate } = component?.$loadingResources(this.$route, this.$store);
69
+
70
+ this.loadResources = loadResources || [resource];
71
+ this.loadIndeterminate = loadIndeterminate || false;
72
+ }
73
+ }
74
+
75
+ if ( !this.componentWillFetch ) {
76
+ if ( !schema ) {
77
+ store.dispatch('loadingError', new Error(this.t('nav.failWhale.resourceListNotFound', { resource }, true)));
78
+
79
+ return;
80
+ }
81
+
82
+ // See comment for `namespaceFilter` and `pagination` watchers, skip fetch if we're not ready yet... and something is going to call fetch later on
83
+ if (!this.namespaceFilterRequired && (!this.canPaginate || this.refreshFlag)) {
84
+ await this.$fetchType(resource);
85
+ }
86
+ }
87
+ },
88
+
89
+ data() {
90
+ const getters = this.$store.getters;
91
+ const params = { ...this.$route.params };
92
+ const resource = params.resource;
93
+
94
+ const hasListComponent = getters['type-map/hasCustomList'](resource);
95
+
96
+ const inStore = getters['currentStore'](resource);
97
+ const schema = getters[`${ inStore }/schemaFor`](resource);
98
+
99
+ const showMasthead = getters[`type-map/optionsFor`](resource).showListMasthead;
100
+
101
+ return {
102
+ schema,
103
+ hasListComponent,
104
+ showMasthead: showMasthead === undefined ? true : showMasthead,
105
+ resource,
106
+ extensionType: ExtensionPoint.PANEL,
107
+ extensionLocation: PanelLocation.RESOURCE_LIST,
108
+ loadResources: [resource], // List of resources that will be loaded, this could be many (`Workloads`)
109
+ /**
110
+ * Will the custom component handle the fetch of resources....
111
+ * or will this instance fetch resources
112
+ */
113
+ componentWillFetch: false,
114
+ // manual refresh
115
+ manualRefreshInit: false,
116
+ watch: false,
117
+ force: false,
118
+ // Provided by fetch later
119
+ customTypeDisplay: null,
120
+ // incremental loading
121
+ loadIndeterminate: false,
122
+ // query param for simple filtering
123
+ useQueryParamsForSimpleFiltering: true,
124
+ };
125
+ },
126
+
127
+ computed: {
128
+ headers() {
129
+ if ( this.hasListComponent || !this.schema ) {
130
+ // Custom lists figure out their own headers
131
+ return [];
132
+ }
133
+
134
+ return this.$store.getters['type-map/headersFor'](this.schema, this.canPaginate);
135
+ },
136
+
137
+ groupBy() {
138
+ return this.$store.getters['type-map/groupByFor'](this.schema);
139
+ },
140
+
141
+ showIncrementalLoadingIndicator() {
142
+ return this.perfConfig?.incrementalLoading?.enabled;
143
+ },
144
+
145
+ },
146
+
147
+ watch: {
148
+
149
+ /**
150
+ * When a NS filter is required and the user selects a different one, kick off a new set of API requests
151
+ *
152
+ * ResourceList has two modes
153
+ * 1) ResourceList component handles API request to fetch resources
154
+ * 2) Custom list component handles API request to fetch resources
155
+ *
156
+ * This covers case 1
157
+ */
158
+ namespaceFilter(neu, old) {
159
+ if (neu && !this.componentWillFetch) {
160
+ if (sameContents(neu, old)) {
161
+ return;
162
+ }
163
+
164
+ this.$fetchType(this.resource);
165
+ }
166
+ },
167
+
168
+ /**
169
+ * When a pagination is required and the user changes page / sort / filter, kick off a new set of API requests
170
+ *
171
+ * ResourceList has two modes
172
+ * 1) ResourceList component handles API request to fetch resources
173
+ * 2) Custom list component handles API request to fetch resources
174
+ *
175
+ * This covers case 1
176
+ */
177
+ pagination(neu, old) {
178
+ if (neu && !this.componentWillFetch && !this.paginationEqual(neu, old)) {
179
+ this.$fetchType(this.resource);
180
+ }
181
+ },
182
+
183
+ /**
184
+ * Monitor the rows to ensure deleting the last entry in a server-side paginated page doesn't
185
+ * result in an empty page
186
+ */
187
+ rows(neu) {
188
+ if (!this.pagination) {
189
+ return;
190
+ }
191
+
192
+ if (this.pagination.page > 1 && neu.length === 0) {
193
+ this.setPagination({
194
+ ...this.pagination,
195
+ page: this.pagination.page - 1
196
+ });
197
+ }
198
+ },
199
+ },
200
+
201
+ created() {
202
+ let listComponent = false;
203
+
204
+ const resource = this.$route.params.resource;
205
+ const hasListComponent = this.$store.getters['type-map/hasCustomList'](resource);
206
+
207
+ if ( hasListComponent ) {
208
+ listComponent = this.$store.getters['type-map/importList'](resource);
209
+ }
210
+
211
+ this.listComponent = listComponent;
212
+ },
213
+ };
214
+ </script>
215
+
216
+ <template>
217
+ <IconMessage
218
+ v-if="namespaceFilterRequired"
219
+ :vertical="true"
220
+ :subtle="false"
221
+ icon="icon-filter_alt"
222
+ >
223
+ <template #message>
224
+ {{ t('resourceList.nsFiltering') }}
225
+ </template>
226
+ </IconMessage>
227
+ <IconMessage
228
+ v-else-if="paginationNsFilterRequired"
229
+ :vertical="true"
230
+ :subtle="false"
231
+ icon="icon-filter_alt"
232
+ >
233
+ <template #message>
234
+ {{ t('resourceList.nsFilteringGeneric') }}
235
+ </template>
236
+ </IconMessage>
237
+ <div
238
+ v-else
239
+ class="outlet"
240
+ >
241
+ <Masthead
242
+ v-if="showMasthead"
243
+ :type-display="customTypeDisplay"
244
+ :schema="schema"
245
+ :resource="resource"
246
+ :show-incremental-loading-indicator="showIncrementalLoadingIndicator"
247
+ :load-resources="loadResources"
248
+ :load-indeterminate="loadIndeterminate"
249
+ >
250
+ <template #extraActions>
251
+ <slot name="extraActions" />
252
+ </template>
253
+ </Masthead>
254
+ <!-- Extensions area -->
255
+ <ExtensionPanel
256
+ :resource="{}"
257
+ :type="extensionType"
258
+ :location="extensionLocation"
259
+ />
260
+
261
+ <div
262
+ v-if="hasListComponent"
263
+ >
264
+ <component
265
+ :is="listComponent"
266
+ :incremental-loading-indicator="showIncrementalLoadingIndicator"
267
+ :rows="rows"
268
+ v-bind="$data"
269
+ />
270
+ </div>
271
+ <ResourceTable
272
+ v-else
273
+ :schema="schema"
274
+ :rows="rows"
275
+ :alt-loading="canPaginate && !isFirstLoad"
276
+ :loading="loading"
277
+ :headers="headers"
278
+ :group-by="groupBy"
279
+ :has-advanced-filtering="hasAdvancedFiltering"
280
+ :adv-filter-hide-labels-as-cols="advFilterHideLabelsAsCols"
281
+ :adv-filter-prevent-filtering-labels="advFilterPreventFilteringLabels"
282
+ :use-query-params-for-simple-filtering="useQueryParamsForSimpleFiltering"
283
+ :force-update-live-and-delayed="forceUpdateLiveAndDelayed"
284
+ :external-pagination-enabled="canPaginate"
285
+ :external-pagination-result="paginationResult"
286
+ @pagination-changed="paginationChanged"
287
+ />
288
+ </div>
289
+ </template>
290
+
291
+ <style lang="scss" scoped>
292
+ .header {
293
+ position: relative;
294
+ }
295
+ H2 {
296
+ position: relative;
297
+ margin: 0 0 20px 0;
298
+ }
299
+ .filter{
300
+ line-height: 45px;
301
+ }
302
+ .right-action {
303
+ position: absolute;
304
+ top: 10px;
305
+ right: 10px;
306
+ }
307
+ </style>
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Component name of the `ResourceList`
3
+ *
4
+ * This needs to be a in separate file to avoid circular dependency of
5
+ * index.vue --> resource-fetch mixin --> resource-fetch-namespaced mixin --> index.vue
6
+ */
7
+ export const ResourceListComponentName = 'ResourceList';