wip
This commit is contained in:
parent
607a221028
commit
cf5e2fea70
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
|
||||
use App\Models\ProjectDownload;
|
||||
use Illuminate\Broadcasting\Channel;
|
||||
use Illuminate\Broadcasting\PrivateChannel;
|
||||
use Illuminate\Contracts\Broadcasting\ShouldBroadcastNow;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
|
@ -26,8 +27,8 @@ public function __construct($projectDownload)
|
|||
* Get the channels the event should broadcast on.
|
||||
*
|
||||
*/
|
||||
public function broadcastOn(): array
|
||||
public function broadcastOn(): Channel
|
||||
{
|
||||
return [new PrivateChannel('download.'.$this->projectDownload->id)];
|
||||
return new PrivateChannel('download.'.$this->projectDownload->id);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,11 +44,13 @@ public function handle(): void
|
|||
];
|
||||
|
||||
$process = new Process($command);
|
||||
$process->setTimeout(3600);
|
||||
$process->setTimeout(600);
|
||||
$process->run();
|
||||
|
||||
if (!$process->isSuccessful()) {
|
||||
logger('error', [$process->getErrorOutput()]);
|
||||
$this->download->setStatusFailed();
|
||||
return;
|
||||
}
|
||||
logger($process->getOutput());
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ public function project(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
|||
protected static function booted(): void
|
||||
{
|
||||
parent::booted();
|
||||
static::updated(function (ProjectDownload $projectDownload) {
|
||||
self::updated(function (ProjectDownload $projectDownload) {
|
||||
event(new ProjectDownloadStatus($projectDownload));
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
<span class="inline-flex items-center rounded-md {{ $this->getColorClasses() }} px-1.5 py-0.5 text-xs font-medium"
|
||||
@if($this->type)
|
||||
x-init="Echo.private(`{{$this->type}}.@js($this->id)`).listen('Project{{ucfirst($this->type)}}Status', (e) => {
|
||||
x-init="Echo.private(`{{$this->type}}.{{$this->id}}`).listen('Project{{ucfirst($this->type)}}Status', (e) => {
|
||||
if(e.project{{ucfirst($this->type)}}.status){
|
||||
$wire.setStatus(e.project{{ucfirst($this->type)}}.status);
|
||||
$wire.refreshPendingMessage();
|
||||
}
|
||||
});"
|
||||
x-destroy="Echo.leaveChannel(`{{$this->type}}.@js($this->id)`);"
|
||||
x-destroy="Echo.leaveChannel(`{{$this->type}}.{{$this->id}}`);"
|
||||
@endif
|
||||
>
|
||||
{{ $status }}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,12 @@
|
|||
<div class="m-2">
|
||||
<div>
|
||||
<div class="px-4">
|
||||
<div class="sm:flex sm:flex-col">
|
||||
<div class="flex flex-col md:flex-row md:justify-between items-center w-full my-4">
|
||||
<div class="flex flex-col md:flex-row justify-between w-full my-4">
|
||||
<h1 class="text-base font-semibold leading-6 text-gray-900">Downloads</h1>
|
||||
<livewire:components.pending-message :project="$project" type="downloads"></livewire:components.pending-message>
|
||||
<livewire:components.pending-message :project="$project"
|
||||
type="downloads"></livewire:components.pending-message>
|
||||
</div>
|
||||
<div class="mt-4 sm:mt-0 flex flex-col sm:flex-row sm:justify-between gap-2">
|
||||
<div class="flex flex-col md:flex-row mt-4 items-center md:justify-between w-full gap-2">
|
||||
<x-search class="flex-1 w-full"></x-search>
|
||||
<x-button wire:click="openDownloadModal"
|
||||
class="rounded-md bg-indigo-600 px-3 py-2 justify-center text-center text-sm font-semibold text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600">
|
||||
|
|
@ -42,7 +44,9 @@ class="px-3 py-3.5 text-right pr-4 sm:pr-8 lg:pr-8 text-sm font-semibold text-gr
|
|||
</td>
|
||||
<td class="relative whitespace-nowrap py-4 pl-3 pr-4 text-right text-sm font-medium sm:pr-6 lg:pr-8"
|
||||
>
|
||||
<livewire:components.badge :status="$download->status" :id="$download->id" type="download" wire:key="{{$download->id}}"></livewire:components.badge>
|
||||
<livewire:components.badge :status="$download->status" :id="$download->id"
|
||||
type="download"
|
||||
wire:key="{{$download->id}}"></livewire:components.badge>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
|
@ -60,6 +64,7 @@ class="px-3 py-3.5 text-right pr-4 sm:pr-8 lg:pr-8 text-sm font-semibold text-gr
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<x-download-create-modal :manager="$this"/>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,17 +1,18 @@
|
|||
<div>
|
||||
<div class="px-4 sm:px-6 lg:px-8">
|
||||
<div class="px-4">
|
||||
<div class="sm:flex sm:flex-col sm:items-center">
|
||||
<div class="w-full flex justify-between my-4">
|
||||
<div class="flex flex-col md:flex-row justify-between w-full my-4">
|
||||
<h1 class="text-base font-semibold leading-6 text-gray-900">{{ __('Mailing') }}</h1>
|
||||
<livewire:components.pending-message :project="$project"
|
||||
type="mailings"></livewire:components.pending-message>
|
||||
</div>
|
||||
<div class="mt-4 sm:mt-0 sm:flex sm:justify-between w-full">
|
||||
<div class="flex flex-col md:flex-row mt-4 items-center md:justify-between w-full gap-2">
|
||||
<x-search></x-search>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-8">
|
||||
<div class="mt-8 flow-root overflow-x-scroll">
|
||||
<div class="">
|
||||
<div class="relative">
|
||||
<div class="inline-block min-w-full py-2 align-middle mb-10">
|
||||
<div class="">
|
||||
<table class="min-w-full divide-y divide-gray-300">
|
||||
|
|
@ -25,7 +26,9 @@ class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6 lg
|
|||
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6 lg:pl-8">@lang('Subject')</th>
|
||||
<th scope="col"
|
||||
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6 lg:pl-8">@lang('Status')</th>
|
||||
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">#</th>
|
||||
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">
|
||||
#
|
||||
</th>
|
||||
<th scope="col"
|
||||
class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">@lang('Attachment')
|
||||
</th>
|
||||
|
|
@ -34,21 +37,24 @@ class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">@lang('Attachm
|
|||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-200">
|
||||
<tbody class="divide-y divide-gray-200 bg-white">
|
||||
@foreach($mailings as $mail)
|
||||
<tr>
|
||||
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm font-medium text-gray-900 sm:pl-6 lg:pl-8">{{ $mail->id }}</td>
|
||||
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">{{ $mail->subject }}</td>
|
||||
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500 max-w-[300px] truncate ...">{{ $mail->subject }}</td>
|
||||
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">
|
||||
<livewire:components.badge :status="$mail->status" :id="$mail->id"
|
||||
type="mailing"
|
||||
wire:key="{{$mail->id}}"></livewire:components.badge>
|
||||
</td>
|
||||
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">{{ $mail->recipients()->count() }}</td>
|
||||
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">{{ $mail->attachments()->pluck('name')->join( ', ') }}</td>
|
||||
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500 max-w-[250px] truncate ...">
|
||||
{{ $mail->attachments()->pluck('name')->join( ', ') }}
|
||||
</td>
|
||||
<td class="relative whitespace-nowrap py-4 pl-3 pr-4 text-right text-sm font-medium sm:pr-0">
|
||||
<button type="button" wire:click="showMailingDetailsModal({{ $mail->id }})" x-on:click="$dispatch('preview',{mail: {{$mail}}})"
|
||||
class="text-indigo-600 hover:text-indigo-900">Show
|
||||
<button type="button" wire:click="showMailingDetailsModal({{ $mail->id }})"
|
||||
x-on:click="$dispatch('preview',{mail: {{$mail}}})"
|
||||
class="text-indigo-600 hover:text-indigo-900"><i class="fa-solid fa-eye"></i>
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
@ -67,6 +73,7 @@ class="text-indigo-600 hover:text-indigo-900">Show
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<x-modal wire:model="mailingDetailsModal">
|
||||
<x-form-modal submit="saveProject">
|
||||
<x-slot name="title">
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<div>
|
||||
<div class="px-4">
|
||||
<div class="sm:flex sm:flex-col sm:items-center">
|
||||
<div class="flex justify-between w-full my-4">
|
||||
<div class="flex flex-col md:flex-row justify-between w-full my-4">
|
||||
<h1 class="text-base font-semibold leading-6 text-gray-900">Mosaics</h1>
|
||||
<livewire:components.pending-message :project="$project" type="mosaics"></livewire:components.pending-message>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
<div class="m-2">
|
||||
<div class="">
|
||||
<div>
|
||||
<div class="px-4">
|
||||
<div class="sm:flex sm:flex-col sm:items-center">
|
||||
<div class="w-full flex justify-between my-4">
|
||||
<div class="flex flex-col md:flex-row justify-between w-full my-4">
|
||||
<h1 class="text-base font-semibold leading-6 text-gray-900">Reports</h1>
|
||||
<livewire:components.pending-message :project="$project" type="reports"></livewire:components.pending-message>
|
||||
</div>
|
||||
<div class="mt-4 md:mt-0 flex flex-col md:flex md:justify-between md:flex-row w-full gap-2">
|
||||
<div class="flex flex-col md:flex-row mt-4 items-center md:justify-between w-full gap-2">
|
||||
<x-search></x-search>
|
||||
<x-button wire:click="openCreateReportModal"
|
||||
class="flex justify-center rounded-md bg-indigo-600 px-3 py-2 text-center text-sm font-semibold text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600">
|
||||
|
|
@ -52,7 +52,6 @@ class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6 lg
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<x-report-manager-properties-modal :reportManager="$this"/>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -40,10 +40,9 @@
|
|||
this.initMap();
|
||||
this.initMapLayer();
|
||||
this.addLayer(data,type);
|
||||
console.log('GeoJson loaded on the map.');
|
||||
console.log('GeoJson loaded.');
|
||||
},
|
||||
addLayerData(data,layer){
|
||||
console.log('here');
|
||||
var basicColors = ['orange', 'purple'];
|
||||
if(data && layer){
|
||||
layer.clearLayers();
|
||||
|
|
@ -64,9 +63,11 @@
|
|||
switch(type){
|
||||
case 'pivot_file':
|
||||
this.addLayerData(layerData,window.pivotLayer);
|
||||
console.log('Pivot file added.');
|
||||
break;
|
||||
case 'span_file':
|
||||
this.addLayerData(layerData,window.spanLayer);
|
||||
console.log('Span file added.');
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
@ -87,8 +88,12 @@
|
|||
<div class="md:w-2/3">
|
||||
<form x-init="
|
||||
$nextTick(() => {
|
||||
@if($formData['pivot_file'])
|
||||
showMap({{$formData['pivot_file']}},'pivot_file');
|
||||
showMap({{$formData['span_file']}},'span_file')
|
||||
@endif
|
||||
@if($formData['span_file'])
|
||||
showMap({{$formData['span_file']}},'span_file');
|
||||
@endif
|
||||
})
|
||||
">
|
||||
<div id="map">
|
||||
|
|
|
|||
Loading…
Reference in a new issue