From 8f5928b66f35228b6eebcb7aaf3c98f9de73b2aa Mon Sep 17 00:00:00 2001 From: NanamiAdmin Date: Wed, 25 Mar 2026 21:25:07 +0800 Subject: [PATCH] fix(Instances): fix start/stop instance fault Ensure consistent string type for instanceID parameter in API calls to prevent potential type-related issues. Also update status display to use more descriptive 'running'/'stopped' values. --- src/views/Instances.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/views/Instances.vue b/src/views/Instances.vue index 1b4cf84..d3563e1 100644 --- a/src/views/Instances.vue +++ b/src/views/Instances.vue @@ -212,7 +212,7 @@ export default { for (const instance of instances.value) { try { const statusResult = await instanceApi.getInstanceStatus(String(instance.instanceID)); - instance.status = statusResult.data.status; + instance.status = statusResult.data.isRunning ? 'running' : 'stopped'; } catch (error) { console.error(`Failed to load status for instance ${instance.instanceID}:`, error); } @@ -224,7 +224,7 @@ export default { const startInstance = async (instanceID) => { try { - await instanceApi.startInstance(instanceID); + await instanceApi.startInstance(instanceID.toString()); showNotification('Instance started successfully', 'success'); await loadInstances(); } catch (error) { @@ -234,7 +234,7 @@ export default { const stopInstance = async (instanceID) => { try { - await instanceApi.stopInstance(instanceID); + await instanceApi.stopInstance(instanceID.toString()); showNotification('Instance stopped successfully', 'success'); await loadInstances(); } catch (error) {