fixed locale issue

This commit is contained in:
Gitea
2025-04-27 17:04:05 +05:30
parent 94eb01b1ab
commit 66cf32a7bb
19 changed files with 88 additions and 44 deletions

View File

@@ -0,0 +1,28 @@
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\Response;
class Locale
{
/**
* Handle an incoming request.
*
* @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
*/
public function handle(Request $request, Closure $next): Response
{
try {
$locale = explode('-', explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE'])[0])[0];
if (in_array($locale, config('app.locales'))) {
session(['browser-locale' => $locale]);
}
} catch (\Exception $e) {
}
app()->setLocale(session('locale', session('browser-locale', config('app.settings.language', config('app.locale', 'en')))));
return $next($request);
}
}

View File

@@ -11,7 +11,9 @@ return Application::configure(basePath: dirname(__DIR__))
health: '/up', health: '/up',
) )
->withMiddleware(function (Middleware $middleware) { ->withMiddleware(function (Middleware $middleware) {
// $middleware->web(append: [
\App\Http\Middleware\Locale::class,
]);
}) })
->withExceptions(function (Exceptions $exceptions) { ->withExceptions(function (Exceptions $exceptions) {
// //

View File

@@ -57,10 +57,11 @@ window.addEventListener("showAlert", (event) => {
window.addEventListener("copyEmail", (event) => { window.addEventListener("copyEmail", (event) => {
const element = document.getElementById("copyEmail"); const element = document.getElementById("copyEmail");
const copyText = document.getElementById('copyEmailText').innerText
if (element) { if (element) {
const textToCopy = element.innerHTML; const textToCopy = element.innerHTML;
navigator.clipboard.writeText(textToCopy).then(() => { navigator.clipboard.writeText(textToCopy).then(() => {
const detail = { type: 'success', message: 'Email copied to clipboard' }; const detail = { type: 'success', message: copyText};
showToast(detail); showToast(detail);
}).catch(err => { }).catch(err => {
const detail = { type: 'error', message: 'Failed to copy email' }; const detail = { type: 'error', message: 'Failed to copy email' };

View File

@@ -1,4 +1,6 @@
{ {
"Inbox": "صندوق الوارد",
"You are signed in as:": "أنت مسجل دخولك كـ:",
"Get back to MailBox": "ارجع إلى صندوق البريد", "Get back to MailBox": "ارجع إلى صندوق البريد",
"Enter Username": "أدخل اسم المستخدم", "Enter Username": "أدخل اسم المستخدم",
"Select Domain": "حدد المجال", "Select Domain": "حدد المجال",
@@ -49,4 +51,4 @@
" temp mail": " بريد مؤقت", " temp mail": " بريد مؤقت",
"Sorry! That email is already been used by someone else. Please try a different email address.": "آسف! تم استخدام هذا البريد الإلكتروني بالفعل من قبل شخص آخر. يرجى تجربة عنوان بريد إلكتروني مختلف.", "Sorry! That email is already been used by someone else. Please try a different email address.": "آسف! تم استخدام هذا البريد الإلكتروني بالفعل من قبل شخص آخر. يرجى تجربة عنوان بريد إلكتروني مختلف.",
"Invalid Captcha. Please try again": "كلمة التحقق غير صالحة. يرجى المحاولة مرة أخرى" "Invalid Captcha. Please try again": "كلمة التحقق غير صالحة. يرجى المحاولة مرة أخرى"
} }

View File

@@ -1,4 +1,6 @@
{ {
"Inbox": "Posteingang",
"You are signed in as:": "Sie sind angemeldet als:",
"Get back to MailBox": "Geh zurück zu MailBox", "Get back to MailBox": "Geh zurück zu MailBox",
"Enter Username": "Benutzername eingeben", "Enter Username": "Benutzername eingeben",
"Select Domain": "Wählen Sie Domäne", "Select Domain": "Wählen Sie Domäne",
@@ -49,4 +51,4 @@
" temp mail": " Temporäre E-Mail", " temp mail": " Temporäre E-Mail",
"Sorry! That email is already been used by someone else. Please try a different email address.": "Entschuldigung! Diese E-Mail wurde bereits von jemand anderem verwendet. Bitte versuchen Sie es mit einer anderen E-Mail-Adresse.", "Sorry! That email is already been used by someone else. Please try a different email address.": "Entschuldigung! Diese E-Mail wurde bereits von jemand anderem verwendet. Bitte versuchen Sie es mit einer anderen E-Mail-Adresse.",
"Invalid Captcha. Please try again": "Ungültiges Captcha. Bitte versuche es erneut" "Invalid Captcha. Please try again": "Ungültiges Captcha. Bitte versuche es erneut"
} }

View File

@@ -1,4 +1,6 @@
{ {
"Inbox": "Inbox",
"You are signed in as:": "You are signed in as:",
"Get back to MailBox": "Get back to MailBox", "Get back to MailBox": "Get back to MailBox",
"Enter Username": "Enter Username", "Enter Username": "Enter Username",
"Select Domain": "Select Domain", "Select Domain": "Select Domain",
@@ -49,4 +51,4 @@
" temp mail": " temp mail", " temp mail": " temp mail",
"Sorry! That email is already been used by someone else. Please try a different email address.": "Sorry! That email is already been used by someone else. Please try a different email address.", "Sorry! That email is already been used by someone else. Please try a different email address.": "Sorry! That email is already been used by someone else. Please try a different email address.",
"Invalid Captcha. Please try again": "Invalid Captcha. Please try again" "Invalid Captcha. Please try again": "Invalid Captcha. Please try again"
} }

View File

@@ -1,4 +1,6 @@
{ {
"Inbox": "Bandeja de entrada",
"You are signed in as:": "Estás registrado como:",
"Get back to MailBox": "Regresar al buzón", "Get back to MailBox": "Regresar al buzón",
"Enter Username": "Introduce tu nombre", "Enter Username": "Introduce tu nombre",
"Select Domain": "Seleccionar dominio", "Select Domain": "Seleccionar dominio",
@@ -49,4 +51,4 @@
" temp mail": " correo temporal", " temp mail": " correo temporal",
"Sorry! That email is already been used by someone else. Please try a different email address.": "¡Lo siento! Ese correo electrónico ya lo ha utilizado otra persona. Prueba con otra dirección de correo electrónico.", "Sorry! That email is already been used by someone else. Please try a different email address.": "¡Lo siento! Ese correo electrónico ya lo ha utilizado otra persona. Prueba con otra dirección de correo electrónico.",
"Invalid Captcha. Please try again": "Captcha no válido. Inténtalo de nuevo" "Invalid Captcha. Please try again": "Captcha no válido. Inténtalo de nuevo"
} }

View File

@@ -1,4 +1,6 @@
{ {
"Inbox": "Boîte de réception",
"You are signed in as:": "Vous êtes connecté en tant que:",
"Get back to MailBox": "Revenir à la boîte aux lettres", "Get back to MailBox": "Revenir à la boîte aux lettres",
"Enter Username": "Entrez votre nom", "Enter Username": "Entrez votre nom",
"Select Domain": "Sélectionner un domaine", "Select Domain": "Sélectionner un domaine",
@@ -49,4 +51,4 @@
" temp mail": " courrier temporaire", " temp mail": " courrier temporaire",
"Sorry! That email is already been used by someone else. Please try a different email address.": "Désolé ! Cette adresse e-mail a déjà été utilisée par quelqu'un d'autre. Veuillez essayer une autre adresse e-mail.", "Sorry! That email is already been used by someone else. Please try a different email address.": "Désolé ! Cette adresse e-mail a déjà été utilisée par quelqu'un d'autre. Veuillez essayer une autre adresse e-mail.",
"Invalid Captcha. Please try again": "Captcha non valide. Veuillez réessayer" "Invalid Captcha. Please try again": "Captcha non valide. Veuillez réessayer"
} }

View File

@@ -1,4 +1,6 @@
{ {
"Inbox": "इनबॉक्स",
"You are signed in as:": "आप साइन इन हैं जैसे:",
"Get back to MailBox": "MailBox पर वापस जाएं", "Get back to MailBox": "MailBox पर वापस जाएं",
"Enter Username": "यूजरनेम डालें", "Enter Username": "यूजरनेम डालें",
"Select Domain": "डोमेन चुनें", "Select Domain": "डोमेन चुनें",
@@ -49,4 +51,4 @@
" temp mail": " अस्थायी मेल", " temp mail": " अस्थायी मेल",
"Sorry! That email is already been used by someone else. Please try a different email address.": "माफ़ करना! उस ईमेल का उपयोग पहले से ही किसी और द्वारा किया जा चुका है। कृपया एक अलग ईमेल पता आज़माएं।", "Sorry! That email is already been used by someone else. Please try a different email address.": "माफ़ करना! उस ईमेल का उपयोग पहले से ही किसी और द्वारा किया जा चुका है। कृपया एक अलग ईमेल पता आज़माएं।",
"Invalid Captcha. Please try again": "अमान्य कैप्चा। कृपया फिर से कोशिश करें" "Invalid Captcha. Please try again": "अमान्य कैप्चा। कृपया फिर से कोशिश करें"
} }

View File

@@ -1,4 +1,6 @@
{ {
"Inbox": "Kotak Masuk",
"You are signed in as:": "Anda masuk sebagai:",
"Get back to MailBox": "Kembali Ke Kotak Surat", "Get back to MailBox": "Kembali Ke Kotak Surat",
"Enter Username": "Masukkan Nama Pengguna", "Enter Username": "Masukkan Nama Pengguna",
"Select Domain": "Pilih Domain", "Select Domain": "Pilih Domain",
@@ -49,4 +51,4 @@
" temp mail": " Email Sementara", " temp mail": " Email Sementara",
"Sorry! That email is already been used by someone else. Please try a different email address.": "Maaf! Email Tersebut Sudah digunakan oleh user lain, Silahkan mencoba dengan alamat email lain.", "Sorry! That email is already been used by someone else. Please try a different email address.": "Maaf! Email Tersebut Sudah digunakan oleh user lain, Silahkan mencoba dengan alamat email lain.",
"Invalid Captcha. Please try again": "Invalid Captcha. Silahkan Coba Lagi" "Invalid Captcha. Please try again": "Invalid Captcha. Silahkan Coba Lagi"
} }

View File

@@ -1,4 +1,6 @@
{ {
"Inbox": "Innboks",
"You are signed in as:": "Du er logget inn som:",
"Get back to MailBox": "Gå tilbake til innboks", "Get back to MailBox": "Gå tilbake til innboks",
"Enter Username": "Fyll inn brukernavn", "Enter Username": "Fyll inn brukernavn",
"Select Domain": "Velg domene", "Select Domain": "Velg domene",
@@ -49,4 +51,4 @@
" temp mail": " temp post", " temp mail": " temp post",
"Sorry! That email is already been used by someone else. Please try a different email address.": "Unnskyld! Den e-posten er allerede brukt av noen andre. Prøv en annen e-postadresse.", "Sorry! That email is already been used by someone else. Please try a different email address.": "Unnskyld! Den e-posten er allerede brukt av noen andre. Prøv en annen e-postadresse.",
"Invalid Captcha. Please try again": "Ugyldig Captcha. Vennligst prøv på nytt" "Invalid Captcha. Please try again": "Ugyldig Captcha. Vennligst prøv på nytt"
} }

View File

@@ -1,4 +1,6 @@
{ {
"Inbox": "Skrzynka odbiorcza",
"You are signed in as:": "Jesteś zalogowany jako:",
"Get back to MailBox": "Wróć do skrzynki pocztowej", "Get back to MailBox": "Wróć do skrzynki pocztowej",
"Enter Username": "Wprowadź nazwę użytkownika", "Enter Username": "Wprowadź nazwę użytkownika",
"Select Domain": "Wybierz domenę", "Select Domain": "Wybierz domenę",
@@ -49,4 +51,4 @@
" temp mail": " tymczasowa poczta", " temp mail": " tymczasowa poczta",
"Sorry! That email is already been used by someone else. Please try a different email address.": "Przepraszam! Ten e-mail jest już używany przez kogoś innego. Wypróbuj inny adres e-mail.", "Sorry! That email is already been used by someone else. Please try a different email address.": "Przepraszam! Ten e-mail jest już używany przez kogoś innego. Wypróbuj inny adres e-mail.",
"Invalid Captcha. Please try again": "Nieprawidłowy Captcha. Proszę spróbować ponownie" "Invalid Captcha. Please try again": "Nieprawidłowy Captcha. Proszę spróbować ponownie"
} }

View File

@@ -1,4 +1,6 @@
{ {
"Inbox": "Входящие",
"You are signed in as:": "Вы вошли как:",
"Get back to MailBox": "Вернитесь в Mailbox", "Get back to MailBox": "Вернитесь в Mailbox",
"Enter Username": "Введите имя пользователя", "Enter Username": "Введите имя пользователя",
"Select Domain": "Выберите домен", "Select Domain": "Выберите домен",
@@ -49,4 +51,4 @@
" temp mail": " временная почта", " temp mail": " временная почта",
"Sorry! That email is already been used by someone else. Please try a different email address.": "Извините! Этим письмом уже воспользовался кто-то другой. Пожалуйста, укажите другой адрес электронной почты.", "Sorry! That email is already been used by someone else. Please try a different email address.": "Извините! Этим письмом уже воспользовался кто-то другой. Пожалуйста, укажите другой адрес электронной почты.",
"Invalid Captcha. Please try again": "Неверная капча. Пожалуйста, попробуйте еще раз" "Invalid Captcha. Please try again": "Неверная капча. Пожалуйста, попробуйте еще раз"
} }

View File

@@ -1,4 +1,6 @@
{ {
"Inbox": "Gelen Kutusu",
"You are signed in as:": "Oturum açtığınız kişi:",
"Get back to MailBox": "MailBox'a geri dön", "Get back to MailBox": "MailBox'a geri dön",
"Enter Username": "Kullanıcı Adı Girin", "Enter Username": "Kullanıcı Adı Girin",
"Select Domain": "Alan Adı Seç", "Select Domain": "Alan Adı Seç",
@@ -49,4 +51,4 @@
" temp mail": " geçici posta", " temp mail": " geçici posta",
"Sorry! That email is already been used by someone else. Please try a different email address.": "Üzgünüm! Bu e-posta zaten başka biri tarafından kullanılmış. Lütfen farklı bir e-posta adresi deneyin.", "Sorry! That email is already been used by someone else. Please try a different email address.": "Üzgünüm! Bu e-posta zaten başka biri tarafından kullanılmış. Lütfen farklı bir e-posta adresi deneyin.",
"Invalid Captcha. Please try again": "Geçersiz Captcha. Lütfen tekrar deneyin" "Invalid Captcha. Please try again": "Geçersiz Captcha. Lütfen tekrar deneyin"
} }

View File

@@ -1,4 +1,6 @@
{ {
"Inbox": "Hộp thư đến",
"You are signed in as:": "Bạn đã đăng nhập dưới tên:",
"Get back to MailBox": "Quay lại Mailbox", "Get back to MailBox": "Quay lại Mailbox",
"Enter Username": "Nhập tên người dùng", "Enter Username": "Nhập tên người dùng",
"Select Domain": "Chọn tên miền", "Select Domain": "Chọn tên miền",
@@ -49,4 +51,4 @@
" temp mail": " thư tạm thời", " temp mail": " thư tạm thời",
"Sorry! That email is already been used by someone else. Please try a different email address.": "Xin lỗi! Email đó đã được người khác sử dụng. Vui lòng thử một địa chỉ email khác.", "Sorry! That email is already been used by someone else. Please try a different email address.": "Xin lỗi! Email đó đã được người khác sử dụng. Vui lòng thử một địa chỉ email khác.",
"Invalid Captcha. Please try again": "Captcha không hợp lệ. Vui lòng thử lại" "Invalid Captcha. Please try again": "Captcha không hợp lệ. Vui lòng thử lại"
} }

View File

@@ -2,9 +2,10 @@
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}"> <html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ $title ?? 'Page Title' }}</title> <title>@yield('title', config('app.settings.app_title'))</title>
@if (file_exists(public_path('build/manifest.json')) || file_exists(public_path('hot'))) @if (file_exists(public_path('build/manifest.json')) || file_exists(public_path('hot')))
@vite(['resources/css/app.css', 'resources/css/boil.css', 'resources/js/app.js', 'resources/js/boil.js']) @vite(['resources/css/app.css', 'resources/css/boil.css', 'resources/js/app.js', 'resources/js/boil.js'])
@endif @endif
@@ -21,7 +22,7 @@
</div> </div>
<flux:navlist variant="outline"> <flux:navlist variant="outline">
<flux:button class="cursor-pointer inbox-btn" variant="filled" icon="inbox" x-on:click="window.location.href = '{{ route('mailbox') }}'">Inbox</flux:button> <flux:button class="cursor-pointer inbox-btn" variant="filled" icon="inbox" x-on:click="window.location.href = '{{ route('mailbox') }}'">{{ __('Inbox') }}</flux:button>
{{-- <flux:button class="mt-2 cursor-pointer" variant="filled" icon="refresh-cw" x-on:click="Livewire.dispatch('fetchMessages')">Refresh</flux:button>--}} {{-- <flux:button class="mt-2 cursor-pointer" variant="filled" icon="refresh-cw" x-on:click="Livewire.dispatch('fetchMessages')">Refresh</flux:button>--}}
<button type="button" class="relative items-center font-medium justify-center gap-2 whitespace-nowrap disabled:opacity-75 dark:disabled:opacity-75 disabled:cursor-default disabled:pointer-events-none h-10 text-sm rounded-lg px-4 inline-flex bg-zinc-800/5 hover:bg-zinc-800/10 dark:bg-white/10 dark:hover:bg-white/20 text-zinc-800 dark:text-white [[data-flux-button-group]_&amp;]:border-e [:is([data-flux-button-group]>&amp;:last-child,_[data-flux-button-group]_:last-child>&amp;)]:border-e-0 [[data-flux-button-group]_&amp;]:border-zinc-200/80 dark:[[data-flux-button-group]_&amp;]:border-zinc-900/50 mt-2 cursor-pointer" data-flux-button="data-flux-button" data-flux-group-target="data-flux-group-target" x-on:click="Livewire.dispatch('fetchMessages'); document.getElementById('refresh-icon').classList.add('animate-spin')"> <button type="button" class="relative items-center font-medium justify-center gap-2 whitespace-nowrap disabled:opacity-75 dark:disabled:opacity-75 disabled:cursor-default disabled:pointer-events-none h-10 text-sm rounded-lg px-4 inline-flex bg-zinc-800/5 hover:bg-zinc-800/10 dark:bg-white/10 dark:hover:bg-white/20 text-zinc-800 dark:text-white [[data-flux-button-group]_&amp;]:border-e [:is([data-flux-button-group]>&amp;:last-child,_[data-flux-button-group]_:last-child>&amp;)]:border-e-0 [[data-flux-button-group]_&amp;]:border-zinc-200/80 dark:[[data-flux-button-group]_&amp;]:border-zinc-900/50 mt-2 cursor-pointer" data-flux-button="data-flux-button" data-flux-group-target="data-flux-group-target" x-on:click="Livewire.dispatch('fetchMessages'); document.getElementById('refresh-icon').classList.add('animate-spin')">
<svg id="refresh-icon" class="shrink-0 [:where(&amp;)]:size-4" data-flux-icon="" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-slot="icon"> <svg id="refresh-icon" class="shrink-0 [:where(&amp;)]:size-4" data-flux-icon="" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-slot="icon">
@@ -76,17 +77,17 @@
<flux:button icon="circle-user-round" variant="subtle" aria-label="Account" /> <flux:button icon="circle-user-round" variant="subtle" aria-label="Account" />
</flux:tooltip> </flux:tooltip>
<flux:menu> <flux:menu>
<flux:text class="p-1">You are signed in as:</flux:text> <flux:text class="p-1">{{ __('You are signed in as:') }}</flux:text>
<div wire:ignore> <div wire:ignore>
<livewire:frontend.email /> <livewire:frontend.email />
</div> </div>
<flux:menu.separator /> <flux:menu.separator />
<div class="flex"> <div class="flex">
<flux:modal.trigger name="create-account"> <flux:modal.trigger name="create-account">
<flux:button class="p-1 w-full" variant="outline" icon="mail-plus" style="">Create Account</flux:button> <flux:button class="p-1 w-full" variant="outline" icon="mail-plus" style="">{{ __('New') }}</flux:button>
</flux:modal.trigger> </flux:modal.trigger>
<flux:modal.trigger name="delete-account"> <flux:modal.trigger name="delete-account">
<flux:tooltip content="Delete Account"> <flux:tooltip content="{{ __('Delete') }}">
<flux:button class="ml-1 p-1" icon="trash" variant="outline" style="color:#F14743;"></flux:button> <flux:button class="ml-1 p-1" icon="trash" variant="outline" style="color:#F14743;"></flux:button>
</flux:tooltip> </flux:tooltip>
</flux:modal.trigger> </flux:modal.trigger>
@@ -101,9 +102,7 @@
<flux:heading size="lg">Generate Your Temporary Email</flux:heading> <flux:heading size="lg">Generate Your Temporary Email</flux:heading>
</div> </div>
<livewire:frontend.action action="customEmail" /> <livewire:frontend.action action="customEmail" />
<flux:separator text="or" /> <flux:separator text="or" />
<div class="flex w-full"> <div class="flex w-full">
@@ -140,12 +139,14 @@
<flux:main class="dark:bg-gray-900 bg-gray-100"> <flux:main class="dark:bg-gray-900 bg-gray-100">
{{ $slot }} {{ $slot }}
</flux:main> </flux:main>
<!-- Toast Container -->
<!-- Toast Container -->
<div id="toast-container" class="fixed top-5 left-1/2 transform -translate-x-1/2 z-50 space-y-4"></div> <div id="toast-container" class="fixed top-5 left-1/2 transform -translate-x-1/2 z-50 space-y-4"></div>
<p class="hidden" id="copyEmailText">{{ __('Email ID Copied to Clipboard') }}</p>
@fluxScripts @fluxScripts
<script> <script>
document.addEventListener('DOMContentLoaded', () => { document.addEventListener('DOMContentLoaded', () => {
setTimeout(() => { setTimeout(() => {
const email = '{{ App\Models\ZEmail::getEmail(true) }}'; const email = '{{ App\Models\ZEmail::getEmail(true) }}';
const add_mail_in_title = "{{ json_decode(config('app.settings.configuration_settings'))->add_mail_in_title ? 'yes' : 'no' }}" const add_mail_in_title = "{{ json_decode(config('app.settings.configuration_settings'))->add_mail_in_title ? 'yes' : 'no' }}"
@@ -155,7 +156,6 @@
Livewire.dispatch('updateEmail'); Livewire.dispatch('updateEmail');
}, 2000); }, 2000);
document.addEventListener('stopLoader', () => { document.addEventListener('stopLoader', () => {
document.querySelectorAll('#refresh-icon').forEach(el => { document.querySelectorAll('#refresh-icon').forEach(el => {
setTimeout(() => { setTimeout(() => {
@@ -163,8 +163,8 @@
}, 1000); }, 1000);
}); });
}); });
let counter = parseInt({{ json_decode(config('app.settings.configuration_settings'))->fetch_seconds }});
let counter = parseInt({{ json_decode(config('app.settings.configuration_settings'))->fetch_seconds }});
setInterval(() => { setInterval(() => {
if (counter === 0 && document.getElementById('imap-error') === null && !document.hidden) { if (counter === 0 && document.getElementById('imap-error') === null && !document.hidden) {
document.querySelectorAll('#refresh-icon').forEach(el => { document.querySelectorAll('#refresh-icon').forEach(el => {
@@ -173,12 +173,10 @@
Livewire.dispatch('fetchMessages'); Livewire.dispatch('fetchMessages');
counter = parseInt({{ json_decode(config('app.settings.configuration_settings'))->fetch_seconds }}); counter = parseInt({{ json_decode(config('app.settings.configuration_settings'))->fetch_seconds }});
} }
counter--; counter--;
if(document.hidden) { if(document.hidden) {
counter = 1; counter = 1;
} }
}, 1000); }, 1000);
}); });
</script> </script>

View File

@@ -1,10 +1,10 @@
<span> <span>
@if($action == "random") @if($action == "random")
<flux:button wire:click="random()" class="cursor-pointer w-full btn-primary" type="submit" variant="filled">Random Email</flux:button> <flux:button wire:click="random()" class="cursor-pointer w-full btn-primary" type="submit" variant="filled">{{ __('Random') }} Email</flux:button>
@elseif($action == "gmail") @elseif($action == "gmail")
<flux:button wire:click="gmail()" class="cursor-pointer w-full ml-2 btn-warning" type="submit" variant="filled">Disposable Gmail</flux:button> <flux:button wire:click="gmail()" class="cursor-pointer w-full ml-2 btn-warning" type="submit" variant="filled">Disposable Gmail</flux:button>
@elseif($action == "delete") @elseif($action == "delete")
<flux:button wire:click="deleteEmail()" class="cursor-pointer" type="submit" variant="danger">Delete account</flux:button> <flux:button wire:click="deleteEmail()" class="cursor-pointer" type="submit" variant="danger">{{ __('Delete') }}</flux:button>
@elseif($action == "customEmail") @elseif($action == "customEmail")
<div> <div>
<form wire:submit.prevent="create" method="post"> <form wire:submit.prevent="create" method="post">
@@ -14,10 +14,10 @@
<div class="shrink-0 text-base text-gray-500 select-none sm:text-sm/6 mr-1.5"> <div class="shrink-0 text-base text-gray-500 select-none sm:text-sm/6 mr-1.5">
<flux:icon.mail variant="mini"/> <flux:icon.mail variant="mini"/>
</div> </div>
<input type="text" name="username" id="username" autocomplete="false" wire:model.defer="username" class="block min-w-0 grow py-2 pr-3 pl-1 text-base dark:text-white text-gray-900 placeholder:text-gray-400 focus:outline-none sm:text-sm/6" placeholder="Enter Username"> <input type="text" name="username" id="username" autocomplete="false" wire:model.defer="username" class="block min-w-0 grow py-2 pr-3 pl-1 text-base dark:text-white text-gray-900 placeholder:text-gray-400 focus:outline-none sm:text-sm/6" placeholder="{{ __('Enter Username') }}">
<div class="grid shrink-0 grid-cols-1 focus-within:relative"> <div class="grid shrink-0 grid-cols-1 focus-within:relative">
<select id="domain" name="domain" aria-label="Domain" wire:model="domain" class="col-start-1 row-start-1 w-full appearance-none rounded-md py-1.5 pr-7 pl-3 text-base text-gray-500 placeholder:text-gray-400 focus:outline-2 focus:-outline-offset-2 dark:focus:outline-white focus:outline-zinc-900 sm:text-sm/6"> <select id="domain" name="domain" aria-label="Domain" wire:model="domain" class="col-start-1 row-start-1 w-full appearance-none rounded-md py-1.5 pr-7 pl-3 text-base text-gray-500 placeholder:text-gray-400 focus:outline-2 focus:-outline-offset-2 dark:focus:outline-white focus:outline-zinc-900 sm:text-sm/6">
<option class="dark:bg-zinc-700 dark:text-white bg-zinc-100 accent-gray-700" selected>Choose a domain</option> <option class="dark:bg-zinc-700 dark:text-white bg-zinc-100 accent-gray-700" selected>{{ __('Select Domain') }}</option>
@foreach(array_reverse($domains) as $domain) @foreach(array_reverse($domains) as $domain)
<option x-on:click="$refs.domain.value = '{{ $domain }}'; $wire.setDomain('{{ $domain }}')" class="dark:bg-zinc-700 dark:text-white bg-zinc-100 accent-gray-700">{{ $domain }}</option> <option x-on:click="$refs.domain.value = '{{ $domain }}'; $wire.setDomain('{{ $domain }}')" class="dark:bg-zinc-700 dark:text-white bg-zinc-100 accent-gray-700">{{ $domain }}</option>
@endforeach @endforeach
@@ -30,10 +30,10 @@
</div> </div>
</div> </div>
<div class="flex mt-6"> <div class="flex my-6">
<div class="flex w-full"> <div class="flex w-full">
<flux:button x-on:click="$dispatch('closeModal')" class="w-1/2 cursor-pointer" variant="outline">Cancel</flux:button> <flux:button x-on:click="$dispatch('closeModal')" class="w-1/2 cursor-pointer" variant="outline">{{ __('Cancel') }}</flux:button>
<flux:button class="ml-2 w-1/2 btn-success cursor-pointer" type="submit" variant="primary">Create Account</flux:button> <flux:button class="ml-2 w-1/2 btn-success cursor-pointer" type="submit" variant="primary">{{ __('Create') }}</flux:button>
</div> </div>
</div> </div>
</form> </form>

View File

@@ -67,7 +67,7 @@
<div class="-mx-2"> <div class="-mx-2">
<nav class="flex items-center cursor-pointer" x-on:click="show = false"> <nav class="flex items-center cursor-pointer" x-on:click="show = false">
<flux:icon.chevron-left variant="mini"/> <flux:icon.chevron-left variant="mini"/>
<flux:text>Back</flux:text> <flux:text>{{ __('Get back to MailBox') }}</flux:text>
</nav> </nav>
<div class="mt-2 md:flex md:items-center md:justify-between"> <div class="mt-2 md:flex md:items-center md:justify-between">
@@ -80,7 +80,7 @@
<flux:button iconVariant="mini" iconLeading="download" x-on:click="$dispatch('downloadFile', { download_id: {{ $message['id'] }} })" class="cursor-pointer">Download</flux:button> <flux:button iconVariant="mini" iconLeading="download" x-on:click="$dispatch('downloadFile', { download_id: {{ $message['id'] }} })" class="cursor-pointer">Download</flux:button>
{{-- <flux:button iconVariant="mini" iconLeading="file">Source</flux:button>--}} {{-- <flux:button iconVariant="mini" iconLeading="file">Source</flux:button>--}}
<flux:button iconVariant="mini" iconLeading="printer" x-on:click="$dispatch('printFile', { print_id: {{ $message['id'] }} })" class="cursor-pointer">Print</flux:button> <flux:button iconVariant="mini" iconLeading="printer" x-on:click="$dispatch('printFile', { print_id: {{ $message['id'] }} })" class="cursor-pointer">Print</flux:button>
<flux:button iconVariant="mini" iconLeading="trash" x-on:click="show = false; id = 0; document.querySelector(`[data-id='{{ $message['id'] }}']`).remove()" wire:click="delete({{ $message['id'] }})" class="cursor-pointer" style="color: #F14743;">Delete</flux:button> <flux:button iconVariant="mini" iconLeading="trash" x-on:click="show = false; id = 0; document.querySelector(`[data-id='{{ $message['id'] }}']`).remove()" wire:click="delete({{ $message['id'] }})" class="cursor-pointer" style="color: #F14743;">{{ __('Delete') }}</flux:button>
</div> </div>
</div> </div>
<div class="mt-4 px-4 py-5 bg-white border-b border-gray-200 dark:border-gray-900 shadow overflow-hidden sm:px-6 sm:rounded-md"> <div class="mt-4 px-4 py-5 bg-white border-b border-gray-200 dark:border-gray-900 shadow overflow-hidden sm:px-6 sm:rounded-md">

View File

@@ -14,15 +14,6 @@ Route::get('/delete/{email?}', [AppController::class, 'delete'])->name('delete')
Route::get('locale/{locale}', [AppController::class, 'locale'])->name('locale'); Route::get('locale/{locale}', [AppController::class, 'locale'])->name('locale');
Route::get('/download-email', function () {
$data = 'Your content here'; // or pull from DB / session
$filename = 'data.txt';
return response($data)
->header('Content-Type', 'text/plain')
->header('Content-Disposition', "attachment; filename={$filename}");
})->name('download.txt');
Route::get('/msg/{email?}/', function ($email) { Route::get('/msg/{email?}/', function ($email) {
$responses = [ $responses = [
'to' => ZEmail::getMessages($email, 'to', []), 'to' => ZEmail::getMessages($email, 'to', []),