Some service host/domain updates, including schema updates
This commit is contained in:
parent
06b1eca306
commit
2bac177618
@ -228,41 +228,6 @@ class ServiceController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit a domain service details
|
||||
*
|
||||
* @param Request $request
|
||||
* @param Service $o
|
||||
* @return RedirectResponse
|
||||
* @deprecated - use update()
|
||||
*/
|
||||
public function domain_edit(Request $request,Service $o)
|
||||
{
|
||||
session()->flash('service_update',TRUE);
|
||||
|
||||
$validation = $request->validate([
|
||||
'service.domain_name' => ['required',function($attribute,$value,$fail) use ($request,$o) {
|
||||
if (Service\Domain::where('domain_name',$value)
|
||||
->where('domain_tld_id',Arr::get($request,'service.domain_tld_id'))
|
||||
->when($o->type,function($q) use ($o) { return $q->where('id','<>',$o->type->id); })
|
||||
->count() > 0)
|
||||
{
|
||||
$fail('Domain already exists.');
|
||||
}
|
||||
}],
|
||||
'service.domain_expire' => 'required|date',
|
||||
'service.domain_tld_id' => 'required|exists:ab_domain_tld,id',
|
||||
'service.domain_registrar_id' => 'required|exists:ab_domain_registrar,id',
|
||||
'service.registrar_account' => 'required',
|
||||
'service.registrar_username' => 'required|string|min:5',
|
||||
'service.registrar_ns' => 'required|string|min:5',
|
||||
]);
|
||||
|
||||
$o->type->forceFill($validation['service'])->save();
|
||||
|
||||
return redirect()->back()->with('success','Record updated.');
|
||||
}
|
||||
|
||||
/**
|
||||
* List all the domains managed by the user
|
||||
*
|
||||
|
@ -5,12 +5,7 @@ namespace App\Models;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Leenooks\Traits\ScopeActive;
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
class DomainRegistrar extends Model
|
||||
{
|
||||
use ScopeActive;
|
||||
|
||||
protected $table = 'ab_domain_registrar';
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Leenooks\Traits\ScopeActive;
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
class DomainTld extends Model
|
||||
{
|
||||
use ScopeActive;
|
||||
|
||||
protected $table = 'ab_domain_tld';
|
||||
|
||||
/* RELATIONS */
|
||||
|
||||
public function services()
|
||||
{
|
||||
return $this->hasMany(Service::class);
|
||||
}
|
||||
|
||||
/* ATTRIBUTES */
|
||||
|
||||
public function getNameAttribute($value): string
|
||||
{
|
||||
return strtoupper($value);
|
||||
}
|
||||
|
||||
public function getPriceGroupAttribute($value): array
|
||||
{
|
||||
return unserialize($value);
|
||||
}
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class HostServer extends Model
|
||||
{
|
||||
protected $table = 'ab_host_server';
|
||||
}
|
@ -16,6 +16,26 @@ class Domain extends Type
|
||||
protected $table = 'service_domain';
|
||||
protected $with = ['tld'];
|
||||
|
||||
/* OVERRIDES */
|
||||
|
||||
/**
|
||||
* Service update validation
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function validation(): array
|
||||
{
|
||||
return [
|
||||
'domain_name' => 'nullable|string|min:2',
|
||||
'tld_id' => 'required|exists:tlds,id',
|
||||
'expire_at' => 'required|date',
|
||||
'domain_registrar_id' => 'required|exists:domain_registrars,id',
|
||||
'registrar_account' => 'nullable|string',
|
||||
'registrar_ns' => 'nullable|string',
|
||||
'registrar_username' => 'nullable|string',
|
||||
];
|
||||
}
|
||||
|
||||
/* RELATIONS */
|
||||
|
||||
public function registrar()
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\Models\Service;
|
||||
|
||||
use App\Models\HostServer;
|
||||
use App\Models\SupplierHostServer;
|
||||
use App\Traits\ServiceDomains;
|
||||
|
||||
/**
|
||||
@ -20,6 +20,25 @@ class Host extends Type
|
||||
|
||||
public function provider()
|
||||
{
|
||||
return $this->belongsTo(HostServer::class,'host_server_id');
|
||||
return $this->belongsTo(SupplierHostServer::class,'supplier_host_server_id');
|
||||
}
|
||||
|
||||
/* OVERRIDES */
|
||||
|
||||
/**
|
||||
* Service update validation
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function validation(): array
|
||||
{
|
||||
return [
|
||||
'domain_name' => 'nullable|string|min:2',
|
||||
'tld_id' => 'required|exists:tlds,id',
|
||||
'expire_at' => 'required|date',
|
||||
'supplier_host_server_id' => 'required|exists:supplier_host_servers,id',
|
||||
'host_username' => 'nullable|string',
|
||||
'host_password' => 'nullable|string',
|
||||
];
|
||||
}
|
||||
}
|
11
app/Models/SupplierHostServer.php
Normal file
11
app/Models/SupplierHostServer.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Leenooks\Traits\ScopeActive;
|
||||
|
||||
class SupplierHostServer extends Model
|
||||
{
|
||||
use ScopeActive;
|
||||
}
|
@ -20,7 +20,7 @@
|
||||
"laravel/passport": "^10.1",
|
||||
"laravel/socialite": "^5.2",
|
||||
"laravel/ui": "^3.2",
|
||||
"leenooks/laravel": "^9.2.2",
|
||||
"leenooks/laravel": "^9.2.3",
|
||||
"leenooks/laravel-theme": "^v2.0.18",
|
||||
"nunomaduro/laravel-console-summary": "^1.8",
|
||||
"paypal/paypal-checkout-sdk": "^1.0",
|
||||
|
22
composer.lock
generated
22
composer.lock
generated
@ -4,7 +4,7 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "3306c0a2c799a142669bda57f369316a",
|
||||
"content-hash": "63cb7a16dfcfeae281a7caa276f1c73f",
|
||||
"packages": [
|
||||
{
|
||||
"name": "asm89/stack-cors",
|
||||
@ -3295,11 +3295,11 @@
|
||||
},
|
||||
{
|
||||
"name": "leenooks/laravel",
|
||||
"version": "9.2.2",
|
||||
"version": "9.2.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://dev.leenooks.net/leenooks/laravel",
|
||||
"reference": "2e512cc3edc913e59726a93c248e76705ff44daa"
|
||||
"reference": "8e9ca4c531311da5e329cdf9647ca193915167cf"
|
||||
},
|
||||
"require": {
|
||||
"creativeorange/gravatar": "^1.0",
|
||||
@ -3338,7 +3338,7 @@
|
||||
"laravel",
|
||||
"leenooks"
|
||||
],
|
||||
"time": "2022-08-01T10:29:57+00:00"
|
||||
"time": "2022-08-02T12:34:20+00:00"
|
||||
},
|
||||
{
|
||||
"name": "leenooks/laravel-theme",
|
||||
@ -3885,16 +3885,16 @@
|
||||
},
|
||||
{
|
||||
"name": "nunomaduro/termwind",
|
||||
"version": "v1.13.0",
|
||||
"version": "v1.14.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/nunomaduro/termwind.git",
|
||||
"reference": "132a24bd3e8c559e7f14fa14ba1b83772a0f97f8"
|
||||
"reference": "10065367baccf13b6e30f5e9246fa4f63a79eb1d"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/nunomaduro/termwind/zipball/132a24bd3e8c559e7f14fa14ba1b83772a0f97f8",
|
||||
"reference": "132a24bd3e8c559e7f14fa14ba1b83772a0f97f8",
|
||||
"url": "https://api.github.com/repos/nunomaduro/termwind/zipball/10065367baccf13b6e30f5e9246fa4f63a79eb1d",
|
||||
"reference": "10065367baccf13b6e30f5e9246fa4f63a79eb1d",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -3906,7 +3906,7 @@
|
||||
"ergebnis/phpstan-rules": "^1.0.",
|
||||
"illuminate/console": "^8.0|^9.0",
|
||||
"illuminate/support": "^8.0|^9.0",
|
||||
"laravel/pint": "^0.2.0",
|
||||
"laravel/pint": "^1.0.0",
|
||||
"pestphp/pest": "^1.21.0",
|
||||
"pestphp/pest-plugin-mock": "^1.0",
|
||||
"phpstan/phpstan": "^1.4.6",
|
||||
@ -3951,7 +3951,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/nunomaduro/termwind/issues",
|
||||
"source": "https://github.com/nunomaduro/termwind/tree/v1.13.0"
|
||||
"source": "https://github.com/nunomaduro/termwind/tree/v1.14.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@ -3967,7 +3967,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2022-07-01T15:06:55+00:00"
|
||||
"time": "2022-08-01T11:03:24+00:00"
|
||||
},
|
||||
{
|
||||
"name": "nyholm/psr7",
|
||||
|
@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
DB::statement('RENAME TABLE ab_domain_registrar TO domain_registrars');
|
||||
DB::statement('ALTER TABLE domain_registrars MODIFY active tinyint(1) NOT NULL');
|
||||
|
||||
Schema::table('domain_registrars', function (Blueprint $table) {
|
||||
$table->datetime('created_at')->nullable()->after('id');
|
||||
$table->datetime('updated_at')->nullable()->after('created_at');
|
||||
|
||||
$table->dropForeign('ab_domain_registrar_site_id_foreign');
|
||||
$table->dropIndex('ab_domain_registrar_id_site_id_index');
|
||||
|
||||
$table->foreign(['site_id'])->references(['id'])->on('sites');
|
||||
});
|
||||
|
||||
Schema::table('service_domain', function (Blueprint $table) {
|
||||
$table->foreign(['domain_registrar_id','site_id'])->references(['id','site_id'])->on('domain_registrars');
|
||||
});
|
||||
|
||||
DB::statement('RENAME TABLE ab_host_server TO supplier_host_servers');
|
||||
DB::statement('ALTER TABLE supplier_host_servers MODIFY active tinyint(1) DEFAULT NULL,MODIFY debug tinyint(1) DEFAULT NULL');
|
||||
DB::statement('ALTER TABLE supplier_host_servers MODIFY id int unsigned auto_increment,MODIFY site_id int unsigned NOT NULL,MODIFY max_accounts int unsigned DEFAULT NULL');
|
||||
DB::statement('ALTER TABLE supplier_host_servers MODIFY notes longtext DEFAULT NULL');
|
||||
|
||||
Schema::table('supplier_host_servers', function (Blueprint $table) {
|
||||
$table->datetime('created_at')->nullable()->after('id');
|
||||
$table->datetime('updated_at')->nullable()->after('created_at');
|
||||
|
||||
$table->integer('supplier_id')->unsigned()->nullable();
|
||||
|
||||
$table->foreign(['site_id'])->references(['id'])->on('sites');
|
||||
$table->foreign(['supplier_id'])->references(['id'])->on('suppliers');
|
||||
});
|
||||
|
||||
DB::statement('ALTER TABLE service_host RENAME COLUMN host_server_id TO supplier_host_server_id');
|
||||
DB::statement('ALTER TABLE service_host MODIFY supplier_host_server_id int unsigned DEFAULT NULL');
|
||||
|
||||
Schema::table('service_host', function (Blueprint $table) {
|
||||
$table->foreign(['supplier_host_server_id','site_id'])->references(['id','site_id'])->on('supplier_host_servers');
|
||||
});
|
||||
|
||||
DB::statement('DROP TABLE ab_domain_tld');
|
||||
//delete from ab_host_server where id=0;
|
||||
//alter table service_host modify host_server_id int unsigned default null;
|
||||
//update service_host set host_server_id=NULL where host_server_id=0
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
abort(500,'Cant go back');
|
||||
}
|
||||
};
|
18
public/css/fixes.css
vendored
18
public/css/fixes.css
vendored
@ -111,3 +111,21 @@ span.select2-selection.select2-selection--single > span.select2-selection__rende
|
||||
background-color: #6c757d;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
/* Fixes to select2, to make sure col-x widths are honoured */
|
||||
.select2-selection.select2-selection--single {
|
||||
height: calc(2.25rem + 2px) !important;
|
||||
}
|
||||
.select2.select2-container.select2-container--default {
|
||||
display: flex;
|
||||
flex: 1 1 auto;
|
||||
}
|
||||
.select2.select2-container.select2-container--default .selection {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* Render the invalid red when a select container fails validation */
|
||||
.is-invalid + .select2-container--default .select2-selection--single,
|
||||
.is-invalid + .select2-container--default .select2-selection--multiple {
|
||||
border: 1px solid #dc3545;
|
||||
}
|
@ -1,145 +1,97 @@
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<div class="form-group has-validation">
|
||||
<div class="col-12 col-sm-9 col-md-12 col-xl-7">
|
||||
<div class="form-group">
|
||||
<label for="domain_name">Domain Name</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fas fa-fw fa-globe-asia"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control text-right @error('domain.domain_name') is-invalid @enderror" id="domain_name" name="domain[domain_name]" placeholder="Domain Name..." value="{{ old('domain.domain_name',$o->domain_name) }}" required>
|
||||
<input type="text" style="width:55%;" class="form-control text-right @error('domain_name') is-invalid @enderror" id="domain_name" name="domain[domain_name]" placeholder="Domain Name..." value="{{ old('domain.domain_name',$o->domain_name) }}" required>
|
||||
|
||||
<div class="input-group-append">
|
||||
<span class="input-group-text">.</span>
|
||||
</div>
|
||||
<select class="form-control" id="domain_tld_id" name="domain[domain_tld_id]">
|
||||
@foreach(\App\Models\DomainTld::active()->orderBy('name')->get() as $oo)
|
||||
<option value="{{ $oo->id }}" @if($oo->id == old('domain.domain_tld_id',$o->domain_tld_id))selected @endif>{{ $oo->name }}</option>
|
||||
|
||||
<select style="width:25%;" class="form-control @error('tld_id') is-invalid @enderror" id="tld_id" name="domain[tld_id]">
|
||||
@foreach(\App\Models\TLD::orderBy('name')->get() as $oo)
|
||||
<option value="{{ $oo->id }}" @if($oo->id == old('domain.tld_id',$o->tld_id))selected @endif>{{ $oo->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('domain.domain_name')
|
||||
@error('domain_name')
|
||||
{{ $message }}
|
||||
@enderror
|
||||
@error('tld_id')
|
||||
{{ $message }}
|
||||
@else
|
||||
Domain Name is required.
|
||||
@enderror
|
||||
</span>
|
||||
</div>
|
||||
<span class="input-helper">Licensed Domain Name.</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-3">
|
||||
<div class="form-group has-validation">
|
||||
<label for="domain_expire">Expiry</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fas fa-fw fa-calendar"></i></span>
|
||||
</div>
|
||||
<input type="date" class="form-control @error('domain.domain_expire') is-invalid @enderror" id="domain_expire" name="domain[domain_expire]" value="{{ old('domain.domain_expire',$o->service_expire->format('Y-m-d')) }}" required>
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('domain.domain_expire')
|
||||
{{ $message }}
|
||||
@else
|
||||
Domain Expiry is required.
|
||||
@enderror
|
||||
</span>
|
||||
</div>
|
||||
<span class="input-helper">Date Domain Expires.</span>
|
||||
</div>
|
||||
<div class="col-12 col-sm-9 col-md-6 col-xl-5">
|
||||
@include('adminlte::widget.form_date',[
|
||||
'label'=>'Expiry',
|
||||
'id'=>'expire_at',
|
||||
'old'=>'domain.expire_at',
|
||||
'name'=>'domain[expire_at]',
|
||||
'value'=>$o->expire_at ? $o->expire_at->format('Y-m-d') : ($o->connect_at ? $o->connect_at->addMonths($o->contract_term)->format('Y-m-d') : ''),
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<p class="h6">Registrar Details</p>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12 col-sm-9 col-md-6 col-xl-5">
|
||||
@include('adminlte::widget.form_select',[
|
||||
'label'=>'Registrar',
|
||||
'icon'=>'fas fa-handshake',
|
||||
'id'=>'domain_registrar_id',
|
||||
'old'=>'domain.domain_registrar_id',
|
||||
'name'=>'domain[domain_registrar_id]',
|
||||
'options'=>\App\Models\DomainRegistrar::active()->orderBy('name')->get()->transform(function($item) { return ['id'=>$item->id,'value'=>$item->name]; }),
|
||||
'value'=>$o->domain_registrar_id ?? '',
|
||||
])
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-sm-9 col-md-12 col-xl-6">
|
||||
@include('adminlte::widget.form_text',[
|
||||
'label'=>'Registrar Account',
|
||||
'icon'=>'fas fa-user-circle',
|
||||
'id'=>'registrar_account',
|
||||
'old'=>'domain.registrar_account',
|
||||
'name'=>'domain[registrar_account]',
|
||||
'value'=>$o->registrar_account ?? '',
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<div class="form-group has-validation">
|
||||
<label for="domain_registrar_id">Registrar</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fas fa-fw fa-handshake"></i></span>
|
||||
</div>
|
||||
<select class="form-control @error('domain.domain_registrar_id') is-invalid @enderror" id="domain_registrar_id" name="domain[domain_registrar_id]">
|
||||
<option></option>
|
||||
@foreach(\App\Models\DomainRegistrar::active()->orderBy('name')->get() as $oo)
|
||||
<option value="{{ $oo->id }}" @if($oo->id == old('domain.domain_registrar_id',$o->domain_registrar_id))selected @endif>{{ $oo->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('domain.domain_registrar_id')
|
||||
{{ $message }}
|
||||
@else
|
||||
Domain Registrar is required.
|
||||
@enderror
|
||||
</span>
|
||||
</div>
|
||||
<span class="input-helper">Domain Name Registrar.</span>
|
||||
</div>
|
||||
<div class="col-12 col-sm-9 col-md-6 col-xl-5">
|
||||
@include('adminlte::widget.form_select',[
|
||||
'label'=>'DNS Location',
|
||||
'icon'=>'fas fa-project-diagram',
|
||||
'id'=>'registrar_ns',
|
||||
'old'=>'domain.registrar_ns',
|
||||
'name'=>'domain[registrar_ns]',
|
||||
'options'=>\App\Models\Service\Domain::select('registrar_ns')->distinct()->orderBy('registrar_ns')->get()->transform(function($item) { return ['id'=>$item->registrar_ns,'value'=>$item->registrar_ns]; }),
|
||||
'value'=>$o->registrar_ns ?? '',
|
||||
'addvalues'=>TRUE,
|
||||
])
|
||||
</div>
|
||||
|
||||
<div class="col-3">
|
||||
<div class="form-group has-validation">
|
||||
<label for="registrar_account">Registrar Account</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fas fa-fw fa-user"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control @error('domain.registrar_account') is-invalid @enderror" id="registrar_account" name="domain[registrar_account]" value="{{ old('domain.registrar_account',$o->registrar_account) }}">
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('domain.registrar_account')
|
||||
{{ $message }}
|
||||
@else
|
||||
Registrar Account ID is required.
|
||||
@enderror
|
||||
</span>
|
||||
</div>
|
||||
<span class="input-helper">Registrar Account ID.</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<div class="form-group has-validation">
|
||||
<label for="registrar_ns">DNS Location</label>
|
||||
<div class="input-group flex-nowrap">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fas fa-fw fa-project-diagram"></i></span>
|
||||
</div>
|
||||
<select class="form-control @error('domain.registrar_ns') is-invalid @enderror" id="registrar_ns" name="domain[registrar_ns]">
|
||||
@foreach(\App\Models\Service\Domain::select('registrar_ns')->distinct()->get() as $oo)
|
||||
<option value="{{ $oo->registrar_ns }}" @if($oo->registrar_ns == old('domain.registrar_ns',$o->registrar_ns))selected @endif>{{ $oo->registrar_ns }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('domain.registrar_ns')
|
||||
{{ $message }}
|
||||
@else
|
||||
DNS Details is required.
|
||||
@enderror
|
||||
</span>
|
||||
</div>
|
||||
<span class="input-helper">Domain DNS details.</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-3">
|
||||
<div class="form-group has-validation">
|
||||
<label for="registrar_username">Registrar Username</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fas fa-fw fa-user"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control @error('domain.registrar_username') is-invalid @enderror" id="registrar_username" name="domain[registrar_username]" value="{{ old('domain.registrar_username',$o->registrar_username) }}">
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('domain.registrar_username')
|
||||
{{ $message }}
|
||||
@else
|
||||
Registrar Username is required.
|
||||
@enderror
|
||||
</span>
|
||||
</div>
|
||||
<span class="input-helper">Registrar Username ID.</span>
|
||||
</div>
|
||||
<div class="col-12 col-sm-9 col-md-12 col-xl-6">
|
||||
@include('adminlte::widget.form_text',[
|
||||
'label'=>'Registrar Username',
|
||||
'icon'=>'fas fa-user',
|
||||
'id'=>'registrar_username',
|
||||
'old'=>'domain.registrar_username',
|
||||
'name'=>'domain[registrar_username]',
|
||||
'value'=>$o->registrar_username ?? '',
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -147,32 +99,11 @@
|
||||
@css(select2)
|
||||
@js(select2,autofocus)
|
||||
|
||||
<style>
|
||||
.select2-selection.select2-selection--single {
|
||||
height: calc(2.25rem + 2px) !important;
|
||||
}
|
||||
.select2.select2-container.select2-container--default {
|
||||
display: flex;
|
||||
flex: 1 1 auto;
|
||||
}
|
||||
.select2.select2-container.select2-container--default .selection {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
// @todo This is taking up too much width
|
||||
//$('#domain_tld_id').select2();
|
||||
|
||||
$('#domain_registrar_id').select2({
|
||||
dropdownAutoWidth: true,
|
||||
});
|
||||
|
||||
$('#registrar_ns').select2({
|
||||
$('#tld_id').select2({
|
||||
dropdownAutoWidth: true,
|
||||
width: 'style',
|
||||
tags: true,
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
@ -1,115 +1,85 @@
|
||||
<!-- o = App\Models\Service\Host::class -->
|
||||
<div class="row">
|
||||
<!-- DOMAIN NAME -->
|
||||
<div class="col-6">
|
||||
<div class="form-group has-validation">
|
||||
<div class="col-12 col-sm-9 col-md-12 col-xl-7">
|
||||
<div class="form-group">
|
||||
<label for="domain_name">Domain Name</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fas fa-fw fa-globe-asia"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control col-9 text-right @error('host.domain_name') is-invalid @enderror" id="domain_name" name="host[domain_name]" placeholder="Domain Name..." value="{{ old('host.domain_name',$o->domain_name) }}" required>
|
||||
<input type="text" style="width:55%;" class="form-control text-right @error('domain_name') is-invalid @enderror" id="domain_name" name="domain[domain_name]" placeholder="Domain Name..." value="{{ old('host.domain_name',$o->domain_name) }}" required>
|
||||
|
||||
<div class="input-group-append">
|
||||
<span class="input-group-text">.</span>
|
||||
</div>
|
||||
<select class="form-control" id="domain_tld_id" name="host[domain_tld_id]">
|
||||
@foreach(\App\Models\DomainTld::active()->orderBy('name')->get() as $oo)
|
||||
<option value="{{ $oo->id }}" @if($oo->id == old('domain.domain_tld_id',$o->domain_tld_id))selected @endif>{{ $oo->name }}</option>
|
||||
|
||||
<select style="width:25%;" class="form-control @error('tld_id') is-invalid @enderror" id="tld_id" name="host[tld_id]">
|
||||
@foreach(\App\Models\TLD::orderBy('name')->get() as $oo)
|
||||
<option value="{{ $oo->id }}" @if($oo->id == old('host.tld_id',$o->tld_id))selected @endif>{{ $oo->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('host.domain_name')
|
||||
{{ $message }}
|
||||
@else
|
||||
Domain Name is required.
|
||||
@enderror
|
||||
</span>
|
||||
</div>
|
||||
<span class="input-helper">Domain Name</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- EXPIRY -->
|
||||
<div class="col-3">
|
||||
<div class="form-group has-validation">
|
||||
<label for="host_expire">Expiry</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fas fa-fw fa-calendar"></i></span>
|
||||
</div>
|
||||
<input type="date" class="form-control @error('host.host_expire') is-invalid @enderror" id="host_expire" name="host[host_expire]" value="{{ old('host.host_expire',($o->host_expire ? $o->host_expire->format('Y-m-d') : NULL)) }}">
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('host.host_expire')
|
||||
@error('domain_name')
|
||||
{{ $message }}
|
||||
@enderror
|
||||
@error('tld_id')
|
||||
{{ $message }}
|
||||
@enderror
|
||||
</span>
|
||||
</div>
|
||||
<span class="input-helper">Hosting Expires</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-sm-9 col-md-6 col-xl-5">
|
||||
@include('adminlte::widget.form_date',[
|
||||
'label'=>'Expiry',
|
||||
'id'=>'expire_at',
|
||||
'old'=>'host.expire_at',
|
||||
'name'=>'host[expire_at]',
|
||||
'value'=>$o->expire_at ? $o->expire_at->format('Y-m-d') : ($o->connect_at ? $o->connect_at->addMonths($o->contract_term)->format('Y-m-d') : ''),
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<p class="h6">Hosting Details</p>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12 col-sm-9 col-md-6 col-xl-5">
|
||||
@include('adminlte::widget.form_select',[
|
||||
'label'=>'Hosting Server',
|
||||
'icon'=>'fas fa-handshake',
|
||||
'id'=>'supplier_host_server_id',
|
||||
'old'=>'host.supplier_host_server_id',
|
||||
'name'=>'host[supplier_host_server_id]',
|
||||
'options'=>\App\Models\SupplierHostServer::active()->orderBy('name')->get()->transform(function($item) { return ['id'=>$item->id,'value'=>$item->name]; }),
|
||||
'value'=>$o->supplier_host_server_id ?? '',
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
{{--
|
||||
<!-- ADMIN URL -->
|
||||
<div class="col-9">
|
||||
<div class="form-group has-validation">
|
||||
<label for="admin_url">Hosting Admin URL</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fab fa-fw fa-safari"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control @error('host.admin_url') is-invalid @enderror" id="admin_url" name="host[admin_url]" placeholder="Admin URL..." value="{{ old('host.admin_url',$o->admin_url) }}">
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('host.admin_url')
|
||||
{{ $message }}
|
||||
@enderror
|
||||
</span>
|
||||
</div>
|
||||
<span class="input-helper">Admin URL</span>
|
||||
</div>
|
||||
</div>
|
||||
--}}
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<!-- ADMIN USER -->
|
||||
<div class="col-6">
|
||||
<div class="form-group has-validation">
|
||||
<label for="host_username">Admin User</label>
|
||||
<div class="input-group flex-nowrap">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fas fa-fw fa-user"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control @error('host.host_username') is-invalid @enderror" id="host_username" name="host[host_username]" placeholder="Admin USER" value="{{ old('host.host_username',$o->host_username) }}">
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('host.host_username')
|
||||
{{ $message }}
|
||||
@enderror
|
||||
</span>
|
||||
</div>
|
||||
<span class="input-helper">Admin USER</span>
|
||||
</div>
|
||||
<div class="col-12 col-sm-9 col-md-12 col-xl-7">
|
||||
@include('adminlte::widget.form_text',[
|
||||
'label'=>'Admin User',
|
||||
'icon'=>'fas fa-user',
|
||||
'id'=>'host_username',
|
||||
'old'=>'host.host_username',
|
||||
'name'=>'host[host_username]',
|
||||
'value'=>$o->host_username ?? '',
|
||||
])
|
||||
</div>
|
||||
|
||||
<!-- ADMIN PASS -->
|
||||
<div class="col-6">
|
||||
<div class="form-group has-validation">
|
||||
<label for="host_password">Admin Pass</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fas fa-fw fa-lock"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control @error('host.host_password') is-invalid @enderror" id="host_password" name="host[host_password]" value="{{ old('host.host_password',$o->host_password) }}">
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('host.host_password')
|
||||
{{ $message }}
|
||||
@enderror
|
||||
</span>
|
||||
</div>
|
||||
<span class="input-helper">Admin PASSWORD</span>
|
||||
</div>
|
||||
<div class="col-12 col-sm-9 col-md-5 col-xl-5">
|
||||
@include('adminlte::widget.form_text',[
|
||||
'label'=>'Admin Password',
|
||||
'icon'=>'fas fa-lock',
|
||||
'id'=>'host_password',
|
||||
'old'=>'host.host_password',
|
||||
'name'=>'host[host_password]',
|
||||
'value'=>$o->host_password ?? '',
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -117,23 +87,12 @@
|
||||
@css(select2)
|
||||
@js(select2,autofocus)
|
||||
|
||||
<style>
|
||||
.select2-selection.select2-selection--single {
|
||||
height: calc(2.25rem + 2px) !important;
|
||||
}
|
||||
.select2.select2-container.select2-container--default {
|
||||
display: flex;
|
||||
flex: 1 1 auto;
|
||||
}
|
||||
.select2.select2-container.select2-container--default .selection {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
// @todo This is taking up too much width
|
||||
//$('#domain_tld_id').select2();
|
||||
$('#tld_id').select2({
|
||||
dropdownAutoWidth: true,
|
||||
width: 'style',
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@append
|
Loading…
Reference in New Issue
Block a user