Web frontend work
This commit is contained in:
39
app/Http/Controllers/DomainController.php
Normal file
39
app/Http/Controllers/DomainController.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use App\Models\Domain;
|
||||
|
||||
class DomainController extends Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
}
|
||||
|
||||
/**
|
||||
* Add or edit a node
|
||||
*/
|
||||
public function add_edit(Request $request,Domain $o)
|
||||
{
|
||||
if ($request->post()) {
|
||||
foreach (['name','dnsdomain','active','notes'] as $key)
|
||||
$o->{$key} = $request->post($key);
|
||||
|
||||
$o->active = TRUE;
|
||||
$o->save();
|
||||
|
||||
return redirect()->action([self::class,'home']);
|
||||
}
|
||||
|
||||
return view('domain.addedit')
|
||||
->with('o',$o);
|
||||
}
|
||||
|
||||
public function home()
|
||||
{
|
||||
return view('domain.home');
|
||||
}
|
||||
}
|
46
app/Http/Controllers/NodeController.php
Normal file
46
app/Http/Controllers/NodeController.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use App\Models\Node;
|
||||
|
||||
class NodeController extends Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
}
|
||||
|
||||
/**
|
||||
* Add or edit a node
|
||||
*/
|
||||
public function add_edit(Request $request,Node $o)
|
||||
{
|
||||
if ($request->post()) {
|
||||
foreach ([
|
||||
'zone_id','host_id','node_id','point_id',
|
||||
'system','sysop','location','email',
|
||||
'address','port','notes','software_id','protocol_id',
|
||||
'sespass','pktpass','ticpass','fixpass'
|
||||
] as $key)
|
||||
$o->{$key} = $request->post($key);
|
||||
|
||||
foreach(['is_zc','is_rc','is_hub','is_host','active'] as $key)
|
||||
$o->{$key} = $request->post($key,FALSE);
|
||||
|
||||
$o->save();
|
||||
|
||||
return redirect()->action([self::class,'home']);
|
||||
}
|
||||
|
||||
return view('node.addedit')
|
||||
->with('o',$o);
|
||||
}
|
||||
|
||||
public function home()
|
||||
{
|
||||
return view('node.home');
|
||||
}
|
||||
}
|
39
app/Http/Controllers/ZoneController.php
Normal file
39
app/Http/Controllers/ZoneController.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use App\Models\Zone;
|
||||
|
||||
class ZoneController extends Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
}
|
||||
|
||||
/**
|
||||
* Add or edit a node
|
||||
*/
|
||||
public function add_edit(Request $request,Zone $o)
|
||||
{
|
||||
if ($request->post()) {
|
||||
foreach (['zone_id','name','active','description','notes','domain_id'] as $key)
|
||||
$o->{$key} = $request->post($key);
|
||||
|
||||
$o->active = TRUE;
|
||||
$o->save();
|
||||
|
||||
return redirect()->action([self::class,'home']);
|
||||
}
|
||||
|
||||
return view('zone.addedit')
|
||||
->with('o',$o);
|
||||
}
|
||||
|
||||
public function home()
|
||||
{
|
||||
return view('zone.home');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user