feat: able to delete configuration from server

This commit is contained in:
Andras Bacsai
2024-04-12 10:54:25 +02:00
parent 8b668cf8b7
commit 9032879e20
16 changed files with 127 additions and 10 deletions

View File

@@ -27,6 +27,14 @@ class Service extends BaseModel
{
return $this->morphToMany(Tag::class, 'taggable');
}
public function delete_configurations()
{
$server = data_get($this, 'server');
$workdir = $this->workdir();
if (str($workdir)->endsWith($this->uuid)) {
instant_remote_process(["rm -rf " . $this->workdir()], $server, false);
}
}
public function status()
{
$applications = $this->applications;