mirror of
https://github.com/MCSManager/MCSManager.git
synced 2024-12-27 07:59:08 +08:00
Fix: reset current page
This commit is contained in:
parent
a97efa50af
commit
8b2e658340
@ -74,9 +74,10 @@ const initNodes = async () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const initInstancesData = async () => {
|
const initInstancesData = async (resetPage?: boolean) => {
|
||||||
try {
|
try {
|
||||||
selectedInstance.value = [];
|
selectedInstance.value = [];
|
||||||
|
if (resetPage) operationForm.value.currentPage = 1;
|
||||||
if (!currentRemoteNode.value) {
|
if (!currentRemoteNode.value) {
|
||||||
await initNodes();
|
await initNodes();
|
||||||
}
|
}
|
||||||
@ -112,7 +113,7 @@ const handleChangeNode = async (item: NodeStatus) => {
|
|||||||
try {
|
try {
|
||||||
currentRemoteNode.value = item;
|
currentRemoteNode.value = item;
|
||||||
selectedInstance.value = [];
|
selectedInstance.value = [];
|
||||||
await initInstancesData();
|
await initInstancesData(true);
|
||||||
localStorage.setItem("pageSelectedRemote", JSON.stringify(item));
|
localStorage.setItem("pageSelectedRemote", JSON.stringify(item));
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
console.error(err.message);
|
console.error(err.message);
|
||||||
@ -262,7 +263,7 @@ const batchDeleteInstance = async (deleteFile: boolean) => {
|
|||||||
message: t("TXT_CODE_c3c06801"),
|
message: t("TXT_CODE_c3c06801"),
|
||||||
description: t("TXT_CODE_50075e02")
|
description: t("TXT_CODE_50075e02")
|
||||||
});
|
});
|
||||||
await initInstancesData();
|
await initInstancesData(true);
|
||||||
}
|
}
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
@ -406,7 +407,7 @@ onMounted(async () => {
|
|||||||
v-model:pageSize="operationForm.pageSize"
|
v-model:pageSize="operationForm.pageSize"
|
||||||
:total="instances.maxPage * operationForm.pageSize"
|
:total="instances.maxPage * operationForm.pageSize"
|
||||||
show-size-changer
|
show-size-changer
|
||||||
@change="initInstancesData"
|
@change="initInstancesData()"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</BetweenMenus>
|
</BetweenMenus>
|
||||||
|
Loading…
Reference in New Issue
Block a user