layouts.blade.php 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437
  1. @extends('_layout')
  2. @section('title', sysConfig('website_name'))
  3. @section('layout_css')
  4. <link href="/assets/global/fonts/font-awesome/css/all.min.css" rel="stylesheet">
  5. <link href="/assets/global/vendor/toastr/toastr.min.css" rel="stylesheet">
  6. <style>
  7. @media (max-width: 768px) {
  8. .pagination .page-link {
  9. padding: .429rem .786rem;
  10. font-size: .858rem;
  11. line-height: 1.5
  12. }
  13. .pagination .page-item:first-child .page-link {
  14. border-top-left-radius: .143rem;
  15. border-bottom-left-radius: .143rem
  16. }
  17. .pagination .page-item:last-child .page-link {
  18. border-top-right-radius: .143rem;
  19. border-bottom-right-radius: .143rem
  20. }
  21. }
  22. </style>
  23. @yield('css')
  24. @endsection
  25. @section('body_class', 'dashboard')
  26. @section('layout_content')
  27. <nav class="site-navbar navbar navbar-default navbar-fixed-top navbar-mega {{ config('theme.navbar.inverse') }} {{ config('theme.navbar.skin') }}"
  28. role="navigation">
  29. <div class="navbar-header">
  30. <button class="navbar-toggler hamburger hamburger-close navbar-toggler-left hided" data-toggle="menubar" type="button">
  31. <span class="sr-only">{{ trans('common.toggle_action', ['action' => trans('common.function.navigation')]) }}</span>
  32. <span class="hamburger-bar"></span>
  33. </button>
  34. <button class="navbar-toggler collapsed" data-target="#site-navbar-collapse" data-toggle="collapse" type="button">
  35. <i class="icon wb-more-horizontal" aria-hidden="true"></i>
  36. </button>
  37. <div class="navbar-brand navbar-brand-center">
  38. <img class="navbar-brand-logo" src="{{ sysConfig('website_logo') ? asset(sysConfig('website_logo')) : '/assets/images/logo.png' }}"
  39. alt="logo" />
  40. <span class="navbar-brand-text hidden-xs-down"> {{ sysConfig('website_name') }}</span>
  41. </div>
  42. </div>
  43. <div class="navbar-container container-fluid">
  44. <div class="collapse navbar-collapse navbar-collapse-toolbar" id="site-navbar-collapse">
  45. <ul class="nav navbar-toolbar">
  46. <li class="nav-item hidden-float" id="toggleMenubar">
  47. <a class="nav-link" data-toggle="menubar" href="#" role="button">
  48. <i class="icon hamburger hamburger-arrow-left">
  49. <span class="sr-only">{{ trans('common.toggle_action', ['action' => trans('common.function.menubar')]) }}</span>
  50. <span class="hamburger-bar"></span>
  51. </i>
  52. </a>
  53. </li>
  54. <li class="nav-item hidden-sm-down">
  55. <a class="nav-link icon icon-fullscreen" data-toggle="fullscreen" href="#" role="button">
  56. <span class="sr-only">{{ trans('common.toggle_action', ['action' => trans('common.function.fullscreen')]) }}</span>
  57. </a>
  58. </li>
  59. <li class="nav-item dropdown">
  60. <a class="nav-link" data-toggle="dropdown" href="javascript:void(0)" role="button">
  61. <span class="icon wb-globe"></span>
  62. <span class="icon wb-chevron-down-mini"></span>
  63. </a>
  64. <div class="dropdown-menu" role="menu">
  65. @foreach (config('common.language') as $key => $value)
  66. <a class="dropdown-item" href="{{ route('lang', ['locale' => $key]) }}" role="menuitem">
  67. <i class="fi fi-{{ $value[1] }}" aria-hidden="true"></i>
  68. <span style="padding: inherit;">{{ $value[0] }}</span>
  69. </a>
  70. @endforeach
  71. </div>
  72. </li>
  73. </ul>
  74. <ul class="nav navbar-toolbar navbar-right navbar-toolbar-right">
  75. <li class="nav-item dropdown">
  76. <a class="nav-link navbar-avatar" data-toggle="dropdown" data-animation="scale-up" href="#" role="button" aria-expanded="false">
  77. <span class="avatar avatar-online">
  78. <img data-uid="{{ auth()->user()->id }}" data-qq="{{ auth()->user()->qq }}" data-username="{{ auth()->user()->username }}"
  79. src="" alt="{{ trans('common.avatar') }}" loading="lazy" />
  80. <i></i>
  81. </span>
  82. </a>
  83. <div class="dropdown-menu" role="menu">
  84. <a class="dropdown-item" href="/" role="menuitem">
  85. <i class="icon wb-settings" aria-hidden="true"></i>
  86. {{ trans('admin.user_dashboard') }}
  87. </a>
  88. <div class="dropdown-divider" role="presentation"></div>
  89. <a class="dropdown-item" href="{{ route('logout') }}" role="menuitem">
  90. <i class="icon wb-power" aria-hidden="true"></i>
  91. {{ trans('auth.logout') }}
  92. </a>
  93. </div>
  94. </li>
  95. </ul>
  96. </div>
  97. </div>
  98. </nav>
  99. @php
  100. $apply_count = auth()->user()->can('admin.aff.index')
  101. ? Cache::rememberForever('open_referral_apply_count', static function () {
  102. return App\Models\ReferralApply::whereStatus(0)->count();
  103. })
  104. : null;
  105. $ticket_count = auth()->user()->can('admin.ticket.index')
  106. ? Cache::rememberForever('open_ticket_count', static function () {
  107. return App\Models\Ticket::whereStatus(0)->count();
  108. })
  109. : null;
  110. $env = config('app.env') === 'local' && config('app.debug');
  111. @endphp
  112. <x-ui.site.menubar :items="[
  113. ['icon' => 'wb-dashboard', 'route' => 'admin.index', 'text' => trans('admin.menu.dashboard'), 'can' => 'admin.index'],
  114. [
  115. 'icon' => 'wb-user',
  116. 'text' => trans('admin.menu.user.attribute'),
  117. 'active' => ['admin.user.*', 'admin.log.credit', 'admin.subscribe.*'],
  118. 'can' => ['admin.user.index', 'admin.user.group.index', 'admin.log.credit', 'admin.subscribe.index'],
  119. 'children' => [
  120. [
  121. 'route' => 'admin.user.index',
  122. 'active' => ['admin.user.index', 'admin.user.edit', 'admin.user.monitor', 'admin.user.online', 'admin.user.online', 'admin.user.export'],
  123. 'text' => trans('admin.menu.user.list'),
  124. 'can' => 'admin.user.index',
  125. ],
  126. ['route' => 'admin.user.oauth', 'active' => 'admin.user.oauth', 'text' => trans('admin.menu.user.oauth'), 'can' => 'admin.user.oauth'],
  127. [
  128. 'route' => 'admin.user.group.index',
  129. 'active' => 'admin.user.group.*',
  130. 'text' => trans('admin.menu.user.group'),
  131. 'can' => 'admin.user.group.index',
  132. ],
  133. ['route' => 'admin.log.credit', 'active' => 'admin.log.credit', 'text' => trans('admin.menu.user.credit_log'), 'can' => 'admin.log.credit'],
  134. [
  135. 'route' => 'admin.subscribe.index',
  136. 'active' => 'admin.subscribe.*',
  137. 'text' => trans('admin.menu.user.subscribe'),
  138. 'can' => 'admin.subscribe.index',
  139. ],
  140. ],
  141. ],
  142. [
  143. 'icon' => 'wb-users',
  144. 'text' => trans('admin.menu.rbac.attribute'),
  145. 'active' => ['admin.permission.*', 'admin.role.*'],
  146. 'can' => ['admin.permission.index', 'admin.role.index'],
  147. 'children' => [
  148. [
  149. 'route' => 'admin.permission.index',
  150. 'active' => 'admin.permission.*',
  151. 'text' => trans('admin.menu.rbac.permission'),
  152. 'can' => 'admin.permission.index',
  153. ],
  154. ['route' => 'admin.role.index', 'active' => 'admin.role.*', 'text' => trans('admin.menu.rbac.role'), 'can' => 'admin.role.index'],
  155. ],
  156. ],
  157. [
  158. 'icon' => 'wb-chat-working',
  159. 'text' => trans('admin.menu.customer_service.attribute'),
  160. 'active' => ['admin.ticket.*', 'admin.article.*', 'admin.marketing.*'],
  161. 'can' => ['admin.ticket.index', 'admin.article.index', 'admin.marketing.index'],
  162. 'badge' => $ticket_count,
  163. 'children' => [
  164. [
  165. 'route' => 'admin.ticket.index',
  166. 'active' => 'admin.ticket.*',
  167. 'text' => trans('admin.menu.customer_service.ticket'),
  168. 'can' => 'admin.ticket.index',
  169. 'badge' => $ticket_count,
  170. ],
  171. [
  172. 'route' => 'admin.article.index',
  173. 'active' => 'admin.article.*',
  174. 'text' => trans('admin.menu.customer_service.article'),
  175. 'can' => 'admin.article.index',
  176. ],
  177. [
  178. 'route' => 'admin.marketing.index',
  179. 'active' => 'admin.marketing.*',
  180. 'text' => trans('admin.menu.customer_service.marketing'),
  181. 'can' => 'admin.marketing.index',
  182. ],
  183. ],
  184. ],
  185. [
  186. 'icon' => 'wb-cloud',
  187. 'text' => trans('admin.menu.node.attribute'),
  188. 'active' => ['admin.node.*', 'admin.node.auth.*', 'admin.node.cert.*'],
  189. 'can' => ['admin.node.index', 'admin.node.auth.index', 'admin.node.cert.index'],
  190. 'children' => [
  191. [
  192. 'route' => 'admin.node.index',
  193. 'active' => ['admin.node.index', 'admin.node.create', 'admin.node.edit'],
  194. 'text' => trans('admin.menu.node.list'),
  195. 'can' => 'admin.node.index',
  196. ],
  197. [
  198. 'route' => 'admin.node.auth.index',
  199. 'active' => 'admin.node.auth.*',
  200. 'text' => trans('admin.menu.node.auth'),
  201. 'can' => 'admin.node.auth.index',
  202. ],
  203. [
  204. 'route' => 'admin.node.cert.index',
  205. 'active' => 'admin.node.cert.*',
  206. 'text' => trans('admin.menu.node.cert'),
  207. 'can' => 'admin.node.cert.index',
  208. ],
  209. ],
  210. ],
  211. [
  212. 'icon' => 'wb-eye',
  213. 'text' => trans('admin.menu.rule.attribute'),
  214. 'active' => 'admin.rule.*',
  215. 'can' => ['admin.rule.index', 'admin.rule.group.index', 'admin.rule.log'],
  216. 'children' => [
  217. ['route' => 'admin.rule.index', 'active' => 'admin.rule.index', 'text' => trans('admin.menu.rule.list'), 'can' => 'admin.rule.index'],
  218. [
  219. 'route' => 'admin.rule.group.index',
  220. 'active' => 'admin.rule.group.*',
  221. 'text' => trans('admin.menu.rule.group'),
  222. 'can' => 'admin.rule.group.index',
  223. ],
  224. ['route' => 'admin.rule.log', 'active' => 'admin.rule.log', 'text' => trans('admin.menu.rule.trigger'), 'can' => 'admin.rule.log'],
  225. ],
  226. ],
  227. [
  228. 'icon' => 'wb-shopping-cart',
  229. 'text' => trans('admin.menu.shop.attribute'),
  230. 'active' => ['admin.goods.*', 'admin.coupon.*', 'admin.order'],
  231. 'can' => ['admin.goods.index', 'admin.coupon.index', 'admin.order'],
  232. 'children' => [
  233. ['route' => 'admin.goods.index', 'active' => 'admin.goods.*', 'text' => trans('admin.menu.shop.goods'), 'can' => 'admin.goods.index'],
  234. ['route' => 'admin.coupon.index', 'active' => 'admin.coupon.*', 'text' => trans('admin.menu.shop.coupon'), 'can' => 'admin.coupon.index'],
  235. ['route' => 'admin.order', 'active' => 'admin.order', 'text' => trans('admin.menu.shop.order'), 'can' => 'admin.order'],
  236. ],
  237. ],
  238. [
  239. 'icon' => 'wb-thumb-up',
  240. 'text' => trans('admin.menu.promotion.attribute'),
  241. 'active' => ['admin.invite.*', 'admin.aff.*'],
  242. 'can' => ['admin.invite.index', 'admin.aff.index', 'admin.aff.rebate'],
  243. 'badge' => $apply_count,
  244. 'children' => [
  245. ['route' => 'admin.invite.index', 'active' => 'admin.invite.*', 'text' => trans('admin.menu.promotion.invite'), 'can' => 'admin.invite.index'],
  246. [
  247. 'route' => 'admin.aff.index',
  248. 'active' => ['admin.aff.index', 'admin.aff.detail'],
  249. 'text' => trans('admin.menu.promotion.withdraw'),
  250. 'can' => 'admin.aff.index',
  251. 'badge' => $apply_count,
  252. ],
  253. [
  254. 'route' => 'admin.aff.rebate',
  255. 'active' => 'admin.aff.rebate',
  256. 'text' => trans('admin.menu.promotion.rebate_flow'),
  257. 'can' => 'admin.aff.rebate',
  258. ],
  259. ],
  260. ],
  261. [
  262. 'icon' => 'wb-stats-bars',
  263. 'text' => trans('admin.menu.analysis.attribute'),
  264. 'active' => 'admin.report.*',
  265. 'can' => ['admin.report.accounting', 'admin.report.userAnalysis', 'admin.report.nodeAnalysis', 'admin.report.siteAnalysis'],
  266. 'children' => [
  267. [
  268. 'route' => 'admin.report.accounting',
  269. 'active' => 'admin.report.accounting',
  270. 'text' => trans('admin.menu.analysis.accounting'),
  271. 'can' => 'admin.report.accounting',
  272. ],
  273. [
  274. 'route' => 'admin.report.userAnalysis',
  275. 'active' => 'admin.report.userAnalysis',
  276. 'text' => trans('admin.menu.analysis.user_flow'),
  277. 'can' => 'admin.report.userAnalysis',
  278. ],
  279. [
  280. 'route' => 'admin.report.nodeAnalysis',
  281. 'active' => 'admin.report.nodeAnalysis',
  282. 'text' => trans('admin.menu.analysis.node_flow'),
  283. 'can' => 'admin.report.nodeAnalysis',
  284. ],
  285. [
  286. 'route' => 'admin.report.siteAnalysis',
  287. 'active' => 'admin.report.siteAnalysis',
  288. 'text' => trans('admin.menu.analysis.site_flow'),
  289. 'can' => 'admin.report.siteAnalysis',
  290. ],
  291. ],
  292. ],
  293. [
  294. 'icon' => 'wb-calendar',
  295. 'text' => trans('admin.menu.log.attribute'),
  296. 'active' => [
  297. 'admin.log.traffic',
  298. 'admin.log.flow',
  299. 'admin.log.ban',
  300. 'admin.log.ip',
  301. 'admin.log.online',
  302. 'admin.log.notify',
  303. 'admin.payment.callback',
  304. ],
  305. 'can' => ['admin.log.traffic', 'admin.log.flow', 'admin.log.ban', 'admin.log.ip', 'admin.log.online', 'admin.log.notify', 'admin.payment.callback'],
  306. 'children' => [
  307. ['route' => 'admin.log.traffic', 'active' => 'admin.log.traffic', 'text' => trans('admin.menu.log.traffic'), 'can' => 'admin.log.traffic'],
  308. ['route' => 'admin.log.flow', 'active' => 'admin.log.flow', 'text' => trans('admin.menu.log.traffic_flow'), 'can' => 'admin.log.flow'],
  309. ['route' => 'admin.log.ban', 'active' => 'admin.log.ban', 'text' => trans('admin.menu.log.service_ban'), 'can' => 'admin.log.ban'],
  310. ['route' => 'admin.log.ip', 'active' => 'admin.log.ip', 'text' => trans('admin.menu.log.online_logs'), 'can' => 'admin.log.ip'],
  311. ['route' => 'admin.log.online', 'active' => 'admin.log.online', 'text' => trans('admin.menu.log.online_monitor'), 'can' => 'admin.log.online'],
  312. ['route' => 'admin.log.notify', 'active' => 'admin.log.notify', 'text' => trans('admin.menu.log.notify'), 'can' => 'admin.log.notify'],
  313. [
  314. 'route' => 'admin.payment.callback',
  315. 'active' => 'admin.payment.callback',
  316. 'text' => trans('admin.menu.log.payment_callback'),
  317. 'can' => 'admin.payment.callback',
  318. ],
  319. ['route' => 'log-viewer::dashboard', 'text' => trans('admin.menu.log.system'), 'can' => 'log-viewer'],
  320. ['route' => 'horizon.index', 'text' => 'Horizon', 'can' => 'viewHorizon'],
  321. ['route' => 'telescope', 'text' => 'Telescope', 'can' => 'viewTelescope', 'show' => $env],
  322. ],
  323. ],
  324. [
  325. 'icon' => 'wb-briefcase',
  326. 'text' => trans('admin.menu.tools.attribute'),
  327. 'active' => 'admin.tools.*',
  328. 'can' => ['admin.tools.decompile', 'admin.tools.convert', 'admin.tools.import', 'admin.tools.analysis'],
  329. 'children' => [
  330. [
  331. 'route' => 'admin.tools.decompile',
  332. 'active' => 'admin.tools.decompile',
  333. 'text' => trans('admin.menu.tools.decompile'),
  334. 'can' => 'admin.tools.decompile',
  335. ],
  336. [
  337. 'route' => 'admin.tools.convert',
  338. 'active' => 'admin.tools.convert',
  339. 'text' => trans('admin.menu.tools.convert'),
  340. 'can' => 'admin.tools.convert',
  341. ],
  342. ['route' => 'admin.tools.import', 'active' => 'admin.tools.import', 'text' => trans('admin.menu.tools.import'), 'can' => 'admin.tools.import'],
  343. [
  344. 'route' => 'admin.tools.analysis',
  345. 'active' => 'admin.tools.analysis',
  346. 'text' => trans('admin.menu.tools.analysis'),
  347. 'can' => 'admin.tools.analysis',
  348. ],
  349. ],
  350. ],
  351. [
  352. 'icon' => 'wb-settings',
  353. 'text' => trans('admin.menu.setting.attribute'),
  354. 'active' => ['admin.config.*', 'admin.system.index'],
  355. 'can' => ['admin.config.filter.index', 'admin.config.index', 'admin.system.index'],
  356. 'children' => [
  357. [
  358. 'route' => 'admin.config.filter.index',
  359. 'active' => 'admin.config.filter.index',
  360. 'text' => trans('admin.menu.setting.email_suffix'),
  361. 'can' => 'admin.config.filter.index',
  362. ],
  363. [
  364. 'route' => 'admin.config.index',
  365. 'active' => 'admin.config.index',
  366. 'text' => trans('admin.menu.setting.universal'),
  367. 'can' => 'admin.config.index',
  368. ],
  369. [
  370. 'route' => 'admin.system.index',
  371. 'active' => 'admin.system.index',
  372. 'text' => trans('admin.menu.setting.system'),
  373. 'can' => 'admin.system.index',
  374. ],
  375. ],
  376. ],
  377. ]" />
  378. <div class="page">
  379. @yield('content')
  380. </div>
  381. @endsection
  382. @section('layout_javascript')
  383. <script src="/assets/custom/sweetalert2/sweetalert2.all.min.js"></script>
  384. <script src="/assets/global/vendor/toastr/toastr.min.js"></script>
  385. <script src="/assets/global/js/Plugin/toastr.js"></script>
  386. <script>
  387. // 全局变量,用于common.js
  388. const CSRF_TOKEN = '{{ csrf_token() }}';
  389. // 页面特定的翻译文本
  390. window.i18n.extend({
  391. 'warning': '{{ trans('common.warning') }}',
  392. 'confirm': {
  393. 'delete': '{{ trans('admin.confirm.delete', ['attribute' => '{attribute}', 'name' => '{name}']) }}'
  394. },
  395. 'btn': {
  396. 'close': '{{ trans('common.close') }}',
  397. 'confirm': '{{ trans('common.confirm') }}'
  398. },
  399. 'copy': {
  400. 'success': '{{ trans('common.copy.success') }}',
  401. 'failed': '{{ trans('common.copy.failed') }}'
  402. }
  403. });
  404. const $buoop = {
  405. required: {
  406. e: 11,
  407. f: -6,
  408. o: -6,
  409. s: -6,
  410. c: -6
  411. },
  412. insecure: true,
  413. unsupported: true,
  414. api: 2024.07
  415. };
  416. function $buo_f() {
  417. const e = document.createElement("script");
  418. e.src = "//browser-update.org/update.min.js";
  419. document.body.appendChild(e);
  420. }
  421. try {
  422. document.addEventListener("DOMContentLoaded", $buo_f, false);
  423. } catch (e) {
  424. window.attachEvent("onload", $buo_f);
  425. }
  426. </script>
  427. <script src="/assets/js/config/common.js"></script>
  428. <script src="/assets/js/config/admin.js"></script>
  429. @yield('javascript')
  430. @endsection