Add all files

This commit is contained in:
root
2025-11-30 11:57:22 +01:00
parent 2ee51cac4f
commit 044271db3d
1476 changed files with 142544 additions and 0 deletions

View File

@@ -0,0 +1,75 @@
@php
$audits = $record->audits;
// Also get the child audits
if (get_class($record) === 'App\Models\Product') {
$record->plans->each(function ($plan) use (&$audits) {
$audits = $audits->merge($plan->audits->map(function ($audit) use ($plan) {
$audit->event = 'Plan ' . $plan->name . ' ' . $audit->event;
return $audit;
}));
$plan->prices->each(function ($price) use (&$audits, $plan) {
$audits = $audits->merge($price->audits->map(function ($audit) use ($price, $plan) {
$audit->event = 'Price from Plan ' . $plan->name . ' ' . $audit->event;
return $audit;
}));
});
});
}
// sort
$audits = $audits->sortByDesc('created_at');
@endphp
<div class="flex flex-col h-full space-y-4">
<x-filament::grid class="gap-4">
@foreach ($audits as $audit)
<div
class="fi-in-repeatable-item block rounded-xl bg-white p-4 shadow-sm ring-1 ring-gray-950/5 dark:bg-white/5 dark:ring-white/10">
<div class="flex gap-x-3">
<div class="flex-grow space-y-2 pt-[6px]">
<div class="flex gap-x-2 items-center justify-between">
<div class="flex gap-x-2 items-center">
<div class="text-sm font-medium text-gray-950 dark:text-white">
{{ $audit->user->name }}
</div>
<div class="text-xs text-gray-950 dark:text-white">
{{ $audit->created_at->diffForHumans() }}
</div>
</div>
<div class="text-xs text-gray-950 dark:text-white">
{{ $audit->created_at->format('Y-m-d H:i:s') }}
</div>
</div>
<div class="text-sm text-gray-950 dark:text-white">
{{ $audit->event }}
@if(count($audit->getModified()) === 0)
<span class="text-xs text-gray-950 dark:text-white">
(No changes)
</span>
@else
@foreach ($audit->getModified() as $key => $value)
<div class="my-2 p-2 bg-background-secondary rounded">
<span class="font-semibold">{{ $key }}</span> changed from
<div class="flex flex-wrap items-center gap-2">
<span class="text-red-300 p-1 rounded">
<code>{{ $value['old'] ?? '' }}</code>
</span>
<span class="font-medium">to</span>
<span class="text-green-300 p-1 rounded">
<code>{{ $value['new'] ?? '' }}</code>
</span>
</div>
</div>
@endforeach
@endif
</div>
</div>
</div>
</div>
@endforeach
</x-filament::grid>
</div>

View File

@@ -0,0 +1 @@
<iframe srcdoc="{{ $getRecord()->body }}" style="width: 100%; height: 700px; border: none;"></iframe>

View File

@@ -0,0 +1,12 @@
<div class="fi-in-entry-wrp">
<div class="grid gap-y-2">
<div class="flex items-center gap-x-3 justify-between">
<dt class="fi-in-entry-wrp-label inline-flex items-center gap-x-3">
<span class="text-sm font-medium leading-6 text-gray-950 dark:text-white">
{{ $entry->getLabel() }}
</span>
</dt>
</div>
<pre style="overflow-x: auto;"><code>{{ json_encode($getState(), JSON_PRETTY_PRINT) }}</code></pre>
</div>
</div>

View File

@@ -0,0 +1,10 @@
<x-filament-panels::page>
<x-filament-panels::form id="settings" wire:submit="save">
{{ $this->form }}
<x-filament-panels::form.actions :actions="$this->getFormActions()" />
</x-filament-panels::form>
</x-filament-panels::page>

View File

