wip
This commit is contained in:
parent
910e8279a0
commit
f723b504a1
@ -11,6 +11,8 @@ class Form extends Component
|
||||
public $server_id;
|
||||
public Server $server;
|
||||
public $uptime;
|
||||
public $dockerVersion;
|
||||
public $dockerComposeVersion;
|
||||
|
||||
protected $rules = [
|
||||
'server.name' => 'required|min:6',
|
||||
@ -30,9 +32,11 @@ public function installDocker()
|
||||
"curl https://releases.rancher.com/install-docker/23.0.sh | sh"
|
||||
]);
|
||||
}
|
||||
public function checkConnection()
|
||||
public function checkServer()
|
||||
{
|
||||
$this->uptime = runRemoteCommandSync($this->server, ['uptime']);
|
||||
$this->dockerVersion = runRemoteCommandSync($this->server, ['docker version|head -2|grep -i version'], false);
|
||||
$this->dockerComposeVersion = runRemoteCommandSync($this->server, ['docker compose version|head -2|grep -i version'], false);
|
||||
}
|
||||
public function submit()
|
||||
{
|
||||
|
@ -21,12 +21,15 @@
|
||||
<button class="w-16 mt-4" type="submit">
|
||||
Submit
|
||||
</button>
|
||||
<button wire:click.prevent='checkConnection'>Check Connection</button>
|
||||
<button wire:click.prevent='checkServer'>Check Server</button>
|
||||
<button wire:click.prevent='installDocker'>Install Docker</button>
|
||||
</div>
|
||||
</form>
|
||||
@isset($uptime)
|
||||
<p>Connection OK</p>
|
||||
<p>Uptime: {{ $uptime }}</p>
|
||||
<p>{{ $dockerVersion }}</p>
|
||||
<p>{{ $dockerComposeVersion }}</p>
|
||||
@endisset
|
||||
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user