Change address promot/demote to only apply to normal nodes and hubs
This commit is contained in:
parent
e7336a942b
commit
70f3a049f6
@ -173,7 +173,9 @@ class SystemController extends Controller
|
||||
|
||||
// Make sure that no other system has this address active.
|
||||
if ($o->role_id === Address::NODE_NN)
|
||||
return redirect()->back()->withErrors(['address'=>sprintf('%s cannot be demoted any more',$o->ftn3D)]);
|
||||
return redirect()
|
||||
->back()
|
||||
->withErrors(['address'=>sprintf('%s cannot be demoted any more',$o->ftn3D)]);
|
||||
|
||||
$off = $o->role_id;
|
||||
$o->role &= ~$off;
|
||||
@ -181,7 +183,8 @@ class SystemController extends Controller
|
||||
|
||||
$o->save();
|
||||
|
||||
return redirect()->to(sprintf('system/addedit/%d',$o->system_id));
|
||||
return redirect()
|
||||
->to(sprintf('system/addedit/%d',$o->system_id));
|
||||
}
|
||||
|
||||
public function address_merge(AddressMerge $request,int $id)
|
||||
@ -351,8 +354,10 @@ class SystemController extends Controller
|
||||
session()->flash('accordion','address');
|
||||
|
||||
// Make sure that no other system has this address active.
|
||||
if ($o->role_id === Address::NODE_NC)
|
||||
return redirect()->back()->withErrors(['address'=>sprintf('%s cannot be promoted any more',$o->ftn3D)]);
|
||||
if ($o->role_id === Address::NODE_HC)
|
||||
return redirect()
|
||||
->back()
|
||||
->withErrors(['address'=>sprintf('%s cannot be promoted any more',$o->ftn3D)]);
|
||||
|
||||
$off = $o->role_id;
|
||||
$o->role &= ~$off;
|
||||
@ -360,7 +365,8 @@ class SystemController extends Controller
|
||||
|
||||
$o->save();
|
||||
|
||||
return redirect()->to(sprintf('system/addedit/%d',$o->system_id));
|
||||
return redirect()
|
||||
->to(sprintf('system/addedit/%d',$o->system_id));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -142,10 +142,10 @@
|
||||
<a href="{{ url('system/address/sus',[$oo->id]) }}" title="@if($oo->active)Pause @else Activate @endif Address"><i class="bi @if($oo->active)bi-pause-circle @else bi-play-circle @endif"></i></a>
|
||||
<a href="{{ url('system/address/mov',[$o->id,$oo->id]) }}" title="Move Address to another System"><i class="bi bi-arrow-right-square"></i></a>
|
||||
<a href="{{ url('system/address/del',[$oo->id]) }}" title="Delete Address"><i class="bi bi-trash"></i></a>
|
||||
@if ((Address::NODE_HC|Address::NODE_NN) & $oo->role_id)
|
||||
@if ($oo->role_id === Address::NODE_NN)
|
||||
<a href="{{ url('system/address/pro',[$oo->id]) }}" title="Promote Address"><i class="bi bi-arrow-up-square"></i></a>
|
||||
@endif
|
||||
@if ((Address::NODE_NC|Address::NODE_HC) & $oo->role_id)
|
||||
@if ($oo->role_id === Address::NODE_HC)
|
||||
<a href="{{ url('system/address/dem',[$oo->id]) }}" title="Demote Address"><i class="bi bi-arrow-down-square"></i></a>
|
||||
@endif
|
||||
@endif
|
||||
|
Loading…
Reference in New Issue
Block a user