diff --git a/src/views/InstanceDetail.vue b/src/views/InstanceDetail.vue index c84e0e3..10c7acb 100644 --- a/src/views/InstanceDetail.vue +++ b/src/views/InstanceDetail.vue @@ -368,6 +368,10 @@ export default { await instanceApi.startInstance(instanceID.value); showNotification('Instance started successfully', 'success'); await loadInstanceInfo(); + // Clear logs && reconnect to websocket + logs.value = []; + disconnectLogWebSocket(); + connectLogWebSocket(); } catch (error) { showNotification(error.message || 'Start instance failed', 'error'); } @@ -378,6 +382,10 @@ export default { await instanceApi.stopInstance(instanceID.value); showNotification('Instance stopped successfully', 'success'); await loadInstanceInfo(); + // Clear logs && reconnect to websocket + logs.value = []; + disconnectLogWebSocket(); + connectLogWebSocket(); } catch (error) { showNotification(error.message || 'Stop instance failed', 'error'); } @@ -398,6 +406,10 @@ export default { await instanceApi.restartInstance(instanceID.value); showNotification('Instance restarted successfully', 'success'); await loadInstanceInfo(); + // Clear logs && reconnect to websocket + logs.value = []; + disconnectLogWebSocket(); + connectLogWebSocket(); } catch (error) { showNotification(error.message || 'Restart instance failed', 'error'); }