Skip to content

Commit

Permalink
Update:
Browse files Browse the repository at this point in the history
apply reduce listing time on k8s
  • Loading branch information
0oM4R committed Mar 17, 2024
1 parent cb9dbdc commit 7e15e30
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions packages/playground/src/components/k8s_deployment_table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,13 @@
<AccessDeploymentAlert />

<InputTooltip tooltip="Didn't find your deployments in the list? Enable to show all deployments." inline>
<VSwitch inset color="primary" label="Show All Deployments" v-model="showAllDeployments" />
<VSwitch
inset
color="primary"
label="Show All Deployments"
@update:model-value="loadDeployments"
v-model="showAllDeployments"
/>
</InputTooltip>

<ListTable
Expand Down Expand Up @@ -141,7 +147,7 @@ import { getNodeHealthColor, NodeHealth } from "@/utils/get_nodes";
import { useProfileManager } from "../stores";
import { getGrid, updateGrid } from "../utils/grid";
import { markAsFromAnotherClient } from "../utils/helpers";
import { loadK8s, mergeLoadedDeployments } from "../utils/load_deployment";
import { type K8S, type LoadedDeployments, loadK8s, mergeLoadedDeployments } from "../utils/load_deployment";
const profileManager = useProfileManager();
const showDialog = ref(false);
const showEncryption = ref(false);
Expand All @@ -166,11 +172,14 @@ async function loadDeployments() {
const grid = await getGrid(profileManager.profile!, props.projectName);
const chunk1 = await loadK8s(grid!);
const chunk2 = await loadK8s(updateGrid(grid!, { projectName: props.projectName.toLowerCase() }));
const chunk3 = await loadK8s(updateGrid(grid!, { projectName: "" }));
chunk3.items = chunk3.items.map(i => {
return !i.projectName || i.projectName === "Kubernetes" ? markAsFromAnotherClient(i) : i;
});
let chunk3: LoadedDeployments<K8S> = { count: 0, items: [], failedDeployments: [] };
if (showAllDeployments.value) {
chunk3 = await loadK8s(updateGrid(grid!, { projectName: "" }));
chunk3.items = chunk3.items.map(i => {
return !i.projectName || i.projectName === "Kubernetes" ? markAsFromAnotherClient(i) : i;
});
}
const clusters = mergeLoadedDeployments(chunk1, chunk2, chunk3);
failedDeployments.value = clusters.failedDeployments;
Expand Down

0 comments on commit 7e15e30

Please sign in to comment.