welcome.html 46 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121
  1. {include file="../../../application/admin/view_new/public/head" /}
  2. <div class="page-container main-body">
  3. <div class="cont-Card">
  4. <!-- Card -->
  5. <div class="cont-Card-body">
  6. <div class="cont-Card-info ">
  7. <!-- Header -->
  8. <div class="cont-Card-Header ">
  9. <!-- Icon -->
  10. <span class="cont-Card-icon">
  11. <img src="__STATIC__/images/home/[email protected]" />
  12. </span>
  13. <!-- End Icon -->
  14. </div>
  15. <!-- End Header -->
  16. <h2 class="cont-Card-H2 ">
  17. {:lang('admin/index/welcome/today_visit_count')}
  18. </h2>
  19. <div class="cont-Card-textinfo ">
  20. <h3 class="cont-Card-H3 ">
  21. {$dashboard_data['today_visit_count']}
  22. </h3>
  23. </div>
  24. </div>
  25. </div>
  26. <!-- End Card -->
  27. <!-- Card -->
  28. <div class="cont-Card-body">
  29. <div class="cont-Card-info">
  30. <!-- Header -->
  31. <div class="cont-Card-Header">
  32. <!-- Icon -->
  33. <span class="cont-Card-icon">
  34. <img src="__STATIC__/images/home/[email protected]" />
  35. </span>
  36. <!-- End Icon -->
  37. </div>
  38. <!-- End Header -->
  39. <h2 class="cont-Card-H2">
  40. {:lang('admin/index/welcome/today_money_get')}</h2>
  41. <div class="cont-Card-textinfo">
  42. <h3 class="cont-Card-H3">
  43. {$dashboard_data['today_money_get']}
  44. </h3>
  45. </div>
  46. </div>
  47. </div>
  48. <!-- End Card -->
  49. <!-- Card -->
  50. <div class="cont-Card-body">
  51. <div class="cont-Card-info">
  52. <!-- Header -->
  53. <div class="cont-Card-Header">
  54. <!-- Icon -->
  55. <span class="cont-Card-icon">
  56. <img src="__STATIC__/images/home/[email protected]" />
  57. </span>
  58. <!-- End Icon -->
  59. </div>
  60. <!-- End Header -->
  61. <h2 class="cont-Card-H2">
  62. {:lang('admin/index/welcome/filed_last_login_time')}</h2>
  63. <div class="cont-Card-textinfo">
  64. <h3 class="cont-Card-H3">
  65. {$admin.admin_last_login_time|mac_day}</h3>
  66. </div>
  67. </div>
  68. </div>
  69. <!-- End Card -->
  70. <!-- Card -->
  71. <div class="cont-Card-body">
  72. <div class="cont-Card-info">
  73. <!-- Header -->
  74. <div class="cont-Card-Header">
  75. <!-- Icon -->
  76. <span class="cont-Card-icon">
  77. <img src="__STATIC__/images/home/[email protected]" />
  78. </span>
  79. <!-- End Icon -->
  80. <div>
  81. </div>
  82. </div>
  83. <!-- End Header -->
  84. <h2 class="cont-Card-H2">
  85. {:lang('admin/index/welcome/filed_last_login_ip')}</h2>
  86. <div class="cont-Card-textinfo">
  87. <h3 class="cont-Card-H3">
  88. {$admin.admin_last_login_ip|long2ip}</h3>
  89. </div>
  90. </div>
  91. <!-- End Col -->
  92. </div>
  93. <!-- End Card -->
  94. </div>
  95. <div class="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-5">
  96. <!-- Browsers Card -->
  97. <div class="Browsers-card">
  98. <!-- Header -->
  99. <div class="Browsers-card-header">
  100. <h2 class="ms-1 inline-block font-semibold text-[16px] text-gray-800">
  101. {:lang('admin/index/welcome/system_status')}
  102. </h2>
  103. <span
  104. class="py-1 ps-1.5 pe-2 inline-flex items-center gap-x-1 text-xs font-medium rounded-[6px] bg-white border border-gray-200 text-gray-800 ">
  105. <svg class="flex-shrink-0 size-3" width="16" height="16" viewBox="0 0 16 16" fill="currentColor"
  106. xmlns="http://www.w3.org/2000/svg">
  107. <path
  108. d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zm-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z">
  109. </path>
  110. </svg>
  111. Good
  112. </span>
  113. </div>
  114. <!-- End Header -->
  115. <!-- Body -->
  116. <div class="flex flex-col justify-between h-full pb-5 px-5">
  117. <!-- Stats -->
  118. <div class="mt-5">
  119. <!-- Grid -->
  120. <div class="grid grid-cols-2 gap-3 max-md:grid-cols-1">
  121. <!-- Card -->
  122. <div class="p-3 bg-[#3C82F6] rounded-lg flex items-center">
  123. <div class="size-[46px] flex items-center justify-center rounded-full bg-white mr-3">
  124. <svg class="flex-shrink-0 size-6 text-[#3C82F6]" fill="#3C82F6"
  125. xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
  126. <path
  127. d="M176 24c0-13.3-10.7-24-24-24s-24 10.7-24 24V64c-35.3 0-64 28.7-64 64H24c-13.3 0-24 10.7-24 24s10.7 24 24 24H64v56H24c-13.3 0-24 10.7-24 24s10.7 24 24 24H64v56H24c-13.3 0-24 10.7-24 24s10.7 24 24 24H64c0 35.3 28.7 64 64 64v40c0 13.3 10.7 24 24 24s24-10.7 24-24V448h56v40c0 13.3 10.7 24 24 24s24-10.7 24-24V448h56v40c0 13.3 10.7 24 24 24s24-10.7 24-24V448c35.3 0 64-28.7 64-64h40c13.3 0 24-10.7 24-24s-10.7-24-24-24H448V280h40c13.3 0 24-10.7 24-24s-10.7-24-24-24H448V176h40c13.3 0 24-10.7 24-24s-10.7-24-24-24H448c0-35.3-28.7-64-64-64V24c0-13.3-10.7-24-24-24s-24 10.7-24 24V64H280V24c0-13.3-10.7-24-24-24s-24 10.7-24 24V64H176V24zM160 128H352c17.7 0 32 14.3 32 32V352c0 17.7-14.3 32-32 32H160c-17.7 0-32-14.3-32-32V160c0-17.7 14.3-32 32-32zm192 32H160V352H352V160z">
  128. </path>
  129. </svg>
  130. </div>
  131. <p class="text-sm text-white">Cpu</p>
  132. <p class="font-semibold text-lg text-white ml-auto mr-4" id="cpu_usage">
  133. {if condition="!empty($os_data['cpu_usage'])"}
  134. {$os_data['cpu_usage']}%
  135. {/if}
  136. </p>
  137. </div>
  138. <!-- Card -->
  139. <div class="p-3 bg-[#40CC92] rounded-lg flex items-center">
  140. <div class="size-[46px] flex items-center justify-center rounded-full bg-white mr-3">
  141. <svg xmlns="http://www.w3.org/2000/svg" fill="#40CC92" viewBox="0 0 576 512"
  142. class="flex-shrink-0 size-6 ">
  143. <path
  144. d="M64 64C28.7 64 0 92.7 0 128v7.4c0 6.8 4.4 12.6 10.1 16.3C23.3 160.3 32 175.1 32 192s-8.7 31.7-21.9 40.3C4.4 236 0 241.8 0 248.6V320H576V248.6c0-6.8-4.4-12.6-10.1-16.3C552.7 223.7 544 208.9 544 192s8.7-31.7 21.9-40.3c5.7-3.7 10.1-9.5 10.1-16.3V128c0-35.3-28.7-64-64-64H64zM576 352H0v64c0 17.7 14.3 32 32 32H80V416c0-8.8 7.2-16 16-16s16 7.2 16 16v32h96V416c0-8.8 7.2-16 16-16s16 7.2 16 16v32h96V416c0-8.8 7.2-16 16-16s16 7.2 16 16v32h96V416c0-8.8 7.2-16 16-16s16 7.2 16 16v32h48c17.7 0 32-14.3 32-32V352zM192 160v64c0 17.7-14.3 32-32 32s-32-14.3-32-32V160c0-17.7 14.3-32 32-32s32 14.3 32 32zm128 0v64c0 17.7-14.3 32-32 32s-32-14.3-32-32V160c0-17.7 14.3-32 32-32s32 14.3 32 32zm128 0v64c0 17.7-14.3 32-32 32s-32-14.3-32-32V160c0-17.7 14.3-32 32-32s32 14.3 32 32z">
  145. </path>
  146. </svg>
  147. </div>
  148. <p class="text-sm text-white">Ram</p>
  149. <p class="font-semibold text-lg text-white ml-auto mr-4" id="mem_usage">
  150. {if condition="!empty($os_data['mem_usage'])"}
  151. {$os_data['mem_usage']}%
  152. {/if}
  153. </p>
  154. </div>
  155. <!-- Card -->
  156. <!-- End Card -->
  157. </div>
  158. <!-- End Grid -->
  159. </div>
  160. <!-- End Stats -->
  161. <div class="mt-5">
  162. <ul class="space-y-2">
  163. <li class="flex justify-between items-center">
  164. <span
  165. class="text-xs uppercase text-[#4B5563]">{:lang('admin/index/welcome/mem_detail')}</span>
  166. <span class="text-sm text-gray-800 " id="mem_detail">{$os_data['mem_used']} MB/
  167. {$os_data['mem_total']} MB</span>
  168. </li>
  169. <li class="flex justify-between items-center">
  170. <span class="text-xs uppercase text-[#4B5563]">
  171. {:lang('admin/index/welcome/filed_os')}</span>
  172. <span class="text-sm text-gray-800 ">
  173. <?php echo PHP_OS ?>
  174. (
  175. <?php echo $_SERVER['SERVER_SOFTWARE'] ?>)
  176. </span>
  177. </li>
  178. <li class="flex justify-between items-center">
  179. <span
  180. class="text-xs uppercase text-[#4B5563]">{:lang('admin/index/welcome/filed_host')}</span>
  181. <span class="text-sm text-gray-800 ">
  182. <?php echo $_SERVER['HTTP_HOST'] ?>
  183. </span>
  184. </li>
  185. <li class="flex justify-between items-center">
  186. <span
  187. class="text-xs uppercase text-[#4B5563]">{:lang('admin/index/welcome/filed_max_upload')}</span>
  188. <span class="text-sm text-gray-800 ">
  189. <?php echo get_cfg_var("file_uploads") ? get_cfg_var("upload_max_filesize") : $error;?>
  190. </span>
  191. </li>
  192. <li class="flex justify-between items-center">
  193. <span
  194. class="text-xs uppercase text-[#4B5563]">{:lang('admin/index/welcome/filed_date')}</span>
  195. <span class="text-sm text-gray-800 ">
  196. <?php echo date('Y-m-d'); ?>
  197. </span>
  198. </li>
  199. <li class="flex justify-between items-center">
  200. <span
  201. class="text-xs uppercase text-[#4B5563]">{:lang('admin/index/welcome/filed_php_ver')}</span>
  202. <span class="text-sm text-gray-800 ">
  203. <?php echo PHP_VERSION ?>
  204. </span>
  205. </li>
  206. <li class="flex justify-between items-center">
  207. <span
  208. class="text-xs uppercase text-[#4B5563]">{:lang('admin/index/welcome/filed_thinkphp_ver')}</span>
  209. <span class="text-sm text-gray-800 ">
  210. <?php echo THINK_VERSION; ?>
  211. </span>
  212. </li>
  213. </li>
  214. <li class="flex justify-between items-center">
  215. <span
  216. class="text-xs uppercase text-[#4B5563]">{:lang('admin/index/welcome/filed_ver')}</span>
  217. <span class="text-sm text-gray-800 ">{$version.code}</span>
  218. </li>
  219. </ul>
  220. </div>
  221. </div>
  222. <!-- End Body -->
  223. </div>
  224. <!-- End Browsers Card -->
  225. <!-- Import Data Card -->
  226. <div class="Browsers-card">
  227. <!-- Header -->
  228. <div class="Browsers-card-header">
  229. <div>
  230. <h2 class="inline-block font-semibold text-gray-800 ">
  231. {:lang('admin/index/welcome/disk_space_usage')}</h2>
  232. <div class="hs-tooltip hover:z-10 inline-block">
  233. <svg class="flex-shrink-0 size-4 " xmlns="http://www.w3.org/2000/svg" width="24" height="24"
  234. viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
  235. stroke-linecap="round" stroke-linejoin="round">
  236. <circle cx="12" cy="12" r="10"></circle>
  237. <path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"></path>
  238. <path d="M12 17h.01"></path>
  239. </svg>
  240. <span
  241. class="hs-tooltip-content hs-tooltip-shown:opacity-100 hs-tooltip-shown:visible opacity-0 transition-opacity invisible z-10 py-1 px-2 bg-gray-900 text-xs font-medium text-white rounded-lg shadow-sm hidden"
  242. role="tooltip"
  243. style="position: fixed; inset: auto auto 0px 0px; margin: 0px; transform: translate(1110px, -600px);"
  244. data-popper-placement="top">
  245. {:lang('admin/index/welcome/disk_detail_tips')}
  246. </span>
  247. </div>
  248. </div>
  249. </div>
  250. <!-- End Header -->
  251. <!-- Body -->
  252. <div class="h-full p-5 pt-0">
  253. <div class="h-full flex flex-col justify-between space-y-4">
  254. <div class="space-y-4">
  255. <ul id="disk_list">
  256. {volist name="os_data['disk_datas']" id="disk_data" key="disk_count" }
  257. <li
  258. class="flex items-center gap-3 md:gap-10 justify-between gap-x-4 py-4 border-b border-solid border-[#E6E7EB]">
  259. <img class="size-[32px]" src="__STATIC__/images/home/[email protected]" alt=""
  260. srcset="" />
  261. <div class="grow flex flex-col gap-2">
  262. <div class="flex items-center ">
  263. <span class="flex-shrink-0 size-2.5 inline-block
  264. {switch $disk_count%7 }
  265. {case 1 }bg-blue-600{/case}
  266. {case 2}bg-teal-500{/case}
  267. {case 3}bg-orange-600{/case}
  268. {case 4}bg-yellow-300{/case}
  269. {case 5}bg-green-500{/case}
  270. {case 6}bg-violet-500{/case}
  271. {/switch}
  272. rounded-sm me-2.5">
  273. </span>
  274. <span class="text-xs text-gray-800 ">
  275. {$key}
  276. {if condition="$os_data['os_name']=='WINDOWS'"}:/{/if}
  277. </span>
  278. </div>
  279. <div class="flex items-center">
  280. <div class="flex w-full h-2 bg-stone-200 rounded-full overflow-hidden text-xs text-center hs-tooltip hover:z-10"
  281. role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100">
  282. <div class="flex flex-col justify-center overflow-hidden bg-green-600 text-xs text-white text-center rounded-full whitespace-nowrap"
  283. style="width:{$disk_data[2]}%" id="chart_{$disk_count}"></div>
  284. <span id="disk_data_{$disk_count}"
  285. class="hs-tooltip-content hs-tooltip-shown:opacity-100 hs-tooltip-shown:visible opacity-0 transition-opacity invisible z-10 py-1 px-2 bg-gray-900 text-xs font-medium text-white rounded-lg shadow-sm hidden"
  286. role="tooltip"
  287. style="position: fixed; inset: auto auto 0px 0px; margin: 0px; transform: translate(1110px, -600px);"
  288. data-popper-placement="top">
  289. {$disk_data[1]-$disk_data[0]} GB/{$disk_data[1]} GB
  290. </span>
  291. </div>
  292. </div>
  293. </div>
  294. <span id="disk_usage_{$disk_count}" class="text-[24px] font-semibold text-[#1F2937]">
  295. {$disk_data[2]}%
  296. </span>
  297. </li>
  298. {/volist}
  299. </ul>
  300. </div>
  301. </div>
  302. </div>
  303. <!-- End Body -->
  304. <!-- End Footer -->
  305. </div>
  306. <!-- End Import Data Card -->
  307. <!-- Sales Stats Card -->
  308. <div class="Browsers-card">
  309. <!-- Header -->
  310. <div class="Browsers-card-header">
  311. <h2 class="inline-block font-semibold text-gray-800 ">
  312. {:lang('admin/index/welcome/seven_day_reg_data')}
  313. </h2>
  314. </div>
  315. <!-- End Header -->
  316. <!-- Body -->
  317. <div class="h-full pb-5 px-5 space-y-8">
  318. <h4 class="text-4xl font-medium text-gray-800 Stats-Card-h4">
  319. <img class="w-[228px] h-[126px] absolute right-0 top-0"
  320. src="__STATIC__/images/home/[email protected]" alt="" srcset="" />
  321. {$dashboard_data['seven_day_reg_total_count']}
  322. {if condition="$dashboard_data['raise_reg_user_today']>0"}
  323. <svg class="inline-block align-middle size-4 text-teal-500" xmlns="http://www.w3.org/2000/svg"
  324. width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
  325. stroke-linecap="round" stroke-linejoin="round">
  326. <polyline points="22 7 13.5 15.5 8.5 10.5 2 17"></polyline>
  327. <polyline points="16 7 22 7 22 13"></polyline>
  328. </svg>
  329. <p class="text-sm text-green-500">
  330. {else /}
  331. <svg class="inline-block align-top mt-1 size-5 text-red-500" xmlns="http://www.w3.org/2000/svg"
  332. width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor"
  333. stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  334. <polyline points="22 17 13.5 8.5 8.5 13.5 2 7"></polyline>
  335. <polyline points="16 17 22 17 22 11"></polyline>
  336. </svg>
  337. <p class="text-sm text-red-500">
  338. {/if}
  339. <span class="text-[#4B5563]">用户注册量</span>
  340. {$dashboard_data['raise_reg_user_today']}%
  341. </p>
  342. </h4>
  343. <!-- List Group -->
  344. <ul class="space-y-3">
  345. <!-- List Item -->
  346. <li
  347. class="flex flex-wrap py-2 justify-between items-center gap-x-2 border-b border-solid border-[#E6E7EB]">
  348. <div>
  349. <div class="flex items-center gap-x-2">
  350. <div class="inline-block size-2.5 bg-blue-600 rounded-sm"></div>
  351. <h2 class="inline-block align-middle text-gray-500 ">
  352. {:lang('admin/index/welcome/reg_users_count')}</h2>
  353. </div>
  354. </div>
  355. <div>
  356. <span class="text-gray-800 ">
  357. {$dashboard_data['user_count']}
  358. </span>
  359. </div>
  360. </li>
  361. <!-- End List Item -->
  362. <!-- List Item -->
  363. <li
  364. class="flex flex-wrap py-2 justify-between items-center gap-x-2 border-b border-solid border-[#E6E7EB]">
  365. <div>
  366. <div class="flex items-center gap-x-2">
  367. <div class="inline-block size-2.5 bg-purple-600 rounded-sm"></div>
  368. <h2 class="inline-block align-middle text-gray-500 ">
  369. {:lang('admin/index/welcome/active_reg_users_count')}</h2>
  370. </div>
  371. </div>
  372. <div>
  373. <span class="text-gray-800 ">
  374. {$dashboard_data['user_active_count']}
  375. </span>
  376. </div>
  377. </li>
  378. <!-- End List Item -->
  379. <!-- List Item -->
  380. <!-- End List Item -->
  381. </ul>
  382. <!-- End List Group -->
  383. </div>
  384. <!-- End Body -->
  385. <!-- Footer -->
  386. <div class="p-5 pt-0 space-y-8">
  387. <div class="w-full">
  388. <!-- Apex Line Chart -->
  389. <div id="hs-total-sales-lines-chart" style="min-height: 100px;"></div>
  390. </div>
  391. </div>
  392. <!-- End Footer -->
  393. </div>
  394. <!-- End Sales Stats Card -->
  395. </div>
  396. <div class="flex flex-col bg-white border border-gray-200 shadow-sm rounded-xl">
  397. <!-- Header -->
  398. <div class="Browsers-card-header">
  399. <!-- Select -->
  400. <div class="relative inline-block">
  401. <div class="hs-select relative">
  402. <h2 class="inline-block font-semibold text-gray-800 ">
  403. {:lang('admin/index/welcome/seven_day_visit_data')}
  404. </h2>
  405. </div>
  406. </div>
  407. <!-- End Select -->
  408. <div class="md:justify-end">
  409. <div class="w-48">
  410. <input type="text" class="layui-input" id="date-range" placeholder="请选择日期范围">
  411. </div>
  412. </div>
  413. <!-- End Col -->
  414. </div>
  415. <!-- End Header -->
  416. <div class="flex items-center w-full p-5 h-[300px] max-md:flex-col max-md:h-[500px]">
  417. <div class="visits ">
  418. <img class="w-full h-[82px] absolute left-0 bottom-0 max-md:w-fit max-md:left-auto max-md:right-0"
  419. src="__STATIC__/images/home/[email protected]" alt="" srcset="" />
  420. <h4 class="text-2xl flex gap-2 font-semibold text-gray-800 ">
  421. <div id="visit_sum">{$dashboard_data['seven_day_visit_total_count']}</div>
  422. {if condition="$dashboard_data['raise_visit_user_today']<=0"} <svg
  423. class="inline-block align-top mt-1 size-5 text-red-500" xmlns="http://www.w3.org/2000/svg"
  424. width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
  425. stroke-linecap="round" stroke-linejoin="round">
  426. <polyline points="22 17 13.5 8.5 8.5 13.5 2 7"></polyline>
  427. <polyline points="16 17 22 17 22 11"></polyline>
  428. </svg>
  429. </h4>
  430. <p class="text-sm text-red-500">
  431. {else /}
  432. <svg class="inline-block align-middle size-4 text-teal-500" xmlns="http://www.w3.org/2000/svg"
  433. width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
  434. stroke-linecap="round" stroke-linejoin="round">
  435. <polyline points="22 7 13.5 15.5 8.5 10.5 2 17"></polyline>
  436. <polyline points="16 7 22 7 22 13"></polyline>
  437. </svg>
  438. </h4>
  439. <p class="text-sm text-green-500">
  440. {/if}
  441. {$dashboard_data['raise_visit_user_today']}%
  442. </p>
  443. </div>
  444. <div class="flex flex-col flex-1 h-full">
  445. <!-- Legend Indicator -->
  446. <div class="flex px-5 justify-center sm:justify-end items-center gap-x-4 mt-5 sm:mt-0 sm:mb-6">
  447. <div class="inline-flex items-center">
  448. <span class="size-2.5 inline-block bg-blue-600 rounded-sm me-2"></span>
  449. <span class="text-[13px] text-gray-600 ">日訪問量</span>
  450. </div>
  451. </div>
  452. <!-- End Legend Indicator -->
  453. <!-- Apex Line Chart -->
  454. <div id="hs-visit-line-chart" class="h-full"></div>
  455. </div>
  456. </div>
  457. </div>
  458. <!-- End Double Area Chart in Card -->
  459. <div class="pb-5 flex flex-col bg-white border border-stone-200 shadow-sm rounded-xl">
  460. <!-- Header -->
  461. <div class="Browsers-card-header">
  462. <h2 class="inline-block font-semibold text-stone-800 ">
  463. 近七日爬虫次数
  464. </h2>
  465. <!-- Select -->
  466. <div class="ml-auto relative inline-block layui-form layui-input-inline w-[100px]">
  467. <select id="hs-pro-select-currency" lay-filter="spider_type">
  468. <option value="Google" selected>Google</option>
  469. <option value="Baidu">Baidu</option>
  470. <option value="Sogou">Sogou</option>
  471. <option value="SOSO">SOSO</option>
  472. <option value="Yahoo">Yahoo</option>
  473. <option value="MSN">MSN</option>
  474. <option value="msnbot">msnbot</option>
  475. <option value="Sohu">Sohu</option>
  476. <option value="Yodao">Yodao</option>
  477. <option value="Twiceler">Twiceler</option>
  478. <option value="Alexa">Alexa</option>
  479. <option value="360">360</option>
  480. <option value="so.com">so.com</option>
  481. </select>
  482. </div>
  483. <!-- End Select -->
  484. </div>
  485. <!-- End Header -->
  486. <!-- Apex Line Chart -->
  487. <div id="hs-all-time-earnings-line-charts" class="min-h-[300px] mt-5"></div>
  488. </div>
  489. <!-- <blockquote class="layui-elem-quote layui-quote-nm mt10">-->
  490. <!-- <p class="f-20 text-success">{:lang('admin/index/welcome/tip_warn')}</p>-->
  491. <!-- <p>{:lang('admin/index/welcome/filed_login_num')}:{$admin.admin_login_num} {:lang('admin/index/welcome/filed_last_login_ip')}:{$admin.admin_last_login_ip|long2ip} {:lang('admin/index/welcome/filed_last_login_time')}:{$admin.admin_last_login_time|mac_day}</p>-->
  492. <!-- </blockquote>-->
  493. <!-- <table class="layui-table" >-->
  494. <!-- <tbody>-->
  495. <!-- <tr>-->
  496. <!-- <td width="110">{:lang('admin/index/welcome/filed_os')}</td>-->
  497. <!-- <td><?php echo PHP_OS ?> (<?php echo $_SERVER['SERVER_SOFTWARE'] ?>)</td>-->
  498. <!-- </tr>-->
  499. <!-- <tr>-->
  500. <!-- <td>{:lang('admin/index/welcome/filed_host')}</td>-->
  501. <!-- <td><?php echo $_SERVER['HTTP_HOST'] ?></td>-->
  502. <!-- </tr>-->
  503. <!-- <tr>-->
  504. <!-- <td>{:lang('admin/index/welcome/filed_max_upload')}</td>-->
  505. <!-- <td><?php echo get_cfg_var("file_uploads") ? get_cfg_var("upload_max_filesize") : $error;?></td>-->
  506. <!-- </tr>-->
  507. <!-- <tr>-->
  508. <!-- <td>{:lang('admin/index/welcome/filed_date')}</td>-->
  509. <!-- <td><?php echo date('Y-m-d'); ?></td>-->
  510. <!-- </tr>-->
  511. <!-- <tr>-->
  512. <!-- <td>{:lang('admin/index/welcome/filed_php_ver')}</td>-->
  513. <!-- <td><?php echo PHP_VERSION ?></td>-->
  514. <!-- </tr>-->
  515. <!-- <tr>-->
  516. <!-- <td>{:lang('admin/index/welcome/filed_thinkphp_ver')}</td>-->
  517. <!-- <td><?php echo THINK_VERSION; ?></td>-->
  518. <!-- </tr>-->
  519. <!-- <tr>-->
  520. <!-- <td>{:lang('admin/index/welcome/filed_ver')}</td>-->
  521. <!-- <td><span class="layui-badge">{$version.code}</span></td>-->
  522. <!-- </tr>-->
  523. <!-- </tbody>-->
  524. <!-- </table>-->
  525. {if condition="$update_sql"}
  526. <table class="tbinfo pleft layui-table">
  527. <thead>
  528. <th colspan="2">{:lang('admin/index/welcome/tip_update_db')}</th>
  529. </thead>
  530. <tr>
  531. <td colspan="2">
  532. <font class="tif s20">{:lang('admin/index/welcome/tip_update_db_txt')}</font><a class="j-iframe"
  533. title="{:lang('admin/index/welcome/tip_update_go')}" data-href="{:url('update/step2')}">
  534. <font class="tit s20">{:lang('admin/index/welcome/tip_update_go')}</font>
  535. </a>
  536. </td>
  537. </tr>
  538. </table>
  539. {/if}
  540. </div>
  541. <link id="apexcharts-css" rel="stylesheet" href="__STATIC__/css/apexcharts.css">
  542. <script src="__STATIC__/js/apexcharts.min.js"></script>
  543. <script src="__STATIC__/js/hs-apexcharts-helpers.js"></script>
  544. <script>
  545. (function () {
  546. buildChart(
  547. "#hs-total-sales-lines-chart",
  548. (mode) => ({
  549. series: [
  550. {
  551. name: "{:lang('admin/index/welcome/reg_users_count')}",
  552. data: <?= json_encode($dashboard_data['seven_day_reg_count']) ?>
  553. }
  554. ],
  555. chart: {
  556. height: 100,
  557. type: "line",
  558. sparkline: {
  559. enabled: true
  560. }
  561. },
  562. stroke: {
  563. curve: "straight",
  564. width: 2
  565. },
  566. xaxis: {
  567. type: "category",
  568. categories: <?= json_encode($dashboard_data['seven_day_reg_day']) ?>
  569. },
  570. crosshairs: {
  571. show: false
  572. },
  573. markers: {
  574. hover: {
  575. size: 0
  576. }
  577. },
  578. tooltip: {
  579. custom: function (props) {
  580. const { categories } = props.ctx.opts.xaxis;
  581. const { dataPointIndex } = props;
  582. const title = categories[dataPointIndex];
  583. return buildTooltip(props, {
  584. title: title,
  585. mode,
  586. hasTextLabel: true,
  587. wrapperExtClasses: "kfx52",
  588. labelDivider: ":",
  589. labelExtClasses: "qupk7"
  590. });
  591. }
  592. }
  593. }),
  594. {
  595. colors: ["#9333ea"],
  596. grid: {
  597. borderColor: "#e5e7eb"
  598. },
  599. fill: {
  600. type: "gradient",
  601. gradient: {
  602. gradientToColors: ["#fff", "#fff", "#fff"]
  603. }
  604. }
  605. },
  606. {
  607. colors: ["#3b82f6", "#a855f7", "#737373"],
  608. grid: {
  609. borderColor: "#404040"
  610. },
  611. fill: {
  612. type: "gradient",
  613. gradient: {
  614. gradientToColors: ["#262626", "#262626", "#262626"]
  615. }
  616. }
  617. }
  618. );
  619. })();
  620. var options = {
  621. series: [{
  622. name: "Visitors",
  623. data: <?= json_encode($dashboard_data['seven_day_visit_count']) ?>
  624. }],
  625. colors: ['#2563eb', '#9333ea'],
  626. fill: {
  627. gradient: {
  628. stops: [0, 90, 100]
  629. }
  630. },
  631. chart: {
  632. height: $('#hs-visit-line-chart').height(),
  633. type: 'area',
  634. toolbar: {
  635. show: false
  636. },
  637. zoom: {
  638. enabled: false
  639. }
  640. },
  641. dataLabels: {
  642. enabled: false
  643. },
  644. stroke: {
  645. curve: 'straight',
  646. width: 2
  647. },
  648. fill: {
  649. type: 'gradient',
  650. gradient: {
  651. type: 'vertical',
  652. shadeIntensity: 1,
  653. opacityFrom: 0.2,
  654. opacityTo: 0.8
  655. }
  656. },
  657. grid: {
  658. row: {
  659. colors: ['#f3f3f3', 'transparent'],
  660. opacity: 0.2
  661. }
  662. },
  663. xaxis: {
  664. type: 'category',
  665. tickPlacement: 'on',
  666. categories: <?= json_encode($dashboard_data['seven_day_visit_day']) ?>,
  667. axisBorder: {
  668. show: false
  669. },
  670. axisTicks: {
  671. show: false
  672. },
  673. crosshairs: {
  674. stroke: {
  675. dashArray: 0
  676. },
  677. dropShadow: {
  678. show: false
  679. }
  680. },
  681. tooltip: {
  682. x: {
  683. format: 'MMMM yyyy'
  684. },
  685. y: {
  686. formatter: (value) => `$${value >= 1000 ? `${value / 1000}k` : value}`
  687. },
  688. custom: function (props) {
  689. return buildTooltipCompareTwo(props, {
  690. title: 'Revenue',
  691. mode,
  692. hasTextLabel: true,
  693. wrapperExtClasses: 'min-w-48'
  694. });
  695. }
  696. },
  697. labels: {
  698. style: {
  699. colors: '#9ca3af',
  700. fontSize: '13px',
  701. fontFamily: 'Inter, ui-sans-serif',
  702. fontWeight: 400
  703. }
  704. }
  705. },
  706. yaxis: {
  707. labels: {
  708. align: 'left',
  709. minWidth: 0,
  710. maxWidth: 140,
  711. style: {
  712. colors: '#9ca3af',
  713. fontSize: '12px',
  714. fontFamily: 'Inter, ui-sans-serif',
  715. fontWeight: 400
  716. },
  717. formatter: (value) => value >= 1000 ? `${value / 1000}k` : value
  718. }
  719. },
  720. responsive: [{
  721. breakpoint: 568,
  722. options: {
  723. chart: {
  724. height: 300
  725. },
  726. labels: {
  727. style: {
  728. colors: '#9ca3af',
  729. fontSize: '11px',
  730. fontFamily: 'Inter, ui-sans-serif',
  731. fontWeight: 400
  732. },
  733. offsetX: -2,
  734. formatter: (title) => title.slice(0, 3)
  735. },
  736. yaxis: {
  737. labels: {
  738. align: 'left',
  739. minWidth: 0,
  740. maxWidth: 140,
  741. style: {
  742. colors: '#9ca3af',
  743. fontSize: '11px',
  744. fontFamily: 'Inter, ui-sans-serif',
  745. fontWeight: 400
  746. },
  747. formatter: (value) => value >= 1000 ? `${value / 1000}k` : value
  748. }
  749. }
  750. }
  751. }]
  752. };
  753. var chart = new ApexCharts(document.querySelector("#hs-visit-line-chart"), options);
  754. chart.render();
  755. layui.use(['laydate'], function () {
  756. var laydate = layui.laydate;
  757. //日期范围
  758. laydate.render({
  759. elem: '#date-range'
  760. , type: 'date'
  761. , range: true
  762. , max: 0 //最大日期为今天
  763. , value: getLastSevenDays() //默认最近7天
  764. , done: function (value, date, endDate) {
  765. var dates = value.split(' - ');
  766. $.ajax({
  767. url: ADMIN_PATH + '/admin/index/rangeDateDailyVisit.html',
  768. data: {
  769. startDate: dates[0],
  770. endDate: dates[1]
  771. },
  772. method: "POST",
  773. success: function (data) {
  774. chart.updateOptions({
  775. xaxis: {
  776. categories: JSON.parse(data).days
  777. },
  778. series: [{
  779. name: "Visitors",
  780. data: JSON.parse(data).count
  781. }],
  782. });
  783. $('#visit_sum').text(JSON.parse(data).sum);
  784. },
  785. error: function (xhr, status, error) {
  786. layer.msg('获取数据失败');
  787. }
  788. });
  789. }
  790. });
  791. //获取最近7天的日期范围
  792. function getLastSevenDays() {
  793. var end = new Date();
  794. var start = new Date();
  795. start.setTime(start.getTime() - 3600 * 1000 * 24 * 6);
  796. return formatDate(start) + ' - ' + formatDate(end);
  797. }
  798. //格式化日期
  799. function formatDate(date) {
  800. var year = date.getFullYear();
  801. var month = date.getMonth() + 1;
  802. var day = date.getDate();
  803. month = month < 10 ? '0' + month : month;
  804. day = day < 10 ? '0' + day : day;
  805. return year + '-' + month + '-' + day;
  806. }
  807. });
  808. var chart_spider = buildChart('#hs-all-time-earnings-line-charts', (mode) => ({
  809. chart: {
  810. height: 400,
  811. type: 'area',
  812. toolbar: {
  813. show: false
  814. },
  815. zoom: {
  816. enabled: false
  817. }
  818. },
  819. series: [
  820. {
  821. name: 'Referrals',
  822. data: <?= json_encode($spider_data['Google']['values']) ?>
  823. }
  824. ],
  825. legend: {
  826. show: false
  827. },
  828. dataLabels: {
  829. enabled: false
  830. },
  831. stroke: {
  832. curve: 'smooth',
  833. width: 2
  834. },
  835. fill: {
  836. type: 'gradient',
  837. gradient: {
  838. type: 'vertical',
  839. shadeIntensity: 1,
  840. opacityFrom: 0.2,
  841. opacityTo: 0.8
  842. }
  843. },
  844. xaxis: {
  845. type: 'category',
  846. tickPlacement: 'on',
  847. categories: <?= json_encode($spider_data['Google']['key']) ?>,
  848. axisBorder: {
  849. show: false
  850. },
  851. axisTicks: {
  852. show: false
  853. },
  854. crosshairs: {
  855. stroke: {
  856. dashArray: 0
  857. },
  858. dropShadow: {
  859. show: false
  860. }
  861. },
  862. tooltip: {
  863. enabled: false
  864. },
  865. labels: {
  866. style: {
  867. colors: '#a8a29e',
  868. fontSize: '13px',
  869. fontFamily: 'Inter, ui-sans-serif',
  870. fontWeight: 400
  871. },
  872. formatter: (title) => title ? title.slice(0, 3) : title
  873. }
  874. },
  875. yaxis: {
  876. labels: {
  877. align: 'left',
  878. minWidth: 0,
  879. maxWidth: 140,
  880. style: {
  881. colors: '#a8a29e',
  882. fontSize: '12px',
  883. fontFamily: 'Inter, ui-sans-serif',
  884. fontWeight: 400
  885. },
  886. formatter: (value) => value >= 1000 ? `${value / 1000}k` : value
  887. }
  888. },
  889. tooltip: {
  890. y: {
  891. formatter: (value) => `$${value >= 1000 ? `${value / 1000}k` : value}`
  892. },
  893. custom: function (props) {
  894. const { categories } = props.ctx.opts.xaxis;
  895. const { dataPointIndex } = props;
  896. const title = categories[dataPointIndex];
  897. const newTitle = `${title}`;
  898. return buildTooltip(props, {
  899. title: newTitle,
  900. mode,
  901. valuePrefix: '',
  902. hasCategory: false,
  903. hasTextLabel: true,
  904. wrapperExtClasses: 'min-w-[130px]',
  905. labelDivider: ':',
  906. labelExtClasses: 'ms-2'
  907. });
  908. }
  909. },
  910. responsive: [{
  911. breakpoint: 568,
  912. options: {
  913. chart: {
  914. height: 200
  915. },
  916. labels: {
  917. style: {
  918. colors: '#a8a29e',
  919. fontSize: '11px',
  920. fontFamily: 'Inter, ui-sans-serif',
  921. fontWeight: 400
  922. },
  923. offsetX: -2,
  924. formatter: (title) => title.slice(0, 3)
  925. },
  926. yaxis: {
  927. labels: {
  928. align: 'left',
  929. minWidth: 0,
  930. maxWidth: 140,
  931. style: {
  932. colors: '#a8a29e',
  933. fontSize: '11px',
  934. fontFamily: 'Inter, ui-sans-serif',
  935. fontWeight: 400
  936. },
  937. formatter: (value) => value >= 1000 ? `${value / 1000}k` : value
  938. }
  939. }
  940. }
  941. }]
  942. }),
  943. {
  944. colors: ['#16a34a'],
  945. fill: {
  946. gradient: {
  947. stops: [0, 90, 100]
  948. }
  949. },
  950. grid: {
  951. strokeDashArray: 2,
  952. borderColor: '#e5e5e5'
  953. },
  954. xaxis: {
  955. labels: {
  956. style: {
  957. colors: '#a8a29e'
  958. }
  959. }
  960. },
  961. yaxis: {
  962. labels: {
  963. style: {
  964. colors: '#a8a29e'
  965. }
  966. }
  967. }
  968. },
  969. {
  970. colors: ['#22c55e'],
  971. fill: {
  972. gradient: {
  973. stops: [100, 90, 0]
  974. }
  975. },
  976. grid: {
  977. strokeDashArray: 2,
  978. borderColor: '#44403c'
  979. },
  980. xaxis: {
  981. labels: {
  982. style: {
  983. colors: '#a3a3a3'
  984. }
  985. }
  986. },
  987. yaxis: {
  988. labels: {
  989. style: {
  990. colors: '#a3a3a3'
  991. }
  992. }
  993. }
  994. }
  995. );
  996. function showSpiderData() {
  997. console.log("showSpiderData -> showSpiderData")
  998. $.ajax({
  999. url: ADMIN_PATH + '/admin/index/botlist.html',
  1000. data: {
  1001. category: $('#hs-pro-select-currency').val()
  1002. },
  1003. method: "POST",
  1004. success: function (data) {
  1005. console.log("showSpiderData -> data", data.key)
  1006. chart_spider.updateOptions({
  1007. xaxis: {
  1008. categories: data.key ? data.key : data.keys
  1009. },
  1010. series: [{
  1011. name: "Spider_Visit",
  1012. data: data.values
  1013. }]
  1014. });
  1015. },
  1016. error: function (xhr, status, error) {
  1017. // Handle error
  1018. }
  1019. });
  1020. }
  1021. function update_system_status() {
  1022. $.ajax({
  1023. url: ADMIN_PATH + '/admin/index/get_system_status.html',
  1024. method: "GET",
  1025. success: function (data) {
  1026. if (data.cpu_usage != 'undefine') {
  1027. $('#cpu_usage').text(data.cpu_usage + '%');
  1028. }
  1029. if (data.mem_usage != 'undefine') {
  1030. $('#mem_usage').text(data.mem_usage + '%');
  1031. }
  1032. var i = 1;
  1033. for (const [key, value] of Object.entries(data.disk_datas)) {
  1034. $('#mem_detail').text(roundTo(data.mem_used, 2) + ' MB/' + roundTo(data.mem_total, 2) + ' MB');
  1035. $('#chart_' + i).css('width', data.disk_datas[key][2] + '%');
  1036. $('#disk_usage_' + i).text(data.disk_datas[key][2] + '%');
  1037. $('#disk_data_' + i).text(roundTo(data.disk_datas[key][1] - data.disk_datas[key][0], 2) + ' GB/' + roundTo(data.disk_datas[key][1], 2) + ' GB');
  1038. i++;
  1039. }
  1040. },
  1041. error: function (xhr, status, error) {
  1042. // Handle error
  1043. }
  1044. });
  1045. }
  1046. roundTo = function (num, decimal) {
  1047. return Math.round((num + Number.EPSILON) * Math.pow(10, decimal)) / Math.pow(10, decimal);
  1048. }
  1049. window.onload = () => {
  1050. update_system_status()
  1051. showSpiderData()
  1052. // $('.fade').fadeIn("slow");
  1053. // $('.tbinfo').css("display","none");
  1054. }
  1055. layui.use(['layer', 'form'], function (params) {
  1056. var $ = layui.jquery, layer = layui.layer, form = layui.form;
  1057. form.on('select(spider_type)', function (data) {
  1058. showSpiderData()
  1059. });
  1060. })
  1061. </script>
  1062. {include file="../../../application/admin/view_new/public/foot" /}
  1063. </body>
  1064. </html>