fix: stopping a resource is now job based
ui: show status on project
This commit is contained in:
@@ -32,16 +32,8 @@ class Application extends BaseModel
|
||||
]);
|
||||
});
|
||||
static::deleting(function ($application) {
|
||||
// Stop Container
|
||||
if ($application->destination->server->isFunctional()) {
|
||||
instant_remote_process(
|
||||
["docker rm -f {$application->uuid}"],
|
||||
$application->destination->server,
|
||||
false
|
||||
);
|
||||
}
|
||||
$application->settings()->delete();
|
||||
$storages = $application->persistentStorages()->get();
|
||||
$storages = $application->persistentStorages()->get();
|
||||
foreach ($storages as $storage) {
|
||||
instant_remote_process(["docker volume rm -f $storage->name"], $application->destination->server, false);
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ class Service extends BaseModel
|
||||
static::deleting(function ($service) {
|
||||
$storagesToDelete = collect([]);
|
||||
foreach ($service->applications()->get() as $application) {
|
||||
instant_remote_process(["docker rm -f {$application->name}-{$service->uuid}"], $service->server, false);
|
||||
$storages = $application->persistentStorages()->get();
|
||||
foreach ($storages as $storage) {
|
||||
$storagesToDelete->push($storage);
|
||||
@@ -27,7 +26,6 @@ class Service extends BaseModel
|
||||
$application->persistentStorages()->delete();
|
||||
}
|
||||
foreach ($service->databases()->get() as $database) {
|
||||
instant_remote_process(["docker rm -f {$database->name}-{$service->uuid}"], $service->server, false);
|
||||
$storages = $database->persistentStorages()->get();
|
||||
foreach ($storages as $storage) {
|
||||
$storagesToDelete->push($storage);
|
||||
|
||||
@@ -29,21 +29,13 @@ class StandalonePostgresql extends BaseModel
|
||||
]);
|
||||
});
|
||||
static::deleting(function ($database) {
|
||||
// Stop Container
|
||||
instant_remote_process(
|
||||
["docker rm -f {$database->uuid}"],
|
||||
$database->destination->server,
|
||||
false
|
||||
);
|
||||
// Stop TCP Proxy
|
||||
if ($database->is_public) {
|
||||
instant_remote_process(["docker rm -f {$database->uuid}-proxy"], $database->destination->server, false);
|
||||
$storages = $database->persistentStorages()->get();
|
||||
foreach ($storages as $storage) {
|
||||
instant_remote_process(["docker volume rm -f $storage->name"], $database->destination->server, false);
|
||||
}
|
||||
$database->scheduledBackups()->delete();
|
||||
$database->persistentStorages()->delete();
|
||||
$database->environment_variables()->delete();
|
||||
// Remove Volume
|
||||
instant_remote_process(['docker volume rm postgres-data-' . $database->uuid], $database->destination->server, false);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -24,21 +24,13 @@ class StandaloneRedis extends BaseModel
|
||||
]);
|
||||
});
|
||||
static::deleting(function ($database) {
|
||||
// Stop Container
|
||||
instant_remote_process(
|
||||
["docker rm -f {$database->uuid}"],
|
||||
$database->destination->server,
|
||||
false
|
||||
);
|
||||
// Stop TCP Proxy
|
||||
if ($database->is_public) {
|
||||
instant_remote_process(["docker rm -f {$database->uuid}-proxy"], $database->destination->server, false);
|
||||
}
|
||||
$database->scheduledBackups()->delete();
|
||||
$storages = $database->persistentStorages()->get();
|
||||
foreach ($storages as $storage) {
|
||||
instant_remote_process(["docker volume rm -f $storage->name"], $database->destination->server, false);
|
||||
}
|
||||
$database->persistentStorages()->delete();
|
||||
$database->environment_variables()->delete();
|
||||
// Remove Volume
|
||||
instant_remote_process(['docker volume rm postgres-data-' . $database->uuid], $database->destination->server, false);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user