@@ -0,0 +1,63 @@
<x-filament-panels::page>
@assets
<script src="https://cdn.jsdelivr.net/npm/ansi_up@5.0.0/ansi_up.min.js"></script>
@endassets
@if(config('app.version') == 'beta')
<div>
<strong>Warning:</strong> You are using a beta version of the application. This can cause problems
</div>
@endif
@if(config('app.version') == 'beta' && config('settings.latest_commit') != config('app.commit'))
<div class="flex flex-col gap-1">
<div>
<strong>Latest commit:</strong> {{ config('settings.latest_commit') }}
</div>
<div>
<strong>Your commit:</strong> {{ config('app.commit') }}
</div>
<p>See <a
href="https://paymenter.org/docs/installation/updating">https://paymenter.org/docs/installation/updating</a>
on how to update</p>
<p class="mt-2">OR try the web updater (This is a beta feature, use at your own risk)</p>
<div class="mt-2">
{{ $this->update }}
</div>
</div>
@elseif(config('app.version') != config('settings.latest_version') && config('app.version') != 'beta')
<div class="flex flex-col gap-1">
<div>
<strong>Latest version:</strong> {{ config('settings.latest_version') }}
</div>
<div>
<strong>Your version:</strong> {{ config('app.version') }}
</div>
<!-- <p>See <a
href="https://paymenter.org/docs/installation/updating">https://paymenter.org/docs/installation/updating</a>
on how to update</p>
<p class="mt-2">OR try the web updater (This is a beta feature, use at your own risk)</p>
<div class="mt-2">
{{ $this->update }}
</div>--><p>Do not inadvertently run any updates as this is a forked version of the software. Please refer to the documentation or support channels for guidance on updating.
Updating without proper instructions may lead to unexpected issues. Please refer to <b>Adekabang</b> for support and update instructions.
</p>
</div>
@else
<div class="flex flex-col gap-1">
<div>
<strong>Latest version:</strong> {{ config('settings.latest_version') }}
</div>
<div>
<strong>Your version:</strong> {{ config('app.version') }}
</div>
<p>You are up to date!</p>
</div>
@endif
<code>
<pre id="update-result" class="mt-2" x-data="{ output: '' }" x-html="output" x-on:update-completed.window="output = (new AnsiUp()).ansi_to_html($event.detail[0].output);">
</pre>
</code>
</x-filament-panels::page>

View File

@@ -0,0 +1,50 @@
<x-filament-panels::page>
<div class="md:grid grid-cols-4 flex flex-col gap-4" wire:poll.5s>
<div class="md:col-span-3">
<div class="flex flex-col gap-4 max-h-[60vh] overflow-y-auto pr-4">
@foreach ($this->record->messages()->with('user')->get() as $index => $message)
<div
class="bg-background-secondary hover:bg-background-secondary/80 border border-neutral p-4 rounded-lg w-full max-w-[80%] {{ $message->user_id === $this->record->user_id ? 'ml-auto' : 'mr-auto' }}"
@if ($loop->last) x-data x-init="$el.scrollIntoView()" @endif>
<div class="flex justify-between">
<div>
<a class="text-lg font-semibold hover:underline"
href="{{ App\Admin\Resources\UserResource::getUrl('edit', ['record' => $message->user]) }}">
{{ $message->user->name }}
</a>
</div>
<div>
@can('delete', $message)
<button wire:click="deleteMessage({{ $message->id }})"
class="dark:text-danger-300 text-danger-600 p-0">
Delete
</button>
@endcan
</div>
</div>
<p class="text-sm text-gray-500">{{ $message->created_at->diffForHumans() }}</p>
<div class="mt-2 prose dark:prose-invert" style="word-break: break-all;">{!! Str::markdown(e($message->message), [
'allow_unsafe_links' => false,
'renderer' => [
'soft_break' => "<br>"
]
]) !!}</div>
</div>
@endforeach
</div>
<!-- Reply Form -->
<div class="mt-4">
<x-filament-panels::form id="form"
:wire:key="$this->getId() . '.forms.' . $this->getFormStatePath()" wire:submit="save">
{{ $this->form }}
<x-filament-panels::form.actions :actions="$this->getCachedFormActions()" :full-width="$this->hasFullWidthFormActions()" />
</x-filament-panels::form>
</div>
</div>
<div class="md:order-last order-first w-full col-span-3 sm:col-auto">{{ $this->infolist }}</div>
</div>
</x-filament-panels::page>

View File

@@ -0,0 +1,33 @@
{{-- Had to put a lot outside the <a> since it would always trigger redirect, layout shouldn't be changed at all --}}
<x-filament-widgets::widget>
<x-filament::section heading="Active Users ({{ $onlineCount }})">
@foreach($sessions as $session)
@if(!$session->user)
@continue
@endif
<div class="flex flex-row justify-between w-full items-center space-x-4">
<a href="{{ \App\Admin\Resources\UserResource::getUrl('edit', ['record' => $session->user]) }}" wire:navigate class="flex-grow">
<div>
<h2 class="font-bold">{{ $session->user->name }}</h2>
<div class="text-sm mb-2">
{{ $session->user->email }}
</div>
</div>
</a>
<div class="text-right min-w-[140px]">
<p class="text-sm text-base">{{ $session->last_activity->diffForHumans() }}</p>
<p
class="text-xs text-gray-400 dark:text-gray-500 cursor-pointer hover:text-primary-500 transition-colors select-none"
x-data="{ copied: false }"
x-on:click="
navigator.clipboard.writeText('{{ $session->ip_address }}');
copied = true;
setTimeout(() => copied = false, 2000);
"
x-text="copied ? 'Copied!' : '{{ $session->ip_address }}'"
></p>
</div>
</div>
@endforeach
</x-filament::section>
</x-filament-widgets::widget>