feat: able to generate only the required labels for resources

This commit is contained in:
Andras Bacsai
2024-08-07 18:27:50 +02:00
parent 92f90d4e52
commit 0b000919cf
5 changed files with 245 additions and 98 deletions

View File

@@ -20,6 +20,10 @@ class Proxy extends Component
protected $listeners = ['proxyStatusUpdated', 'saveConfiguration' => 'submit'];
protected $rules = [
'server.settings.generate_exact_labels' => 'required|boolean',
];
public function mount()
{
$this->selectedProxy = $this->server->proxyType();
@@ -31,13 +35,13 @@ class Proxy extends Component
$this->dispatch('refresh')->self();
}
public function change_proxy()
public function changeProxy()
{
$this->server->proxy = null;
$this->server->save();
}
public function select_proxy($proxy_type)
public function selectProxy($proxy_type)
{
$this->server->proxy->set('status', 'exited');
$this->server->proxy->set('type', $proxy_type);
@@ -49,6 +53,17 @@ class Proxy extends Component
$this->dispatch('proxyStatusUpdated');
}
public function instantSave()
{
try {
$this->validate();
$this->server->settings->save();
$this->dispatch('success', 'Settings saved.');
} catch (\Throwable $e) {
return handleError($e, $this);
}
}
public function submit()
{
try {