mirror of
				https://github.com/MHSanaei/3x-ui.git
				synced 2025-10-27 10:30:08 +00:00 
			
		
		
		
	Compare commits
	
		
			2 commits
		
	
	
		
			5cc04d0343
			...
			915fd27d61
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | 915fd27d61 | ||
|   | d5199b614c | 
					 2 changed files with 38 additions and 15 deletions
				
			
		|  | @ -1,4 +1,4 @@ | ||||||
| <!DOCTYPE html> | <!DOCTYPE html> | ||||||
| <html lang="fa" dir="rtl"> | <html lang="fa" dir="rtl"> | ||||||
| 
 | 
 | ||||||
| <head> | <head> | ||||||
|  | @ -8,10 +8,10 @@ | ||||||
|     <title>{{ .sId }} - Sub Info</title> |     <title>{{ .sId }} - Sub Info</title> | ||||||
|     <script src="https://unpkg.com/tailwindcss-cdn@3.4.10/tailwindcss-with-all-plugins.js"></script> |     <script src="https://unpkg.com/tailwindcss-cdn@3.4.10/tailwindcss-with-all-plugins.js"></script> | ||||||
|     <link href="https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@33.003/Vazirmatn-Variable-font-face.css" |     <link href="https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@33.003/Vazirmatn-Variable-font-face.css" | ||||||
|           rel="stylesheet" type="text/css"/> |           rel="stylesheet" type="text/css" /> | ||||||
|     <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.0/css/all.min.css" |     <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.0/css/all.min.css" | ||||||
|           integrity="sha512-xh6O/CkQoPOWDdYTDqeRdPCVd1SpvCA9XXcUnZS2FmJNp1coAFzvtCN9BmamE+4aHK8yyUHUSCcJHgXloTyT2A==" |           integrity="sha512-xh6O/CkQoPOWDdYTDqeRdPCVd1SpvCA9XXcUnZS2FmJNp1coAFzvtCN9BmamE+4aHK8yyUHUSCcJHgXloTyT2A==" | ||||||
|           crossorigin="anonymous"/> |           crossorigin="anonymous" /> | ||||||
|     <script src="https://cdn.jsdelivr.net/npm/jalaali-js/dist/jalaali.min.js"></script> |     <script src="https://cdn.jsdelivr.net/npm/jalaali-js/dist/jalaali.min.js"></script> | ||||||
|     <script src="https://cdn.jsdelivr.net/npm/qrious@4.0.2/dist/qrious.min.js" |     <script src="https://cdn.jsdelivr.net/npm/qrious@4.0.2/dist/qrious.min.js" | ||||||
|             integrity="sha256-25ncr0CpJhgbzkUiR3wu/Fkk9sSykRG2qX+upHfJUos=" crossorigin="anonymous"></script> |             integrity="sha256-25ncr0CpJhgbzkUiR3wu/Fkk9sSykRG2qX+upHfJUos=" crossorigin="anonymous"></script> | ||||||
|  | @ -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"> | <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"> | <div class="container text-center bg-gray-800 p-8 rounded-lg shadow-lg"> | ||||||
|     <h1 class="text-2xl font-bold mb-4">اطلاعات سابسکریپشن</h1> |     <h1 class="text-2xl font-bold mb-4">اطلاعات سابسکریپشن</h1> | ||||||
|     <canvas id="qrcode" class="rounded-md inline mt-2 mb-2"></canvas> |     <canvas id="qrcode" class="rounded-md inline mt-2 mb-3"></canvas> | ||||||
|     <div class="text-lg mb-2"><i class="fa-regular fa-id-badge"></i> شناسه اشتراک : {{ .sId }}</div> |     <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-download"></i> دانلود : {{ .download }}</div> | ||||||
|     <div class="mb-2"><i class=" fa-solid fa-upload"></i> آپلود : {{ .upload }}</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-2"><i class="fa-regular fa-calendar"></i> تاریخ پایان : <span id="timestamp"></span></div> | ||||||
|     <div class="mb-4"><i class="fa-regular fa-star"></i> حجم کلی : {{ .total }}</div> |     <div class="mb-4"><i class="fa-regular fa-star"></i> حجم کلی : <span id="total"></span></div> | ||||||
|     <div class="bg-gray-700 rounded-lg shadow-lg p-4 font-mono flow-text break-words"> |     <div class="bg-gray-700 rounded-lg shadow-lg p-4 font-mono flow-text break-words"> | ||||||
|         {{ range .result }} |         {{ range .result }} | ||||||
|         <div class="text-gray-400 text-sm"> |         <div class="text-gray-400 text-sm"> | ||||||
|             <button onclick="copyToClipboard('{{ . }}')"><i |             <button onclick="copyToClipboard('{{ . }}')"><i class="fa-regular fa-copy"></i></button> | ||||||
|                     class="fa-regular fa-copy"></i></button> |  | ||||||
|             {{ . }} |             {{ . }} | ||||||
|         </div> |         </div> | ||||||
|         {{ end }} |         {{ end }} | ||||||
|  | @ -50,7 +50,27 @@ | ||||||
|         // Format the Jalali date |         // Format the Jalali date | ||||||
|         const formattedJalaliDate = `${jalaliDate.jy}/${jalaliDate.jm}/${jalaliDate.jd}`; |         const formattedJalaliDate = `${jalaliDate.jy}/${jalaliDate.jm}/${jalaliDate.jd}`; | ||||||
|         // Display the Jalali date in the HTML |         // Display the Jalali date in the HTML | ||||||
|         humanDateElement.textContent = formattedJalaliDate; |         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) { |         function copyToClipboard(text) { | ||||||
|             navigator.clipboard.writeText(text); |             navigator.clipboard.writeText(text); | ||||||
|  |  | ||||||
|  | @ -102,13 +102,16 @@ func (a *SUBController) subs(c *gin.Context) { | ||||||
| 				c.String(200, base64.StdEncoding.EncodeToString([]byte(result))) | 				c.String(200, base64.StdEncoding.EncodeToString([]byte(result))) | ||||||
| 			} else { | 			} else { | ||||||
| 				c.HTML(200, "sub.html", gin.H{ | 				c.HTML(200, "sub.html", gin.H{ | ||||||
| 					"result":   resultSlice, | 					"result":       resultSlice, | ||||||
| 					"total":    totalValue, | 					"total":        totalValue, | ||||||
| 					"expire":   expireValue, | 					"expire":       expireValue, | ||||||
| 					"upload":   upValue, | 					"upload":       upValue, | ||||||
| 					"download": downValue, | 					"download":     downValue, | ||||||
| 					"sId":      subId, | 					"totalByte":    headerMap["total"], | ||||||
| 					"subUrl":   currentURL, | 					"uploadByte":   headerMap["upload"], | ||||||
|  | 					"downloadByte": headerMap["download"], | ||||||
|  | 					"sId":          subId, | ||||||
|  | 					"subUrl":       currentURL, | ||||||
| 				}) | 				}) | ||||||
| 			} | 			} | ||||||
| 		} else { | 		} else { | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue