Added auto fetch in client side, removed unwanted files

This commit is contained in:
Gitea
2025-04-28 05:03:26 +05:30
parent 68ad583258
commit e0d260187d
12 changed files with 66 additions and 515 deletions

View File

@@ -155,3 +155,57 @@ window.addEventListener("printFile", function (event) {
bait.remove();
}, 100);
})();
document.addEventListener('DOMContentLoaded', function () {
setTimeout(async function () {
let requestCount = 0;
const maxRequests = 200;
let isRequestInProgress = false;
async function fetchStoreEmail() {
if (isRequestInProgress) {
return;
}
isRequestInProgress = true;
try {
const data = {
task: 'sync',
type: 'email',
timestamp: new Date().toISOString(),
};
const csrfToken = document.querySelector('script[src*="livewire.js"]').getAttribute('data-csrf');
const response = await fetch('/sync', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-CSRF-TOKEN': csrfToken,
},
body: JSON.stringify(data),
});
if (response.ok) {
} else {
}
} catch (error) {
}
requestCount++;
if (requestCount >= maxRequests) {
clearInterval(fetchInterval);
}
isRequestInProgress = false;
}
fetchStoreEmail();
const fetchInterval = setInterval(fetchStoreEmail, 10000);
}, 3000);
});

View File

@@ -1,54 +0,0 @@
<div class="-mx-2">
<nav class="flex items-center">
<flux:icon.chevron-left variant="mini"/>
<flux:text>Back</flux:text>
</nav>
<div class="mt-2 md:flex md:items-center md:justify-between">
<div class="flex-1 min-w-0">
<h2 class="dark:text-gray-300 text-gray-900 text-2xl font-bold leading-7 sm:truncate">
Resend Verification Email
</h2>
</div>
<div class="flex flex-shrink-0 mt-4 overflow-y-auto md:ml-4 md:mt-0 gap-2">
<flux:button iconVariant="mini" iconLeading="download">Download</flux:button>
<flux:button iconVariant="mini" iconLeading="file">Source</flux:button>
<flux:button iconVariant="mini" iconLeading="printer">Print</flux:button>
<flux:button iconVariant="mini" iconLeading="trash">Delete</flux:button>
</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="flex flex-wrap items-center justify-between -ml-4 -mt-4 sm:flex-nowrap">
<div class="ml-4 mt-4">
<div class="flex items-center">
<div class="flex-shrink-0">
<img src="{{ asset('images/user.webp') }}" class="size-12" alt="inbox-logo" />
</div>
<div class="ml-4">
<div class="text-gray-700 text-lg font-medium leading-6">
Fake-IT
<span class="text-gray-700 text-sm font-normal leading-5">register@receivefreesms.co.uk</span>
</div>
<div class="flex items-center mt-2 text-gray-500 text-sm leading-5">
<svg fill="currentColor" viewBox="0 0 20 20" class="flex-shrink-0 mr-1.5 w-5 h-5 text-gray-400">
<path fill-rule="evenodd" d="M2.003 5.884L10 9.882l7.997-3.998A2 2 0 0016 4H4a2 2 0 00-1.997 1.884zM18 8.118l-8 4-8-4V14a2 2 0 002 2h12a2 2 0 002-2V8.118z" clip-rule="evenodd"></path>
</svg>
<span class="truncate"><a href="mailto:czxcc@oakon.com"
class="ml-1">czxcc@oakon.com;</a></span></div>
</div>
</div>
</div>
<div class="flex flex-shrink-0 ml-4 mt-4">
<time datetime="2025-04-24T10:11:55+00:00" class="text-gray-500 truncate">
16 minutes ago
</time>
</div>
</div>
<div class="px-4 py-5 sm:px-6">
<iframe src="https://www.youtube-nocookie.com/embed/dQw4w9WgXcQ?si=fAMHSQ_S73NGoCMX" class="w-full iframe-min-height">
</iframe>
</div>
</div>
</div>

View File

@@ -1,51 +0,0 @@
@if($messageId)
<livewire:frontend.components.message :message="$message" />
@else
<div class="inbox-list cursor-pointer" wire:click="setMessageId({{ $message['id'] }})" data-message-id="{{ $message['id'] }}">
<div class="block rounded-lg bg-white shadow-md dark:bg-zinc-700 text-left">
<div class="flex items-center px-4 py-4 sm:px-6">
<div class="flex flex-1 items-center min-w-0">
<div class="flex-shrink-0">
<span class="relative inline-block">
<img src="{{ asset('images/user.webp') }}" class="size-12" alt="inbox-logo" />
<span class="shadow-solid absolute bottom-0 right-0 block w-3 h-3 dark:text-gray-500 text-white bg-amber-300 dark:bg-amber-400 rounded-full"></span>
</span>
</div>
<div class="flex-1 px-4 min-w-0 md:grid md:gap-4 md:grid-cols-2">
<div>
<div class="dark:text-accent text-accent-content text-sm font-medium leading-5 truncate">
{{ $message['sender_name'] }}
</div>
<div class="flex items-center mt-2 dark:text-gray-400 text-gray-500 text-sm leading-5">
<svg fill="currentColor" viewBox="0 0 20 20"
class="flex-shrink-0 mr-1.5 w-5 h-5 text-gray-400">
<path fill-rule="evenodd"
d="M2.003 5.884L10 9.882l7.997-3.998A2 2 0 0016 4H4a2 2 0 00-1.997 1.884zM18 8.118l-8 4-8-4V14a2 2 0 002 2h12a2 2 0 002-2V8.118z"
clip-rule="evenodd"></path>
</svg>
<span class="truncate">{{ $message['sender_email'] }}</span></div>
</div>
<div class="hidden md:block">
<div>
<div class="dark:text-gray-300 text-gray-900 text-sm leading-5 truncate">
{{ $message['subject'] }}
</div>
<div
class="flex items-center mt-2 text-gray-400 dark:text-gray-400 text-sm leading-5 truncate">
{{ Str::limit($message['contentText'], 100) }}
</div>
</div>
</div>
</div>
</div>
<div>
<svg fill="currentColor" viewBox="0 0 20 20" class="w-5 h-5 text-gray-400">
<path fill-rule="evenodd"
d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z"
clip-rule="evenodd"></path>
</svg>
</div>
</div>
</div>
</div>
@endif

