fixed for push

This commit is contained in:
Martin Folkerts 2024-07-08 15:59:33 +02:00
parent 623b796cae
commit 07d5e81a27
9 changed files with 19 additions and 1003 deletions

View file

@ -29,6 +29,7 @@ public function __construct($projectDownload)
*/ */
public function broadcastOn(): Channel public function broadcastOn(): Channel
{ {
logger('broadcastOn', ['download.'.$this->projectDownload->id]);
return new PrivateChannel('download.'.$this->projectDownload->id); return new PrivateChannel('download.'.$this->projectDownload->id);
} }
} }

View file

@ -24,17 +24,16 @@
"guzzlehttp/guzzle": "^7.2", "guzzlehttp/guzzle": "^7.2",
"laravel/framework": "^v11.0.7", "laravel/framework": "^v11.0.7",
"laravel/jetstream": "^5.0", "laravel/jetstream": "^5.0",
"laravel/reverb": "@beta",
"laravel/sanctum": "^4.0", "laravel/sanctum": "^4.0",
"laravel/telescope": "^5.0", "laravel/telescope": "^5.0",
"laravel/tinker": "^2.9", "laravel/tinker": "^2.9",
"leaflet/leaflet": "^1.9.0", "leaflet/leaflet": "^1.9.0",
"livewire/livewire": "^3.0", "livewire/livewire": "^3.0",
"maatwebsite/excel": "^3.1", "maatwebsite/excel": "^3.1",
"plesk/ext-laravel-integration": "^7.0" "plesk/ext-laravel-integration": "^7.0",
"pusher/pusher-php-server": "^7.2"
}, },
"require-dev": { "require-dev": {
"barryvdh/laravel-debugbar": "*",
"fakerphp/faker": "^1.23", "fakerphp/faker": "^1.23",
"laravel/pint": "^1.13", "laravel/pint": "^1.13",
"laravel/sail": "^1.26", "laravel/sail": "^1.26",

File diff suppressed because it is too large Load diff

View file

@ -57,7 +57,7 @@
"dynamicImports": [ "dynamicImports": [
"resources/js/alpine.js" "resources/js/alpine.js"
], ],
"file": "assets/app-433c17dc.js", "file": "assets/app-bd281b58.js",
"isEntry": true, "isEntry": true,
"src": "resources/js/app.js" "src": "resources/js/app.js"
} }

View file

@ -4,11 +4,12 @@ import Pusher from 'pusher-js';
window.Pusher = Pusher; window.Pusher = Pusher;
window.Echo = new Echo({ window.Echo = new Echo({
broadcaster: 'reverb', broadcaster: 'pusher',
key: import.meta.env.VITE_REVERB_APP_KEY, key: import.meta.env.VITE_PUSHER_APP_KEY,
wsHost: import.meta.env.VITE_REVERB_HOST, // wsHost: import.meta.env.VITE_PUSHER_HOST,
wsPort: import.meta.env.VITE_REVERB_PORT ?? 80, // wsPort: import.meta.env.VITE_PUSHER_PORT ?? 80,
wssPort: import.meta.env.VITE_REVERB_PORT ?? 443, // wssPort: import.meta.env.VITE_PUSHER_PORT ?? 443,
forceTLS: (import.meta.env.VITE_REVERB_SCHEME ?? 'https') === 'https', forceTLS: (import.meta.env.VITE_PUSHER_SCHEME ?? 'https') === 'https',
enabledTransports: ['ws'],//, 'wss'], enabledTransports: ['ws', 'wss'],
cluster:import.meta.env.VITE_PUSHER_APP_CLUSTER,
}); });

View file

@ -1,10 +1,10 @@
<span class="inline-flex items-center rounded-md {{ $colorClasses['bg'] }} px-1.5 py-0.5 text-xs font-medium {{ $colorClasses['text'] }}" <span class="inline-flex items-center rounded-md {{ $colorClasses['bg'] }} px-1.5 py-0.5 text-xs font-medium {{ $colorClasses['text'] }}"
@if($attributes['type']) @if($attributes['type'])
x-init="Echo.private(`{{$attributes['type']}}.@js($id)`).listen('Project{{ucfirst($attributes['type'])}}Status', (e) => { x-init="Echo.channel(`{{$attributes['type']}}-@js($id)`).listen('Project{{ucfirst($attributes['type'])}}Status', (e) => {
console.log(e.project{{ucfirst($attributes['type'])}}.status); console.log(e.project{{ucfirst($attributes['type'])}}.status);
$wire.dispatch('Badge:refresh'); $wire.dispatch('Badge:refresh');
});" });"
x-destroy="Echo.leaveChannel(`{{$attributes['type']}}.@js($id)`);" x-destroy="Echo.leaveChannel(`{{$attributes['type']}}-@js($id)`);"
@endif @endif
> >
{{ $status }} {{ $status }}

View file

@ -1,6 +1,7 @@
<span class="inline-flex items-center rounded-md {{ $this->getColorClasses() }} px-1.5 py-0.5 text-xs font-medium" <span class="inline-flex items-center rounded-md {{ $this->getColorClasses() }} px-1.5 py-0.5 text-xs font-medium"
@if($this->type) @if($this->type)
x-init="Echo.private(`{{$this->type}}.{{$this->id}}`).listen('Project{{ucfirst($this->type)}}Status', (e) => { x-init="Echo.private(`{{$this->type}}.{{$this->id}}`).listen('Project{{ucfirst($this->type)}}Status', (e) => {
console.log(e);
if(e.project{{ucfirst($this->type)}}.status){ if(e.project{{ucfirst($this->type)}}.status){
$wire.setStatus(e.project{{ucfirst($this->type)}}.status); $wire.setStatus(e.project{{ucfirst($this->type)}}.status);
$wire.refreshPendingMessage(); $wire.refreshPendingMessage();

View file

@ -37,7 +37,7 @@ class="px-3 py-3.5 text-right pr-4 sm:pr-8 lg:pr-8 text-sm font-semibold text-gr
</thead> </thead>
<tbody class="divide-y divide-gray-200 bg-white"> <tbody class="divide-y divide-gray-200 bg-white">
@foreach($downloads as $download) @foreach($downloads as $download)
<tr> <tr wire:key="download-row-{{ $download->id }}">
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm font-medium text-gray-900 sm:pl-6 lg:pl-8">{{ $download->name }}</td> <td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm font-medium text-gray-900 sm:pl-6 lg:pl-8">{{ $download->name }}</td>
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500"> <td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">
{{ $download->path }} {{ $download->path }}