mirror of
https://github.com/snipe/snipe-it.git
synced 2024-09-22 08:47:35 -07:00
0a085af0a0
WIP: Wiring up more and more of the actions on the importer Files now upload okay, a little glitchy on the display-side though add to readmes so i dont forget
46 lines
934 B
PHP
46 lines
934 B
PHP
<?php
|
|
|
|
namespace App\Http\Livewire;
|
|
|
|
use Livewire\Component;
|
|
|
|
use App\Models\Import;
|
|
|
|
use Log;
|
|
|
|
class Importer extends Component
|
|
{
|
|
public $files;
|
|
public $processDetails;
|
|
public $forcerefresh;
|
|
|
|
protected $rules = [
|
|
'files.*.file_path' => 'required|string',
|
|
'files.*.created_at' => 'required|string',
|
|
'files.*.filesize' => 'required|integer'
|
|
];
|
|
|
|
public function mount()
|
|
{
|
|
//$this->files = Import::all(); // this *SHOULD* be how it works, but...it doesn't?
|
|
$this->forcerefresh = 0;
|
|
}
|
|
|
|
public function test()
|
|
{
|
|
Log::error("Test Button Clicked!!!!");
|
|
}
|
|
|
|
public function toggleEvent($id)
|
|
{
|
|
Log::error("toggled on: ".$id);
|
|
$this->processDetails = Import::find($id);
|
|
}
|
|
|
|
public function render()
|
|
{
|
|
$this->files = Import::all(); //HACK - slows down renders.
|
|
return view('livewire.importer');
|
|
}
|
|
}
|