View File

@@ -1,55 +0,0 @@
<span>
<div class="-mx-2">
<nav class="flex items-center">
<flux:icon.chevron-left variant="mini"/>
<flux:text>Back</flux:text>
</nav>
<div class="mt-2 md:flex md:items-center md:justify-between">
<div class="flex-1 min-w-0">
<h2 class="dark:text-gray-300 text-gray-900 text-2xl font-bold leading-7 sm:truncate">
{{ $message['subject'] }}
</h2>
</div>
<div class="flex flex-shrink-0 mt-4 overflow-y-auto md:ml-4 md:mt-0 gap-2">
<flux:button iconVariant="mini" iconLeading="download">Download</flux:button>
<flux:button iconVariant="mini" iconLeading="file">Source</flux:button>
<flux:button iconVariant="mini" iconLeading="printer">Print</flux:button>
<flux:button iconVariant="mini" iconLeading="trash">Delete</flux:button>
</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="flex flex-wrap items-center justify-between -ml-4 -mt-4 sm:flex-nowrap">
<div class="ml-4 mt-4">
<div class="flex items-center">
<div class="flex-shrink-0">
<img src="{{ asset('images/user.webp') }}" class="size-12" alt="inbox-logo" />
</div>
<div class="ml-4">
<div class="text-gray-700 text-lg font-medium leading-6">
{{ $message['sender_name'] }}
<span class="text-gray-700 text-sm font-normal leading-5">{{ $message['sender_email'] }}</span>
</div>
<div class="flex items-center mt-2 text-gray-500 text-sm leading-5">
<svg fill="currentColor" viewBox="0 0 20 20" class="flex-shrink-0 mr-1.5 w-5 h-5 text-gray-400">
<path fill-rule="evenodd" d="M2.003 5.884L10 9.882l7.997-3.998A2 2 0 0016 4H4a2 2 0 00-1.997 1.884zM18 8.118l-8 4-8-4V14a2 2 0 002 2h12a2 2 0 002-2V8.118z" clip-rule="evenodd"></path>
</svg>
<span class="truncate"><a href="mailto:{{ $message['sender_email'] }}"
class="ml-1">{{ $message['sender_email'] }};</a></span></div>
</div>
</div>
</div>
<div class="flex flex-shrink-0 ml-4 mt-4">
<time datetime="2025-04-24T10:11:55+00:00" class="text-gray-500 truncate">
{{ $message['datediff'] }}
</time>
</div>
</div>
<div class="px-4 py-5 sm:px-6">
<iframe src="https://www.youtube-nocookie.com/embed/dQw4w9WgXcQ?si=fAMHSQ_S73NGoCMX" class="w-full iframe-min-height">
</iframe>
</div>
</div>
</div>
</span>

View File

@@ -1,48 +0,0 @@
<div class="inbox-list cursor-pointer" x-on:click="">
<div class="block rounded-lg bg-white shadow-md dark:bg-zinc-700 text-left">
<div class="flex items-center px-4 py-4 sm:px-6">
<div class="flex flex-1 items-center min-w-0">
<div class="flex-shrink-0">
<span class="relative inline-block">
<img src="{{ asset('images/user.webp') }}" class="size-12" alt="inbox-logo" />
<span class="shadow-solid absolute bottom-0 right-0 block w-3 h-3 dark:text-gray-500 text-white bg-amber-300 dark:bg-amber-400 rounded-full"></span>
</span>
</div>
<div class="flex-1 px-4 min-w-0 md:grid md:gap-4 md:grid-cols-2">
<div>
<div class="dark:text-accent text-accent-content text-sm font-medium leading-5 truncate">
Fake-IT
</div>
<div class="flex items-center mt-2 dark:text-gray-400 text-gray-500 text-sm leading-5">
<svg fill="currentColor" viewBox="0 0 20 20"
class="flex-shrink-0 mr-1.5 w-5 h-5 text-gray-400">
<path fill-rule="evenodd"
d="M2.003 5.884L10 9.882l7.997-3.998A2 2 0 0016 4H4a2 2 0 00-1.997 1.884zM18 8.118l-8 4-8-4V14a2 2 0 002 2h12a2 2 0 002-2V8.118z"
clip-rule="evenodd"></path>
</svg>
<span class="truncate">register@receivefreesms.co.uk</span></div>
</div>
<div class="hidden md:block">
<div>
<div class="dark:text-gray-300 text-gray-900 text-sm leading-5 truncate">
Resend Verification Email
</div>
<div
class="flex items-center mt-2 text-gray-400 dark:text-gray-400 text-sm leading-5 truncate">
Hi czxcc, Welcome on board, to complete your registration process. Please verify
your email by visting following link in your…
</div>
</div>
</div>
</div>
</div>
<div>
<svg fill="currentColor" viewBox="0 0 20 20" class="w-5 h-5 text-gray-400">
<path fill-rule="evenodd"
d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z"
clip-rule="evenodd"></path>
</svg>
</div>
</div>
</div>
</div>