Rework DomainController/UserController methods and paths, no functional changes
This commit is contained in:
parent
27985dbf0b
commit
b25e6f432c
@ -3,7 +3,6 @@
|
|||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
use Illuminate\Http\Request;
|
|
||||||
|
|
||||||
use App\Http\Requests\DomainRequest;
|
use App\Http\Requests\DomainRequest;
|
||||||
use App\Models\{Address,Domain,Zone};
|
use App\Models\{Address,Domain,Zone};
|
||||||
@ -95,9 +94,4 @@ class DomainController extends Controller
|
|||||||
return ['id'=>$item->region_id,'value'=>sprintf('%s %s',$item->ftn_3d,$item->system->location)];
|
return ['id'=>$item->region_id,'value'=>sprintf('%s %s',$item->ftn_3d,$item->system->location)];
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public function home()
|
|
||||||
{
|
|
||||||
return view('domain.home');
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -45,11 +45,6 @@ class UserController extends Controller
|
|||||||
->with('user',$user);
|
->with('user',$user);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function home()
|
|
||||||
{
|
|
||||||
return view('user.home');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function link(Request $request)
|
public function link(Request $request)
|
||||||
{
|
{
|
||||||
if ($request->post()) {
|
if ($request->post()) {
|
||||||
|
@ -141,7 +141,7 @@
|
|||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<a href="{{ url('ftn/domain') }}" class="btn btn-danger">Cancel</a>
|
<a href="{{ url('domain') }}" class="btn btn-danger">Cancel</a>
|
||||||
@can('admin',$o)
|
@can('admin',$o)
|
||||||
<button type="submit" name="submit" class="btn btn-success float-end">@if ($o->exists)Save @else Add @endif</button>
|
<button type="submit" name="submit" class="btn btn-success float-end">@if ($o->exists)Save @else Add @endif</button>
|
||||||
@endcan
|
@endcan
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
<p>In FTN network addresses, a domain is the 5th dimension and used when a system supports 5D addressing, ie: zone:net/node.point@<strong class="highlight">domain</strong>.</p>
|
<p>In FTN network addresses, a domain is the 5th dimension and used when a system supports 5D addressing, ie: zone:net/node.point@<strong class="highlight">domain</strong>.</p>
|
||||||
<p>Domains are used with zones to uniquely identify a FTN network.</p>
|
<p>Domains are used with zones to uniquely identify a FTN network.</p>
|
||||||
<p><small>Some legacy Fidonet software is not 5D aware and may behave unexpectedly when a domain is used</small></p>
|
<p><small>Some legacy Fidonet software is not 5D aware and may behave unexpectedly when a domain is used</small></p>
|
||||||
<p>This system is aware of the following domains @can('admin',(new \App\Models\Domain))(you can <a href="{{ url('ftn/domain/addedit') }}">add</a> more)@endcan:</p>
|
<p>This system is aware of the following domains @can('admin',(new \App\Models\Domain))(you can <a href="{{ url('domain/addedit') }}">add</a> more)@endcan:</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -18,7 +18,7 @@
|
|||||||
<div class="col-9">
|
<div class="col-9">
|
||||||
@if (\App\Models\Domain::count() === 0)
|
@if (\App\Models\Domain::count() === 0)
|
||||||
@can('admin',(new \App\Models\Domain))
|
@can('admin',(new \App\Models\Domain))
|
||||||
<p>There are no domains setup, to <a href="{{ url('ftn/domain/addedit') }}">set up your first</a>.</p>
|
<p>There are no domains setup, to <a href="{{ url('domain/addedit') }}">set up your first</a>.</p>
|
||||||
@else
|
@else
|
||||||
<p class="pad">There are no domains - you need to ask an admin to create one for you.</p>
|
<p class="pad">There are no domains - you need to ask an admin to create one for you.</p>
|
||||||
@endcan
|
@endcan
|
||||||
@ -37,7 +37,7 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
@foreach (\App\Models\Domain::orderBy('name')->with(['zones'])->get() as $oo)
|
@foreach (\App\Models\Domain::orderBy('name')->with(['zones'])->get() as $oo)
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="{{ url('ftn/domain/addedit',[$oo->id]) }}">{{ $oo->id }}</a></td>
|
<td><a href="{{ url('domain/addedit',[$oo->id]) }}">{{ $oo->id }}</a></td>
|
||||||
<td>{{ $oo->name }}</td>
|
<td>{{ $oo->name }}</td>
|
||||||
<td>{{ $oo->active ? 'YES' : 'NO' }}</td>
|
<td>{{ $oo->active ? 'YES' : 'NO' }}</td>
|
||||||
<td>{{ $oo->dnsdomain }}</td>
|
<td>{{ $oo->dnsdomain }}</td>
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
A domain is required.
|
A domain is required.
|
||||||
@enderror
|
@enderror
|
||||||
</span>
|
</span>
|
||||||
<span class="input-helper">Add a <a href="{{ url('ftn/domain/addedit') }}">NEW Domain</a></span>
|
<span class="input-helper">Add a <a href="{{ url('domain/addedit') }}">NEW Domain</a></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
A domain is required.
|
A domain is required.
|
||||||
@enderror
|
@enderror
|
||||||
</span>
|
</span>
|
||||||
<span class="input-helper">Add a <a href="{{ url('ftn/domain/addedit') }}">NEW Domain</a></span>
|
<span class="input-helper">Add a <a href="{{ url('domain/addedit') }}">NEW Domain</a></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
@if ($user->isZC())
|
@if ($user->isZC())
|
||||||
<dl>
|
<dl>
|
||||||
<dt>Network Admin</dt>
|
<dt>Network Admin</dt>
|
||||||
<dd><a href="{{ url('ftn/domain') }}">Domains</a></dd>
|
<dd><a href="{{ url('domain') }}">Domains</a></dd>
|
||||||
<dd><a href="{{ url('system') }}">Systems</a></dd>
|
<dd><a href="{{ url('system') }}">Systems</a></dd>
|
||||||
<dd><a href="{{ url('zone') }}">Zones</a></dd>
|
<dd><a href="{{ url('zone') }}">Zones</a></dd>
|
||||||
<dd><a href="{{ url('ftn/echoarea') }}">Echoareas</a></dd>
|
<dd><a href="{{ url('ftn/echoarea') }}">Echoareas</a></dd>
|
||||||
|
@ -275,7 +275,7 @@ use App\Classes\Protocol\{Binkp,EMSI,DNS};
|
|||||||
|
|
||||||
<div class="row pt-5">
|
<div class="row pt-5">
|
||||||
<div class="col-2">
|
<div class="col-2">
|
||||||
<a href="{{ url('ftn/domain') }}" class="btn btn-danger">Cancel</a>
|
<a href="{{ url('domain') }}" class="btn btn-danger">Cancel</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<span class="col-6 mt-auto mx-auto text-center align-bottom">
|
<span class="col-6 mt-auto mx-auto text-center align-bottom">
|
||||||
|
@ -249,7 +249,7 @@
|
|||||||
if (! $('#node-address').hasClass('d-none'))
|
if (! $('#node-address').hasClass('d-none'))
|
||||||
$('#node-address').addClass('d-none');
|
$('#node-address').addClass('d-none');
|
||||||
|
|
||||||
$.get('{{ url('regions') }}'+'/'+this.value,function(data) {
|
$.get('{{ url('domain/api/regions') }}'+'/'+this.value,function(data) {
|
||||||
$('#region_id').append('<option value=""></option>');
|
$('#region_id').append('<option value=""></option>');
|
||||||
$('#region_id').append('<option value="0">No Region</option>');
|
$('#region_id').append('<option value="0">No Region</option>');
|
||||||
$('#region_id').append('<option value="new">New Region</option>');
|
$('#region_id').append('<option value="new">New Region</option>');
|
||||||
@ -339,7 +339,7 @@
|
|||||||
$('#host_id').children().remove();
|
$('#host_id').children().remove();
|
||||||
var that = this;
|
var that = this;
|
||||||
|
|
||||||
$.get('{{ url('hosts') }}'+'/'+$('#zone_id').val()+'/'+this.value,function(data) {
|
$.get('{{ url('domain/api/hosts') }}'+'/'+$('#zone_id').val()+'/'+this.value,function(data) {
|
||||||
$('#host_id').append('<option value=""></option>');
|
$('#host_id').append('<option value=""></option>');
|
||||||
if (that.value !== '0')
|
if (that.value !== '0')
|
||||||
$('#host_id').append('<option value="0">No Host</option>');
|
$('#host_id').append('<option value="0">No Host</option>');
|
||||||
@ -411,7 +411,7 @@
|
|||||||
$('#hub_id').prop('disabled',true);
|
$('#hub_id').prop('disabled',true);
|
||||||
$('#hub_id').children().remove();
|
$('#hub_id').children().remove();
|
||||||
|
|
||||||
$.get('{{ url('hubs') }}'+'/'+$('#zone_id').val()+'/'+this.value,function(data) {
|
$.get('{{ url('domain/api/hubs') }}'+'/'+$('#zone_id').val()+'/'+this.value,function(data) {
|
||||||
$('#hub_id').append('<option value="">No Hub</option>');
|
$('#hub_id').append('<option value="">No Hub</option>');
|
||||||
|
|
||||||
data.forEach(function(item) {
|
data.forEach(function(item) {
|
||||||
|
@ -87,7 +87,7 @@ Move Address
|
|||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-2">
|
<div class="col-2">
|
||||||
<a href="{{ url('ftn/domain') }}" class="btn btn-danger">Cancel</a>
|
<a href="{{ url('domain') }}" class="btn btn-danger">Cancel</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<span class="col-6 mt-auto mx-auto text-center align-bottom">
|
<span class="col-6 mt-auto mx-auto text-center align-bottom">
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
A domain is required.
|
A domain is required.
|
||||||
@enderror
|
@enderror
|
||||||
</span>
|
</span>
|
||||||
<span class="input-helper">Add a <a href="{{ url('ftn/domain/addedit') }}">NEW Domain</a></span>
|
<span class="input-helper">Add a <a href="{{ url('domain/addedit') }}">NEW Domain</a></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -53,10 +53,18 @@ Route::get('search',[HomeController::class,'search']);
|
|||||||
Route::middleware(['auth','verified','activeuser'])->group(function () {
|
Route::middleware(['auth','verified','activeuser'])->group(function () {
|
||||||
Route::get('dashboard',[UserController::class,'dashboard']);
|
Route::get('dashboard',[UserController::class,'dashboard']);
|
||||||
|
|
||||||
|
/* DOMAIN PATHS */
|
||||||
Route::get('ftn/domain',[DomainController::class,'home']);
|
Route::view('domain','domain.home');
|
||||||
Route::match(['get','post'],'ftn/domain/addedit/{o?}',[DomainController::class,'add_edit'])
|
Route::get('domain/api/hosts/{o}/{region}',[DomainController::class,'api_hosts'])
|
||||||
|
->where('o','[0-9]+')
|
||||||
|
->where('region','[0-9]+');
|
||||||
|
Route::get('domain/api/hubs/{o}/{host}',[DomainController::class,'api_hubs'])
|
||||||
->where('o','[0-9]+');
|
->where('o','[0-9]+');
|
||||||
|
Route::get('domain/api/regions/{o}',[DomainController::class,'api_regions'])
|
||||||
|
->where('o','[0-9]+');
|
||||||
|
Route::match(['get','post'],'domain/addedit/{o?}',[DomainController::class,'add_edit'])
|
||||||
|
->where('o','[0-9]+');
|
||||||
|
|
||||||
Route::get('ftn/echoarea',[EchoareaController::class,'home']);
|
Route::get('ftn/echoarea',[EchoareaController::class,'home']);
|
||||||
Route::match(['get','post'],'ftn/echoarea/addedit/{o?}',[EchoareaController::class,'add_edit'])
|
Route::match(['get','post'],'ftn/echoarea/addedit/{o?}',[EchoareaController::class,'add_edit'])
|
||||||
->where('o','[0-9]+');
|
->where('o','[0-9]+');
|
||||||
@ -108,18 +116,11 @@ Route::middleware(['auth','verified','activeuser'])->group(function () {
|
|||||||
->where('o','[0-9]+')
|
->where('o','[0-9]+')
|
||||||
->where('date','[0-9:\-@]+');
|
->where('date','[0-9:\-@]+');
|
||||||
|
|
||||||
Route::get('hosts/{o}/{region}',[DomainController::class,'api_hosts'])
|
|
||||||
->where('o','[0-9]+')
|
|
||||||
->where('region','[0-9]+');
|
|
||||||
Route::get('hubs/{o}/{host}',[DomainController::class,'api_hubs'])
|
|
||||||
->where('o','[0-9]+');
|
|
||||||
Route::match(['get','post'],'link',[UserController::class,'link']);
|
Route::match(['get','post'],'link',[UserController::class,'link']);
|
||||||
Route::post('packet/contents/{o}/{packet}',[HomeController::class,'packet_contents'])
|
Route::post('packet/contents/{o}/{packet}',[HomeController::class,'packet_contents'])
|
||||||
->where('o','[0-9]+')
|
->where('o','[0-9]+')
|
||||||
->where('packet','[0-9a-z]+');
|
->where('packet','[0-9a-z]+');
|
||||||
Route::get('permissions',[HomeController::class,'permissions']);
|
Route::get('permissions',[HomeController::class,'permissions']);
|
||||||
Route::get('regions/{o}',[DomainController::class,'api_regions'])
|
|
||||||
->where('o','[0-9]+');
|
|
||||||
|
|
||||||
Route::match(['get','post'],'user/system/register',[SystemController::class,'register']);
|
Route::match(['get','post'],'user/system/register',[SystemController::class,'register']);
|
||||||
Route::match(['post'],'user/system/link',[SystemController::class,'system_link']);
|
Route::match(['post'],'user/system/link',[SystemController::class,'system_link']);
|
||||||
@ -136,8 +137,8 @@ Route::middleware(['auth','can:admin'])->group(function () {
|
|||||||
Route::match(['get','post'],'address/merge/{id}',[SystemController::class,'address_merge']);
|
Route::match(['get','post'],'address/merge/{id}',[SystemController::class,'address_merge']);
|
||||||
Route::get('echomail/view/{o}',[EchomailController::class,'view']);
|
Route::get('echomail/view/{o}',[EchomailController::class,'view']);
|
||||||
Route::get('netmail/view/{o}',[NetmailController::class,'view']);
|
Route::get('netmail/view/{o}',[NetmailController::class,'view']);
|
||||||
Route::get('user/list',[UserController::class,'home']);
|
|
||||||
Route::match(['get','post'],'setup',[HomeController::class,'setup']);
|
Route::match(['get','post'],'setup',[HomeController::class,'setup']);
|
||||||
Route::match(['get','post'],'user/addedit/{o?}',[UserController::class,'add_edit'])
|
Route::match(['get','post'],'user/addedit/{o?}',[UserController::class,'add_edit'])
|
||||||
->where('o','[0-9]+');
|
->where('o','[0-9]+');
|
||||||
|
Route::view('user/list','user.home');
|
||||||
});
|
});
|
@ -21,7 +21,7 @@ class SiteAdminTest extends TestCase
|
|||||||
$this->get('about')
|
$this->get('about')
|
||||||
->assertOk();
|
->assertOk();
|
||||||
|
|
||||||
$this->get('ftn/domain')
|
$this->get('domain')
|
||||||
->assertRedirect('login');
|
->assertRedirect('login');
|
||||||
$this->get('zone')
|
$this->get('zone')
|
||||||
->assertRedirect('login');
|
->assertRedirect('login');
|
||||||
@ -52,7 +52,7 @@ class SiteAdminTest extends TestCase
|
|||||||
// Use model in tests...
|
// Use model in tests...
|
||||||
$this->actingAs($user);
|
$this->actingAs($user);
|
||||||
|
|
||||||
$this->get('ftn/domain')
|
$this->get('domain')
|
||||||
->assertRedirect('email/verify');
|
->assertRedirect('email/verify');
|
||||||
$this->get('zone')
|
$this->get('zone')
|
||||||
->assertRedirect('email/verify');
|
->assertRedirect('email/verify');
|
||||||
|
Loading…
Reference in New Issue
Block a user