Skip to content

Commit

Permalink
Fix: reload gateway nodes
Browse files Browse the repository at this point in the history
- add reload node logic, and reset the gateway field
  • Loading branch information
0oM4R committed Jun 12, 2024
1 parent 8a6d2d0 commit b5fde6b
Showing 1 changed file with 22 additions and 19 deletions.
41 changes: 22 additions & 19 deletions packages/playground/src/components/node_selector/TfDomainName.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<template #append-item v-if="pagination.page !== -1">
<VContainer>
<VBtn
@click="reloadDomains()"
@click="loadDomains()"
block
color="secondary"
variant="tonal"
Expand Down Expand Up @@ -149,26 +149,28 @@ export default {
farmId: enableCustomDomain.value ? props.farm?.farmId : undefined,
availableFor: gridStore.client.twinId,
}));
const selectedDomain = ref<NodeInfo | null>(null);
const loadDomains = () => domainsTask.value.run(gridStore, filters.value);
const reloadDomains = async (_filters: FilterOptions = filters.value) => {
if (selectedDomain.value) {
selectedDomain.value = null;
bindModelValue();
bindStatus();
}
await pageCountTask.value.run(gridStore, _filters);
pagination.value.reset(pageCountTask.value.data as number);
await nextTick();
loadedDomains.value = [];
return loadDomains();
};
const reloadDomains = () => domainsTask.value.run(gridStore, filters.value);
useWatchDeep(
filters,
async filters => {
await pageCountTask.value.run(gridStore, filters);
pagination.value.reset(pageCountTask.value.data as number);
await nextTick();
loadedDomains.value = [];
return reloadDomains();
},
{
immediate: true,
deep: true,
ignoreFields: ["page"],
},
);
useWatchDeep(filters, reloadDomains, {
immediate: true,
deep: true,
ignoreFields: ["page"],
});
const customDomain = ref("");
const selectedDomain = ref<NodeInfo | null>(null);
const domainNameValid = ref<boolean | null>(null);
watch(domainNameValid, valid => {
Expand Down Expand Up @@ -235,6 +237,7 @@ export default {
domainsTask,
loadedDomains,
selectedDomain,
loadDomains,
reloadDomains,
disableSelectedDomain,
Expand Down

0 comments on commit b5fde6b

Please sign in to comment.