Skip to content

Commit

Permalink
FIX the add and remove login page updating
Browse files Browse the repository at this point in the history
  • Loading branch information
mabasian committed Mar 21, 2024
1 parent 0a2345a commit 198e99e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import ServerHeader from './components/ServerHeader.vue';
/>
<ServerHeader @tab-picker="tabPicker" />
<ServerBody
:key="serverBodyComponentKey"
@server-login="loginHandler"
@select-server="serverHandler"
@change-password="acceptChangePass"
Expand Down Expand Up @@ -53,6 +54,7 @@ const router = useRouter();
const keyLocation = ref("");
let loginAbortController = new AbortController();
console.log("Server Management Screen", loginAbortController);
const serverBodyComponentKey = ref(0);
watchEffect(() => {
serverStore.setActiveState("isServerDetailsActive");
Expand Down Expand Up @@ -209,6 +211,7 @@ const removeServerHandler = async () => {
await remove();
serverStore.isRemoveProcessing = false;
serverStore.isRemoveModalActive = false;
serverBodyComponentKey.value++;
};
//SSH Key Management
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,7 @@ const IpScanLan1 = async () => {
const saveServer = async () => {
await add();
//reload the page
};
const removeServer = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,19 +88,17 @@ const getFilteredServers = () => {
);
};
// Recompute filteredServers when searchQuery changes
watch(searchQuery, () => {
filteredServers.value = null;
setTimeout(() => {
filteredServers.value = getFilteredServers();
}, 10);
});
// Watch for changes in both searchQuery and serverStore.refreshServers
watch(
() => serverStore.refreshServers,
async () => {
await loadStoredConnections();
}
[searchQuery, () => serverStore.refreshServers],
async ([, refreshTrigger], [, oldRefreshTrigger]) => {
if (refreshTrigger !== oldRefreshTrigger) {
await loadStoredConnections();
}
filteredServers.value = getFilteredServers();
},
{ deep: true }
);
//Lifecycle Hooks
Expand Down

0 comments on commit 198e99e

Please sign in to comment.