From 1c18b8aadf694e0c0db42840d967808cf1c5589e Mon Sep 17 00:00:00 2001 From: John Gardner Date: Thu, 7 Mar 2024 07:32:42 -0500 Subject: [PATCH] feat: table view with launch etc --- pkg/app-launcher/pages/index.vue | 69 +++++++++++++++++++++++++++++++- 1 file changed, 68 insertions(+), 1 deletion(-) diff --git a/pkg/app-launcher/pages/index.vue b/pkg/app-launcher/pages/index.vue index 231c990..62bc8d0 100644 --- a/pkg/app-launcher/pages/index.vue +++ b/pkg/app-launcher/pages/index.vue @@ -2,6 +2,8 @@ import { MANAGEMENT } from '@shell/config/types'; import Loading from '@shell/components/Loading'; import SortableTable from '@shell/components/SortableTable'; +import ButtonDropDown from '@shell/components/ButtonDropdown'; +import { isMaybeSecure } from '@shell/utils/url'; import AppLauncherCard from '../components/AppLauncherCard.vue'; @@ -11,7 +13,8 @@ export default { components: { Loading, AppLauncherCard, - SortableTable + SortableTable, + ButtonDropDown }, data() { return { @@ -30,6 +33,27 @@ export default { sort: 'metadata.name', sortOrder: 'asc', }, + { + name: 'namespace', + label: 'Namespace', + value: 'metadata.namespace', + }, + { + name: 'version', + label: 'Version', + value: 'metadata.labels["app.kubernetes.io/version"]', + }, + { + name: 'helmChart', + label: 'Helm Chart', + value: 'metadata.labels["helm.sh/chart"]', + }, + { + name: 'actions', + label: 'Actions', + value: 'actions', + align: 'right', + }, ], }; }, @@ -108,6 +132,20 @@ export default { toggleSortOrder() { this.tableHeaders[0].sortOrder = this.tableHeaders[0].sortOrder === 'asc' ? 'desc' : 'asc'; }, + getEndpoints(service) { + return ( + service?.spec.ports?.map((port) => { + const endpoint = `${ + isMaybeSecure(port.port, port.protocol) ? 'https' : 'http' + }:${service.metadata.name}:${port.port}`; + + return { + label: `${endpoint}${port.protocol === 'UDP' ? ' (UDP)' : ''}`, + value: `/k8s/clusters/${this.selectedCluster}/api/v1/namespaces/${service.metadata.namespace}/services/${endpoint}/proxy`, + }; + }) ?? [] + ); + }, }, computed: { selectedClusterData() { @@ -182,6 +220,35 @@ export default { + + + +