1
0

index.html 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620
  1. {include file="../../../application/admin/view_new/public/head" /}
  2. <link rel="stylesheet" href="__STATIC__/css/update.css">
  3. <style type="text/css">
  4. .hs-iframe {
  5. width: 100%;
  6. height: 100%;
  7. }
  8. .layui-tab-content {
  9. top: 60px;
  10. position: absolute;
  11. bottom: 0;
  12. width: 100%;
  13. padding: 20px 20px 0 20px;
  14. background: #f9fafb;
  15. }
  16. .layui-tab-item {
  17. height: 100%;
  18. }
  19. .layui-tab-title .layui-this:after {
  20. border: none;
  21. }
  22. .footer {
  23. position: fixed;
  24. left: 0;
  25. bottom: 0;
  26. z-index: 998;
  27. }
  28. .footer .text-footer {
  29. width: 100%;
  30. background: #fff;
  31. line-height: 30px;
  32. height: 30px;
  33. color: rgba(96, 101, 118, 1);
  34. font-size: 12px;
  35. }
  36. </style>
  37. <div class="layui-layout layui-layout-admin w-full">
  38. <div class="layui-header maccmsTop max-sm:!hidden">
  39. <div class="fl maccms-header-logo">
  40. <img class="header-logo-img" src="__STATIC__/images/[email protected]" alt="" />
  41. {:lang('admin/index/index/name')}
  42. </div>
  43. </div>
  44. <div class="layui-header header-top px-2">
  45. <div class="top-logo flex gap-2 items-center mr-auto">
  46. <img class="size-12" src="__STATIC__/images/[email protected]" alt="" />
  47. {:lang('admin/index/index/name')}
  48. </div>
  49. <ul class="layout-right" lay-filter="">
  50. <li class="nav-item">
  51. <a href="__ROOT__/" target="_blank"><i class="layui-icon layui-icon-home"></i></a>
  52. </li>
  53. <li class="nav-item ">
  54. <a href="{:url('index/clear')}" class="j-ajax " refresh="yes">
  55. <i class="layui-icon layui-icon-delete size-16"></i>
  56. </a>
  57. </li>
  58. <li class="nav-item">
  59. <a class="site-tree-mobile" href="javascript:;" id="admin_name">
  60. <i class="layui-icon"></i>
  61. </a>
  62. </li>
  63. </ul>
  64. </div>
  65. <div class="layui-side" id="switchNav">
  66. <div class="layui-side-scroll navBar" id="navBar">
  67. {volist name="menus" id="v" key="k"}
  68. <ul class="layui-nav layui-nav-tree">
  69. <!-- layui-nav-itemed-->
  70. <li class="layui-nav-item">
  71. <a class="nav-row" href="javascript:;">
  72. <img class="nav-icon" src="__STATIC__/images/nav/left_ic_{$k}[email protected]" alt="" srcset="" />
  73. {$v['name']}
  74. <i class=" maccms-icon macCms-a-zu1679"></i>
  75. </a>
  76. <dl class="layui-nav-child">
  77. {volist name="v['sub']" id="vv" key="kk"}
  78. <dd>
  79. {if condition="($vv['url'] !=='###')"}
  80. <a class="admin-nav-item" data-id="{$key}{$kk}" href="{$vv['url']}">
  81. <i class="{$vv['icon']}"></i> {$vv['name']}
  82. </a>
  83. {else}
  84. <!-- <hr class="layui-bg-gray"/>-->
  85. {/if}
  86. </dd>
  87. {/volist}
  88. </dl>
  89. </li>
  90. </ul>
  91. {/volist}
  92. <ul class="layui-nav layui-nav-tree md:hidden">
  93. <li class="layui-nav-item">
  94. <a class="nav-row" href="javascript:;" onclick="chanage_version()">
  95. <svg class="nav-icon" width="20px" height="20px" viewBox="0 0 20 20" version="1.1"
  96. xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
  97. <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
  98. <g id="超级控制台_首页_1122" transform="translate(-1880.000000, -21.000000)">
  99. <g id="top_ic_old" transform="translate(1880.000000, 21.000000)">
  100. <rect id="矩形" fill="currentColor" opacity="0" x="0" y="0" width="20"
  101. height="20"></rect>
  102. <path
  103. d="M18.4424065,7.27519736 C18.4284666,7.23333945 18.4145268,7.19148155 18.3866471,7.14962365 C18.3448276,7.06590784 18.3030081,6.9682394 18.2751284,6.87057096 L18.2611886,6.85661832 C18.1914894,6.67523407 18.1078503,6.49384983 17.9963316,6.31246558 C17.703595,5.76831283 16.7975055,4.87534423 15.2641233,4.84743896 C14.4695525,4.86139159 13.3683052,5.08463374 12.6713133,6.14503396 C12.6294938,6.2008445 12.6016141,6.25665504 12.5737344,6.29851294 L9.40939105,12.9678722 L6.34262656,6.31246558 C6.13352898,5.85202864 5.57593544,5.64273912 5.11592076,5.86598127 C4.65590609,6.07527079 4.44680851,6.63337617 4.65590609,7.09381311 L7.88994864,14.0701303 L7.90388848,14.084083 C8.32208364,14.8654305 8.85179751,15.2700569 9.50696992,15.2700569 C10.1203228,15.2421516 10.622157,14.8375252 10.9845928,14.0422251 L14.2325752,7.17752891 C14.2325752,7.16357628 14.246515,7.16357628 14.246515,7.14962365 C14.3301541,7.0100973 14.5392517,6.68918671 15.2780631,6.68918671 L15.2920029,6.68918671 C16.0447542,6.70313934 16.3653705,7.12171838 16.40719,7.19148155 C16.4211299,7.21938682 16.4350697,7.26124472 16.4629494,7.27519736 C16.4908291,7.31705526 16.5326486,7.42867634 16.5744681,7.52634478 C16.6162876,7.63796585 16.672047,7.76353956 16.7278063,7.88911327 C17.0066031,8.76812925 17.1599413,9.63319258 17.1599413,10.4703507 C17.1599413,12.5492932 16.4350697,14.3212778 14.9574468,15.8700202 C13.382245,17.3769047 11.6118855,18.1163943 9.52090976,18.1163943 C7.37417461,18.1163943 5.60381511,17.3908574 4.11225238,15.8839728 C2.57887014,14.4189462 1.85399853,12.633009 1.85399853,10.4843033 C1.85399853,8.33559758 2.57887014,6.563613 4.09831255,5.04277584 C5.24137931,3.84284927 6.74688188,3.08940701 8.43360235,2.89407013 C9.24211299,2.82430696 9.57666911,2.82430696 10.5106383,2.89407013 C10.622157,2.90802276 11.5840059,3.04754911 12.3925165,3.34055443 C12.6294938,3.42427024 12.8804109,3.41031761 13.1034483,3.31264916 C13.3264857,3.20102809 13.5077036,3.03359648 13.5774028,2.79640169 L13.5913426,2.75454379 L13.5913426,2.74059115 C13.6610418,2.517349 13.647102,2.28015421 13.5495231,2.0708647 C13.4380044,1.84762254 13.2707263,1.68019093 13.0337491,1.59647512 C12.0440205,1.23370663 10.8312546,1.05232238 10.6360968,1.05232238 C9.60454879,0.982559207 9.18635363,0.982559207 8.25238445,1.05232238 C6.09170946,1.31742243 4.19589142,2.25224894 2.76008804,3.75913347 C0.89214967,5.62878649 0,7.83330274 0,10.4982559 C0,13.1632091 0.906089508,15.3677254 2.77402788,17.2234257 C4.61408657,19.0651735 6.87234043,20 9.49303008,20 C12.0440205,20 14.3022744,19.0651735 16.239912,17.2234257 C18.0660308,15.3119148 19,13.051588 19,10.4982559 C18.9860602,9.45180833 18.8048423,8.36350285 18.4424065,7.27519736 Z"
  104. id="路径" fill="currentColor" fill-rule="nonzero"></path>
  105. </g>
  106. </g>
  107. </g>
  108. </svg>
  109. 切换旧版本
  110. </a>
  111. </li>
  112. </ul>
  113. <ul class="layui-nav layui-nav-tree md:hidden">
  114. <li class="layui-nav-item">
  115. <a class="nav-row" href="javascript:;">
  116. <svg class="nav-icon" width="20px" height="20px" viewBox="0 0 20 20" version="1.1"
  117. xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
  118. <defs>
  119. <rect id="path-1" x="0" y="0" width="20" height="20"></rect>
  120. </defs>
  121. <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
  122. <g id="超级控制台_首页_1122" transform="translate(-1787.000000, -188.000000)">
  123. <g id="编组-9" transform="translate(1787.000000, 188.000000)">
  124. <g id="Clipped"
  125. transform="translate(10.000000, 10.000000) scale(1, -1) translate(-10.000000, -10.000000) ">
  126. <mask id="mask-2" fill="white">
  127. <use xlink:href="#path-1"></use>
  128. </mask>
  129. <g id="align-right"></g>
  130. <g id="编组" mask="url(#mask-2)" fill="currentColor">
  131. <g transform="translate(2.173913, 8.847826)" id="矩形">
  132. <rect x="0" y="0" width="3" height="3" rx="1.5"></rect>
  133. <rect x="6" y="0" width="3" height="3" rx="1.5"></rect>
  134. <rect x="12" y="0" width="3" height="3" rx="1.5"></rect>
  135. </g>
  136. </g>
  137. </g>
  138. </g>
  139. </g>
  140. </g>
  141. </svg>
  142. 操作
  143. <i class=" maccms-icon macCms-a-zu1679"></i>
  144. </a>
  145. <dl class="layui-nav-child">
  146. <dd>
  147. <a href="{:url('index/clear')}" class="j-ajax"
  148. refresh="yes">{:lang('admin/index/index/menu_cache_clear')}</a>
  149. </dd>
  150. <dd><a href="javascript:void(0);" id="lockScreen">{:lang('admin/index/index/menu_lock')}</a>
  151. </dd>
  152. <dd><a href="{:url('index/logout')}">{:lang('admin/index/index/menu_logout')}</a></dd>
  153. </dl>
  154. </li>
  155. </ul>
  156. </div>
  157. </div>
  158. <div class="site-mobile-shade"></div>
  159. <div class="layui-body" id="switchBody">
  160. <div class="layui-tab mag0" id="top_tabs_box" lay-filter="macTab" lay-allowClose="true">
  161. <ul class="layui-tab-title" id="B_history">
  162. <li lay-id="111" class="layui-this">{:lang('admin/index/index/menu_welcome')}</li>
  163. </ul>
  164. <div class="bottom-nav">
  165. <ul class="layui-nav layui-layout-right layui-form flex gap-1 items-center h-[60px]" lay-filter="demo">
  166. <li class="layui-nav-item" >
  167. <a href="javascript:;">{:lang('admin/index/index/menu_opt')}</a>
  168. <dl class="layui-nav-child">
  169. <dd><a href="javascript:;" class="closePageAll">&nbsp;{:lang('admin/index/index/menu_close_all')}</a></dd>
  170. <dd><a href="javascript:;" class="closePageOther">&nbsp;{:lang('admin/index/index/menu_close_other')}</a></dd>
  171. </dl>
  172. </li>
  173. <div class="layui-input-inline w-[150px]">
  174. <select id="languageSelect" name="app[lang]" lay-filter="lang">
  175. <option value="">{:lang('install/select_lang')}</option>
  176. {volist name="langs" id="vo"}
  177. <option value="{$vo}" {if condition="$config['app']['lang'] eq $vo" } selected {/if}>{$vo}
  178. </option>
  179. {/volist}
  180. </select>
  181. </div>
  182. <li class="layui-nav-item flex-shrink-0">
  183. <a href="javascript:void(0);" class="hover:!text-[#40CC92] cursor-pointer !px-[10px]"
  184. title="{:lang('opt')}">
  185. <svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1"
  186. xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
  187. <defs>
  188. <rect id="path-1" x="0" y="0" width="20" height="20"></rect>
  189. </defs>
  190. <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
  191. <g id="超级控制台_首页_1122" transform="translate(-1787.000000, -188.000000)">
  192. <g id="编组-9" transform="translate(1787.000000, 188.000000)">
  193. <g id="Clipped"
  194. transform="translate(10.000000, 10.000000) scale(1, -1) translate(-10.000000, -10.000000) ">
  195. <mask id="mask-2" fill="white">
  196. <use xlink:href="#path-1"></use>
  197. </mask>
  198. <g id="align-right"></g>
  199. <g id="编组" mask="url(#mask-2)" fill="currentColor">
  200. <g transform="translate(2.173913, 8.847826)" id="矩形">
  201. <rect x="0" y="0" width="3" height="3" rx="1.5"></rect>
  202. <rect x="6" y="0" width="3" height="3" rx="1.5"></rect>
  203. <rect x="12" y="0" width="3" height="3" rx="1.5"></rect>
  204. </g>
  205. </g>
  206. </g>
  207. </g>
  208. </g>
  209. </g>
  210. </svg>
  211. </a>
  212. <dl class="layui-nav-child !top-[28px] !rounded-[10px]">
  213. <dd><a href="{:url('index/clear')}" class="j-ajax"
  214. refresh="yes">{:lang('admin/index/index/menu_cache_clear')}</a>
  215. </dd>
  216. <dd><a href="javascript:void(0);" id="lockScreen">{:lang('admin/index/index/menu_lock')}</a>
  217. </dd>
  218. <dd><a href="{:url('index/logout')}">{:lang('admin/index/index/menu_logout')}</a></dd>
  219. </dl>
  220. </li>
  221. <li class="layui-nav-item flex-shrink-0">
  222. <a href="__ROOT__/" class="hover:!text-[#40CC92] cursor-pointer !px-[10px]" target="_blank"
  223. title="{:lang('admin/index/index/menu_index')}">
  224. <svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1"
  225. xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
  226. <defs>
  227. <rect id="path-1" x="0" y="0" width="20" height="20"></rect>
  228. </defs>
  229. <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
  230. <g id="超级控制台_首页_1122" transform="translate(-1840.000000, -21.000000)">
  231. <g id="Clipped" transform="translate(1840.000000, 21.000000)">
  232. <mask id="mask-2" fill="white">
  233. <use xlink:href="#path-1"></use>
  234. </mask>
  235. <g id="home"></g>
  236. <g id="编组" mask="url(#mask-2)" stroke="currentColor" stroke-linejoin="round"
  237. stroke-width="2">
  238. <g transform="translate(2.000000, 1.304348)" id="Vector">
  239. <path
  240. d="M8,0 L14.8247512,5.22983652 C15.5655919,5.79754594 16,6.67772393 16,7.61107213 L16,15.6956522 L16,15.6956522 C16,16.1565217 16.0478261,16.8521739 15.726087,17.1826087 C15.3956522,17.5043478 14.9608696,17.6956522 14.5,17.6956522 L1.73913043,17.9347826 C1.26956522,17.9347826 0.834782609,17.7434783 0.504347826,17.4217391 C0.182608696,17.0913043 0,16.6565217 0,16.1956522 L0,7.61107213 C1.1883661e-15,6.67772393 0.434408137,5.79754594 1.1752488,5.22983652 L8,0 L8,0 Z">
  241. </path>
  242. <path
  243. d="M4.99250848,17.6745991 L4.99250848,12.6745991 C4.99250848,11.0177448 6.33565423,9.67459908 7.99250848,9.67459908 C9.64936273,9.67459908 10.9925085,11.0177448 10.9925085,12.6745991 L10.9925085,17.6745991 L10.9925085,17.6745991"
  244. stroke-linecap="round"></path>
  245. </g>
  246. </g>
  247. </g>
  248. </g>
  249. </g>
  250. </svg>
  251. </a>
  252. </li>
  253. <li class="layui-nav-item flex-shrink-0 cursor-pointer">
  254. <a href="javascript:void;" class="hover:!text-[#40CC92] cursor-pointer !px-[10px]"
  255. onclick="chanage_version()" title="{:lang('admin/index/index/old_version')}">
  256. <svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1"
  257. xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
  258. <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
  259. <g id="超级控制台_首页_1122" transform="translate(-1880.000000, -21.000000)">
  260. <g id="top_ic_old" transform="translate(1880.000000, 21.000000)">
  261. <rect id="矩形" fill="currentColor" opacity="0" x="0" y="0" width="20"
  262. height="20"></rect>
  263. <path
  264. d="M18.4424065,7.27519736 C18.4284666,7.23333945 18.4145268,7.19148155 18.3866471,7.14962365 C18.3448276,7.06590784 18.3030081,6.9682394 18.2751284,6.87057096 L18.2611886,6.85661832 C18.1914894,6.67523407 18.1078503,6.49384983 17.9963316,6.31246558 C17.703595,5.76831283 16.7975055,4.87534423 15.2641233,4.84743896 C14.4695525,4.86139159 13.3683052,5.08463374 12.6713133,6.14503396 C12.6294938,6.2008445 12.6016141,6.25665504 12.5737344,6.29851294 L9.40939105,12.9678722 L6.34262656,6.31246558 C6.13352898,5.85202864 5.57593544,5.64273912 5.11592076,5.86598127 C4.65590609,6.07527079 4.44680851,6.63337617 4.65590609,7.09381311 L7.88994864,14.0701303 L7.90388848,14.084083 C8.32208364,14.8654305 8.85179751,15.2700569 9.50696992,15.2700569 C10.1203228,15.2421516 10.622157,14.8375252 10.9845928,14.0422251 L14.2325752,7.17752891 C14.2325752,7.16357628 14.246515,7.16357628 14.246515,7.14962365 C14.3301541,7.0100973 14.5392517,6.68918671 15.2780631,6.68918671 L15.2920029,6.68918671 C16.0447542,6.70313934 16.3653705,7.12171838 16.40719,7.19148155 C16.4211299,7.21938682 16.4350697,7.26124472 16.4629494,7.27519736 C16.4908291,7.31705526 16.5326486,7.42867634 16.5744681,7.52634478 C16.6162876,7.63796585 16.672047,7.76353956 16.7278063,7.88911327 C17.0066031,8.76812925 17.1599413,9.63319258 17.1599413,10.4703507 C17.1599413,12.5492932 16.4350697,14.3212778 14.9574468,15.8700202 C13.382245,17.3769047 11.6118855,18.1163943 9.52090976,18.1163943 C7.37417461,18.1163943 5.60381511,17.3908574 4.11225238,15.8839728 C2.57887014,14.4189462 1.85399853,12.633009 1.85399853,10.4843033 C1.85399853,8.33559758 2.57887014,6.563613 4.09831255,5.04277584 C5.24137931,3.84284927 6.74688188,3.08940701 8.43360235,2.89407013 C9.24211299,2.82430696 9.57666911,2.82430696 10.5106383,2.89407013 C10.622157,2.90802276 11.5840059,3.04754911 12.3925165,3.34055443 C12.6294938,3.42427024 12.8804109,3.41031761 13.1034483,3.31264916 C13.3264857,3.20102809 13.5077036,3.03359648 13.5774028,2.79640169 L13.5913426,2.75454379 L13.5913426,2.74059115 C13.6610418,2.517349 13.647102,2.28015421 13.5495231,2.0708647 C13.4380044,1.84762254 13.2707263,1.68019093 13.0337491,1.59647512 C12.0440205,1.23370663 10.8312546,1.05232238 10.6360968,1.05232238 C9.60454879,0.982559207 9.18635363,0.982559207 8.25238445,1.05232238 C6.09170946,1.31742243 4.19589142,2.25224894 2.76008804,3.75913347 C0.89214967,5.62878649 0,7.83330274 0,10.4982559 C0,13.1632091 0.906089508,15.3677254 2.77402788,17.2234257 C4.61408657,19.0651735 6.87234043,20 9.49303008,20 C12.0440205,20 14.3022744,19.0651735 16.239912,17.2234257 C18.0660308,15.3119148 19,13.051588 19,10.4982559 C18.9860602,9.45180833 18.8048423,8.36350285 18.4424065,7.27519736 Z"
  265. id="路径" fill="currentColor" fill-rule="nonzero"></path>
  266. </g>
  267. </g>
  268. </g>
  269. </svg>
  270. </a>
  271. </li>
  272. <li class="layui-nav-item flex-shrink-0">
  273. <a>{$ip_location}</a>
  274. </li>
  275. </ul>
  276. </div>
  277. <div class="layui-tab-content max-md:!px-0 max-md:!pt-3">
  278. <div class="layui-tab-item layui-show">
  279. <iframe lay-id="111" src="{:url('index/welcome')}" width="100%" height="100%" frameborder="0"
  280. scrolling="yes" class="hs-iframe"></iframe>
  281. </div>
  282. </div>
  283. </div>
  284. </div>
  285. <div class="layui-footer footer center">
  286. <div class="text-footer">{:lang('maccms_copyright')}</div>
  287. </div>
  288. </div>
  289. {include file="../../../application/admin/view_new/public/foot" /}
  290. <!--请在下方写此页面业务相关的脚本-->
  291. <script>
  292. window.localStorage.clear();
  293. var LAYUI_OFFSET = 60;
  294. $('#admin_name').click(function () {
  295. $('body').toggleClass('drawer-body-right');
  296. })
  297. </script>
  298. <script>
  299. var MAC_VERSION='{$version.code}',PHP_VERSION='{php}echo PHP_VERSION{/php}',THINK_VERSION='{php}echo THINK_VERSION{/php}';MAC_LANG='{$mac_lang}';
  300. </script>
  301. <script type="text/javascript">
  302. var layer;
  303. layui.use(['element', 'layer', 'form'], function () {
  304. var $ = layui.jquery, element = layui.element, form = layui.form;
  305. layer = layui.layer;
  306. console.log("MAC_VERSION", MAC_VERSION)
  307. if (typeof (MAC_VERSION) != 'undefined' && typeof (PHP_VERSION) != 'undefined' && typeof (THINK_VERSION) != 'undefined') {
  308. $.ajax({
  309. url: `https://update.maccms.la/v10/?c=check&v=${MAC_VERSION}&p=${PHP_VERSION}&tp=${THINK_VERSION}&t=${Math.random()}`,
  310. type: 'GET',
  311. dataType: 'text', // 确保返回的数据被视为纯文本
  312. success: function (response) {
  313. // 使用正则表达式提取update_content
  314. // var updateContentRegex = /var update_content = \[((?:.|\n)*?)\].join\('<br>\');/g;
  315. var updateContentMatch = response.match(/var update_content\s*=\s*\[(.*?)\]\.join\('<br>'\);/s);
  316. console.log("updateContentMatch", updateContentMatch)
  317. if (updateContentMatch){
  318. eval(updateContentMatch[0])
  319. }
  320. // 使用正则表达式提取new_v
  321. var newVRegex = /var new_v = '(.*?)';/;
  322. var newVMatch = response.match(newVRegex);
  323. var newV = newVMatch ? newVMatch[1] : '未找到new_v';
  324. if (newV > MAC_VERSION) {
  325. var package = 'maccms10_update';
  326. // js 判断是否移动端
  327. var area = ['460px', '638px']
  328. var agent = navigator.userAgent.toLowerCase();
  329. var isMobile = /android|iphone|ipod|ipad|ios/.test(agent)
  330. if (isMobile) {
  331. area = ['95%', '638px']
  332. }
  333. layer.open({
  334. type: 1,
  335. area, // 宽高
  336. title: false, // 不显示标题栏
  337. closeBtn: 0,
  338. btn: ['关闭'],
  339. btnAlign: 'c',
  340. shadeClose: true, // 点击遮罩关闭层
  341. skin: 'skin_updae_from', // 加上边框
  342. content: `
  343. <div class="updae_from">
  344. <img class="update_bg" src="__STATIC__/images/[email protected]" alt="" srcset="">
  345. <div class="update_content">
  346. <div class="update_title">
  347. <p>更新提示</p>
  348. <p>${newV}>>></p>
  349. </div>
  350. <a class="group_link" target="_blank" href="https://t.me/maccms_channel">Telegram群 https://t.me/maccms_channel</a>
  351. <a class="group_link" target="_blank"
  352. href="https://github.com/magicblack">Github源码 https://github.com/magicblack</a>
  353. <div class="flex-col flex my-[20px] gap-1">
  354. <a class="j-iframe text-[#53D19C]" title="点击进入升级"
  355. data-href="${ADMIN_PATH}/admin/update/step1.html?file=${package}">
  356. 【点击进入在线升级】
  357. </a>
  358. <a href="https://github.com/magicblack/maccms_down/raw/master/maccms10_update.zip">
  359. 【下载离线升级包线路1】
  360. </a>
  361. <a href="https://cdn.jsdelivr.net/gh/magicblack/maccms_down@master/maccms10_update.zip">
  362. 【下载离线升级包线路2】
  363. </a>
  364. </div>
  365. <div class="update_list">
  366. ${update_content}
  367. </div>
  368. </div>
  369. `
  370. });
  371. }
  372. },
  373. error: function (xhr, status, error) {
  374. console.error('AJAX请求失败:', error);
  375. }
  376. });
  377. }
  378. // layer.msg('提示信息', { time: 180000 });
  379. element.init('nav', 'demo');
  380. // 重新渲染select,将下拉弹层插入到body
  381. form.render('select', {
  382. render: true
  383. });
  384. form.on('select(lang)', function (data) {
  385. if (data.value != '') {
  386. // location.href = "{:url('index')}?lang=" + (data.value);
  387. $.ajax({
  388. url: "{:url('system/configlang')}",
  389. type: "post",
  390. dataType: "json",
  391. data: { 'lang': data.value },
  392. beforeSend: function () {
  393. },
  394. error: function (r) {
  395. layer.msg("configedit error", { time: 1800 });
  396. },
  397. success: function (r) {
  398. layer.msg(r.msg, { time: 1800 });
  399. },
  400. complete: function () {
  401. location.reload();
  402. }
  403. });
  404. }
  405. });
  406. // 获取窗口宽度
  407. var windowWidth = $(window).width();
  408. // 设置一个阈值,例如 768px,根据实际需要调整
  409. var mobileThreshold = 768;
  410. // 判断是否为移动端
  411. if (windowWidth < mobileThreshold) {
  412. // 在移动端执行的代码
  413. $('.layui-tab-content').height($(window).height() - 195);
  414. } else {
  415. // 在非移动端执行的代码
  416. $('.layui-tab-content').height($(window).height() - 130);
  417. }
  418. var tab = {
  419. add: function (title, url, id) {
  420. element.tabAdd('macTab', {
  421. title: title,
  422. content: '<iframe width="100%" height="100%" lay-id="' + id + '" frameborder="0" src="' + url + '" scrolling="yes" class="x-iframe"></iframe>',
  423. id: id
  424. });
  425. }, change: function (id) {
  426. element.tabChange('macTab', id);
  427. }
  428. };
  429. $('.admin-nav-item').click(function (event) {
  430. var that = $(this);
  431. var id = that.attr('data-id');
  432. if ($('iframe[lay-id="' + id + '"]')[0]) {
  433. tab.change(id);
  434. event.stopPropagation();
  435. $(this).parent('dd').addClass('layui-this');
  436. $("iframe[lay-id='" + id + "']")[0].contentWindow.location.reload(true);//切换后刷新框架
  437. return false;
  438. }
  439. if ($('iframe').length == 10) {
  440. layer.msg("{:lang('admin/index/index/menu_max')}");
  441. return false;
  442. }
  443. tab.add(that.text(), that.attr('href'), that.attr('data-id'));
  444. tab.change(that.attr('data-id'));
  445. event.stopPropagation();
  446. $(this).parent('dd').addClass('layui-this');
  447. $('body').removeClass('site-mobile');
  448. return false;
  449. });
  450. $(document).on('click', '.layui-tab-close', function () {
  451. $('.layui-nav-child a[data-id="' + $(this).parent('li').attr('lay-id') + '"]').parent('dd').removeClass('layui-this');
  452. });
  453. //显示顶部导航时作位置判断,点击左边菜单、上一tab、下一tab时公用
  454. function showTab(li) {
  455. if (li.length) {
  456. var ul = $('#B_history'),
  457. li_offset = li.offset(),
  458. li_width = li.outerWidth(true),
  459. next_left = $('#page-next').offset().left, //右边按钮的界限位置
  460. prev_right = $('#page-prev').offset().left + $('#page-prev').outerWidth(true); //左边按钮的界限位置
  461. if (li_offset.left + li_width > next_left) { //如果将要移动的元素在不可见的右边,则需要移动
  462. var distance = li_offset.left + li_width - next_left; //计算当前父元素的右边距离,算出右移多少像素
  463. ul.animate({
  464. left: '-=' + distance
  465. }, 200, 'swing');
  466. } else if (li_offset.left < prev_right) { //如果将要移动的元素在不可见的左边,则需要移动
  467. var distance = prev_right - li_offset.left; //计算当前父元素的左边距离,算出左移多少像素
  468. ul.animate({
  469. left: '+=' + distance
  470. }, 200, 'swing');
  471. }
  472. li.trigger('click');
  473. }
  474. }
  475. //上一个选项卡
  476. $('#page-prev').click(function (e) {
  477. e.preventDefault();
  478. e.stopPropagation();
  479. var ul = $('#B_history'),
  480. current = ul.find('.layui-this'),
  481. li = current.prev('li');
  482. showTab(li);
  483. });
  484. //下一个选项卡
  485. $('#page-next').click(function (e) {
  486. e.preventDefault();
  487. e.stopPropagation();
  488. var ul = $('#B_history'),
  489. current = ul.find('.layui-this'),
  490. li = current.next('li');
  491. showTab(li);
  492. });
  493. //刷新
  494. $('#J_refresh').click(function (e) {
  495. e.preventDefault();
  496. e.stopPropagation();
  497. var index = layer.load();
  498. var id = $('#B_history .layui-this').attr('lay-id'),
  499. iframe = $("iframe[lay-id='" + id + "']")[0];
  500. if (iframe.contentWindow) {
  501. iframe.contentWindow.location.reload(true);
  502. layer.close(index);
  503. }
  504. });
  505. //关闭全部选项卡
  506. $(".closePageAll").on("click", function () {
  507. if ($("#B_history li").length > 1) {
  508. $("#B_history li").each(function () {
  509. data_id = $(this).attr('lay-id');
  510. if (data_id != '' && data_id != '111') {
  511. element.tabDelete("macTab", data_id);
  512. $("iframe[lay-id='" + data_id + "']").remove(); //移除iframe页面
  513. }
  514. })
  515. } else {
  516. layer.msg("{:lang('admin/index/index/menu_close_empty')}");
  517. }
  518. });
  519. //关闭其他选项卡
  520. $(".closePageOther").on("click", function () {
  521. if ($("#B_history li").length > 1) {
  522. var cid = $('#B_history .layui-this').attr('lay-id');
  523. $("#B_history li").each(function () {
  524. data_id = $(this).attr('lay-id');
  525. if (data_id != '' && data_id != '111' && data_id != cid) {
  526. element.tabDelete("macTab", data_id);
  527. $("iframe[lay-id='" + data_id + "']").remove(); //移除iframe页面
  528. }
  529. })
  530. } else {
  531. layer.msg("{:lang('admin/index/index/menu_close_empty')}");
  532. }
  533. });
  534. $('.mob-nav').on("click", function () {
  535. $('.site-tree-mobile').click();
  536. });
  537. //手机设备的简单适配
  538. var treeMobile = $('.site-tree-mobile'),
  539. shadeMobile = $('.site-mobile-shade')
  540. treeMobile.on('click', function () {
  541. $('body').toggleClass('site-mobile');
  542. $('.Menus-winner').toggleClass('topLevelMenus');//解决top导航
  543. $('.Menus-winner').toggleClass('topLevelMenus-winner');//解决top导航
  544. });
  545. shadeMobile.on('click', function () {
  546. $('body').removeClass('site-mobile');
  547. $('.Menus-winner').addClass('topLevelMenus');//解决top导航
  548. });
  549. });
  550. $(function () {
  551. setInterval("checkCache()", 30 * 1000);
  552. });
  553. //检查缓存并保持登录状态
  554. function checkCache() {
  555. $.ajax({
  556. url: "{:url('checkcache')}",
  557. cache: false,
  558. success: function (r) {
  559. if (r == 'haved') {
  560. layer.msg('{:lang("admin/index/cache_data")}', { time: 3000 });
  561. }
  562. }
  563. });
  564. }
  565. function chanage_version() {
  566. $.ajax({
  567. url: "{:url('system/configVersion')}",
  568. type: "post",
  569. dataType: "json",
  570. data: { 'version': 0 },
  571. beforeSend: function () {
  572. },
  573. error: function (r) {
  574. layer.msg("configedit error", { time: 1800 });
  575. },
  576. success: function (r) {
  577. if(r.code != 1){
  578. alert(r.msg)
  579. }
  580. layer.msg(r.msg, { time: 1800 });
  581. },
  582. complete: function () {
  583. location.reload();
  584. }
  585. });
  586. }
  587. </script>
  588. </body>
  589. </html>