wip
This commit is contained in:
@@ -8,27 +8,26 @@ use Livewire\Component;
|
||||
|
||||
class Create extends Component
|
||||
{
|
||||
protected string|null $from = null;
|
||||
public string $name;
|
||||
public string|null $description = null;
|
||||
public string $value;
|
||||
public string $currentRoute;
|
||||
|
||||
public function mount()
|
||||
{
|
||||
$this->currentRoute = Route::current()->uri();
|
||||
}
|
||||
public function createPrivateKey()
|
||||
{
|
||||
$this->value = trim($this->value);
|
||||
if (!str_ends_with($this->value, "\n")) {
|
||||
$this->value .= "\n";
|
||||
}
|
||||
$new_private_key = PrivateKey::create([
|
||||
$private_key = PrivateKey::create([
|
||||
'name' => $this->name,
|
||||
'description' => $this->description,
|
||||
'private_key' => $this->value,
|
||||
'team_id' => session('currentTeam')->id
|
||||
]);
|
||||
redirect()->route('server.new');
|
||||
if ($this->from === 'server') {
|
||||
return redirect()->route('server.new');
|
||||
}
|
||||
return redirect()->route('private-key.show', ['private_key_uuid' => $private_key->uuid]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ namespace App\Http\Livewire\Server;
|
||||
use App\Models\PrivateKey as ModelsPrivateKey;
|
||||
use App\Models\Server;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Livewire\Component;
|
||||
|
||||
class PrivateKey extends Component
|
||||
@@ -13,9 +14,13 @@ class PrivateKey extends Component
|
||||
public $parameters;
|
||||
public function setPrivateKey($private_key_id)
|
||||
{
|
||||
Server::where('uuid', $this->parameters['server_uuid'])->update([
|
||||
$server = Server::where('uuid', $this->parameters['server_uuid']);
|
||||
$server->update([
|
||||
'private_key_id' => $private_key_id
|
||||
]);
|
||||
// Delete the old ssh mux file to force a new one to be created
|
||||
Storage::disk('local')->delete(".ssh/ssh_mux_{$server->first()->ip}_{$server->first()->port}_{$server->first()->user}");
|
||||
|
||||
return redirect()->route('server.show', $this->parameters['server_uuid']);
|
||||
}
|
||||
public function mount()
|
||||
|
||||
@@ -17,13 +17,22 @@ class Proxy extends Component
|
||||
public ProxyTypes $selectedProxy = ProxyTypes::TRAEFIK_V2;
|
||||
public $proxy_settings = null;
|
||||
|
||||
public function mount()
|
||||
{
|
||||
$this->proxyStatus();
|
||||
}
|
||||
public function serverValidated()
|
||||
{
|
||||
$this->server->settings->refresh();
|
||||
}
|
||||
public function installProxy()
|
||||
{
|
||||
$this->saveConfiguration($this->server);
|
||||
if (
|
||||
$this->server->extra_attributes->last_applied_proxy_settings &&
|
||||
$this->server->extra_attributes->last_saved_proxy_settings !== $this->server->extra_attributes->last_applied_proxy_settings
|
||||
) {
|
||||
$this->saveConfiguration($this->server);
|
||||
}
|
||||
$activity = resolve(InstallProxy::class)($this->server);
|
||||
$this->emit('newMonitorActivity', $activity->id);
|
||||
}
|
||||
@@ -32,6 +41,7 @@ class Proxy extends Component
|
||||
{
|
||||
$this->server->extra_attributes->proxy_status = checkContainerStatus(server: $this->server, container_id: 'coolify-proxy');
|
||||
$this->server->save();
|
||||
$this->server->refresh();
|
||||
}
|
||||
public function setProxy()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user