Commit 28d57b3e authored by Mahmoud Aglan's avatar Mahmoud Aglan

Fix instance show: use getAppDefinition for full state, auto-load on mount

getAppInfo only returns build status. getAppDefinition returns the full
config (env vars, volumes, replicas, SSL). Also auto-loads state on page
load so you don't have to click "Load State".
Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
parent 5854d283
......@@ -20,13 +20,19 @@ class InstanceShow extends Component
public function mount(Instance $instance): void
{
$this->instance = $instance;
if (!in_array($instance->status, ['deleted', 'failed'])) {
$this->loadState();
}
}
public function loadState(): void
{
try {
$caprover = app(CapRoverService::class);
$info = $caprover->getAppInfo($this->instance->app_name);
$info = $caprover->getAppDefinition($this->instance->app_name);
if (!$info) {
throw new \RuntimeException('App not found in CapRover');
}
$this->appState = [
'instanceCount' => $info['instanceCount'] ?? 0,
'isAppBuilding' => $info['isAppBuilding'] ?? false,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment