Compare commits

..

No commits in common. "915fd27d6180016ef358244c67aa6aab50155e30" and "5cc04d03439d5166bc8d945e9551ffae4e1d8dc5" have entirely different histories.

2 changed files with 15 additions and 38 deletions

View file

@ -1,4 +1,4 @@
<!DOCTYPE html>
<!DOCTYPE html>
<html lang="fa" dir="rtl">
<head>
@ -20,17 +20,17 @@
<body class="flex items-center justify-center min-h-screen bg-gray-900 text-white font-[Vazirmatn] mr-4 ml-4">
<div class="container text-center bg-gray-800 p-8 rounded-lg shadow-lg">
<h1 class="text-2xl font-bold mb-4">اطلاعات سابسکریپشن</h1>
<canvas id="qrcode" class="rounded-md inline mt-2 mb-3"></canvas>
<canvas id="qrcode" class="rounded-md inline mt-2 mb-2"></canvas>
<div class="text-lg mb-2"><i class="fa-regular fa-id-badge"></i> شناسه اشتراک : {{ .sId }}</div>
<div class="mb-2"><i class="fa-solid fa-circle-info"></i> وضعیت اشتراک : <span id="status"></span></div>
<div class="mb-2"><i class=" fa-solid fa-download"></i> دانلود : {{ .download }}</div>
<div class="mb-2"><i class=" fa-solid fa-upload"></i> آپلود : {{ .upload }}</div>
<div class="mb-2"><i class="fa-regular fa-calendar"></i> تاریخ پایان : <span id="timestamp"></span></div>
<div class="mb-4"><i class="fa-regular fa-star"></i> حجم کلی : <span id="total"></span></div>
<div class="mb-4"><i class="fa-regular fa-star"></i> حجم کلی : {{ .total }}</div>
<div class="bg-gray-700 rounded-lg shadow-lg p-4 font-mono flow-text break-words">
{{ range .result }}
<div class="text-gray-400 text-sm">
<button onclick="copyToClipboard('{{ . }}')"><i class="fa-regular fa-copy"></i></button>
<button onclick="copyToClipboard('{{ . }}')"><i
class="fa-regular fa-copy"></i></button>
{{ . }}
</div>
{{ end }}
@ -50,27 +50,7 @@
// Format the Jalali date
const formattedJalaliDate = `${jalaliDate.jy}/${jalaliDate.jm}/${jalaliDate.jd}`;
// Display the Jalali date in the HTML
if ('{{ .expire }}' === '0') {
humanDateElement.textContent = 'بدون انقضا';
} else {
humanDateElement.textContent = formattedJalaliDate;
}
// Get the HTML element to display the status.
const statusElement = document.getElementById('status');
if (timestamp >= Date.now() && '{{ .downloadByte}}' + '{{ .uploadByte }}' <= '{{ .totalByte }}') {
statusElement.textContent = 'فعال';
} else {
if ('{{ .totalByte }}' === '0') {
statusElement.textContent = 'نامحدود';
} else {
statusElement.textContent = 'غیرفعال';
}
}
if ('{{ .totalByte }}' === '0') {
document.getElementById('total').textContent = '∞';
} else {
document.getElementById('total').textContent = '{{ .total }}';
}
function copyToClipboard(text) {
navigator.clipboard.writeText(text);

View file

@ -107,9 +107,6 @@ func (a *SUBController) subs(c *gin.Context) {
"expire": expireValue,
"upload": upValue,
"download": downValue,
"totalByte": headerMap["total"],
"uploadByte": headerMap["upload"],
"downloadByte": headerMap["download"],
"sId": subId,
"subUrl": currentURL,
})