@rancher/shell 0.4.0 → 0.5.0
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/providers/ovhcloudmks.svg +122 -0
- package/assets/images/providers/ovhcloudpubliccloud.svg +122 -0
- package/assets/styles/global/_layout.scss +99 -0
- package/assets/translations/en-us.yaml +30 -5
- package/assets/translations/zh-hans.yaml +1 -1
- package/babel.config.js +7 -1
- package/chart/monitoring/alerting/index.vue +7 -21
- package/chart/monitoring/grafana/index.vue +55 -0
- package/chart/monitoring/index.vue +51 -17
- package/chart/monitoring/prometheus/index.vue +37 -43
- package/chart/rancher-backup/index.vue +2 -1
- package/cloud-credential/azure.vue +4 -17
- package/components/AsyncButton.vue +17 -5
- package/components/Certificates.vue +164 -0
- package/components/CodeMirror.vue +19 -21
- package/components/CruResource.vue +1 -0
- package/components/DraggableZone.vue +2 -2
- package/components/EtcdInfoBanner.vue +1 -1
- package/components/ExplorerProjectsNamespaces.vue +25 -1
- package/components/IconOrSvg.vue +1 -1
- package/components/LandingPagePreference.vue +1 -4
- package/components/PodSecurityAdmission.vue +2 -2
- package/components/Questions/index.vue +1 -1
- package/components/ResourceDetail/Masthead.vue +16 -3
- package/components/ResourceTable.vue +14 -2
- package/components/ResourceYaml.vue +5 -0
- package/components/SideNav.vue +1 -1
- package/components/SingleClusterInfo.vue +1 -4
- package/components/Tabbed/index.vue +12 -0
- package/components/fleet/FleetRepos.vue +62 -27
- package/components/fleet/FleetResources.vue +6 -1
- package/components/form/ArrayListSelect.vue +10 -0
- package/components/form/Error.vue +3 -3
- package/components/form/Footer.vue +2 -2
- package/components/form/GitPicker.vue +83 -38
- package/components/form/KeyValue.vue +4 -0
- package/components/form/LabeledSelect.vue +4 -0
- package/components/formatter/Checked.vue +11 -3
- package/components/formatter/FleetClusterSummaryGraph.vue +27 -0
- package/components/formatter/FleetSummaryGraph.vue +23 -11
- package/components/formatter/LiveDuration.vue +1 -1
- package/components/formatter/PercentageBar.vue +1 -1
- package/components/formatter/__tests__/Checked.test.ts +19 -0
- package/components/nav/Group.vue +2 -2
- package/components/nav/Header.vue +0 -1
- package/components/nav/TopLevelMenu.vue +36 -6
- package/components/nav/Type.vue +1 -3
- package/components/nav/WindowManager/ContainerLogs.vue +101 -3
- package/components/nav/WindowManager/ContainerShell.vue +6 -1
- package/components/nav/WindowManager/__tests__/ContainerLogs.test.ts +186 -0
- package/components/nav/WindowManager/index.vue +11 -10
- package/components/nav/__tests__/TopLevelMenu.test.ts +33 -0
- package/components/nav/__tests__/Type.test.ts +1 -1
- package/components/nuxt/nuxt-child.js +14 -78
- package/components/nuxt/nuxt.js +1 -1
- package/{layouts → components/templates}/blank.vue +1 -1
- package/{layouts → components/templates}/default.vue +8 -98
- package/{layouts → components/templates}/error.vue +10 -19
- package/{layouts → components/templates}/home.vue +4 -1
- package/{layouts → components/templates}/plain.vue +4 -1
- package/{layouts → components/templates}/standalone.vue +1 -1
- package/{layouts → components/templates}/unauthenticated.vue +1 -1
- package/composables/useCompactInput.test.ts +36 -0
- package/composables/useCompactInput.ts +20 -0
- package/composables/useLabeledFormElement.test.ts +135 -0
- package/composables/useLabeledFormElement.ts +138 -0
- package/config/harvester-manager-types.js +2 -0
- package/config/private-label.js +22 -0
- package/config/product/explorer.js +3 -0
- package/config/product/fleet.js +6 -1
- package/config/product/manager.js +8 -2
- package/config/query-params.js +1 -0
- package/config/router.js +385 -364
- package/config/settings.ts +1 -0
- package/config/store.js +1 -1
- package/config/system-namespaces.js +3 -0
- package/config/table-headers.js +47 -0
- package/core/plugin-routes.ts +56 -114
- package/core/plugin.ts +16 -10
- package/core/plugins-loader.js +7 -9
- package/core/plugins.js +0 -3
- package/creators/app/files/.gitlab-ci.yml +1 -1
- package/detail/fleet.cattle.io.cluster.vue +11 -1
- package/detail/provisioning.cattle.io.cluster.vue +4 -3
- package/dialog/ScaleMachineDownDialog.vue +34 -17
- package/edit/__tests__/service.test.ts +89 -0
- package/edit/auth/googleoauth.vue +1 -5
- package/edit/cloudcredential.vue +2 -0
- package/edit/configmap.vue +2 -1
- package/edit/management.cattle.io.podsecurityadmissionconfigurationtemplate.vue +2 -2
- package/edit/networking.k8s.io.networkpolicy/__tests__/PolicyRuleTarget.spec.ts +1 -1
- package/edit/provisioning.cattle.io.cluster/SelectCredential.vue +15 -7
- package/edit/provisioning.cattle.io.cluster/__tests__/Advanced.test.ts +112 -0
- package/edit/provisioning.cattle.io.cluster/__tests__/Basics.test.ts +473 -0
- package/edit/provisioning.cattle.io.cluster/__tests__/{CustomCommand.tests.ts → CustomCommand.test.ts} +4 -0
- package/edit/provisioning.cattle.io.cluster/__tests__/DrainOptions.test.ts +1 -1
- package/edit/provisioning.cattle.io.cluster/__tests__/index.test.ts +73 -0
- package/edit/provisioning.cattle.io.cluster/__tests__/rke2.test.ts +7 -1
- package/edit/provisioning.cattle.io.cluster/__tests__/utils/cluster.ts +386 -0
- package/edit/provisioning.cattle.io.cluster/import.vue +2 -2
- package/edit/provisioning.cattle.io.cluster/index.vue +92 -36
- package/edit/provisioning.cattle.io.cluster/rke2.vue +171 -583
- package/edit/provisioning.cattle.io.cluster/tabs/AddOnConfig.vue +137 -0
- package/edit/provisioning.cattle.io.cluster/tabs/Advanced.vue +157 -0
- package/edit/provisioning.cattle.io.cluster/{Basics.vue → tabs/Basics.vue} +94 -19
- package/edit/provisioning.cattle.io.cluster/{MachinePool.vue → tabs/MachinePool.vue} +1 -0
- package/edit/provisioning.cattle.io.cluster/tabs/etcd/index.vue +135 -0
- package/edit/provisioning.cattle.io.cluster/tabs/networking/index.vue +189 -0
- package/edit/provisioning.cattle.io.cluster/tabs/registries/index.vue +144 -0
- package/edit/provisioning.cattle.io.cluster/tabs/upgrade/index.vue +76 -0
- package/edit/service.vue +12 -0
- package/edit/workload/mixins/workload.js +1 -1
- package/initialize/App.js +25 -71
- package/initialize/client.js +21 -162
- package/initialize/index.js +27 -123
- package/list/management.cattle.io.feature.vue +1 -7
- package/list/node.vue +1 -0
- package/machine-config/__tests__/vmwarevsphere.test.ts +100 -21
- package/machine-config/vmwarevsphere.vue +73 -51
- package/middleware/authenticated.js +10 -17
- package/mixins/auth-config.js +2 -7
- package/mixins/brand.js +29 -41
- package/mixins/create-edit-view/index.js +2 -2
- package/mixins/labeled-form-element.ts +6 -1
- package/models/__tests__/management.cattle.io.node.ts +85 -0
- package/models/__tests__/management.cattle.io.nodepool.ts +83 -0
- package/models/__tests__/namespace.test.ts +49 -9
- package/models/__tests__/workload.test.ts +91 -0
- package/models/cluster/node.js +4 -4
- package/models/cluster.x-k8s.io.machinedeployment.js +14 -0
- package/models/fleet.cattle.io.cluster.js +4 -0
- package/models/fleet.cattle.io.gitrepo.js +56 -13
- package/models/management.cattle.io.kontainerdriver.js +1 -1
- package/models/management.cattle.io.node.js +18 -14
- package/models/management.cattle.io.nodepool.js +17 -0
- package/models/namespace.js +1 -1
- package/models/pod.js +20 -0
- package/models/provisioning.cattle.io.cluster.js +20 -3
- package/models/secret.js +117 -18
- package/models/workload.js +16 -0
- package/models/workload.service.js +18 -0
- package/package.json +10 -9
- package/pages/about.vue +0 -1
- package/pages/account/create-key.vue +0 -1
- package/pages/account/index.vue +0 -1
- package/pages/auth/login.vue +0 -1
- package/pages/auth/logout.vue +0 -2
- package/pages/auth/setup.vue +0 -4
- package/pages/auth/verify.vue +14 -8
- package/pages/c/_cluster/apps/charts/install.vue +4 -4
- package/pages/c/_cluster/apps/index.vue +0 -2
- package/pages/c/_cluster/auth/index.vue +0 -2
- package/pages/c/_cluster/ecm/index.vue +0 -2
- package/pages/c/_cluster/explorer/index.vue +28 -2
- package/pages/c/_cluster/fleet/index.vue +1 -1
- package/pages/c/_cluster/index.vue +0 -2
- package/pages/c/_cluster/settings/banners.vue +0 -2
- package/pages/c/_cluster/settings/brand.vue +0 -2
- package/pages/c/_cluster/settings/index.vue +0 -2
- package/pages/c/_cluster/settings/links.vue +0 -1
- package/pages/c/_cluster/settings/performance.vue +0 -1
- package/pages/c/_cluster/uiplugins/CatalogList/CatalogLoadDialog.vue +2 -1
- package/pages/c/_cluster/uiplugins/CatalogList/index.vue +10 -46
- package/pages/c/_cluster/uiplugins/index.vue +0 -2
- package/pages/diagnostic.vue +1 -2
- package/pages/fail-whale.vue +0 -1
- package/pages/prefs.vue +0 -1
- package/pages/support/index.vue +2 -8
- package/pkg/auto-import.js +1 -1
- package/plugins/axios.js +0 -36
- package/plugins/back-button.js +3 -5
- package/plugins/codemirror-loader.js +1 -1
- package/plugins/codemirror.js +41 -0
- package/plugins/dashboard-store/__tests__/{mutations.spec.ts → mutations.test.ts} +1 -1
- package/plugins/dashboard-store/__tests__/resource-class.test.ts +49 -0
- package/plugins/dashboard-store/__tests__/utils/store-mocks.ts +7 -0
- package/plugins/dashboard-store/actions.js +30 -4
- package/plugins/dashboard-store/classify.js +1 -18
- package/plugins/dashboard-store/getters.js +10 -5
- package/plugins/dashboard-store/index.js +0 -12
- package/plugins/dashboard-store/mutations.js +0 -4
- package/plugins/dashboard-store/resource-class.js +59 -18
- package/plugins/steve/__tests__/steve-class.spec.ts +59 -0
- package/plugins/steve/__tests__/utils/steve-mocks.ts +31 -0
- package/plugins/steve/getters.js +4 -1
- package/plugins/steve/norman-class.js +19 -0
- package/plugins/steve/steve-class.js +22 -0
- package/plugins/steve/subscribe.js +4 -10
- package/rancher-components/Accordion/Accordion.test.ts +45 -0
- package/rancher-components/Accordion/Accordion.vue +86 -0
- package/rancher-components/Accordion/index.ts +1 -0
- package/rancher-components/BadgeState/BadgeState.vue +3 -3
- package/rancher-components/Banner/Banner.vue +2 -2
- package/rancher-components/Card/Card.vue +3 -3
- package/rancher-components/Form/Checkbox/Checkbox.vue +3 -3
- package/rancher-components/Form/LabeledInput/LabeledInput.test.ts +18 -1
- package/rancher-components/Form/LabeledInput/LabeledInput.vue +65 -24
- package/rancher-components/Form/Radio/RadioButton.test.ts +7 -3
- package/rancher-components/Form/Radio/RadioButton.vue +13 -7
- package/rancher-components/Form/Radio/RadioGroup.test.ts +30 -0
- package/rancher-components/Form/Radio/RadioGroup.vue +8 -3
- package/rancher-components/Form/TextArea/TextAreaAutoGrow.vue +6 -4
- package/rancher-components/Form/ToggleSwitch/ToggleSwitch.vue +7 -4
- package/rancher-components/LabeledTooltip/LabeledTooltip.vue +9 -4
- package/rancher-components/StringList/StringList.test.ts +270 -0
- package/rancher-components/StringList/StringList.vue +65 -26
- package/rancher-components/components/Accordion/Accordion.test.ts +45 -0
- package/rancher-components/components/Accordion/Accordion.vue +86 -0
- package/rancher-components/components/Accordion/index.ts +1 -0
- package/rancher-components/components/BadgeState/BadgeState.vue +3 -3
- package/rancher-components/components/Banner/Banner.vue +2 -2
- package/rancher-components/components/Card/Card.vue +3 -3
- package/rancher-components/components/Form/Checkbox/Checkbox.vue +3 -3
- package/rancher-components/components/Form/LabeledInput/LabeledInput.test.ts +18 -1
- package/rancher-components/components/Form/LabeledInput/LabeledInput.vue +57 -24
- package/rancher-components/components/Form/Radio/RadioButton.vue +13 -7
- package/rancher-components/components/Form/Radio/RadioGroup.vue +4 -3
- package/rancher-components/components/Form/TextArea/TextAreaAutoGrow.vue +6 -4
- package/rancher-components/components/Form/ToggleSwitch/ToggleSwitch.vue +7 -4
- package/rancher-components/components/LabeledTooltip/LabeledTooltip.vue +9 -4
- package/rancher-components/components/StringList/StringList.vue +8 -8
- package/scripts/.gitlab/workflows/build-extension-catalog.gitlab-ci.yml +50 -0
- package/scripts/extension/parse-tag-name +2 -2
- package/scripts/publish-shell.sh +10 -0
- package/scripts/test-plugins-build.sh +85 -9
- package/server/har-file.js +183 -0
- package/store/catalog.js +1 -1
- package/store/features.js +1 -0
- package/store/i18n.js +11 -0
- package/store/index.js +10 -11
- package/store/prefs.js +33 -35
- package/store/type-map.js +8 -7
- package/tsconfig.json +35 -9
- package/tsconfig.paths.json +21 -0
- package/types/shell/index.d.ts +427 -234
- package/types/vue-shim.d.ts +42 -0
- package/utils/__tests__/create-yaml.test.ts +60 -0
- package/utils/axios.js +0 -19
- package/utils/azure.js +24 -0
- package/utils/create-yaml.js +17 -10
- package/utils/git.ts +1 -1
- package/utils/monitoring.js +1 -1
- package/utils/nuxt.js +18 -39
- package/utils/object.js +14 -0
- package/utils/router.scrollBehavior.js +12 -14
- package/utils/time.js +1 -1
- package/utils/url.ts +1 -1
- package/vue.config.js +23 -2
- package/.DS_Store +0 -0
- package/assets/images/providers/aks-black.svg +0 -28
- package/assets/images/providers/aks.svg +0 -31
- package/edit/provisioning.cattle.io.cluster/__tests__/Basics.tests.ts +0 -234
- package/initialize/layouts.ts +0 -26
- package/mixins/fetch.server.js +0 -73
- package/pages/c/index.vue +0 -9
- package/pages/rio/mesh.vue +0 -508
- package/plugins/transitions.js +0 -4
- package/scripts/.DS_Store +0 -0
- package/scripts/verdaccio.log +0 -205
- package/tsconfig.default.json +0 -46
- package/yarn-error.log +0 -200
- /package/components/form/__tests__/{NameNsDescription.ts → NameNsDescription.test.ts} +0 -0
- /package/edit/networking.k8s.io.networkpolicy/__tests__/utils/{selectors.ts → selectors.test.ts} +0 -0
- /package/edit/provisioning.cattle.io.cluster/{AgentConfiguration.vue → tabs/AgentConfiguration.vue} +0 -0
- /package/edit/provisioning.cattle.io.cluster/{MemberRoles.vue → tabs/MemberRoles.vue} +0 -0
- /package/edit/provisioning.cattle.io.cluster/{S3Config.vue → tabs/etcd/S3Config.vue} +0 -0
- /package/edit/provisioning.cattle.io.cluster/{ACE.vue → tabs/networking/ACE.vue} +0 -0
- /package/edit/provisioning.cattle.io.cluster/{RegistryConfigs.vue → tabs/registries/RegistryConfigs.vue} +0 -0
- /package/edit/provisioning.cattle.io.cluster/{RegistryMirrors.vue → tabs/registries/RegistryMirrors.vue} +0 -0
- /package/edit/provisioning.cattle.io.cluster/{DrainOptions.vue → tabs/upgrade/DrainOptions.vue} +0 -0
- /package/plugins/dashboard-store/__tests__/{actions.spec.ts → actions.test.ts} +0 -0
- /package/plugins/dashboard-store/__tests__/{getters.spec.ts → getters.test.ts} +0 -0
- /package/rancher-components/BadgeState/{BadgeState.spec.ts → BadgeState.test.ts} +0 -0
- /package/rancher-components/components/BadgeState/{BadgeState.spec.ts → BadgeState.test.ts} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import
|
|
2
|
+
import { defineComponent } from 'vue';
|
|
3
3
|
import { _VIEW, _CREATE } from '@shell/config/query-params';
|
|
4
4
|
import LabeledSelect from '@shell/components/form/LabeledSelect.vue';
|
|
5
5
|
import Checkbox from '@components/Form/Checkbox/Checkbox.vue';
|
|
@@ -25,7 +25,7 @@ const getExemptionControl = (): PSAExemptionControl => ({
|
|
|
25
25
|
value: ''
|
|
26
26
|
});
|
|
27
27
|
|
|
28
|
-
export default
|
|
28
|
+
export default defineComponent({
|
|
29
29
|
components: {
|
|
30
30
|
Checkbox, LabeledSelect, LabeledInput
|
|
31
31
|
},
|
|
@@ -422,6 +422,7 @@ export default {
|
|
|
422
422
|
<span v-if="value.detailPageHeaderActionOverride && value.detailPageHeaderActionOverride(realMode)">{{ value.detailPageHeaderActionOverride(realMode) }}</span>
|
|
423
423
|
<t
|
|
424
424
|
v-else
|
|
425
|
+
class="mastehead-resource-title"
|
|
425
426
|
:k="'resourceDetail.header.' + realMode"
|
|
426
427
|
:subtype="resourceSubtype"
|
|
427
428
|
:name="displayName"
|
|
@@ -544,6 +545,10 @@ export default {
|
|
|
544
545
|
|
|
545
546
|
HEADER {
|
|
546
547
|
margin: 0;
|
|
548
|
+
|
|
549
|
+
.title {
|
|
550
|
+
overflow: hidden;
|
|
551
|
+
}
|
|
547
552
|
}
|
|
548
553
|
|
|
549
554
|
.primaryheader {
|
|
@@ -553,6 +558,17 @@ export default {
|
|
|
553
558
|
|
|
554
559
|
h1 {
|
|
555
560
|
margin: 0;
|
|
561
|
+
overflow: hidden;
|
|
562
|
+
display: flex;
|
|
563
|
+
flex-direction: row;
|
|
564
|
+
align-items: center;
|
|
565
|
+
|
|
566
|
+
.mastehead-resource-title {
|
|
567
|
+
padding: 0 8px;
|
|
568
|
+
text-overflow: ellipsis;
|
|
569
|
+
overflow: hidden;
|
|
570
|
+
white-space: nowrap;
|
|
571
|
+
}
|
|
556
572
|
}
|
|
557
573
|
}
|
|
558
574
|
|
|
@@ -575,9 +591,6 @@ export default {
|
|
|
575
591
|
|
|
576
592
|
.masthead-state {
|
|
577
593
|
font-size: initial;
|
|
578
|
-
display: inline-block;
|
|
579
|
-
position: relative;
|
|
580
|
-
top: -2px;
|
|
581
594
|
}
|
|
582
595
|
|
|
583
596
|
.masthead-istio {
|
|
@@ -97,6 +97,14 @@ export default {
|
|
|
97
97
|
default: 'sortableTable.paging.resource',
|
|
98
98
|
},
|
|
99
99
|
|
|
100
|
+
/**
|
|
101
|
+
* Additional params to pass to the pagingLabel translation
|
|
102
|
+
*/
|
|
103
|
+
pagingParams: {
|
|
104
|
+
type: Object,
|
|
105
|
+
default: null,
|
|
106
|
+
},
|
|
107
|
+
|
|
100
108
|
rowActions: {
|
|
101
109
|
type: Boolean,
|
|
102
110
|
default: true,
|
|
@@ -392,7 +400,11 @@ export default {
|
|
|
392
400
|
return standard.concat(this.listGroups);
|
|
393
401
|
},
|
|
394
402
|
|
|
395
|
-
|
|
403
|
+
parsedPagingParams() {
|
|
404
|
+
if (this.pagingParams) {
|
|
405
|
+
return this.pagingParams;
|
|
406
|
+
}
|
|
407
|
+
|
|
396
408
|
if ( !this.schema ) {
|
|
397
409
|
return {
|
|
398
410
|
singularLabel: '',
|
|
@@ -482,7 +494,7 @@ export default {
|
|
|
482
494
|
:group-options="groupOptions"
|
|
483
495
|
:search="search"
|
|
484
496
|
:paging="true"
|
|
485
|
-
:paging-params="
|
|
497
|
+
:paging-params="parsedPagingParams"
|
|
486
498
|
:paging-label="pagingLabel"
|
|
487
499
|
:row-actions="rowActions"
|
|
488
500
|
:table-actions="_showBulkActions"
|
|
@@ -190,6 +190,11 @@ export default {
|
|
|
190
190
|
|
|
191
191
|
cm.foldLinesMatching(/managedFields/);
|
|
192
192
|
|
|
193
|
+
// Allow the model to supply an array of json paths to fold other sections in the YAML for the given resource type
|
|
194
|
+
if (this.value?.yamlFolding) {
|
|
195
|
+
this.value.yamlFolding.forEach((path) => cm.foldYaml(path));
|
|
196
|
+
}
|
|
197
|
+
|
|
193
198
|
// regardless of edit or create we should probably fold all the comments so they dont get out of hand.
|
|
194
199
|
const saved = cm.getMode().fold;
|
|
195
200
|
|
package/components/SideNav.vue
CHANGED
|
@@ -13,10 +13,7 @@ export default {
|
|
|
13
13
|
},
|
|
14
14
|
|
|
15
15
|
async fetch() {
|
|
16
|
-
this.clusters = await this.$store.dispatch('management/findAll', {
|
|
17
|
-
type: MANAGEMENT.CLUSTER,
|
|
18
|
-
opt: { url: MANAGEMENT.CLUSTER }
|
|
19
|
-
});
|
|
16
|
+
this.clusters = await this.$store.dispatch('management/findAll', { type: MANAGEMENT.CLUSTER });
|
|
20
17
|
},
|
|
21
18
|
|
|
22
19
|
data() {
|
|
@@ -19,6 +19,11 @@ export default {
|
|
|
19
19
|
default: false
|
|
20
20
|
},
|
|
21
21
|
|
|
22
|
+
hideSingleTab: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: false
|
|
25
|
+
},
|
|
26
|
+
|
|
22
27
|
showTabsAddRemove: {
|
|
23
28
|
type: Boolean,
|
|
24
29
|
default: false
|
|
@@ -86,6 +91,11 @@ export default {
|
|
|
86
91
|
sortedTabs() {
|
|
87
92
|
return sortBy(this.tabs, ['weight:desc', 'labelDisplay', 'name']);
|
|
88
93
|
},
|
|
94
|
+
|
|
95
|
+
// hide tabs based on tab count IF flag is active
|
|
96
|
+
hideTabs() {
|
|
97
|
+
return this.hideSingleTab && this.sortedTabs.length === 1;
|
|
98
|
+
}
|
|
89
99
|
},
|
|
90
100
|
|
|
91
101
|
watch: {
|
|
@@ -225,11 +235,13 @@ export default {
|
|
|
225
235
|
<template>
|
|
226
236
|
<div :class="{'side-tabs': !!sideTabs, 'tabs-only': tabsOnly }">
|
|
227
237
|
<ul
|
|
238
|
+
v-if="!hideTabs"
|
|
228
239
|
ref="tablist"
|
|
229
240
|
role="tablist"
|
|
230
241
|
class="tabs"
|
|
231
242
|
:class="{'clearfix':!sideTabs, 'vertical': sideTabs, 'horizontal': !sideTabs}"
|
|
232
243
|
tabindex="0"
|
|
244
|
+
data-testid="tabbed-block"
|
|
233
245
|
@keydown.right.prevent="selectNext(1)"
|
|
234
246
|
@keydown.left.prevent="selectNext(-1)"
|
|
235
247
|
@keydown.down.prevent="selectNext(1)"
|
|
@@ -8,8 +8,16 @@ import {
|
|
|
8
8
|
AGE,
|
|
9
9
|
STATE,
|
|
10
10
|
NAME,
|
|
11
|
-
FLEET_SUMMARY
|
|
11
|
+
FLEET_SUMMARY,
|
|
12
|
+
FLEET_REPO,
|
|
13
|
+
FLEET_REPO_TARGET,
|
|
14
|
+
FLEET_REPO_CLUSTERS_READY,
|
|
15
|
+
FLEET_REPO_CLUSTER_SUMMARY,
|
|
16
|
+
FLEET_REPO_PER_CLUSTER_STATE
|
|
17
|
+
|
|
12
18
|
} from '@shell/config/table-headers';
|
|
19
|
+
import { FLEET } from '@shell/config/labels-annotations';
|
|
20
|
+
import { STATES_ENUM } from '@shell/plugins/dashboard-store/resource-class';
|
|
13
21
|
|
|
14
22
|
export default {
|
|
15
23
|
|
|
@@ -19,6 +27,11 @@ export default {
|
|
|
19
27
|
ResourceTable, Link, Shortened, FleetIntro
|
|
20
28
|
},
|
|
21
29
|
props: {
|
|
30
|
+
clusterId: {
|
|
31
|
+
type: String,
|
|
32
|
+
required: false,
|
|
33
|
+
default: null,
|
|
34
|
+
},
|
|
22
35
|
rows: {
|
|
23
36
|
type: Array,
|
|
24
37
|
required: true,
|
|
@@ -54,35 +67,46 @@ export default {
|
|
|
54
67
|
});
|
|
55
68
|
},
|
|
56
69
|
|
|
70
|
+
isClusterView() {
|
|
71
|
+
return !!this.clusterId;
|
|
72
|
+
},
|
|
73
|
+
|
|
57
74
|
noRows() {
|
|
58
75
|
return !this.filteredRows.length;
|
|
59
76
|
},
|
|
60
77
|
|
|
61
78
|
headers() {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
{
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
value: 'repoDisplay',
|
|
69
|
-
sort: 'repoDisplay',
|
|
70
|
-
search: ['spec.repo', 'status.commit'],
|
|
79
|
+
// Cluster summary is only shown in the cluster view
|
|
80
|
+
const fleetClusterSummary = {
|
|
81
|
+
...FLEET_REPO_CLUSTER_SUMMARY,
|
|
82
|
+
formatterOpts: {
|
|
83
|
+
// Fleet uses labels to identify clusters
|
|
84
|
+
clusterLabel: this.clusterId
|
|
71
85
|
},
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
search: false,
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
// if hasPerClusterState then use the repo state
|
|
89
|
+
const fleetPerClusterState = {
|
|
90
|
+
...FLEET_REPO_PER_CLUSTER_STATE,
|
|
91
|
+
value: (row) => {
|
|
92
|
+
const statePerCluster = row.clusterResourceStatus?.find((c) => {
|
|
93
|
+
return c.clusterLabel === this.clusterId;
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
return statePerCluster ? statePerCluster?.status?.displayStatus : STATES_ENUM.ACTIVE;
|
|
84
97
|
},
|
|
85
|
-
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
const summary = this.isClusterView ? [fleetClusterSummary] : [FLEET_REPO_CLUSTERS_READY, FLEET_SUMMARY];
|
|
101
|
+
|
|
102
|
+
const state = this.isClusterView ? fleetPerClusterState : STATE;
|
|
103
|
+
|
|
104
|
+
const out = [
|
|
105
|
+
state,
|
|
106
|
+
NAME,
|
|
107
|
+
FLEET_REPO,
|
|
108
|
+
FLEET_REPO_TARGET,
|
|
109
|
+
...summary,
|
|
86
110
|
AGE
|
|
87
111
|
];
|
|
88
112
|
|
|
@@ -92,6 +116,12 @@ export default {
|
|
|
92
116
|
methods: {
|
|
93
117
|
parseTargetMode(row) {
|
|
94
118
|
return row.targetInfo?.mode === 'clusterGroup' ? this.t('fleet.gitRepo.warningTooltip.clusterGroup') : this.t('fleet.gitRepo.warningTooltip.cluster');
|
|
119
|
+
},
|
|
120
|
+
|
|
121
|
+
clusterViewResourceStatus(row) {
|
|
122
|
+
return row.clusterResourceStatus.find((c) => {
|
|
123
|
+
return c.metadata?.labels[FLEET.CLUSTER_NAME] === this.clusterId;
|
|
124
|
+
});
|
|
95
125
|
}
|
|
96
126
|
},
|
|
97
127
|
};
|
|
@@ -111,7 +141,7 @@ export default {
|
|
|
111
141
|
key-field="_key"
|
|
112
142
|
v-on="$listeners"
|
|
113
143
|
>
|
|
114
|
-
<template #cell:repo="{row}">
|
|
144
|
+
<template #cell:repo="{ row }">
|
|
115
145
|
<Link
|
|
116
146
|
:row="row"
|
|
117
147
|
:value="row.spec.repo"
|
|
@@ -119,6 +149,7 @@ export default {
|
|
|
119
149
|
before-icon-key="repoIcon"
|
|
120
150
|
url-key="spec.repo"
|
|
121
151
|
/>
|
|
152
|
+
{{ row.cluster }}
|
|
122
153
|
<template v-if="row.commitDisplay">
|
|
123
154
|
<div class="text-muted">
|
|
124
155
|
<Shortened
|
|
@@ -130,7 +161,10 @@ export default {
|
|
|
130
161
|
</template>
|
|
131
162
|
</template>
|
|
132
163
|
|
|
133
|
-
<template
|
|
164
|
+
<template
|
|
165
|
+
v-if="!isClusterView"
|
|
166
|
+
#cell:clustersReady="{ row }"
|
|
167
|
+
>
|
|
134
168
|
<span
|
|
135
169
|
v-if="!row.clusterInfo"
|
|
136
170
|
class="text-muted"
|
|
@@ -138,7 +172,8 @@ export default {
|
|
|
138
172
|
<span
|
|
139
173
|
v-else-if="row.clusterInfo.unready"
|
|
140
174
|
class="text-warning"
|
|
141
|
-
>{{ row.clusterInfo.ready }}/{{
|
|
175
|
+
>{{ row.clusterInfo.ready }}/{{
|
|
176
|
+
row.clusterInfo.total }}</span>
|
|
142
177
|
<span
|
|
143
178
|
v-else
|
|
144
179
|
class="cluster-count-info"
|
|
@@ -152,7 +187,7 @@ export default {
|
|
|
152
187
|
</span>
|
|
153
188
|
</template>
|
|
154
189
|
|
|
155
|
-
<template #cell:target="{row}">
|
|
190
|
+
<template #cell:target="{ row }">
|
|
156
191
|
{{ row.targetInfo.modeDisplay }}
|
|
157
192
|
</template>
|
|
158
193
|
</ResourceTable>
|
|
@@ -24,6 +24,10 @@ export default {
|
|
|
24
24
|
loading: {
|
|
25
25
|
type: Boolean,
|
|
26
26
|
default: false
|
|
27
|
+
},
|
|
28
|
+
disabled: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: true
|
|
27
31
|
}
|
|
28
32
|
},
|
|
29
33
|
computed: {
|
|
@@ -34,6 +38,10 @@ export default {
|
|
|
34
38
|
|
|
35
39
|
addAllowed() {
|
|
36
40
|
return this.filteredOptions.length > 0;
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
defaultAddValue() {
|
|
44
|
+
return this.options[0]?.value;
|
|
37
45
|
}
|
|
38
46
|
},
|
|
39
47
|
|
|
@@ -62,6 +70,8 @@ export default {
|
|
|
62
70
|
class="array-list-select"
|
|
63
71
|
:add-allowed="addAllowed || loading"
|
|
64
72
|
:loading="loading"
|
|
73
|
+
:defaultAddValue="defaultAddValue"
|
|
74
|
+
:disabled="disabled"
|
|
65
75
|
@input="$emit('input', $event)"
|
|
66
76
|
>
|
|
67
77
|
<template v-slot:columns="scope">
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import
|
|
2
|
+
import { PropType, defineComponent } from 'vue';
|
|
3
3
|
import Banner from '@components/Banner/Banner.vue';
|
|
4
4
|
|
|
5
|
-
type Rule = (v?: string) => undefined | string;
|
|
5
|
+
type Rule = (v?: string | number | Record<string, any> | unknown[]) => undefined | string;
|
|
6
6
|
|
|
7
|
-
export default
|
|
7
|
+
export default defineComponent({
|
|
8
8
|
components: { Banner },
|
|
9
9
|
props: {
|
|
10
10
|
value: {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import
|
|
2
|
+
import { defineComponent } from 'vue';
|
|
3
3
|
import { _VIEW } from '@shell/config/query-params';
|
|
4
4
|
import AsyncButton, { AsyncButtonCallback } from '@shell/components/AsyncButton.vue';
|
|
5
5
|
import Banner from '@components/Banner/Banner.vue';
|
|
6
6
|
|
|
7
|
-
export default
|
|
7
|
+
export default defineComponent({
|
|
8
8
|
components: { AsyncButton, Banner },
|
|
9
9
|
|
|
10
10
|
props: {
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import
|
|
2
|
+
import { defineComponent, inject } from 'vue';
|
|
3
3
|
import SortableTable from '@shell/components/SortableTable/index.vue';
|
|
4
4
|
import RadioButton from '@components/Form/Radio/RadioButton.vue';
|
|
5
5
|
import debounce from 'lodash/debounce';
|
|
6
6
|
import { isArray } from '@shell/utils/array';
|
|
7
7
|
import LabeledSelect from '@shell/components/form/LabeledSelect.vue';
|
|
8
8
|
import LabeledInput from '@components/Form/LabeledInput/LabeledInput.vue';
|
|
9
|
-
import { GitUtils } from '
|
|
9
|
+
import { GitUtils, Commit } from '@shell/utils/git';
|
|
10
|
+
import type { DebouncedFunc } from 'lodash';
|
|
10
11
|
|
|
11
12
|
interface commit {
|
|
12
13
|
[key: string]: any,
|
|
@@ -17,21 +18,45 @@ interface Data {
|
|
|
17
18
|
repo: boolean,
|
|
18
19
|
branch: boolean,
|
|
19
20
|
commits: boolean,
|
|
21
|
+
branches?: unknown,
|
|
20
22
|
},
|
|
21
23
|
|
|
22
24
|
repos: object[],
|
|
23
25
|
branches: object[],
|
|
24
26
|
commits: commit[],
|
|
25
27
|
|
|
26
|
-
selectedAccOrOrg: string|
|
|
27
|
-
selectedRepo: object|
|
|
28
|
-
selectedBranch: object|
|
|
29
|
-
selectedCommit:
|
|
28
|
+
selectedAccOrOrg: string | undefined,
|
|
29
|
+
selectedRepo: object | undefined,
|
|
30
|
+
selectedBranch: object | undefined,
|
|
31
|
+
selectedCommit: Commit | null,
|
|
30
32
|
}
|
|
31
33
|
|
|
32
|
-
|
|
34
|
+
interface CommitHeader {
|
|
35
|
+
name: string;
|
|
36
|
+
label: string;
|
|
37
|
+
width?: number;
|
|
38
|
+
formatter?: string;
|
|
39
|
+
formatterOpts?: { [key: string]: any };
|
|
40
|
+
value?: string | string[];
|
|
41
|
+
sort?: string | string[];
|
|
42
|
+
defaultSort?: boolean;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
interface NonReactiveProps {
|
|
46
|
+
onSearchRepo: DebouncedFunc<(param: any) => Promise<any>> | undefined;
|
|
47
|
+
onSearchBranch: DebouncedFunc<(param: any) => Promise<any>> | undefined;
|
|
48
|
+
debounceTime: number;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const debounceTime = 1_000;
|
|
33
52
|
|
|
34
|
-
|
|
53
|
+
const provideProps: NonReactiveProps = {
|
|
54
|
+
onSearchRepo: undefined,
|
|
55
|
+
onSearchBranch: undefined,
|
|
56
|
+
debounceTime,
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export default defineComponent({
|
|
35
60
|
|
|
36
61
|
components: {
|
|
37
62
|
LabeledSelect,
|
|
@@ -52,10 +77,20 @@ export default Vue.extend<Data, any, any, any>({
|
|
|
52
77
|
}
|
|
53
78
|
},
|
|
54
79
|
|
|
55
|
-
|
|
80
|
+
setup() {
|
|
81
|
+
const onSearchRepo = inject('onSearchRepo', provideProps.onSearchRepo);
|
|
82
|
+
const onSearchBranch = inject('onSearchBranch', provideProps.onSearchBranch);
|
|
83
|
+
const debounceTime = inject('debounceTime', provideProps.debounceTime);
|
|
84
|
+
|
|
56
85
|
return {
|
|
86
|
+
onSearchRepo,
|
|
87
|
+
onSearchBranch,
|
|
57
88
|
debounceTime,
|
|
89
|
+
};
|
|
90
|
+
},
|
|
58
91
|
|
|
92
|
+
data(): Data {
|
|
93
|
+
return {
|
|
59
94
|
hasError: {
|
|
60
95
|
repo: false,
|
|
61
96
|
branch: false,
|
|
@@ -66,10 +101,10 @@ export default Vue.extend<Data, any, any, any>({
|
|
|
66
101
|
branches: [],
|
|
67
102
|
commits: [] as commit[],
|
|
68
103
|
|
|
69
|
-
selectedAccOrOrg:
|
|
70
|
-
selectedRepo:
|
|
71
|
-
selectedBranch:
|
|
72
|
-
selectedCommit:
|
|
104
|
+
selectedAccOrOrg: undefined,
|
|
105
|
+
selectedRepo: undefined,
|
|
106
|
+
selectedBranch: undefined,
|
|
107
|
+
selectedCommit: null,
|
|
73
108
|
};
|
|
74
109
|
},
|
|
75
110
|
|
|
@@ -95,13 +130,14 @@ export default Vue.extend<Data, any, any, any>({
|
|
|
95
130
|
},
|
|
96
131
|
|
|
97
132
|
computed: {
|
|
98
|
-
commitHeaders() {
|
|
133
|
+
commitHeaders(): CommitHeader[] {
|
|
99
134
|
return [
|
|
100
135
|
{
|
|
101
136
|
name: 'index',
|
|
102
137
|
label: this.t(`gitPicker.${ this.type }.tableHeaders.choose.label`),
|
|
103
138
|
width: 60,
|
|
104
|
-
},
|
|
139
|
+
},
|
|
140
|
+
{
|
|
105
141
|
name: 'sha',
|
|
106
142
|
label: this.t(`gitPicker.${ this.type }.tableHeaders.sha.label`),
|
|
107
143
|
width: 90,
|
|
@@ -134,17 +170,20 @@ export default Vue.extend<Data, any, any, any>({
|
|
|
134
170
|
];
|
|
135
171
|
},
|
|
136
172
|
|
|
137
|
-
preparedRepos() {
|
|
173
|
+
preparedRepos(): unknown {
|
|
138
174
|
return this.normalizeArray(this.repos, (item: any) => ({ id: item.id, name: item.name }));
|
|
139
175
|
},
|
|
140
176
|
|
|
141
|
-
preparedBranches() {
|
|
177
|
+
preparedBranches(): unknown {
|
|
142
178
|
return this.normalizeArray(this.branches, (item: any) => ({ id: item.id, name: item.name }));
|
|
143
179
|
},
|
|
144
180
|
|
|
145
|
-
preparedCommits() {
|
|
146
|
-
return this.normalizeArray(this.commits, (c
|
|
181
|
+
preparedCommits(): Commit[] {
|
|
182
|
+
return this.normalizeArray(this.commits, (c) => GitUtils[this.type].normalize.commit(c));
|
|
147
183
|
},
|
|
184
|
+
selectedCommitId(): string | undefined {
|
|
185
|
+
return this.selectedCommit?.commitId;
|
|
186
|
+
}
|
|
148
187
|
},
|
|
149
188
|
|
|
150
189
|
methods: {
|
|
@@ -164,10 +203,10 @@ export default Vue.extend<Data, any, any, any>({
|
|
|
164
203
|
|
|
165
204
|
reset() {
|
|
166
205
|
this.repos = [];
|
|
167
|
-
this.selectedAccOrOrg =
|
|
168
|
-
this.selectedRepo =
|
|
169
|
-
this.selectedBranch =
|
|
170
|
-
this.selectedCommit =
|
|
206
|
+
this.selectedAccOrOrg = undefined;
|
|
207
|
+
this.selectedRepo = undefined;
|
|
208
|
+
this.selectedBranch = undefined;
|
|
209
|
+
this.selectedCommit = null;
|
|
171
210
|
|
|
172
211
|
this.communicateReset();
|
|
173
212
|
},
|
|
@@ -217,13 +256,13 @@ export default Vue.extend<Data, any, any, any>({
|
|
|
217
256
|
|
|
218
257
|
async fetchRepos() {
|
|
219
258
|
this.repos = [];
|
|
220
|
-
this.selectedRepo =
|
|
221
|
-
this.selectedBranch =
|
|
222
|
-
this.selectedCommit =
|
|
259
|
+
this.selectedRepo = undefined;
|
|
260
|
+
this.selectedBranch = undefined;
|
|
261
|
+
this.selectedCommit = null;
|
|
223
262
|
|
|
224
263
|
this.communicateReset();
|
|
225
264
|
|
|
226
|
-
if (this.selectedAccOrOrg
|
|
265
|
+
if (this.selectedAccOrOrg?.length) {
|
|
227
266
|
try {
|
|
228
267
|
const res = await this.$store.dispatch(`${ this.type }/fetchRecentRepos`, { username: this.selectedAccOrOrg });
|
|
229
268
|
|
|
@@ -237,8 +276,8 @@ export default Vue.extend<Data, any, any, any>({
|
|
|
237
276
|
},
|
|
238
277
|
|
|
239
278
|
async fetchBranches() {
|
|
240
|
-
this.selectedBranch =
|
|
241
|
-
this.selectedCommit =
|
|
279
|
+
this.selectedBranch = undefined;
|
|
280
|
+
this.selectedCommit = null;
|
|
242
281
|
|
|
243
282
|
this.communicateReset();
|
|
244
283
|
|
|
@@ -253,7 +292,7 @@ export default Vue.extend<Data, any, any, any>({
|
|
|
253
292
|
},
|
|
254
293
|
|
|
255
294
|
async fetchCommits() {
|
|
256
|
-
this.selectedCommit =
|
|
295
|
+
this.selectedCommit = null;
|
|
257
296
|
|
|
258
297
|
this.communicateReset();
|
|
259
298
|
|
|
@@ -279,7 +318,7 @@ export default Vue.extend<Data, any, any, any>({
|
|
|
279
318
|
},
|
|
280
319
|
|
|
281
320
|
final(commitId: string) {
|
|
282
|
-
this.selectedCommit = this.preparedCommits.find((c: { commitId?: string }) => c.commitId === commitId);
|
|
321
|
+
this.selectedCommit = this.preparedCommits.find((c: { commitId?: string }) => c.commitId === commitId) || null;
|
|
283
322
|
|
|
284
323
|
if (this.selectedAccOrOrg && this.selectedRepo && this.selectedCommit?.commitId) {
|
|
285
324
|
this.$emit('change', {
|
|
@@ -337,7 +376,7 @@ export default Vue.extend<Data, any, any, any>({
|
|
|
337
376
|
},
|
|
338
377
|
|
|
339
378
|
status(value: boolean) {
|
|
340
|
-
return value ? 'error' :
|
|
379
|
+
return value ? 'error' : undefined;
|
|
341
380
|
},
|
|
342
381
|
|
|
343
382
|
reposRules() {
|
|
@@ -355,11 +394,17 @@ export default Vue.extend<Data, any, any, any>({
|
|
|
355
394
|
const commitId = this.$route.query?.commit;
|
|
356
395
|
|
|
357
396
|
if (commitId) {
|
|
358
|
-
const table = this.$refs.commitsTable
|
|
359
|
-
|
|
397
|
+
const table = this.$refs.commitsTable as unknown as {
|
|
398
|
+
getPageByRow: (id: string | (string | null)[], callback: (commit: any) => any) => any;
|
|
399
|
+
setPage: (page: any) => void;
|
|
400
|
+
};
|
|
401
|
+
const page = table?.getPageByRow(commitId, ({ commitId }: commit) => commitId);
|
|
360
402
|
|
|
361
|
-
table
|
|
403
|
+
table?.setPage(page);
|
|
362
404
|
}
|
|
405
|
+
},
|
|
406
|
+
selectReduction(e: unknown) {
|
|
407
|
+
return e;
|
|
363
408
|
}
|
|
364
409
|
},
|
|
365
410
|
});
|
|
@@ -393,7 +438,7 @@ export default Vue.extend<Data, any, any, any>({
|
|
|
393
438
|
:options="preparedRepos"
|
|
394
439
|
:clearable="true"
|
|
395
440
|
:searchable="true"
|
|
396
|
-
:reduce="
|
|
441
|
+
:reduce="selectReduction"
|
|
397
442
|
:rules="[reposRules]"
|
|
398
443
|
:status="status(hasError.repo)"
|
|
399
444
|
:option-label="'name'"
|
|
@@ -412,7 +457,7 @@ export default Vue.extend<Data, any, any, any>({
|
|
|
412
457
|
:label="t(`gitPicker.${ type }.branch.inputLabel`)"
|
|
413
458
|
:options="preparedBranches"
|
|
414
459
|
:clearable="false"
|
|
415
|
-
:reduce="
|
|
460
|
+
:reduce="selectReduction"
|
|
416
461
|
:searchable="true"
|
|
417
462
|
:rules="[branchesRules]"
|
|
418
463
|
:status="status(hasError.branch)"
|
|
@@ -441,7 +486,7 @@ export default Vue.extend<Data, any, any, any>({
|
|
|
441
486
|
>
|
|
442
487
|
<template #cell:index="{row}">
|
|
443
488
|
<RadioButton
|
|
444
|
-
:value="
|
|
489
|
+
:value="selectedCommitId"
|
|
445
490
|
:val="row.commitId"
|
|
446
491
|
@input="final($event)"
|
|
447
492
|
/>
|