Change public to show on echo/file areas to enable limiting whats shown in the activity graph

This commit is contained in:
Deon George 2023-07-28 13:22:39 +10:00
parent ddb8c349b6
commit f1ccca25ea
9 changed files with 20 additions and 18 deletions

View File

@ -272,7 +272,7 @@ class Tic extends FTNBase
if (! $this->area->exists) { if (! $this->area->exists) {
$this->area->description = $areadesc; $this->area->description = $areadesc;
$this->area->active = TRUE; $this->area->active = TRUE;
$this->area->public = FALSE; $this->area->show = FALSE;
$this->area->notes = 'Autocreated'; $this->area->notes = 'Autocreated';
$this->area->domain_id = $this->from->zone->domain_id; $this->area->domain_id = $this->from->zone->domain_id;
$this->area->save(); $this->area->save();

View File

@ -21,10 +21,10 @@ class EchoareaController extends Controller
'name' => 'required|min:4|max:35|regex:/^[a-zA-Z-_~]{4,}$/|unique:echoareas,name,'.($o->exists ? $o->id : 0), 'name' => 'required|min:4|max:35|regex:/^[a-zA-Z-_~]{4,}$/|unique:echoareas,name,'.($o->exists ? $o->id : 0),
'description' => 'required', 'description' => 'required',
'active' => 'required|boolean', 'active' => 'required|boolean',
'public' => 'required|boolean', 'show' => 'required|boolean',
]); ]);
foreach (['name','description','active','public','notes','domain_id'] as $key) foreach (['name','description','active','show','notes','domain_id'] as $key)
$o->{$key} = $request->post($key); $o->{$key} = $request->post($key);
$o->save(); $o->save();

View File

@ -20,11 +20,11 @@ class FileareaController extends Controller
'name' => 'required|min:4|max:35|regex:/^[a-zA-Z-_~]{4,}$/|unique:fileareas,name,'.($o->exists ? $o->id : 0), 'name' => 'required|min:4|max:35|regex:/^[a-zA-Z-_~]{4,}$/|unique:fileareas,name,'.($o->exists ? $o->id : 0),
'description' => 'required', 'description' => 'required',
'active' => 'required|boolean', 'active' => 'required|boolean',
'public' => 'required|boolean', 'show' => 'required|boolean',
'nodelist' => 'nullable|string|max:12' 'nodelist' => 'nullable|string|max:12'
]); ]);
foreach (['name','description','active','public','notes','domain_id'] as $key) foreach (['name','description','active','show','notes','domain_id'] as $key)
$o->{$key} = $request->post($key); $o->{$key} = $request->post($key);
$o->save(); $o->save();

View File

@ -84,7 +84,7 @@ class EchoareaImport implements ShouldQueue
$o->name = $area; $o->name = $area;
$o->description = ($this->prefix ?: '').$description; $o->description = ($this->prefix ?: '').$description;
$o->active = TRUE; $o->active = TRUE;
$o->public = TRUE; $o->show = TRUE;
$this->do->echoareas()->save($o); $this->do->echoareas()->save($o);
} }

View File

@ -102,6 +102,7 @@ class Domain extends Model
]; ];
})->values(), })->values(),
'dashStyle' => 'ShortDot', 'dashStyle' => 'ShortDot',
'visible'=>(bool)$item->first()->echoarea->show,
]; ];
})->values(); })->values();

View File

@ -77,7 +77,7 @@ class InitialSetupSeeder extends Seeder
'name'=>'-BAD_AREA', 'name'=>'-BAD_AREA',
'description'=>'Inbound invalid echomail', 'description'=>'Inbound invalid echomail',
'active'=>TRUE, 'active'=>TRUE,
'public'=>TRUE, 'show'=>TRUE,
'domain_id'=>$do->id, 'domain_id'=>$do->id,
]); ]);
@ -85,7 +85,7 @@ class InitialSetupSeeder extends Seeder
'name'=>'-BAD_AREA', 'name'=>'-BAD_AREA',
'description'=>'Inbound invalid files', 'description'=>'Inbound invalid files',
'active'=>TRUE, 'active'=>TRUE,
'public'=>TRUE, 'show'=>TRUE,
'domain_id'=>$do->id, 'domain_id'=>$do->id,
]); ]);
} }

View File

@ -1,3 +1,4 @@
<!-- $o = Domain::class -->
@extends('layouts.app') @extends('layouts.app')
@section('htmlheader_title') @section('htmlheader_title')
{{ $o->name }} {{ $o->name }}

View File

@ -64,14 +64,14 @@
</div> </div>
<div class="col-2"> <div class="col-2">
<label for="public" class="form-label">Public</label> <label for="show" class="form-label">Show <i class="bi bi-info-circle" title="Show this area in the activity reports"></i></label>
<div class="input-group"> <div class="input-group">
<div class="btn-group" role="group"> <div class="btn-group" role="group">
<input type="radio" class="btn-check" name="public" id="public_yes" value="1" required @cannot('admin',$o)disabled @endcannot @if(old('public',$o->public ?? TRUE))checked @endif> <input type="radio" class="btn-check" name="show" id="show_yes" value="1" required @cannot('admin',$o)disabled @endcannot @if(old('show',$o->show ?? TRUE))checked @endif>
<label class="btn btn-outline-success" for="public_yes">Yes</label> <label class="btn btn-outline-success" for="show_yes">Yes</label>
<input type="radio" class="btn-check btn-danger" name="public" id="public_no" value="0" required @cannot('admin',$o)disabled @endcannot @if(! old('public',$o->public ?? TRUE))checked @endif> <input type="radio" class="btn-check btn-danger" name="show" id="show_no" value="0" required @cannot('admin',$o)disabled @endcannot @if(! old('show',$o->show ?? TRUE))checked @endif>
<label class="btn btn-outline-danger" for="public_no">No</label> <label class="btn btn-outline-danger" for="show_no">No</label>
</div> </div>
</div> </div>
</div> </div>

View File

@ -65,14 +65,14 @@
</div> </div>
<div class="col-2"> <div class="col-2">
<label for="public" class="form-label">Public</label> <label for="show" class="form-label">Show <i class="bi bi-info-circle" title="Show this area in the activity reports"></i></label>
<div class="input-group"> <div class="input-group">
<div class="btn-group" role="group"> <div class="btn-group" role="group">
<input type="radio" class="btn-check" name="public" id="public_yes" value="1" required @cannot('admin',$o)disabled @endcannot @if(old('public',$o->public ?? TRUE))checked @endif> <input type="radio" class="btn-check" name="show" id="show_yes" value="1" required @cannot('admin',$o)disabled @endcannot @if(old('show',$o->show ?? TRUE))checked @endif>
<label class="btn btn-outline-success" for="public_yes">Yes</label> <label class="btn btn-outline-success" for="show_yes">Yes</label>
<input type="radio" class="btn-check btn-danger" name="public" id="public_no" value="0" required @cannot('admin',$o)disabled @endcannot @if(! old('public',$o->public ?? TRUE))checked @endif> <input type="radio" class="btn-check btn-danger" name="show" id="show_no" value="0" required @cannot('admin',$o)disabled @endcannot @if(! old('show',$o->show ?? TRUE))checked @endif>
<label class="btn btn-outline-danger" for="public_no">No</label> <label class="btn btn-outline-danger" for="show_no">No</label>
</div> </div>
</div> </div>
</div> </div>