fix: increase polling time for services

fix: allow domain as ip address
This commit is contained in:
Andras Bacsai 2023-11-03 10:57:58 +01:00
parent a0031efce0
commit 0cd3a3d848
10 changed files with 12 additions and 16 deletions

View File

@ -164,7 +164,7 @@ public function saveServer()
{
$this->validate([
'remoteServerName' => 'required',
'remoteServerHost' => 'required|ip',
'remoteServerHost' => 'required',
'remoteServerPort' => 'required|integer',
'remoteServerUser' => 'required',
]);

View File

@ -16,7 +16,7 @@ class Form extends Component
protected $validationAttributes = [
'destination.name' => 'name',
'destination.network' => 'network',
'destination.server.ip' => 'IP Address',
'destination.server.ip' => 'IP Address/Domain',
];
public function submit()

View File

@ -13,7 +13,7 @@ class Index extends Component
public $databases;
public array $parameters;
public array $query;
protected $listeners = ["refreshStacks","checkStatus"];
protected $listeners = ["refreshStacks"];
public function render()
{
return view('livewire.project.service.index');

View File

@ -19,10 +19,6 @@ public function render()
return view('livewire.project.service.navbar');
}
public function checkStatus()
{
$this->emit('checkStatus');
}
public function deploy()
{
$this->service->parse();

View File

@ -32,7 +32,7 @@ class Form extends Component
protected $validationAttributes = [
'server.name' => 'Name',
'server.description' => 'Description',
'server.ip' => 'IP address',
'server.ip' => 'IP address/Domain',
'server.user' => 'User',
'server.port' => 'Port',
'server.settings.is_cloudflare_tunnel' => 'Cloudflare Tunnel',
@ -125,7 +125,7 @@ public function submit()
if(isCloud() && !isDev()) {
$this->validate();
$this->validate([
'server.ip' => 'required|ip',
'server.ip' => 'required',
]);
} else {
$this->validate();

View File

@ -26,14 +26,14 @@ class ByIp extends Component
protected $rules = [
'name' => 'required|string',
'description' => 'nullable|string',
'ip' => 'required|ip',
'ip' => 'required',
'user' => 'required|string',
'port' => 'required|integer',
];
protected $validationAttributes = [
'name' => 'Name',
'description' => 'Description',
'ip' => 'IP Address',
'ip' => 'IP Address/Domain',
'user' => 'User',
'port' => 'Port',
];

View File

@ -1,4 +1,4 @@
<div x-data="{ raw: true, activeTab: window.location.hash ? window.location.hash.substring(1) : 'service-stack' }" wire:poll.15000ms="checkStatus">
<div x-data="{ raw: true, activeTab: window.location.hash ? window.location.hash.substring(1) : 'service-stack' }" x-init="$wire.checkStatus" wire:poll.10000ms="checkStatus">
<livewire:project.service.navbar :service="$service" :parameters="$parameters" :query="$query" />
<livewire:project.service.compose-modal :raw="$service->docker_compose_raw" :actual="$service->docker_compose" />
<div class="flex h-full pt-6">

View File

@ -1,4 +1,4 @@
<div x-init="$wire.checkStatus" wire:poll.2500ms='checkStatus'>
<div>
<livewire:project.service.modal />
<h1>Configuration</h1>
<x-resources.breadcrumbs :resource="$service" :parameters="$parameters" />

View File

@ -47,7 +47,7 @@
label="Is it part of a Swarm cluster?" /> --}}
</div>
<div class="flex flex-col w-full gap-2 lg:flex-row">
<x-forms.input id="server.ip" label="IP Address" required />
<x-forms.input id="server.ip" label="IP Address/Domain" helper="An IP Address (127.0.0.1) or domain (example.com)." required />
<div class="flex gap-2">
<x-forms.input id="server.user" label="User" required />
<x-forms.input type="number" id="server.port" label="Port" required />

View File

@ -10,8 +10,8 @@
<x-forms.input id="description" label="Description" />
</div>
<div class="flex gap-2">
<x-forms.input id="ip" label="IP Address" required
helper="An IP Address (127.0.0.1). No domain names." />
<x-forms.input id="ip" label="IP Address/Domain" required
helper="An IP Address (127.0.0.1) or domain (example.com)." />
<x-forms.input id="user" label ="User" required />
<x-forms.input type="number" id="port" label="Port" required />
</div>