Determine if an inbound file is a nodelist
This commit is contained in:
@@ -26,6 +26,7 @@ class FileareaController extends Controller
|
||||
'description' => 'required',
|
||||
'active' => 'required|boolean',
|
||||
'public' => 'required|boolean',
|
||||
'nodelist' => 'nullable|string|max:12'
|
||||
]);
|
||||
|
||||
foreach (['name','description','active','public','notes','domain_id'] as $key)
|
||||
@@ -33,6 +34,12 @@ class FileareaController extends Controller
|
||||
|
||||
$o->save();
|
||||
|
||||
if ($request->post('nodelist')) {
|
||||
$o->domain->nodelist_filename = $request->post('nodelist');
|
||||
$o->domain->nodelist_filearea_id = $o->id;
|
||||
$o->domain->save();
|
||||
}
|
||||
|
||||
return redirect()->action([self::class,'home']);
|
||||
}
|
||||
|
||||
|
@@ -41,5 +41,8 @@ class TicProcess implements ShouldQueue
|
||||
Log::info(sprintf('%s:Processed [%s] storing [%s] as id [%d]',self::LOGKEY,$this->file,$to->fo->file,$to->fo->id));
|
||||
|
||||
unlink($this->file);
|
||||
|
||||
if ($to->isNodelist())
|
||||
NodelistImport::dispatch($to->fo);
|
||||
}
|
||||
}
|
@@ -44,6 +44,11 @@ class Domain extends Model
|
||||
return $this->hasMany(Filearea::class);
|
||||
}
|
||||
|
||||
public function nodelist_filearea()
|
||||
{
|
||||
return $this->belongsTo(Filearea::class);
|
||||
}
|
||||
|
||||
public function zones()
|
||||
{
|
||||
return $this->hasMany(Zone::class);
|
||||
|
Reference in New Issue
Block a user