Minor css fixes, delete/pause addresses, validation fixes for nodes with 0 in address

This commit is contained in:
Deon George
2021-07-02 00:25:41 +10:00
parent 88d189110d
commit 54bcdf4b13
7 changed files with 132 additions and 9 deletions

33
app/Rules/FidoInteger.php Normal file
View File

@@ -0,0 +1,33 @@
<?php
namespace App\Rules;
use Illuminate\Contracts\Validation\Rule;
use App\Http\Controllers\DomainController;
class FidoInteger implements Rule
{
/**
* Determine if the validation rule passes.
* This will check that a number used for zone, net, host is between 1 and DomainController::NUMBER_MAX.
*
* @param string $attribute
* @param mixed $value
* @return bool
*/
public function passes($attribute,$value)
{
return (is_numeric($value) && ($value >= 0) && ($value < DomainController::NUMBER_MAX));
}
/**
* Get the validation error message.
*
* @return string
*/
public function message()
{
return sprintf('The number must be between 0 and %d.',DomainController::NUMBER_MAX);
}
}