浏览代码

使用whenFilled优化代码筛选 & 页面代码适量简化

针对管理页面中筛选行为使用whenFilled属性进行重写简化&规范化修正;
同时对页面搜索代码进行适量简化;
兔姬桑 4 年之前
父节点
当前提交
c3dbcb19f4
共有 81 个文件被更改,包括 3781 次插入4146 次删除
  1. 1 1
      app/Console/Commands/UserExpireWarning.php
  2. 1 1
      app/Console/Commands/UserTrafficWarning.php
  3. 16 23
      app/Http/Controllers/Admin/AffiliateController.php
  4. 7 13
      app/Http/Controllers/Admin/CouponController.php
  5. 103 153
      app/Http/Controllers/Admin/LogsController.php
  6. 6 10
      app/Http/Controllers/Admin/MarketingController.php
  7. 14 22
      app/Http/Controllers/Admin/RuleController.php
  8. 5 10
      app/Http/Controllers/Admin/ShopController.php
  9. 8 14
      app/Http/Controllers/Admin/SubscribeController.php
  10. 3 5
      app/Http/Controllers/Admin/TicketController.php
  11. 20 57
      app/Http/Controllers/Admin/UserController.php
  12. 170 168
      composer.lock
  13. 9 9
      resources/views/_layout.blade.php
  14. 37 50
      resources/views/admin/aff/index.blade.php
  15. 9 23
      resources/views/admin/aff/rebate.blade.php
  16. 30 30
      resources/views/admin/article/create.blade.php
  17. 1 1
      resources/views/admin/article/edit.blade.php
  18. 25 25
      resources/views/admin/article/index.blade.php
  19. 300 300
      resources/views/admin/config/config.blade.php
  20. 41 41
      resources/views/admin/config/emailFilter.blade.php
  21. 18 18
      resources/views/admin/coupon/create.blade.php
  22. 54 67
      resources/views/admin/coupon/index.blade.php
  23. 3 3
      resources/views/admin/index.blade.php
  24. 38 38
      resources/views/admin/inviteList.blade.php
  25. 9 34
      resources/views/admin/logs/callback.blade.php
  26. 8 15
      resources/views/admin/logs/notification.blade.php
  27. 13 28
      resources/views/admin/logs/onlineIPMonitor.blade.php
  28. 23 37
      resources/views/admin/logs/order.blade.php
  29. 17 29
      resources/views/admin/logs/traffic.blade.php
  30. 6 20
      resources/views/admin/logs/userBanHistory.blade.php
  31. 5 19
      resources/views/admin/logs/userCreditHistory.blade.php
  32. 94 94
      resources/views/admin/logs/userMonitor.blade.php
  33. 11 31
      resources/views/admin/logs/userOnlineIP.blade.php
  34. 5 19
      resources/views/admin/logs/userTraffic.blade.php
  35. 11 15
      resources/views/admin/marketing/emailList.blade.php
  36. 40 44
      resources/views/admin/marketing/pushList.blade.php
  37. 75 75
      resources/views/admin/node/auth.blade.php
  38. 25 25
      resources/views/admin/node/cert/index.blade.php
  39. 10 10
      resources/views/admin/node/cert/info.blade.php
  40. 115 115
      resources/views/admin/node/index.blade.php
  41. 322 322
      resources/views/admin/node/info.blade.php
  42. 88 88
      resources/views/admin/node/monitor.blade.php
  43. 25 25
      resources/views/admin/permission/index.blade.php
  44. 10 10
      resources/views/admin/permission/info.blade.php
  45. 25 25
      resources/views/admin/role/index.blade.php
  46. 43 43
      resources/views/admin/role/info.blade.php
  47. 25 25
      resources/views/admin/rule/group/index.blade.php
  48. 36 36
      resources/views/admin/rule/group/info.blade.php
  49. 98 111
      resources/views/admin/rule/index.blade.php
  50. 42 42
      resources/views/admin/rule/log.blade.php
  51. 36 40
      resources/views/admin/shop/index.blade.php
  52. 85 85
      resources/views/admin/shop/info.blade.php
  53. 23 39
      resources/views/admin/subscribe/index.blade.php
  54. 64 77
      resources/views/admin/ticket/index.blade.php
  55. 67 67
      resources/views/admin/ticket/reply.blade.php
  56. 41 41
      resources/views/admin/tools/analysis.blade.php
  57. 40 40
      resources/views/admin/tools/convert.blade.php
  58. 31 31
      resources/views/admin/tools/decompile.blade.php
  59. 38 38
      resources/views/admin/user/export.blade.php
  60. 25 25
      resources/views/admin/user/group/index.blade.php
  61. 35 35
      resources/views/admin/user/group/info.blade.php
  62. 118 132
      resources/views/admin/user/index.blade.php
  63. 176 176
      resources/views/admin/user/info.blade.php
  64. 1 1
      resources/views/auth/activeUser.blade.php
  65. 19 19
      resources/views/auth/login.blade.php
  66. 16 16
      resources/views/auth/maintenance.blade.php
  67. 62 61
      resources/views/auth/register.blade.php
  68. 2 2
      resources/views/components/chat-unit.blade.php
  69. 113 113
      resources/views/user/buy.blade.php
  70. 41 41
      resources/views/user/help.blade.php
  71. 178 178
      resources/views/user/index.blade.php
  72. 32 32
      resources/views/user/invite.blade.php
  73. 47 47
      resources/views/user/invoices.blade.php
  74. 22 22
      resources/views/user/layouts.blade.php
  75. 91 91
      resources/views/user/nodeList.blade.php
  76. 29 29
      resources/views/user/payment.blade.php
  77. 27 27
      resources/views/user/referral.blade.php
  78. 71 71
      resources/views/user/replyTicket.blade.php
  79. 114 114
      resources/views/user/services.blade.php
  80. 3 3
      resources/views/user/stripe-checkout.blade.php
  81. 34 34
      resources/views/user/ticketList.blade.php

+ 1 - 1
app/Console/Commands/UserExpireWarning.php

@@ -33,7 +33,7 @@ class UserExpireWarning extends Command
             ->where('expired_at', '<', date('Y-m-d', strtotime(sysConfig('expire_days').' days')))
             ->chunk(config('tasks.chunk'), function ($users) {
                 foreach ($users as $user) {
-                    if (filter_var($user->email, FILTER_VALIDATE_EMAIL) === false) { // 用户不是邮箱的跳过
+                    if (filter_var($user->email, FILTER_VALIDATE_EMAIL) === false) { // 用户账号不是邮箱的跳过
                         continue;
                     }
                     $user->notify(new AccountExpire($user->expired_at));

+ 1 - 1
app/Console/Commands/UserTrafficWarning.php

@@ -31,7 +31,7 @@ class UserTrafficWarning extends Command
         $trafficWarningPercent = sysConfig('traffic_warning_percent');
         User::activeUser()->where('transfer_enable', '>', 0)->chunk(config('tasks.chunk'), function ($users) use ($trafficWarningPercent) {
             foreach ($users as $user) {
-                // 用户不是邮箱的跳过
+                // 用户账号不是邮箱的跳过
                 if (filter_var($user->email, FILTER_VALIDATE_EMAIL) === false) {
                     continue;
                 }

+ 16 - 23
app/Http/Controllers/Admin/AffiliateController.php

@@ -12,19 +12,16 @@ class AffiliateController extends Controller
     // 提现申请列表
     public function index(Request $request)
     {
-        $email = $request->input('email');
-        $status = $request->input('status');
-
         $query = ReferralApply::with('user:id,email');
-        if (isset($email)) {
-            $query->whereHas('user', static function ($q) use ($email) {
-                $q->where('email', 'like', '%'.$email.'%');
+        $request->whenFilled('email', function ($email) use ($query) {
+            $query->whereHas('user', function ($query) use ($email) {
+                $query->where('email', 'like', "%{$email}%");
             });
-        }
+        });
 
-        if ($status) {
+        $request->whenFilled('status', function ($status) use ($query) {
             $query->whereStatus($status);
-        }
+        });
 
         return view('admin.aff.index', ['applyList' => $query->latest()->paginate(15)->appends($request->except('page'))]);
     }
@@ -60,27 +57,23 @@ class AffiliateController extends Controller
     // 用户返利流水记录
     public function rebate(Request $request)
     {
-        $invitee_email = $request->input('invitee_email');
-        $inviter_email = $request->input('inviter_email');
-        $status = $request->input('status');
-
         $query = ReferralLog::with(['invitee:id,email', 'inviter:id,email'])->orderBy('status')->latest();
 
-        if (isset($invitee_email)) {
-            $query->whereHas('invitee', static function ($q) use ($invitee_email) {
-                $q->where('email', 'like', '%'.$invitee_email.'%');
+        $request->whenFilled('invitee_email', function ($email) use ($query) {
+            $query->whereHas('invitee', function ($query) use ($email) {
+                $query->where('email', 'like', "%{$email}%");
             });
-        }
+        });
 
-        if (isset($inviter_email)) {
-            $query->whereHas('inviter', static function ($q) use ($inviter_email) {
-                $q->where('email', 'like', '%'.$inviter_email.'%');
+        $request->whenFilled('inviter_email', function ($email) use ($query) {
+            $query->whereHas('inviter', function ($query) use ($email) {
+                $query->where('email', 'like', "%{$email}%");
             });
-        }
+        });
 
-        if (isset($status)) {
+        $request->whenFilled('status', function ($status) use ($query) {
             $query->whereStatus($status);
-        }
+        });
 
         return view('admin.aff.rebate', ['referralLogs' => $query->paginate(15)->appends($request->except('page'))]);
     }

+ 7 - 13
app/Http/Controllers/Admin/CouponController.php

@@ -20,22 +20,16 @@ class CouponController extends Controller
     // 优惠券列表
     public function index(Request $request)
     {
-        $sn = $request->input('sn');
-        $type = $request->input('type');
-        $status = $request->input('status');
-
         $query = Coupon::query();
 
-        if (isset($sn)) {
-            $query->where('sn', 'like', '%'.$sn.'%');
-        }
-
-        if (isset($type)) {
-            $query->whereType($type);
-        }
+        $request->whenFilled('sn', function ($sn) use ($query) {
+            $query->where('sn', 'like', "%{$sn}%");
+        });
 
-        if (isset($status)) {
-            $query->whereStatus($status);
+        foreach (['type', 'status'] as $field) {
+            $request->whenFilled($field, function ($value) use ($query, $field) {
+                $query->where($field, $value);
+            });
         }
 
         return view('admin.coupon.index', ['couponList' => $query->latest()->paginate(15)->appends($request->except('page'))]);

+ 103 - 153
app/Http/Controllers/Admin/LogsController.php

@@ -21,63 +21,47 @@ class LogsController extends Controller
     // 订单列表
     public function orderList(Request $request)
     {
-        $email = $request->input('email');
-        $sn = $request->input('sn');
-        $is_coupon = $request->input('is_coupon');
-        $is_expire = $request->input('is_expire');
-        $pay_way = $request->input('pay_way');
-        $status = $request->input('status');
-        $range_time = $request->input('range_time');
-        $sort = $request->input('sort'); // 0-按创建时间降序、1-按创建时间升序
-        $order_id = $request->input('id');
-
         $query = Order::with(['user:id,email', 'goods:id,name', 'coupon:id,name,sn']);
 
-        if (isset($email)) {
-            $query->whereHas('user', static function ($q) use ($email) {
-                $q->where('email', 'like', '%'.$email.'%');
+        $request->whenFilled('email', function ($email) use ($query) {
+            $query->whereHas('user', function ($query) use ($email) {
+                $query->where('email', 'like', "%{$email}%");
             });
-        }
-        if (isset($sn)) {
-            $query->where('sn', 'like', '%'.$sn.'%');
-        }
-
-        if (isset($is_coupon)) {
-            if ($is_coupon) {
-                $query->where('coupon_id', '<>');
-            } else {
-                $query->whereCouponId(null);
-            }
-        }
+        });
 
-        if (isset($is_expire)) {
-            $query->whereIsExpire($is_expire);
-        }
+        $request->whenFilled('sn', function ($value) use ($query) {
+            $query->where('sn', 'like', "%{$value}%");
+        });
 
-        if (isset($pay_way)) {
-            $query->wherePayWay($pay_way);
-        }
+        $request->whenFilled('start', function ($value) use ($query) {
+            $query->where('created_at', '>=', $value);
+        });
 
-        if (isset($status)) {
-            $query->whereStatus($status);
-        }
+        $request->whenFilled('end', function ($value) use ($query) {
+            $query->where('created_at', '<=', $value);
+        });
 
-        if (isset($range_time) && $range_time !== ',') {
-            $range_time = explode(',', $range_time);
-            if ($range_time) {
-                $query->where('created_at', '>=', $range_time[0])->where('created_at', '<=', $range_time[1]);
+        $request->whenFilled('is_coupon', function ($value) use ($query) {
+            if ($value) {
+                $query->where('coupon_id', '<>');
+            } else {
+                $query->where('coupon_id');
             }
-        }
+        });
 
-        if (isset($order_id)) {
-            $query->whereId($order_id);
+        foreach (['is_expire', 'pay_way', 'status'] as $field) {
+            $request->whenFilled($field, function ($value) use ($query, $field) {
+                $query->where($field, $value);
+            });
         }
 
-        if ($sort) {
-            $query->orderBy('id');
-        } else {
-            $query->orderByDesc('id');
-        }
+        $request->whenFilled('sort', function ($value) use ($query) {
+            if ($value) { // 0-按创建时间降序、1-按创建时间升序
+                $query->oldest();
+            } else {
+                $query->latest();
+            }
+        });
 
         return view('admin.logs.order', ['orders' => $query->paginate(15)->appends($request->except('page'))]);
     }
@@ -85,72 +69,58 @@ class LogsController extends Controller
     // 流量日志
     public function trafficLog(Request $request)
     {
-        $port = $request->input('port');
-        $user_id = $request->input('user_id');
-        $email = $request->input('email');
-        $nodeId = $request->input('nodeId');
-        $startTime = $request->input('startTime');
-        $endTime = $request->input('endTime');
-
         $query = UserDataFlowLog::with(['user', 'node']);
 
-        if (isset($port)) {
-            $query->whereHas('user', static function ($q) use ($port) {
-                $q->wherePort($port);
+        $request->whenFilled('port', function ($value) use ($query) {
+            $query->whereHas('user', function ($query) use ($value) {
+                $query->wherePort($value);
             });
-        }
+        });
 
-        if (isset($user_id)) {
-            $query->whereUserId($user_id);
-        }
-
-        if (isset($email)) {
-            $query->whereHas('user', static function ($q) use ($email) {
-                $q->where('email', 'like', '%'.$email.'%');
+        foreach (['user_id', 'node_id'] as $field) {
+            $request->whenFilled($field, function ($value) use ($query, $field) {
+                $query->where($field, $value);
             });
         }
 
-        if (isset($nodeId)) {
-            $query->whereNodeId($nodeId);
-        }
+        $request->whenFilled('email', function ($email) use ($query) {
+            $query->whereHas('user', function ($query) use ($email) {
+                $query->where('email', 'like', "%{$email}%");
+            });
+        });
 
-        if (isset($startTime)) {
-            $query->where('log_time', '>=', strtotime($startTime));
-        }
+        $request->whenFilled('start', function ($value) use ($query) {
+            $query->where('log_time', '>=', strtotime($value));
+        });
 
-        if (isset($endTime)) {
-            $query->where('log_time', '<=', strtotime($endTime));
-        }
+        $request->whenFilled('end', function ($value) use ($query) {
+            $query->where('log_time', '<=', strtotime($value));
+        });
 
+        $totalTraffic = flowAutoShow($query->sum('u') + $query->sum('d')); // 在分页前,计算总使用流量
         $dataFlowLogs = $query->latest('log_time')->paginate(20)->appends($request->except('page'));
         foreach ($dataFlowLogs as $log) {
             $log->u = flowAutoShow($log->u);
             $log->d = flowAutoShow($log->d);
             $log->log_time = date('Y-m-d H:i:s', $log->log_time);
         }
+        $nodes = Node::whereStatus(1)->orderByDesc('sort')->latest()->get();
 
-        return view('admin.logs.traffic', [
-            'totalTraffic' => flowAutoShow($query->sum('u') + $query->sum('d')), // 已使用流量
-            'dataFlowLogs' => $dataFlowLogs,
-            'nodes' => Node::whereStatus(1)->orderByDesc('sort')->latest()->get(),
-        ]);
+        return view('admin.logs.traffic', compact(['totalTraffic', 'dataFlowLogs', 'nodes']));
     }
 
     // 邮件发送日志列表
     public function notificationLog(Request $request)
     {
-        $email = $request->input('email');
-        $type = $request->input('type');
-
         $query = NotificationLog::query();
 
-        if (isset($email)) {
-            $query->where('address', 'like', '%'.$email.'%');
-        }
+        $request->whenFilled('email', function ($email) use ($query) {
+            $query->where('address', 'like', "%{$email}%");
+        });
 
-        if (isset($type)) {
+        $request->whenFilled('type', function ($type) use ($query) {
             $query->whereType($type);
-        }
+        });
 
         return view('admin.logs.notification', ['notificationLogs' => $query->latest()->paginate(15)->appends($request->except('page'))]);
     }
@@ -158,40 +128,35 @@ class LogsController extends Controller
     // 在线IP监控(实时)
     public function onlineIPMonitor(Request $request, $id = null)
     {
-        $ip = $request->input('ip');
-        $email = $request->input('email');
-        $port = $request->input('port');
-        $nodeId = $request->input('nodeId');
-
         $query = NodeOnlineIp::with(['node:id,name', 'user:id,email'])->where('created_at', '>=', strtotime('-2 minutes'));
 
-        if (isset($ip)) {
-            $query->whereIp($ip);
-        }
-
-        if (isset($email)) {
-            $query->whereHas('user', static function ($q) use ($email) {
-                $q->where('email', 'like', '%'.$email.'%');
+        if ($id !== null) {
+            $query->whereHas('user', static function ($query) use ($id) {
+                $query->whereId($id);
             });
         }
 
-        if (isset($port)) {
-            $query->whereHas('user', static function ($q) use ($port) {
-                $q->wherePort($port);
+        $request->whenFilled('ip', function ($ip) use ($query) {
+            $query->whereIp($ip);
+        });
+
+        $request->whenFilled('email', function ($email) use ($query) {
+            $query->whereHas('user', function ($query) use ($email) {
+                $query->where('email', 'like', "%{$email}%");
             });
-        }
+        });
 
-        if (isset($nodeId)) {
-            $query->whereHas('node', static function ($q) use ($nodeId) {
-                $q->whereId($nodeId);
+        $request->whenFilled('port', function ($port) use ($query) {
+            $query->whereHas('user', function ($query) use ($port) {
+                $query->wherePort($port);
             });
-        }
+        });
 
-        if (isset($id)) {
-            $query->whereHas('user', static function ($q) use ($id) {
-                $q->whereId($id);
+        $request->whenFilled('node_id', function ($nodeId) use ($query) {
+            $query->whereHas('node', function ($query) use ($nodeId) {
+                $query->whereId($nodeId);
             });
-        }
+        });
 
         $onlineIPLogs = $query->groupBy('user_id', 'node_id')->latest()->paginate(20)->appends($request->except('page'));
         foreach ($onlineIPLogs as $log) {
@@ -206,22 +171,20 @@ class LogsController extends Controller
 
         return view('admin.logs.onlineIPMonitor', [
             'onlineIPLogs' => $onlineIPLogs,
-            'nodes' => Node::whereStatus(1)->orderByDesc('sort')->latest()->get(),
+            'nodes'        => Node::whereStatus(1)->orderByDesc('sort')->latest()->get(),
         ]);
     }
 
     // 用户余额变动记录
     public function userCreditLogList(Request $request)
     {
-        $email = $request->input('email');
-
         $query = UserCreditLog::with('user:id,email')->latest();
 
-        if (isset($email)) {
-            $query->whereHas('user', static function ($q) use ($email) {
-                $q->where('email', 'like', '%'.$email.'%');
+        $request->whenFilled('email', function ($value) use ($query) {
+            $query->whereHas('user', function ($query) use ($value) {
+                $query->where('email', 'like', "%{$value}%");
             });
-        }
+        });
 
         return view('admin.logs.userCreditHistory', ['userCreditLogs' => $query->paginate(15)->appends($request->except('page'))]);
     }
@@ -229,31 +192,27 @@ class LogsController extends Controller
     // 用户封禁记录
     public function userBanLogList(Request $request)
     {
-        $email = $request->input('email');
+        $query = UserBanedLog::with('user:id,email,t');
 
-        $query = UserBanedLog::with('user:id,email,t')->latest();
-
-        if (isset($email)) {
-            $query->whereHas('user', static function ($q) use ($email) {
-                $q->where('email', 'like', '%'.$email.'%');
+        $request->whenFilled('email', function ($value) use ($query) {
+            $query->whereHas('user', function ($query) use ($value) {
+                $query->where('email', 'like', "%{$value}%");
             });
-        }
+        });
 
-        return view('admin.logs.userBanHistory', ['userBanLogs' => $query->paginate(15)->appends($request->except('page'))]);
+        return view('admin.logs.userBanHistory', ['userBanLogs' => $query->latest()->paginate(15)->appends($request->except('page'))]);
     }
 
     // 用户流量变动记录
     public function userTrafficLogList(Request $request)
     {
-        $email = $request->input('email');
-
         $query = UserDataModifyLog::with(['user:id,email', 'order.goods:id,name']);
 
-        if (isset($email)) {
-            $query->whereHas('user', static function ($q) use ($email) {
-                $q->where('email', 'like', '%'.$email.'%');
+        $request->whenFilled('email', function ($value) use ($query) {
+            $query->whereHas('user', function ($query) use ($value) {
+                $query->where('email', 'like', "%{$value}%");
             });
-        }
+        });
 
         return view('admin.logs.userTraffic', ['userTrafficLogs' => $query->latest()->paginate(15)->appends($request->except('page'))]);
     }
@@ -261,30 +220,21 @@ class LogsController extends Controller
     // 用户在线IP记录
     public function userOnlineIPList(Request $request)
     {
-        $email = $request->input('email');
-        $port = $request->input('port');
-        $wechat = $request->input('wechat');
-        $qq = $request->input('qq');
-
         $query = User::activeUser();
 
-        if (isset($email)) {
-            $query->where('email', 'like', '%'.$email.'%');
-        }
-
-        if (isset($wechat)) {
-            $query->where('wechat', 'like', '%'.$wechat.'%');
-        }
-
-        if (isset($qq)) {
-            $query->where('qq', 'like', '%'.$qq.'%');
+        foreach (['email', 'wechat', 'qq'] as $field) {
+            $request->whenFilled($field, function ($value) use ($query, $field) {
+                $query->where($field, 'like', "%{$value}%");
+            });
         }
 
-        if (isset($port)) {
-            $query->wherePort($port);
+        foreach (['id', 'port'] as $field) {
+            $request->whenFilled($field, function ($value) use ($query, $field) {
+                $query->where($field, $value);
+            });
         }
 
-        $userList = $query->paginate(15)->appends($request->except('page'));
+        $userList = $query->orderBy('id')->paginate(15)->appends($request->except('page'));
 
         $nodeOnlineIPs = NodeOnlineIp::with('node:id,name')->where('created_at', '>=', strtotime('-10 minutes'))->latest()->distinct()->get();
         foreach ($userList as $user) {
@@ -305,12 +255,12 @@ class LogsController extends Controller
     // 回调日志
     public function callbackList(Request $request)
     {
-        $status = $request->input('status', 0);
-
         $query = PaymentCallback::query();
 
-        if (isset($status)) {
-            $query->whereStatus($status);
+        foreach (['trade_no', 'out_trade_no', 'status'] as $field) {
+            $request->whenFilled($field, function ($value) use ($query, $field) {
+                $query->where($field, $value);
+            });
         }
 
         return view('admin.logs.callback', ['callbackLogs' => $query->latest()->paginate(10)->appends($request->except('page'))]);

+ 6 - 10
app/Http/Controllers/Admin/MarketingController.php

@@ -15,13 +15,11 @@ class MarketingController extends Controller
     // 邮件群发消息列表
     public function emailList(Request $request)
     {
-        $status = $request->input('status');
-
         $query = Marketing::whereType(1);
 
-        if (isset($status)) {
-            $query->whereStatus($status);
-        }
+        $request->whenFilled('status', function ($value) use ($query) {
+            $query->whereStatus($value);
+        });
 
         return view('admin.marketing.emailList', ['emails' => $query->paginate(15)->appends($request->except('page'))]);
     }
@@ -29,13 +27,11 @@ class MarketingController extends Controller
     // 消息通道群发列表
     public function pushList(Request $request)
     {
-        $status = $request->input('status');
-
         $query = Marketing::whereType(2);
 
-        if (isset($status)) {
-            $query->whereStatus($status);
-        }
+        $request->whenFilled('status', function ($value) use ($query) {
+            $query->whereStatus($value);
+        });
 
         return view('admin.marketing.pushList', ['pushes' => $query->paginate(15)->appends($request->except('page'))]);
     }

+ 14 - 22
app/Http/Controllers/Admin/RuleController.php

@@ -17,12 +17,11 @@ class RuleController extends Controller
     // 审计规则列表
     public function index(Request $request)
     {
-        $type = $request->input('type');
         $query = Rule::query();
 
-        if ($type) {
-            $query->whereType($type);
-        }
+        $request->whenFilled('type', function ($value) use ($query) {
+            $query->whereType($value);
+        });
 
         return view('admin.rule.index', ['rules' => $query->paginate(15)->appends($request->except('page'))]);
     }
@@ -62,30 +61,23 @@ class RuleController extends Controller
     // 用户触发审计规则日志
     public function ruleLogList(Request $request)
     {
-        $uid = $request->input('uid');
-        $email = $request->input('email');
-        $nodeId = $request->input('node_id');
-        $ruleId = $request->input('rule_id');
         $query = RuleLog::query();
 
-        if ($uid) {
-            $query->whereUserId($uid);
-        }
-        if (isset($email)) {
-            $query->whereHas('user', static function ($q) use ($email) {
-                $q->where('email', 'like', '%'.$email.'%');
+        foreach (['user_id', 'node_id', 'rule_id'] as $field) {
+            $request->whenFilled($field, function ($value) use ($query, $field) {
+                $query->where($field, $value);
             });
         }
-        if ($nodeId) {
-            $query->whereNodeId($nodeId);
-        }
-        if ($ruleId) {
-            $query->whereRuleId($ruleId);
-        }
+
+        $request->whenFilled('email', function ($email) use ($query) {
+            $query->whereHas('user', function ($query) use ($email) {
+                $query->where('email', 'like', "%{$email}%");
+            });
+        });
 
         return view('admin.rule.log', [
-            'nodes' => Node::all(),
-            'rules' => Rule::all(),
+            'nodes'    => Node::all(),
+            'rules'    => Rule::all(),
             'ruleLogs' => $query->latest()->paginate(15)->appends($request->except('page')),
         ]);
     }

+ 5 - 10
app/Http/Controllers/Admin/ShopController.php

@@ -23,17 +23,12 @@ class ShopController extends Controller
     // 商品列表
     public function index(Request $request)
     {
-        $type = $request->input('type');
-        $status = $request->input('status');
-
         $query = Goods::query();
 
-        if (isset($type)) {
-            $query->whereType($type);
-        }
-
-        if (isset($status)) {
-            $query->whereStatus($status);
+        foreach (['type', 'status'] as $field) {
+            $request->whenFilled($field, function ($value) use ($query, $field) {
+                $query->where($field, $value);
+            });
         }
 
         return view('admin.shop.index', ['goodsList' => $query->orderByDesc('status')->paginate(10)->appends($request->except('page'))]);
@@ -95,7 +90,7 @@ class ShopController extends Controller
     public function edit(Goods $good)
     {
         return view('admin.shop.info', [
-            'good' => $good,
+            'good'   => $good,
             'levels' => Level::orderBy('level')->get(),
         ]);
     }

+ 8 - 14
app/Http/Controllers/Admin/SubscribeController.php

@@ -19,24 +19,18 @@ class SubscribeController extends Controller
     // 订阅码列表
     public function index(Request $request)
     {
-        $user_id = $request->input('user_id');
-        $email = $request->input('email');
-        $status = $request->input('status');
-
         $query = UserSubscribe::with(['user:id,email']);
 
-        if (isset($user_id)) {
-            $query->whereUserId($user_id);
-        }
-
-        if (isset($email)) {
-            $query->whereHas('user', static function ($q) use ($email) {
-                $q->where('email', 'like', '%'.$email.'%');
+        $request->whenFilled('email', function ($value) use ($query) {
+            $query->whereHas('user', function ($query) use ($value) {
+                $query->where('email', 'like', "%{$value}%");
             });
-        }
+        });
 
-        if (isset($status)) {
-            $query->whereStatus($status);
+        foreach (['user_id', 'status'] as $field) {
+            $request->whenFilled($field, function ($value) use ($query, $field) {
+                $query->where($field, $value);
+            });
         }
 
         return view('admin.subscribe.index', ['subscribeList' => $query->latest()->paginate(20)->appends($request->except('page'))]);

+ 3 - 5
app/Http/Controllers/Admin/TicketController.php

@@ -18,17 +18,15 @@ class TicketController extends Controller
     // 工单列表
     public function index(Request $request)
     {
-        $email = $request->input('email');
-
         $query = Ticket::where(function ($query) {
             $query->whereAdminId(Auth::id())->orwhere('admin_id');
         });
 
-        if (isset($email)) {
+        $request->whenFilled('email', function ($email) use ($query) {
             $query->whereHas('user', function ($query) use ($email) {
-                $query->where('email', 'like', '%'.$email.'%');
+                $query->where('email', 'like', "%{$email}%");
             });
-        }
+        });
 
         return view('admin.ticket.index', ['ticketList' => $query->latest()->paginate(10)->appends($request->except('page'))]);
     }

+ 20 - 57
app/Http/Controllers/Admin/UserController.php

@@ -29,87 +29,50 @@ class UserController extends Controller
     // 用户列表
     public function index(Request $request)
     {
-        $id = $request->input('id');
-        $email = $request->input('email');
-        $wechat = $request->input('wechat');
-        $qq = $request->input('qq');
-        $port = $request->input('port');
-        $group = $request->input('group');
-        $level = $request->input('level');
-        $status = $request->input('status');
-        $enable = $request->input('enable');
-        $online = $request->input('online');
-        $flowAbnormal = $request->input('flowAbnormal');
-        $expireWarning = $request->input('expireWarning');
-        $largeTraffic = $request->input('largeTraffic');
-
         $query = User::with('subscribe');
-        if (isset($id)) {
-            $query->whereId($id);
-        }
-
-        if (isset($email)) {
-            $query->where('email', 'like', '%'.$email.'%');
-        }
-
-        if (isset($wechat)) {
-            $query->where('wechat', 'like', '%'.$wechat.'%');
-        }
-
-        if (isset($qq)) {
-            $query->where('qq', 'like', '%'.$qq.'%');
-        }
-
-        if (isset($port)) {
-            $query->wherePort($port);
-        }
 
-        if (isset($status)) {
-            $query->whereStatus($status);
+        foreach (['id', 'port', 'status', 'enable', 'user_group_id', 'level'] as $field) {
+            $request->whenFilled($field, function ($value) use ($query, $field) {
+                $query->where($field, $value);
+            });
         }
 
-        if (isset($enable)) {
-            $query->whereEnable($enable);
-        }
-
-        if (isset($group)) {
-            $query->whereUserGroupId($group);
-        }
-
-        if (isset($level)) {
-            $query->whereLevel($level);
+        foreach (['email', 'wechat', 'qq'] as $field) {
+            $request->whenFilled($field, function ($value) use ($query, $field) {
+                $query->where($field, 'like', "%{$value}%");
+            });
         }
 
         // 流量超过100G的
-        if ($largeTraffic) {
+        $request->whenFilled('largeTraffic', function () use ($query) {
             $query->whereIn('status', [0, 1])->whereRaw('(u + d)/transfer_enable >= 0.9');
-        }
+        });
 
         // 临近过期提醒
-        if ($expireWarning) {
+        $request->whenFilled('expireWarning', function () use ($query) {
             $query->whereBetween('expired_at', [date('Y-m-d'), date('Y-m-d', strtotime(sysConfig('expire_days').' days'))]);
-        }
+        });
 
         // 当前在线
-        if ($online) {
+        $request->whenFilled('online', function () use ($query) {
             $query->where('t', '>=', strtotime('-10 minutes'));
-        }
+        });
 
         // 不活跃用户
-        if ($request->has('unActive')) {
+        $request->whenFilled('unActive', function () use ($query) {
             $query->whereBetween('t', [1, strtotime('-'.sysConfig('expire_days').' days')])->whereEnable(1);
-        }
+        });
 
         // 不活跃用户
-        if ($request->has('paying')) {
+        $request->whenFilled('paying', function () use ($query) {
             $payingUser = Order::whereStatus(2)->where('goods_id', '<>', 0)->whereIsExpire(0)->where('amount', '>', 0)->pluck('user_id')->unique();
             $query->whereIn('id', $payingUser);
-        }
+        });
 
         // 1小时内流量异常用户
-        if ($flowAbnormal) {
+        $request->whenFilled('flowAbnormal', function () use ($query) {
             $query->whereIn('id', (new UserHourlyDataFlow)->trafficAbnormal());
-        }
+        });
 
         return view('admin.user.index', [
             'userList'   => $query->orderByDesc('id')->paginate(15)->appends($request->except('page')),

文件差异内容过多而无法显示
+ 170 - 168
composer.lock


+ 9 - 9
resources/views/_layout.blade.php

@@ -36,7 +36,7 @@
     <!-- Scripts -->
     <script src="/assets/global/vendor/breakpoints/breakpoints.min.js"></script>
     <script>
-      Breakpoints();
+        Breakpoints();
     </script>
     @if (config('theme.skin'))
         <link id="skinStyle" href="/assets/css/skins/{{config('theme.skin')}}.min.css" rel="stylesheet" type="text/css">
@@ -70,20 +70,20 @@
 <!-- 设置/Config -->
 <script src="/assets/global/js/config/colors.js"></script>
 <script>
-  Config.set('assets', '/assets');
+    Config.set('assets', '/assets');
 </script>
 <!-- 页面/Page -->
 <script src="/assets/js/Site.js"></script>
 <script src="/assets/global/js/Plugin/asscrollable.js"></script>
 <script src="/assets/global/js/Plugin/slidepanel.js"></script>
 <script>
-  (function(document, window, $) {
-    'use strict';
-    const Site = window.Site;
-    $(document).ready(function() {
-      Site.run();
-    });
-  })(document, window, jQuery);
+    (function(document, window, $) {
+        'use strict';
+        const Site = window.Site;
+        $(document).ready(function() {
+            Site.run();
+        });
+    })(document, window, jQuery);
 </script>
 @yield('layout_javascript')
 </body>

+ 37 - 50
resources/views/admin/aff/index.blade.php

@@ -9,12 +9,12 @@
                 <h3 class="panel-title">提现申请列表</h3>
             </div>
             <div class="panel-body">
-                <div class="form-row">
+                <form class="form-row">
                     <div class="form-group col-lg-2 col-sm-4">
-                        <input type="text" class="form-control" name="email" value="{{Request::input('email')}}" id="email" placeholder="申请账号"/>
+                        <input type="text" class="form-control" name="email" value="{{Request::query('email')}}" placeholder="申请账号"/>
                     </div>
                     <div class="form-group col-lg-2 col-sm-4">
-                        <select class="form-control" name="status" id="status" onChange="Search()">
+                        <select class="form-control" name="status" id="status" onchange="this.form.submit()">
                             <option value="" hidden>状态</option>
                             <option value="-1">驳回</option>
                             <option value="0">待审核</option>
@@ -23,10 +23,10 @@
                         </select>
                     </div>
                     <div class="form-group col-lg-1 col-sm-4 btn-group">
-                        <button class="btn btn-primary" onclick="Search()">搜 索</button>
+                        <button type="submit" class="btn btn-primary">搜 索</button>
                         <a href="{{route('admin.aff.index')}}" class="btn btn-danger">{{trans('common.reset')}}</a>
                     </div>
-                </div>
+                </form>
                 <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                     <thead class="thead-default">
                     <tr>
@@ -116,53 +116,40 @@
     <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js"></script>
     <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
     <script>
-      $(document).ready(function() {
-        $('#status').val({{Request::input('status')}});
-      });
+        $(document).ready(function() {
+            $('#status').val({{Request::query('status')}});
+        });
 
-      //回车检测
-      $(document).on('keypress', 'input', function(e) {
-        if (e.which === 13) {
-          Search();
-          return false;
+        @can('admin.aff.setStatus')
+        // 更改状态
+        function setStatus(id, status) {
+            $.ajax({
+                method: 'PUT',
+                url: '{{route('admin.aff.setStatus','')}}/' + id,
+                data: {
+                    _token: '{{csrf_token()}}',
+                    status: status,
+                },
+                dataType: 'json',
+                success: function(ret) {
+                    if (ret.status === 'success') {
+                        swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
+                    } else {
+                        swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+                    }
+                },
+                error: function(data) {
+                    let str = '';
+                    const errors = data.responseJSON;
+                    if ($.isEmptyObject(errors) === false) {
+                        $.each(errors.errors, function(index, value) {
+                            str += '<li>' + value + '</li>';
+                        });
+                        swal.fire({title: '提示', html: str, icon: 'error', confirmButtonText: '{{trans('common.confirm')}}'});
+                    }
+                },
+            });
         }
-      });
-
-      // 搜索
-      function Search() {
-        window.location.href = '{{route('admin.aff.index')}}?email=' + $('#email').val() + '&status=' + $('#status option:selected').val();
-      }
-
-      @can('admin.aff.setStatus')
-      // 更改状态
-      function setStatus(id, status) {
-        $.ajax({
-          method: 'PUT',
-          url: '{{route('admin.aff.setStatus','')}}/' + id,
-          data: {
-            _token: '{{csrf_token()}}',
-            status: status,
-          },
-          dataType: 'json',
-          success: function(ret) {
-            if (ret.status === 'success') {
-              swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
-            } else {
-              swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-            }
-          },
-          error: function(data) {
-            let str = '';
-            const errors = data.responseJSON;
-            if ($.isEmptyObject(errors) === false) {
-              $.each(errors.errors, function(index, value) {
-                str += '<li>' + value + '</li>';
-              });
-              swal.fire({title: '提示', html: str, icon: 'error', confirmButtonText: '{{trans('common.confirm')}}'});
-            }
-          },
-        });
-      }
         @endcan
     </script>
 @endsection

+ 9 - 23
resources/views/admin/aff/rebate.blade.php

@@ -9,15 +9,15 @@
                 <h2 class="panel-title">返利流水记录</h2>
             </div>
             <div class="panel-body">
-                <div class="form-row">
+                <form class="form-row">
                     <div class="form-group col-lg-4 col-sm-6">
-                        <input type="text" class="form-control" name="invitee_email" id="invitee_email" value="{{Request::input('invitee_email')}}" placeholder="消费者"/>
+                        <input type="text" class="form-control" name="invitee_email" value="{{Request::query('invitee_email')}}" placeholder="消费者"/>
                     </div>
                     <div class="form-group col-lg-4 col-sm-6">
-                        <input type="text" class="form-control" name="inviter_email" id="inviter_email" value="{{Request::input('inviter_email')}}" placeholder="邀请人"/>
+                        <input type="text" class="form-control" name="inviter_email" value="{{Request::query('inviter_email')}}" placeholder="邀请人"/>
                     </div>
                     <div class="form-group col-lg-2 col-sm-6">
-                        <select name="status" id="status" class="form-control" onChange="Search()">
+                        <select name="status" id="status" class="form-control" onchange="this.form.submit()">
                             <option value="" hidden>状态</option>
                             <option value="0">未提现</option>
                             <option value="1">申请中</option>
@@ -25,10 +25,10 @@
                         </select>
                     </div>
                     <div class="form-group col-lg-2 col-sm-6 btn-group">
-                        <button class="btn btn-primary" onclick="Search()">搜 索</button>
+                        <button type="submit" class="btn btn-primary">搜 索</button>
                         <a href="{{route('admin.aff.rebate')}}" class="btn btn-danger">{{trans('common.reset')}}</a>
                     </div>
-                </div>
+                </form>
                 <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                     <thead class="thead-default">
                     <tr>
@@ -100,22 +100,8 @@
     <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js"></script>
     <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
     <script>
-      $(document).ready(function() {
-        $('#status').val({{Request::input('status')}});
-      });
-
-      //回车检测
-      $(document).on('keypress', 'input', function(e) {
-        if (e.which === 13) {
-          Search();
-          return false;
-        }
-      });
-
-      // 搜索
-      function Search() {
-        window.location.href = '{{route('admin.aff.rebate')}}?invitee_email=' + $('#invitee_email').val() +
-            '&inviter_email=' + $('#inviter_email').val() + '&status=' + $('#status option:selected').val();
-      }
+        $(document).ready(function() {
+            $('#status').val({{Request::query('status')}});
+        });
     </script>
 @endsection

+ 30 - 30
resources/views/admin/article/create.blade.php

@@ -94,40 +94,40 @@
     <script>
         @if(old('type'))
         $(document).ready(function() {
-          $("input[name='type'][value='{{old('type')}}']").click();
+            $("input[name='type'][value='{{old('type')}}']").click();
         });
         @endif
 
         $('input:radio[name=\'type\']').on('change', function() {
-          const summary = $('#summary');
-          const sort = $('#sort');
-          const allLogo = $('#all_logo');
-          const icon = $('#icon');
-          const logoUpload = $('#logoUpload');
-          summary.hide();
-          sort.hide();
-          allLogo.show();
-          switch (parseInt($(this).val())) {
-            case 1:
-              summary.show();
-              sort.show();
-              icon.hide();
-              logoUpload.show();
-              break;
-            case 2:
-              allLogo.hide();
-              break;
-            case 3:
-              sort.show();
-              icon.show();
-              logoUpload.hide();
-              break;
-            case 4:
-              icon.show();
-              logoUpload.hide();
-              break;
-            default:
-          }
+            const summary = $('#summary');
+            const sort = $('#sort');
+            const allLogo = $('#all_logo');
+            const icon = $('#icon');
+            const logoUpload = $('#logoUpload');
+            summary.hide();
+            sort.hide();
+            allLogo.show();
+            switch (parseInt($(this).val())) {
+                case 1:
+                    summary.show();
+                    sort.show();
+                    icon.hide();
+                    logoUpload.show();
+                    break;
+                case 2:
+                    allLogo.hide();
+                    break;
+                case 3:
+                    sort.show();
+                    icon.show();
+                    logoUpload.hide();
+                    break;
+                case 4:
+                    icon.show();
+                    logoUpload.hide();
+                    break;
+                default:
+            }
         });
     </script>
 @endsection

+ 1 - 1
resources/views/admin/article/edit.blade.php

@@ -100,7 +100,7 @@
                     </div>
                     <div class="form-actions text-right">
                         <div class="btn-group">
-                            <a href="{{route('admin.article.index', ['page'=>Request::input('page')])}}" class="btn btn-danger">
+                            <a href="{{route('admin.article.index', ['page'=>Request::query('page')])}}" class="btn btn-danger">
                                 返 回
                             </a>
                             <button type="submit" class="btn btn-success">提 交</button>

+ 25 - 25
resources/views/admin/article/index.blade.php

@@ -53,7 +53,7 @@
                                 @canany(['admin.article.edit', 'admin.article.destroy'])
                                     <div class="btn-group">
                                         @can('admin.article.edit')
-                                            <a href="{{route('admin.article.edit',['article'=>$article->id, 'page'=>Request::input('page')])}}" class="btn btn-outline-primary">
+                                            <a href="{{route('admin.article.edit',['article'=>$article->id, 'page'=>Request::query('page')])}}" class="btn btn-outline-primary">
                                                 <i class="icon wb-edit"></i></a>
                                         @endcan
                                         @can('admin.article.destroy')
@@ -88,32 +88,32 @@
     <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
     @can('admin.article.destroy')
         <script>
-          // 删除文章
-          function delArticle(url) {
-            swal.fire({
-              title: '确定删除文章?',
-              icon: 'question',
-              showCancelButton: true,
-              cancelButtonText: '{{trans('common.close')}}',
-              confirmButtonText: '{{trans('common.confirm')}}',
-            }).then((result) => {
-              if (result.value) {
-                $.ajax({
-                  method: 'DELETE',
-                  url: url,
-                  data: {_token: '{{csrf_token()}}'},
-                  dataType: 'json',
-                  success: function(ret) {
-                    if (ret.status === 'success') {
-                      swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
-                    } else {
-                      swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+            // 删除文章
+            function delArticle(url) {
+                swal.fire({
+                    title: '确定删除文章?',
+                    icon: 'question',
+                    showCancelButton: true,
+                    cancelButtonText: '{{trans('common.close')}}',
+                    confirmButtonText: '{{trans('common.confirm')}}',
+                }).then((result) => {
+                    if (result.value) {
+                        $.ajax({
+                            method: 'DELETE',
+                            url: url,
+                            data: {_token: '{{csrf_token()}}'},
+                            dataType: 'json',
+                            success: function(ret) {
+                                if (ret.status === 'success') {
+                                    swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
+                                } else {
+                                    swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+                                }
+                            },
+                        });
                     }
-                  },
                 });
-              }
-            });
-          }
+            }
         </script>
     @endcan
 @endsection

+ 300 - 300
resources/views/admin/config/config.blade.php

@@ -374,43 +374,43 @@
         @can('admin.config.level.store')
         // 添加等级
         function addLevel() {
-          const level = $('#add_level').val();
-          const level_name = $('#add_level_name').val();
-
-          if (level.trim() === '') {
-            $('#level_msg').show().html('等级不能为空');
-            $('#level').focus();
-            return false;
-          }
-
-          if (level_name.trim() === '') {
-            $('#level_msg').show().html('等级名称不能为空');
-            $('#level_name').focus();
-            return false;
-          }
-
-          $.ajax({
-            url: '{{route('admin.config.level.store')}}',
-            method: 'POST',
-            data: {_token: '{{csrf_token()}}', level: level, name: level_name},
-            beforeSend: function() {
-              $('#level_msg').show().html('正在添加');
-            },
-            success: function(ret) {
-              if (ret.status === 'fail') {
-                $('#level_msg').show().html(ret.message);
+            const level = $('#add_level').val();
+            const level_name = $('#add_level_name').val();
+
+            if (level.trim() === '') {
+                $('#level_msg').show().html('等级不能为空');
+                $('#level').focus();
+                return false;
+            }
+
+            if (level_name.trim() === '') {
+                $('#level_msg').show().html('等级名称不能为空');
+                $('#level_name').focus();
                 return false;
-              }
-              $('#add_level_modal').modal('hide');
-              window.location.reload();
-            },
-            error: function() {
-              $('#level_msg').show().html('请求错误,请重试');
-            },
-            complete: function() {
-              swal.fire({title: '添加成功', icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
-            },
-          });
+            }
+
+            $.ajax({
+                url: '{{route('admin.config.level.store')}}',
+                method: 'POST',
+                data: {_token: '{{csrf_token()}}', level: level, name: level_name},
+                beforeSend: function() {
+                    $('#level_msg').show().html('正在添加');
+                },
+                success: function(ret) {
+                    if (ret.status === 'fail') {
+                        $('#level_msg').show().html(ret.message);
+                        return false;
+                    }
+                    $('#add_level_modal').modal('hide');
+                    window.location.reload();
+                },
+                error: function() {
+                    $('#level_msg').show().html('请求错误,请重试');
+                },
+                complete: function() {
+                    swal.fire({title: '添加成功', icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
+                },
+            });
         }
 
         @else
@@ -420,23 +420,23 @@
         @can('admin.config.level.update')
         // 更新等级
         function updateLevel(id) {
-          $.ajax({
-            method: 'PUT',
-            url: '{{route('admin.config.level.update', '')}}/' + id,
-            data: {
-              _token: '{{csrf_token()}}',
-              level: $('#level_' + id).val(),
-              name: $('#level_name_' + id).val(),
-            },
-            dataType: 'json',
-            success: function(ret) {
-              if (ret.status === 'success') {
-                swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
-              } else {
-                swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-              }
-            },
-          });
+            $.ajax({
+                method: 'PUT',
+                url: '{{route('admin.config.level.update', '')}}/' + id,
+                data: {
+                    _token: '{{csrf_token()}}',
+                    level: $('#level_' + id).val(),
+                    name: $('#level_name_' + id).val(),
+                },
+                dataType: 'json',
+                success: function(ret) {
+                    if (ret.status === 'success') {
+                        swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
+                    } else {
+                        swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+                    }
+                },
+            });
         }
 
         @else
@@ -446,30 +446,30 @@
         @can('admin.config.level.destroy')
         // 删除等级
         function delLevel(id, name) {
-          swal.fire({
-            title: '确定删除等级 【' + name + '】 ?',
-            icon: 'question',
-            allowEnterKey: false,
-            showCancelButton: true,
-            cancelButtonText: '{{trans('common.close')}}',
-            confirmButtonText: '{{trans('common.confirm')}}',
-          }).then((result) => {
-            if (result.value) {
-              $.ajax({
-                method: 'DELETE',
-                url: '{{route('admin.config.level.destroy', '')}}/' + id,
-                data: {_token: '{{csrf_token()}}'},
-                dataType: 'json',
-                success: function(ret) {
-                  if (ret.status === 'success') {
-                    swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
-                  } else {
-                    swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-                  }
-                },
-              });
-            }
-          });
+            swal.fire({
+                title: '确定删除等级 【' + name + '】 ?',
+                icon: 'question',
+                allowEnterKey: false,
+                showCancelButton: true,
+                cancelButtonText: '{{trans('common.close')}}',
+                confirmButtonText: '{{trans('common.confirm')}}',
+            }).then((result) => {
+                if (result.value) {
+                    $.ajax({
+                        method: 'DELETE',
+                        url: '{{route('admin.config.level.destroy', '')}}/' + id,
+                        data: {_token: '{{csrf_token()}}'},
+                        dataType: 'json',
+                        success: function(ret) {
+                            if (ret.status === 'success') {
+                                swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
+                            } else {
+                                swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+                            }
+                        },
+                    });
+                }
+            });
         }
 
         @else
@@ -479,48 +479,48 @@
         @can('admin.config.country.store')
         // 添加国家/地区
         function addCountry() {
-          const country_name = $('#add_country_name').val();
-          const country_code = $('#add_country_code').val();
-
-          if (country_code.trim() === '') {
-            $('#country_msg').show().html('国家/地区代码不能为空');
-            $('#add_country_code').focus();
-            return false;
-          }
-
-          if (country_name.trim() === '') {
-            $('#country_msg').show().html('国家/地区名称不能为空');
-            $('#add_country_name').focus();
-            return false;
-          }
-
-          $.ajax({
-            url: '{{route('admin.config.country.store')}}',
-            method: 'POST',
-            data: {_token: '{{csrf_token()}}', code: country_code, name: country_name},
-            beforeSend: function() {
-              $('#country_msg').show().html('正在添加');
-            },
-            success: function(ret) {
-              if (ret.status === 'fail') {
-                $('#country_msg').show().html(ret.message);
+            const country_name = $('#add_country_name').val();
+            const country_code = $('#add_country_code').val();
+
+            if (country_code.trim() === '') {
+                $('#country_msg').show().html('国家/地区代码不能为空');
+                $('#add_country_code').focus();
+                return false;
+            }
+
+            if (country_name.trim() === '') {
+                $('#country_msg').show().html('国家/地区名称不能为空');
+                $('#add_country_name').focus();
                 return false;
-              }
-              $('#add_country_modal').modal('hide');
-              window.location.reload();
-            },
-            error: function() {
-              $('#country_msg').show().html('请求错误,请重试');
-            },
-            complete: function() {
-              swal.fire({
-                title: '添加成功',
-                icon: 'success',
-                timer: 1000,
-                showConfirmButton: false,
-              }).then(() => window.location.reload());
-            },
-          });
+            }
+
+            $.ajax({
+                url: '{{route('admin.config.country.store')}}',
+                method: 'POST',
+                data: {_token: '{{csrf_token()}}', code: country_code, name: country_name},
+                beforeSend: function() {
+                    $('#country_msg').show().html('正在添加');
+                },
+                success: function(ret) {
+                    if (ret.status === 'fail') {
+                        $('#country_msg').show().html(ret.message);
+                        return false;
+                    }
+                    $('#add_country_modal').modal('hide');
+                    window.location.reload();
+                },
+                error: function() {
+                    $('#country_msg').show().html('请求错误,请重试');
+                },
+                complete: function() {
+                    swal.fire({
+                        title: '添加成功',
+                        icon: 'success',
+                        timer: 1000,
+                        showConfirmButton: false,
+                    }).then(() => window.location.reload());
+                },
+            });
         }
 
         @else
@@ -530,19 +530,19 @@
         @can('admin.config.country.update')
         // 更新国家/地区
         function updateCountry(code) {
-          $.ajax({
-            method: 'PUT',
-            url: '{{route('admin.config.country.update', '')}}/' + code,
-            data: {_token: '{{csrf_token()}}', name: $('#country_' + code).val()},
-            dataType: 'json',
-            success: function(ret) {
-              if (ret.status === 'success') {
-                swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
-              } else {
-                swal.fire({title: ret.message, icon: 'error'});
-              }
-            },
-          });
+            $.ajax({
+                method: 'PUT',
+                url: '{{route('admin.config.country.update', '')}}/' + code,
+                data: {_token: '{{csrf_token()}}', name: $('#country_' + code).val()},
+                dataType: 'json',
+                success: function(ret) {
+                    if (ret.status === 'success') {
+                        swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
+                    } else {
+                        swal.fire({title: ret.message, icon: 'error'});
+                    }
+                },
+            });
         }
 
         @else
@@ -552,30 +552,30 @@
         @can('admin.config.country.destroy')
         // 删除国家/地区
         function delCountry(code, name) {
-          swal.fire({
-            title: '确定删除 【' + name + '】 信息?',
-            icon: 'question',
-            allowEnterKey: false,
-            showCancelButton: true,
-            cancelButtonText: '{{trans('common.close')}}',
-            confirmButtonText: '{{trans('common.confirm')}}',
-          }).then((result) => {
-            if (result.value) {
-              $.ajax({
-                method: 'DELETE',
-                url: '{{route('admin.config.country.destroy', '')}}/' + code,
-                data: {_token: '{{csrf_token()}}'},
-                dataType: 'json',
-                success: function(ret) {
-                  if (ret.status === 'success') {
-                    swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
-                  } else {
-                    swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-                  }
-                },
-              });
-            }
-          });
+            swal.fire({
+                title: '确定删除 【' + name + '】 信息?',
+                icon: 'question',
+                allowEnterKey: false,
+                showCancelButton: true,
+                cancelButtonText: '{{trans('common.close')}}',
+                confirmButtonText: '{{trans('common.confirm')}}',
+            }).then((result) => {
+                if (result.value) {
+                    $.ajax({
+                        method: 'DELETE',
+                        url: '{{route('admin.config.country.destroy', '')}}/' + code,
+                        data: {_token: '{{csrf_token()}}'},
+                        dataType: 'json',
+                        success: function(ret) {
+                            if (ret.status === 'success') {
+                                swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
+                            } else {
+                                swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+                            }
+                        },
+                    });
+                }
+            });
         }
 
         @else
@@ -585,38 +585,38 @@
         @can('admin.config.ss.store')
         // 添加配置
         function addConfig() {
-          const name = $('#name').val();
-          const type = $('#type').val();
-
-          if (name.trim() === '') {
-            $('#msg').show().html('名称不能为空');
-            $('#name').focus();
-            return false;
-          }
-
-          $.ajax({
-            url: '{{route('admin.config.ss.store')}}',
-            method: 'POST',
-            data: {_token: '{{csrf_token()}}', name: name, type: type},
-            dataType: 'json',
-            beforeSend: function() {
-              $('#msg').show().html('正在添加');
-            },
-            success: function(ret) {
-              if (ret.status === 'fail') {
-                $('#msg').show().html(ret.message);
+            const name = $('#name').val();
+            const type = $('#type').val();
+
+            if (name.trim() === '') {
+                $('#msg').show().html('名称不能为空');
+                $('#name').focus();
                 return false;
-              }
-
-              $('#add_config_modal').modal('hide');
-            },
-            error: function() {
-              $('#msg').show().html('请求错误,请重试');
-            },
-            complete: function() {
-              swal.fire({title: '添加成功', icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
-            },
-          });
+            }
+
+            $.ajax({
+                url: '{{route('admin.config.ss.store')}}',
+                method: 'POST',
+                data: {_token: '{{csrf_token()}}', name: name, type: type},
+                dataType: 'json',
+                beforeSend: function() {
+                    $('#msg').show().html('正在添加');
+                },
+                success: function(ret) {
+                    if (ret.status === 'fail') {
+                        $('#msg').show().html(ret.message);
+                        return false;
+                    }
+
+                    $('#add_config_modal').modal('hide');
+                },
+                error: function() {
+                    $('#msg').show().html('请求错误,请重试');
+                },
+                complete: function() {
+                    swal.fire({title: '添加成功', icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
+                },
+            });
         }
 
         @else
@@ -626,19 +626,19 @@
         @can('admin.config.ss.update')
         // 置为默认
         function setDefault(id) {
-          $.ajax({
-            method: 'PUT',
-            url: '{{route('admin.config.ss.update', '')}}/' + id,
-            data: {_token: '{{csrf_token()}}'},
-            dataType: 'json',
-            success: function(ret) {
-              if (ret.status === 'success') {
-                swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
-              } else {
-                swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-              }
-            },
-          });
+            $.ajax({
+                method: 'PUT',
+                url: '{{route('admin.config.ss.update', '')}}/' + id,
+                data: {_token: '{{csrf_token()}}'},
+                dataType: 'json',
+                success: function(ret) {
+                    if (ret.status === 'success') {
+                        swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
+                    } else {
+                        swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+                    }
+                },
+            });
         }
 
         @else
@@ -648,30 +648,30 @@
         @can('admin.config.ss.destroy')
         // 删除配置
         function delConfig(id, name) {
-          swal.fire({
-            title: '确定删除配置 【' + name + '】 ?',
-            icon: 'question',
-            allowEnterKey: false,
-            showCancelButton: true,
-            cancelButtonText: '{{trans('common.close')}}',
-            confirmButtonText: '{{trans('common.confirm')}}',
-          }).then((result) => {
-            if (result.value) {
-              $.ajax({
-                method: 'DELETE',
-                url: '{{route('admin.config.ss.destroy', '')}}/' + id,
-                data: {_token: '{{csrf_token()}}'},
-                dataType: 'json',
-                success: function(ret) {
-                  if (ret.status === 'success') {
-                    swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
-                  } else {
-                    swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-                  }
-                },
-              });
-            }
-          });
+            swal.fire({
+                title: '确定删除配置 【' + name + '】 ?',
+                icon: 'question',
+                allowEnterKey: false,
+                showCancelButton: true,
+                cancelButtonText: '{{trans('common.close')}}',
+                confirmButtonText: '{{trans('common.confirm')}}',
+            }).then((result) => {
+                if (result.value) {
+                    $.ajax({
+                        method: 'DELETE',
+                        url: '{{route('admin.config.ss.destroy', '')}}/' + id,
+                        data: {_token: '{{csrf_token()}}'},
+                        dataType: 'json',
+                        success: function(ret) {
+                            if (ret.status === 'success') {
+                                swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
+                            } else {
+                                swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+                            }
+                        },
+                    });
+                }
+            });
         }
 
         @else
@@ -681,46 +681,46 @@
         @can('admin.config.label.store')
         // 添加标签
         function addLabel() {
-          const name = $('#add_label').val();
-          const sort = $('#add_label_sort').val();
-
-          if (name.trim() === '') {
-            $('#lable_msg').show().html('标签不能为空');
-            return false;
-          }
-
-          if (sort.trim() === '') {
-            $('#lable_msg').show().html('标签排序不能为空');
-            return false;
-          }
-
-          $.ajax({
-            url: '{{route('admin.config.label.store')}}',
-            method: 'POST',
-            data: {_token: '{{csrf_token()}}', name: name, sort: sort},
-            beforeSend: function() {
-              $('#level_msg').show().html('正在添加');
-            },
-            success: function(ret) {
-              if (ret.status === 'fail') {
-                $('#lable_msg').show().html(ret.message);
+            const name = $('#add_label').val();
+            const sort = $('#add_label_sort').val();
+
+            if (name.trim() === '') {
+                $('#lable_msg').show().html('标签不能为空');
+                return false;
+            }
+
+            if (sort.trim() === '') {
+                $('#lable_msg').show().html('标签排序不能为空');
                 return false;
-              }
-              $('#add_label_modal').modal('hide');
-              window.location.reload();
-            },
-            error: function() {
-              $('#lable_msg').show().html('请求错误,请重试');
-            },
-            complete: function() {
-              swal.fire({
-                title: '添加成功',
-                icon: 'success',
-                timer: 1000,
-                showConfirmButton: false,
-              }).then(() => window.location.reload());
-            },
-          });
+            }
+
+            $.ajax({
+                url: '{{route('admin.config.label.store')}}',
+                method: 'POST',
+                data: {_token: '{{csrf_token()}}', name: name, sort: sort},
+                beforeSend: function() {
+                    $('#level_msg').show().html('正在添加');
+                },
+                success: function(ret) {
+                    if (ret.status === 'fail') {
+                        $('#lable_msg').show().html(ret.message);
+                        return false;
+                    }
+                    $('#add_label_modal').modal('hide');
+                    window.location.reload();
+                },
+                error: function() {
+                    $('#lable_msg').show().html('请求错误,请重试');
+                },
+                complete: function() {
+                    swal.fire({
+                        title: '添加成功',
+                        icon: 'success',
+                        timer: 1000,
+                        showConfirmButton: false,
+                    }).then(() => window.location.reload());
+                },
+            });
         }
 
         @else
@@ -730,23 +730,23 @@
         @can('admin.config.label.update')
         // 编辑标签
         function updateLabel(id) {
-          $.ajax({
-            method: 'PUT',
-            url: '{{route('admin.config.label.update', '')}}/' + id,
-            data: {
-              _token: '{{csrf_token()}}',
-              name: $('#label_name_' + id).val(),
-              sort: $('#label_sort_' + id).val(),
-            },
-            dataType: 'json',
-            success: function(ret) {
-              if (ret.status === 'success') {
-                swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
-              } else {
-                swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-              }
-            },
-          });
+            $.ajax({
+                method: 'PUT',
+                url: '{{route('admin.config.label.update', '')}}/' + id,
+                data: {
+                    _token: '{{csrf_token()}}',
+                    name: $('#label_name_' + id).val(),
+                    sort: $('#label_sort_' + id).val(),
+                },
+                dataType: 'json',
+                success: function(ret) {
+                    if (ret.status === 'success') {
+                        swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
+                    } else {
+                        swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+                    }
+                },
+            });
         }
 
         @else
@@ -756,28 +756,28 @@
         @can('admin.config.label.destroy')
         // 删除标签
         function delLabel(id, name) {
-          swal.fire({
-            title: '{{trans('common.warning')}}',
-            text: '确定删除标签 【' + name + '】 ?',
-            icon: 'warning',
-            showCancelButton: true,
-            cancelButtonText: '{{trans('common.close')}}',
-            confirmButtonText: '{{trans('common.confirm')}}',
-          }).then((result) => {
-            $.ajax({
-              method: 'DELETE',
-              url: '{{route('admin.config.label.destroy', '')}}/' + id,
-              data: {_token: '{{csrf_token()}}'},
-              dataType: 'json',
-              success: function(ret) {
-                if (ret.status === 'success') {
-                  swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
-                } else {
-                  swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-                }
-              },
+            swal.fire({
+                title: '{{trans('common.warning')}}',
+                text: '确定删除标签 【' + name + '】 ?',
+                icon: 'warning',
+                showCancelButton: true,
+                cancelButtonText: '{{trans('common.close')}}',
+                confirmButtonText: '{{trans('common.confirm')}}',
+            }).then((result) => {
+                $.ajax({
+                    method: 'DELETE',
+                    url: '{{route('admin.config.label.destroy', '')}}/' + id,
+                    data: {_token: '{{csrf_token()}}'},
+                    dataType: 'json',
+                    success: function(ret) {
+                        if (ret.status === 'success') {
+                            swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
+                        } else {
+                            swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+                        }
+                    },
+                });
             });
-          });
         }
 
         @else

+ 41 - 41
resources/views/admin/config/emailFilter.blade.php

@@ -106,54 +106,54 @@
         @can('admin.config.filter.store')
         // 添加邮箱后缀
         function addEmailSuffix() {
-          const words = $('#words').val();
-          if (words.trim() === '') {
-            swal.fire({title: '邮箱后缀不能为空', icon: 'warning', timer: 1000, showConfirmButton: false});
-            $('#words').focus();
-            return false;
-          }
-
-          $.post('{{route('admin.config.filter.store')}}', {
-            _token: '{{csrf_token()}}',
-            type: $('input:radio[name=\'type\']:checked').val(),
-            words: words,
-          }, function(ret) {
-            if (ret.status === 'success') {
-              swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
-            } else {
-              swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+            const words = $('#words').val();
+            if (words.trim() === '') {
+                swal.fire({title: '邮箱后缀不能为空', icon: 'warning', timer: 1000, showConfirmButton: false});
+                $('#words').focus();
+                return false;
             }
-          });
+
+            $.post('{{route('admin.config.filter.store')}}', {
+                _token: '{{csrf_token()}}',
+                type: $('input:radio[name=\'type\']:checked').val(),
+                words: words,
+            }, function(ret) {
+                if (ret.status === 'success') {
+                    swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
+                } else {
+                    swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+                }
+            });
         }
         @endcan
 
         @can('admin.config.filter.destroy')
         // 删除邮箱后缀
         function delSuffix(id, name) {
-          swal.fire({
-            title: '{{trans('common.warning')}}',
-            text: '确定删除邮箱后缀 【' + name + '】 ?',
-            icon: 'warning',
-            showCancelButton: true,
-            cancelButtonText: '取消',
-            confirmButtonText: '确定',
-          }).then((result) => {
-            if (result.value) {
-              $.ajax({
-                method: 'DELETE',
-                url: '{{route('admin.config.filter.destroy', '')}}/' + id,
-                data: {_token: '{{csrf_token()}}'},
-                dataType: 'json',
-                success: function(ret) {
-                  if (ret.status === 'success') {
-                    swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
-                  } else {
-                    swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-                  }
-                },
-              });
-            }
-          });
+            swal.fire({
+                title: '{{trans('common.warning')}}',
+                text: '确定删除邮箱后缀 【' + name + '】 ?',
+                icon: 'warning',
+                showCancelButton: true,
+                cancelButtonText: '取消',
+                confirmButtonText: '确定',
+            }).then((result) => {
+                if (result.value) {
+                    $.ajax({
+                        method: 'DELETE',
+                        url: '{{route('admin.config.filter.destroy', '')}}/' + id,
+                        data: {_token: '{{csrf_token()}}'},
+                        dataType: 'json',
+                        success: function(ret) {
+                            if (ret.status === 'success') {
+                                swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
+                            } else {
+                                swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+                            }
+                        },
+                    });
+                }
+            });
         }
         @endcan
     </script>

+ 18 - 18
resources/views/admin/coupon/create.blade.php

@@ -122,31 +122,31 @@
     <script>
         @if(old('type'))
         $(document).ready(function() {
-          $("input[name='type'][value='{{old('type')}}']").click();
+            $("input[name='type'][value='{{old('type')}}']").click();
         });
         @endif
 
         $('.input-daterange>input').datepicker({
-          format: 'yyyy-mm-dd',
+            format: 'yyyy-mm-dd',
         });
 
         $('input[name=\'type\']').change(function() {
-          if ($(this).val() === '2') {
-            $('#rule').attr('required', true);
-            $('.discount').show();
-            $('.usage').show();
-            $('.amount').hide();
-          } else if ($(this).val() === '3') {
-            $('#rule').attr('required', false);
-            $('.discount').hide();
-            $('.usage').hide();
-            $('.amount').show();
-          } else {
-            $('#rule').attr('required', true);
-            $('.discount').hide();
-            $('.usage').show();
-            $('.amount').show();
-          }
+            if ($(this).val() === '2') {
+                $('#rule').attr('required', true);
+                $('.discount').show();
+                $('.usage').show();
+                $('.amount').hide();
+            } else if ($(this).val() === '3') {
+                $('#rule').attr('required', false);
+                $('.discount').hide();
+                $('.usage').hide();
+                $('.amount').show();
+            } else {
+                $('#rule').attr('required', true);
+                $('.discount').hide();
+                $('.usage').show();
+                $('.amount').show();
+            }
         });
     </script>
 @endsection

+ 54 - 67
resources/views/admin/coupon/index.blade.php

@@ -19,12 +19,12 @@
                 @endcanany
             </div>
             <div class="panel-body">
-                <div class="form-row">
+                <form class="form-row">
                     <div class="form-group col-lg-3 col-sm-4">
-                        <input type="text" class="form-control" name="sn" id="sn" value="{{Request::input('sn')}}" placeholder="券码" autocomplete="off"/>
+                        <input type="text" class="form-control" name="sn" value="{{Request::query('sn')}}" placeholder="券码" autocomplete="off"/>
                     </div>
                     <div class="form-group col-lg-3 col-sm-4">
-                        <select class="form-control" name="type" id="type" onChange="Search()">
+                        <select class="form-control" name="type" id="type">
                             <option value="" hidden>类型</option>
                             <option value="1">现金券</option>
                             <option value="2">折扣券</option>
@@ -32,7 +32,7 @@
                         </select>
                     </div>
                     <div class="form-group col-lg-3 col-sm-4">
-                        <select class="form-control" name="status" id="status" onChange="Search()">
+                        <select class="form-control" name="status" id="status">
                             <option value="" hidden>状态</option>
                             <option value="0">生效中</option>
                             <option value="1">已使用</option>
@@ -40,10 +40,10 @@
                         </select>
                     </div>
                     <div class="form-group col-lg-3 col-sm-4 btn-group">
-                        <button class="btn btn-primary" onclick="Search()">搜 索</button>
+                        <button type="submit" class="btn btn-primary">搜 索</button>
                         <a href="{{route('admin.coupon.index')}}" class="btn btn-danger">{{trans('common.reset')}}</a>
                     </div>
-                </div>
+                </form>
                 <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                     <thead class="thead-default">
                     <tr>
@@ -122,72 +122,59 @@
     <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js"></script>
     <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
     <script>
-      $(document).ready(function() {
-        $('#sn').val({{Request::input('sn')}});
-        $('#type').val({{Request::input('type')}});
-        $('#status').val({{Request::input('status')}});
-      });
-
-      //回车检测
-      $(document).on('keypress', 'input', function(e) {
-        if (e.which === 13) {
-          Search();
-          return false;
-        }
-      });
+        $(document).ready(function() {
+            $('#type').val({{Request::query('type')}});
+            $('#status').val({{Request::query('status')}});
 
-      // 搜索
-      function Search() {
-        window.location.href = '{{route('admin.coupon.index')}}?sn=' + $('#sn').val() + '&type=' + $('#type').val() + '&status=' +
-            $('#status').val();
-      }
-
-      @can('admin.coupon.export')
-      // 批量导出卡券
-      function exportCoupon() {
-        swal.fire({
-          title: '卡券导出',
-          text: '确定导出所有卡券吗?',
-          icon: 'question',
-          showCancelButton: true,
-          cancelButtonText: '{{trans('common.close')}}',
-          confirmButtonText: '{{trans('common.confirm')}}',
-        }).then((result) => {
-          if (result.value) {
-            window.location.href = '{{route('admin.coupon.export')}}';
-          }
+            $('select').on('change', function() { this.form.submit(); });
         });
-      }
-      @endcan
 
-      @can('admin.coupon.destroy')
-      // 删除卡券
-      function delCoupon(id, name) {
-        swal.fire({
-          title: '确定删除卡券 【' + name + '】 吗?',
-          icon: 'question',
-          allowEnterKey: false,
-          showCancelButton: true,
-          cancelButtonText: '{{trans('common.close')}}',
-          confirmButtonText: '{{trans('common.confirm')}}',
-        }).then((result) => {
-          if (result.value) {
-            $.ajax({
-              method: 'DELETE',
-              url: '{{route('admin.coupon.destroy', '')}}/' + id,
-              data: {_token: '{{csrf_token()}}'},
-              dataType: 'json',
-              success: function(ret) {
-                if (ret.status === 'success') {
-                  swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
-                } else {
-                  swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+        @can('admin.coupon.export')
+        // 批量导出卡券
+        function exportCoupon() {
+            swal.fire({
+                title: '卡券导出',
+                text: '确定导出所有卡券吗?',
+                icon: 'question',
+                showCancelButton: true,
+                cancelButtonText: '{{trans('common.close')}}',
+                confirmButtonText: '{{trans('common.confirm')}}',
+            }).then((result) => {
+                if (result.value) {
+                    window.location.href = '{{route('admin.coupon.export')}}';
                 }
-              },
             });
-          }
-        });
-      }
+        }
+        @endcan
+
+        @can('admin.coupon.destroy')
+        // 删除卡券
+        function delCoupon(id, name) {
+            swal.fire({
+                title: '确定删除卡券 【' + name + '】 吗?',
+                icon: 'question',
+                allowEnterKey: false,
+                showCancelButton: true,
+                cancelButtonText: '{{trans('common.close')}}',
+                confirmButtonText: '{{trans('common.confirm')}}',
+            }).then((result) => {
+                if (result.value) {
+                    $.ajax({
+                        method: 'DELETE',
+                        url: '{{route('admin.coupon.destroy', '')}}/' + id,
+                        data: {_token: '{{csrf_token()}}'},
+                        dataType: 'json',
+                        success: function(ret) {
+                            if (ret.status === 'success') {
+                                swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
+                            } else {
+                                swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+                            }
+                        },
+                    });
+                }
+            });
+        }
         @endcan
     </script>
 @endsection

+ 3 - 3
resources/views/admin/index.blade.php

@@ -303,8 +303,8 @@
     <script src="/assets/global/vendor/matchheight/jquery.matchHeight-min.js"></script>
     <script src="/assets/global/js/Plugin/matchheight.js"></script>
     <script>
-      $(function() {
-        $('.card').matchHeight();
-      });
+        $(function() {
+            $('.card').matchHeight();
+        });
     </script>
 @endsection

+ 38 - 38
resources/views/admin/inviteList.blade.php

@@ -93,58 +93,58 @@
         @can('admin.invite.create')
         // 生成邀请码
         function makeInvite() {
-          $.ajax({
-            method: 'POST',
-            url: '{{route('admin.invite.create')}}',
-            dataType: 'json',
-            data: {_token: '{{csrf_token()}}'},
-            success: function(ret) {
-              if (ret.status === 'success') {
-                swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
-              } else {
-                swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-              }
-            },
-          });
+            $.ajax({
+                method: 'POST',
+                url: '{{route('admin.invite.create')}}',
+                dataType: 'json',
+                data: {_token: '{{csrf_token()}}'},
+                success: function(ret) {
+                    if (ret.status === 'success') {
+                        swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
+                    } else {
+                        swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+                    }
+                },
+            });
 
-          return false;
+            return false;
         }
         @endcan
 
         @can('admin.invite.export')
         // 导出邀请码
         function exportInvite() {
-          swal.fire({
-            title: '提示',
-            text: '确定导出所有邀请码吗',
-            icon: 'question',
-            showCancelButton: true,
-            cancelButtonText: '{{trans('common.close')}}',
-            confirmButtonText: '{{trans('common.confirm')}}',
-          }).then((result) => {
-            if (result.value) {
-              window.location.href = '{{route('admin.invite.export')}}';
-            }
-          });
+            swal.fire({
+                title: '提示',
+                text: '确定导出所有邀请码吗',
+                icon: 'question',
+                showCancelButton: true,
+                cancelButtonText: '{{trans('common.close')}}',
+                confirmButtonText: '{{trans('common.confirm')}}',
+            }).then((result) => {
+                if (result.value) {
+                    window.location.href = '{{route('admin.invite.export')}}';
+                }
+            });
         }
         @endcan
 
         const clipboard = new ClipboardJS('.mt-clipboard');
         clipboard.on('success', function() {
-          swal.fire({
-            title: '{{trans('common.copy.success')}}',
-            icon: 'success',
-            timer: 1300,
-            showConfirmButton: false,
-          });
+            swal.fire({
+                title: '{{trans('common.copy.success')}}',
+                icon: 'success',
+                timer: 1300,
+                showConfirmButton: false,
+            });
         });
         clipboard.on('error', function() {
-          swal.fire({
-            title: '{{trans('common.copy.failed')}}',
-            icon: 'error',
-            timer: 1500,
-            showConfirmButton: false,
-          });
+            swal.fire({
+                title: '{{trans('common.copy.failed')}}',
+                icon: 'error',
+                timer: 1500,
+                showConfirmButton: false,
+            });
         });
     </script>
 @endsection

+ 9 - 34
resources/views/admin/logs/callback.blade.php

@@ -11,35 +11,25 @@
                 </h2>
             </div>
             <div class="panel-body">
-                <div class="form-row">
+                <form class="form-row">
                     <div class="form-group col-lg-3 col-sm-6">
-                        <input type="number" class="form-control" name="out_trade_no" id="out_trade_no"
-                               value="{{Request::input('out_trade_no')}}" placeholder="本地订单号" autocomplete="off"/>
+                        <input type="text" class="form-control" name="out_trade_no" value="{{Request::query('out_trade_no')}}" placeholder="本地订单号" autocomplete="off"/>
                     </div>
                     <div class="form-group col-lg-3 col-sm-6">
-                        <input type="number" class="form-control" name="trade_no" id="trade_no"
-                               value="{{Request::input('trade_no')}}" placeholder="外部订单号" autocomplete="off"/>
+                        <input type="text" class="form-control" name="trade_no" value="{{Request::query('trade_no')}}" placeholder="外部订单号" autocomplete="off"/>
                     </div>
                     <div class="form-group col-lg-2 col-sm-4">
-                        <select class="form-control" name="type" id="type" onChange="Search()">
-                            <option value="" hidden>支付方式</option>
-                            @foreach(config('common.payment.labels') as $key => $value)
-                                <option value="{{$key}}">{{$value}}</option>
-                            @endforeach
-                        </select>
-                    </div>
-                    <div class="form-group col-lg-2 col-sm-4">
-                        <select class="form-control" name="trade_status" id="trade_status" onChange="Search()">
+                        <select class="form-control" name="status" id="status" onchange="this.form.submit()">
                             <option value="" hidden>交易状态</option>
                             <option value="1">成功</option>
                             <option value="0">失败</option>
                         </select>
                     </div>
                     <div class="form-group col-lg-2 col-sm-4 btn-group">
-                        <button class="btn btn-primary" onclick="Search()">搜 索</button>
+                        <button type="submit" class="btn btn-primary">搜 索</button>
                         <a href="{{route('admin.payment.callback')}}" class="btn btn-danger">{{trans('common.reset')}}</a>
                     </div>
-                </div>
+                </form>
                 <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                     <thead class="thead-default">
                     <tr>
@@ -92,23 +82,8 @@
     <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js"></script>
     <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
     <script>
-      $(document).ready(function() {
-        $('#type').val({{Request::input('type')}});
-        $('#trade_status').val({{Request::input('trade_status')}});
-      });
-
-      //回车检测
-      $(document).on('keypress', 'input', function(e) {
-        if (e.which === 13) {
-          Search();
-          return false;
-        }
-      });
-
-      // 搜索
-      function Search() {
-        window.location.href = '{{route('admin.payment.callback')}}?out_trade_no=' + $('#trade_no').val() + '&trade_no=' +
-            $('#out_trade_no').val() + '&type=' + $('#type option:selected').val() + '&trade_status=' + $('#trade_status option:selected').val();
-      }
+        $(document).ready(function() {
+            $('#status').val({{Request::query('status')}});
+        });
     </script>
 @endsection

+ 8 - 15
resources/views/admin/logs/notification.blade.php

@@ -9,13 +9,12 @@
                 <h2 class="panel-title">邮件投递记录</h2>
             </div>
             <div class="panel-body">
-                <div class="form-row">
+                <form class="form-row">
                     <div class="form-group col-lg-3 col-sm-4">
-                        <input type="text" class="form-control" name="email" id="email"
-                               value="{{Request::input('email')}}" placeholder="用户名"/>
+                        <input type="text" class="form-control" name="email" value="{{Request::query('email')}}" placeholder="用户账号"/>
                     </div>
                     <div class="form-group col-lg-2 col-sm-4">
-                        <select class="form-control" name="type" id="type" onChange="Search()">
+                        <select class="form-control" name="type" id="type" onchange="this.form.submit()">
                             <option value="" hidden>类型</option>
                             <option value="1">邮件</option>
                             <option value="2">ServerChan</option>
@@ -24,10 +23,10 @@
                         </select>
                     </div>
                     <div class="form-group col-lg-1 col-sm-4 btn-group">
-                        <button class="btn btn-primary" onclick="Search()">搜 索</button>
+                        <button type="submit" class="btn btn-primary">搜 索</button>
                         <a href="{{route('admin.log.notify')}}" class="btn btn-danger">{{trans('common.reset')}}</a>
                     </div>
-                </div>
+                </form>
                 <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                     <thead class="thead-default">
                     <tr>
@@ -82,14 +81,8 @@
     <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js"></script>
     <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
     <script>
-      $(document).ready(function() {
-        $('#type').val({{Request::input('type')}});
-      });
-
-      // 搜索
-      function Search() {
-        window.location.href = '{{route('admin.log.notify')}}?email=' + $('#email').val() + '&type=' +
-            $('#type option:selected').val();
-      }
+        $(document).ready(function() {
+            $('#type').val({{Request::query('type')}});
+        });
     </script>
 @endsection

+ 13 - 28
resources/views/admin/logs/onlineIPMonitor.blade.php

@@ -11,37 +11,32 @@
                 </h3>
             </div>
             <div class="panel-body">
-                <div class="form-row">
+                <form class="form-row">
                     <div class="form-group col-lg-2 col-sm-2">
-                        <input type="number" class="form-control" name="id" id="id" value="{{Request::input('id')}}"
-                               placeholder="ID"/>
+                        <input type="number" class="form-control" name="id" value="{{Request::query('id')}}" placeholder="用户ID"/>
                     </div>
                     <div class="form-group col-lg-2 col-sm-5">
-                        <input type="text" class="form-control" name="email" id="email"
-                               value="{{Request::input('email')}}" placeholder="用户名"/>
+                        <input type="text" class="form-control" name="email" value="{{Request::query('email')}}" placeholder="用户账号"/>
                     </div>
                     <div class="form-group col-lg-2 col-sm-5">
-                        <input type="text" class="form-control" name="ip" id="ip" value="{{Request::input('ip')}}"
-                               placeholder="IP"/>
+                        <input type="text" class="form-control" name="ip" value="{{Request::query('ip')}}" placeholder="IP"/>
                     </div>
                     <div class="form-group col-lg-2 col-sm-3">
-                        <input type="number" class="form-control" name="port" id="port" value="{{Request::input('port')}}"
-                               placeholder="端口"/>
+                        <input type="number" class="form-control" name="port" value="{{Request::query('port')}}" placeholder="端口"/>
                     </div>
                     <div class="form-group col-lg-2 col-sm-5">
-                        <select name="nodeId" id="nodeId" class="form-control" onChange="Search()">
-                            <option value="" @if(Request::input('nodeId') == '') selected @endif hidden>选择节点</option>
+                        <select name="node_id" id="node_id" class="form-control" onchange="this.form.submit()">
+                            <option value="" hidden>选择节点</option>
                             @foreach($nodes as $node)
-                                <option value="{{$node->id}}"
-                                        @if(Request::input('nodeId') == $node->id) selected @endif>{{$node->name}}</option>
+                                <option value="{{$node->id}}">{{$node->name}}</option>
                             @endforeach
                         </select>
                     </div>
                     <div class="form-group col-lg-2 col-sm-4 btn-group">
-                        <button class="btn btn-primary" onclick="Search()">搜 索</button>
+                        <button type="submit" class="btn btn-primary">搜 索</button>
                         <a href="{{route('admin.log.online')}}" class="btn btn-danger">{{trans('common.reset')}}</a>
                     </div>
-                </div>
+                </form>
                 <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                     <thead class="thead-default">
                     <tr>
@@ -96,18 +91,8 @@
     <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js"></script>
     <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
     <script>
-      //回车检测
-      $(document).on('keypress', 'input', function(e) {
-        if (e.which === 13) {
-          Search();
-          return false;
-        }
-      });
-
-      // 搜索
-      function Search() {
-        window.location.href = '{{route('admin.log.online')}}' + $('#id').val() + '?ip=' + $('#ip').val() + '&email=' +
-            $('#email').val() + '&port=' + $('#port').val() + '&nodeId=' + $('#nodeId option:selected').val();
-      }
+        $(document).ready(function() {
+            $('#node_id').val({{Request::query('node_id')}});
+        });
     </script>
 @endsection

+ 23 - 37
resources/views/admin/logs/order.blade.php

@@ -10,41 +10,41 @@
                 <h2 class="panel-title">订单列表</h2>
             </div>
             <div class="panel-body">
-                <div class="form-row">
+                <form class="form-row">
                     <div class="form-group col-lg-2 col-sm-6">
-                        <input type="text" class="form-control" name="email" id="email" value="{{Request::input('email')}}" placeholder="用户名"/>
+                        <input type="text" class="form-control" name="email" value="{{Request::query('email')}}" placeholder="用户账号"/>
                     </div>
                     <div class="form-group col-lg-2 col-sm-6">
-                        <input type="number" class="form-control" name="sn" id="sn" value="{{Request::input('sn')}}" placeholder="订单号"/>
+                        <input type="number" class="form-control" name="sn" value="{{Request::query('sn')}}" placeholder="订单号"/>
                     </div>
                     <div class="form-group col-lg-6 col-sm-12">
                         <div class="input-group input-daterange" data-plugin="datepicker">
                             <div class="input-group-prepend">
                                 <span class="input-group-text"><i class="icon wb-calendar" aria-hidden="true"></i></span>
                             </div>
-                            <input type="text" class="form-control" name="start" id="start" placeholder="{{date('Y-m-d')}}"/>
+                            <input type="text" class="form-control" name="start" value="{{Request::query('start')}}" autocomplete="off"/>
                             <div class="input-group-prepend">
                                 <span class="input-group-text">至</span>
                             </div>
-                            <input type="text" class="form-control" name="end" id="end" placeholder="{{date('Y-m-d', strtotime('1 month'))}}"/>
+                            <input type="text" class="form-control" name="end" value="{{Request::query('end')}}" autocomplete="off"/>
                         </div>
                     </div>
                     <div class="form-group col-lg-2 col-sm-6">
-                        <select class="form-control" name="is_expire" id="is_expire" onChange="Search()">
+                        <select class="form-control" id="is_expire" name="is_expire">
                             <option value="" hidden>是否过期</option>
                             <option value="0">否</option>
                             <option value="1">是</option>
                         </select>
                     </div>
                     <div class="form-group col-lg-2 col-sm-6">
-                        <select class="form-control" name="is_coupon" id="is_coupon" onChange="Search()">
+                        <select class="form-control" id="is_coupon" name="is_coupon">
                             <option value="" hidden>是否使用优惠券</option>
                             <option value="0">否</option>
                             <option value="1">是</option>
                         </select>
                     </div>
                     <div class="form-group col-lg-2 col-sm-6">
-                        <select class="form-control" name="pay_way" id="pay_way" onChange="Search()">
+                        <select class="form-control" id="pay_way" name="pay_way">
                             <option value="" hidden>支付方式</option>
                             @foreach(config('common.payment.labels') as $key => $value)
                                 <option value="{{$key}}">{{$value}}</option>
@@ -52,7 +52,7 @@
                         </select>
                     </div>
                     <div class="form-group col-lg-2 col-sm-6">
-                        <select class="form-control" name="status" id="status" onChange="Search()">
+                        <select class="form-control" name="status" id="status">
                             <option value="" hidden>订单状态</option>
                             <option value="-1">已关闭</option>
                             <option value="0">待支付</option>
@@ -67,21 +67,21 @@
                                 <label for="type">降序</label>
                             </div>
                             <div class="radio-custom radio-primary radio-inline">
-                                <input type="radio" name="sort" value="1" @if(Request::input('sort') === '1') checked @endif/>
+                                <input type="radio" name="sort" value="1"/>
                                 <label for="type">升序</label>
                             </div>
                         </div>
                     </div>
                     <div class="form-group col-lg-2 col-sm-6 btn-group">
-                        <button class="btn btn-primary" onclick="Search()">搜 索</button>
+                        <button type="submit" class="btn btn-primary">搜 索</button>
                         <a href="{{route('admin.order')}}" class="btn btn-danger">{{trans('common.reset')}}</a>
                     </div>
-                </div>
+                </form>
                 <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                     <thead class="thead-default">
                     <tr>
                         <th> #</th>
-                        <th> 用户</th>
+                        <th> 用户账号</th>
                         <th> 订单号</th>
                         <th> 商品</th>
                         <th> 过期时间</th>
@@ -156,31 +156,17 @@
     <script src="/assets/global/vendor/bootstrap-datepicker/bootstrap-datepicker.min.js"></script>
     <script src="/assets/global/js/Plugin/bootstrap-datepicker.js"></script>
     <script>
-      $(document).ready(function() {
-        $('#is_expire').val({{Request::input('is_expire')}});
-        $('#is_coupon').val({{Request::input('is_coupon')}});
-        $('#pay_way').val({{Request::input('pay_way')}});
-        $('#status').val({{Request::input('status')}});
-      });
+        $(document).ready(function() {
+            $('#is_expire').val({{Request::query('is_expire')}});
+            $('#is_coupon').val({{Request::query('is_coupon')}});
+            $('#pay_way').val({{Request::query('pay_way')}});
+            $('#status').val({{Request::query('status')}});
+            $("input[name='sort'][value='{{Request::query('sort')}}']").click();
 
-      // 有效期
-      $('.input-daterange').datepicker({
-        format: 'yyyy-mm-dd',
-      });
-      //回车检测
-      $(document).on('keypress', 'input', function(e) {
-        if (e.which === 13) {
-          Search();
-          return false;
-        }
-      });
+            $('select').on('change', function() { this.form.submit(); });
+        });
 
-      // 搜索
-      function Search() {
-        window.location.href = '{{route('admin.order')}}?email=' + $('#email').val() + '&sn=' + $('#sn').val() +
-            '&is_expire=' + $('#is_expire').val() + '&is_coupon=' + $('#is_coupon').val() + '&pay_way=' +
-            $('#pay_way').val() + '&status=' + $('#status').val() + '&sort=' +
-            $('input:radio[name=\'sort\']:checked').val() + '&range_time=' + [$('#start').val(), $('#end').val()];
-      }
+        // 有效期
+        $('.input-daterange').datepicker({format: 'yyyy-mm-dd'});
     </script>
 @endsection

+ 17 - 29
resources/views/admin/logs/traffic.blade.php

@@ -10,23 +10,21 @@
                 <h2 class="panel-title">流量日志</h2>
             </div>
             <div class="panel-body">
-                <div class="form-row">
+                <form class="form-row">
                     <div class="form-group col-lg-2 col-sm-4">
-                        <input type="number" class="form-control" name="user_id" id="user_id" value="{{Request::input('user_id')}}" placeholder="用户ID"/>
+                        <input type="number" class="form-control" name="user_id" value="{{Request::query('user_id')}}" placeholder="用户ID"/>
                     </div>
                     <div class="form-group col-lg-3 col-sm-8">
-                        <input type="text" class="form-control" name="email" id="email" value="{{Request::input('email')}}" placeholder="用户名"/>
+                        <input type="text" class="form-control" name="email" value="{{Request::query('email')}}" placeholder="用户账号"/>
                     </div>
                     <div class="form-group col-lg-2 col-sm-4">
-                        <input type="number" class="form-control" name="port" id="port" value="{{Request::input('port')}}" placeholder="用户端口"/>
+                        <input type="number" class="form-control" name="port" value="{{Request::query('port')}}" placeholder="用户端口"/>
                     </div>
                     <div class="form-group col-lg-3 col-sm-8">
-                        <select class="form-control" name="nodeId" id="nodeId" onChange="Search()">
-                            <option value="" @if(Request::input('nodeId') == '') selected @endif hidden>选择节点</option>
+                        <select class="form-control" name="node_id" id="node_id" onchange="this.form.submit()">
+                            <option value="" hidden>选择节点</option>
                             @foreach($nodes as $node)
-                                <option value="{{$node->id}}" @if(Request::input('nodeId') == $node->id) selected @endif>
-                                    {{$node->name}}
-                                </option>
+                                <option value="{{$node->id}}">{{$node->name}}</option>
                             @endforeach
                         </select>
                     </div>
@@ -37,19 +35,18 @@
                                     <i class="icon wb-calendar" aria-hidden="true"></i>
                                 </span>
                             </div>
-                            <input type="text" class="form-control" name="start" id="start" value="{{Request::input('startTime')}}" placeholder="{{date("Y-m-d")}}"/>
+                            <input type="text" class="form-control" name="start" value="{{Request::query('start')}}" autocomplete="off"/>
                             <div class="input-group-prepend">
                                 <span class="input-group-text">至</span>
                             </div>
-                            <input type="text" class="form-control" name="end" id="end" value="{{Request::input('endTime')}}"
-                                   placeholder="{{date("Y-m-d",strtotime("+1 month"))}}"/>
+                            <input type="text" class="form-control" name="end" value="{{Request::query('end')}}" autocomplete="off"/>
                         </div>
                     </div>
                     <div class="form-group col-lg-2 col-sm-4 btn-group">
-                        <button class="btn btn-primary" onclick="Search()">搜 索</button>
+                        <button type="submit" class="btn btn-primary">搜 索</button>
                         <a href="{{route('admin.log.traffic')}}" class="btn btn-danger">{{trans('common.reset')}}</a>
                     </div>
-                </div>
+                </form>
                 <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                     <thead class="thead-default">
                     <tr>
@@ -111,21 +108,12 @@
     <script src="/assets/global/vendor/bootstrap-datepicker/bootstrap-datepicker.min.js"></script>
     <script src="/assets/global/js/Plugin/bootstrap-datepicker.js"></script>
     <script>
-      $('.input-daterange').datepicker({
-        format: 'yyyy-mm-dd',
-      });
-      //回车检测
-      $(document).on('keypress', 'input', function(e) {
-        if (e.which === 13) {
-          Search();
-          return false;
-        }
-      });
+        $('.input-daterange').datepicker({
+            format: 'yyyy-mm-dd',
+        });
 
-      // 搜索
-      function Search() {
-        window.location.href = '{{route('admin.log.traffic')}}?port=' + $('#port').val() + '&user_id=' + $('#user_id').val() + '&email=' + $('#email').val()
-            + '&nodeId=' + $('#nodeId option:selected').val() + '&startTime=' + $('#start').val() + '&endTime=' + $('#end').val();
-      }
+        $(document).ready(function() {
+            $('#node_id').val({{Request::query('node_id')}});
+        });
     </script>
 @endsection

+ 6 - 20
resources/views/admin/logs/userBanHistory.blade.php

@@ -9,20 +9,20 @@
                 <h3 class="panel-title">用户封禁记录</h3>
             </div>
             <div class="panel-body">
-                <div class="form-row">
+                <form class="form-row">
                     <div class="form-group col-lg-3 col-sm-6">
-                        <input type="text" class="form-control" name="email" id="email" value="{{Request::input('email')}}" placeholder="用户名"/>
+                        <input type="text" class="form-control" name="email" value="{{Request::query('email')}}" placeholder="用户账号"/>
                     </div>
                     <div class="form-group col-lg-2 col-sm-6 btn-group">
-                        <button class="btn btn-primary" onclick="Search()">搜 索</button>
+                        <button type="submit" class="btn btn-primary">搜 索</button>
                         <a href="{{route('admin.log.ban')}}" class="btn btn-danger">{{trans('common.reset')}}</a>
                     </div>
-                </div>
+                </form>
                 <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                     <thead class="thead-default">
                     <tr>
                         <th> #</th>
-                        <th> 用户</th>
+                        <th> 用户账号</th>
                         <th> 时长</th>
                         <th> 理由</th>
                         <th> 封禁时间</th>
@@ -49,7 +49,7 @@
                             <td> {{$log->time}}分钟</td>
                             <td> {{$log->description}} </td>
                             <td> {{$log->created_at}} </td>
-                            <td> {{date("Y-m-d H:i:s", $log->user->t)}} </td>
+                            <td> {{date('Y-m-d H:i:s', $log->user->t)}} </td>
                         </tr>
                     @endforeach
                     </tbody>
@@ -73,18 +73,4 @@
 @section('javascript')
     <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js"></script>
     <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
-    <script>
-      //回车检测
-      $(document).on('keypress', 'input', function(e) {
-        if (e.which === 13) {
-          Search();
-          return false;
-        }
-      });
-
-      // 搜索
-      function Search() {
-        window.location.href = '{{route('admin.log.ban')}}?email=' + $('#email').val();
-      }
-    </script>
 @endsection

+ 5 - 19
resources/views/admin/logs/userCreditHistory.blade.php

@@ -9,20 +9,20 @@
                 <h3 class="panel-title">余额变动记录</h3>
             </div>
             <div class="panel-body">
-                <div class="form-row">
+                <form class="form-row">
                     <div class="form-group col-lg-3 col-sm-6">
-                        <input type="text" class="form-control" name="email" id="email" value="{{Request::input('email')}}" placeholder="用户名"/>
+                        <input type="text" class="form-control" name="email" value="{{Request::query('email')}}" placeholder="用户账号"/>
                     </div>
                     <div class="form-group col-lg-2 col-sm-6 btn-group">
-                        <button class="btn btn-primary" onclick="Search()">搜 索</button>
+                        <button type="submit" class="btn btn-primary">搜 索</button>
                         <a href="{{route('admin.log.credit')}}" class="btn btn-danger">{{trans('common.reset')}}</a>
                     </div>
-                </div>
+                </form>
                 <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                     <thead class="thead-default">
                     <tr>
                         <th> #</th>
-                        <th> 用户</th>
+                        <th> 用户账号</th>
                         <th> 订单ID</th>
                         <th> 操作前余额</th>
                         <th> 发生金额</th>
@@ -71,18 +71,4 @@
 @section('javascript')
     <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js"></script>
     <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
-    <script>
-      //回车检测
-      $(document).on('keypress', 'input', function(e) {
-        if (e.which === 13) {
-          Search();
-          return false;
-        }
-      });
-
-      // 搜索
-      function Search() {
-        window.location.href = '{{route('admin.log.credit')}}?email=' + $('#email').val();
-      }
-    </script>
 @endsection

+ 94 - 94
resources/views/admin/logs/userMonitor.blade.php

@@ -28,104 +28,104 @@
 @section('javascript')
     <script src="/assets/global/vendor/chart-js/Chart.min.js"></script>
     <script>
-      const dailyChart = new Chart(document.getElementById('dailyChart').getContext('2d'), {
-        type: 'line',
-        data: {
-          labels: {{$dayHours}},
-          datasets: [
-            {
-              fill: true,
-              backgroundColor: 'rgba(98, 168, 234, .1)',
-              borderColor: Config.colors('primary', 600),
-              pointRadius: 4,
-              borderDashOffset: 2,
-              pointBorderColor: '#fff',
-              pointBackgroundColor: Config.colors('primary', 600),
-              pointHoverBackgroundColor: '#fff',
-              pointHoverBorderColor: Config.colors('primary', 600),
-              data: {{$trafficHourly}},
-            }],
-        },
-        options: {
-          legend: {
-            display: false,
-          },
-          responsive: true,
-          scales: {
-            xAxes: [
-              {
-                display: true,
-                scaleLabel: {
-                  display: true,
-                  labelString: '小时',
+        const dailyChart = new Chart(document.getElementById('dailyChart').getContext('2d'), {
+            type: 'line',
+            data: {
+                labels: {{$dayHours}},
+                datasets: [
+                    {
+                        fill: true,
+                        backgroundColor: 'rgba(98, 168, 234, .1)',
+                        borderColor: Config.colors('primary', 600),
+                        pointRadius: 4,
+                        borderDashOffset: 2,
+                        pointBorderColor: '#fff',
+                        pointBackgroundColor: Config.colors('primary', 600),
+                        pointHoverBackgroundColor: '#fff',
+                        pointHoverBorderColor: Config.colors('primary', 600),
+                        data: {{$trafficHourly}},
+                    }],
+            },
+            options: {
+                legend: {
+                    display: false,
                 },
-              }],
-            yAxes: [
-              {
-                display: true,
-                ticks: {
-                  beginAtZero: true,
-                  userCallback: function(tick) {
-                    return tick.toString() + ' GB';
-                  },
+                responsive: true,
+                scales: {
+                    xAxes: [
+                        {
+                            display: true,
+                            scaleLabel: {
+                                display: true,
+                                labelString: '小时',
+                            },
+                        }],
+                    yAxes: [
+                        {
+                            display: true,
+                            ticks: {
+                                beginAtZero: true,
+                                userCallback: function(tick) {
+                                    return tick.toString() + ' GB';
+                                },
+                            },
+                            scaleLabel: {
+                                display: true,
+                                labelString: '{{trans('user.traffic_logs.24hours')}}',
+                            },
+                        }],
                 },
-                scaleLabel: {
-                  display: true,
-                  labelString: '{{trans('user.traffic_logs.24hours')}}',
-                },
-              }],
-          },
-        },
-      });
+            },
+        });
 
-      const monthlyChart = new Chart(document.getElementById('monthlyChart').getContext('2d'), {
-        type: 'line',
-        data: {
-          labels: {{$monthDays}},
-          datasets: [
-            {
-              fill: true,
-              backgroundColor: 'rgba(98, 168, 234, .1)',
-              borderColor: Config.colors('primary', 600),
-              pointRadius: 4,
-              borderDashOffset: 2,
-              pointBorderColor: '#fff',
-              pointBackgroundColor: Config.colors('primary', 600),
-              pointHoverBackgroundColor: '#fff',
-              pointHoverBorderColor: Config.colors('primary', 600),
-              data: {{$trafficDaily}},
-            }],
-        },
-        options: {
-          legend: {
-            display: false,
-          },
-          responsive: true,
-          scales: {
-            xAxes: [
-              {
-                display: true,
-                scaleLabel: {
-                  display: true,
-                  labelString: '天',
-                },
-              }],
-            yAxes: [
-              {
-                display: true,
-                ticks: {
-                  beginAtZero: true,
-                  userCallback: function(tick) {
-                    return tick.toString() + ' GB';
-                  },
+        const monthlyChart = new Chart(document.getElementById('monthlyChart').getContext('2d'), {
+            type: 'line',
+            data: {
+                labels: {{$monthDays}},
+                datasets: [
+                    {
+                        fill: true,
+                        backgroundColor: 'rgba(98, 168, 234, .1)',
+                        borderColor: Config.colors('primary', 600),
+                        pointRadius: 4,
+                        borderDashOffset: 2,
+                        pointBorderColor: '#fff',
+                        pointBackgroundColor: Config.colors('primary', 600),
+                        pointHoverBackgroundColor: '#fff',
+                        pointHoverBorderColor: Config.colors('primary', 600),
+                        data: {{$trafficDaily}},
+                    }],
+            },
+            options: {
+                legend: {
+                    display: false,
                 },
-                scaleLabel: {
-                  display: true,
-                  labelString: '{{trans('user.traffic_logs.30days')}}',
+                responsive: true,
+                scales: {
+                    xAxes: [
+                        {
+                            display: true,
+                            scaleLabel: {
+                                display: true,
+                                labelString: '天',
+                            },
+                        }],
+                    yAxes: [
+                        {
+                            display: true,
+                            ticks: {
+                                beginAtZero: true,
+                                userCallback: function(tick) {
+                                    return tick.toString() + ' GB';
+                                },
+                            },
+                            scaleLabel: {
+                                display: true,
+                                labelString: '{{trans('user.traffic_logs.30days')}}',
+                            },
+                        }],
                 },
-              }],
-          },
-        },
-      });
+            },
+        });
     </script>
 @endsection

+ 11 - 31
resources/views/admin/logs/userOnlineIP.blade.php

@@ -11,37 +11,32 @@
                 </h3>
             </div>
             <div class="panel-body">
-                <div class="form-row">
+                <form class="form-row">
                     <div class="form-group col-lg-1 col-sm-4">
-                        <input type="number" class="form-control" id="id" name="id" value="{{Request::input('id')}}"
-                               placeholder="ID"/>
+                        <input type="number" class="form-control" name="id" value="{{Request::query('id')}}" placeholder="ID"/>
                     </div>
                     <div class="form-group col-lg-3 col-sm-8">
-                        <input type="text" class="form-control" name="email" id="email"
-                               value="{{Request::input('email')}}" placeholder="用户名"/>
+                        <input type="text" class="form-control" name="email" value="{{Request::query('email')}}" placeholder="用户账号"/>
                     </div>
                     <div class="form-group col-lg-2 col-sm-6">
-                        <input type="text" class="form-control" name="wechat" id="wechat"
-                               value="{{Request::input('wechat')}}" placeholder="微信"/>
+                        <input type="text" class="form-control" name="wechat" value="{{Request::query('wechat')}}" placeholder="微信"/>
                     </div>
                     <div class="form-group col-lg-2 col-sm-6">
-                        <input type="number" class="form-control" name="qq" id="qq" value="{{Request::input('qq')}}"
-                               placeholder="QQ"/>
+                        <input type="number" class="form-control" name="qq" value="{{Request::query('qq')}}" placeholder="QQ"/>
                     </div>
                     <div class="form-group col-lg-1 col-sm-6">
-                        <input type="number" class="form-control" name="port" id="port" value="{{Request::input('port')}}"
-                               placeholder="端口"/>
+                        <input type="number" class="form-control" name="port" value="{{Request::query('port')}}" placeholder="端口"/>
                     </div>
                     <div class="form-group col-lg-2 col-sm-6 btn-group">
-                        <button class="btn btn-primary" onclick="Search()">搜 索</button>
+                        <button type="submit" class="btn btn-primary">搜 索</button>
                         <a href="{{route('admin.log.ip')}}" class="btn btn-danger">{{trans('common.reset')}}</a>
                     </div>
-                </div>
+                </form>
                 <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                     <thead class="thead-default">
                     <tr>
                         <th> #</th>
-                        <th> 用户</th>
+                        <th> 用户账号</th>
                         <th> 端口</th>
                         <th> {{trans('common.status')}}</th>
                         <th> 代理</th>
@@ -75,21 +70,21 @@
                                     <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                                         <thead>
                                         <tr>
-                                            <th> 时间</th>
                                             <th> 节点</th>
                                             <th> 类型</th>
                                             <th> IP</th>
+                                            <th> 时间</th>
                                         </tr>
                                         </thead>
                                         <tbody>
                                         @foreach($user->onlineIPList as $log)
                                             <tr>
-                                                <td>{{$log->created_at}}</td>
                                                 <td>{{$log->node->name ?? '【节点已删除】'}}</td>
                                                 <td>{{$log->type}}</td>
                                                 <td>
                                                     <a href="https://www.ipip.net/ip/{{$log->ip}}.html" target="_blank">{{$log->ip}}</a>
                                                 </td>
+                                                <td>{{date('Y-m-d H:i:s', $log->created_at)}}</td>
                                             </tr>
                                         @endforeach
                                         </tbody>
@@ -119,19 +114,4 @@
 @section('javascript')
     <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js"></script>
     <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
-    <script>
-      //回车检测
-      $(document).on('keypress', 'input', function(e) {
-        if (e.which === 13) {
-          Search();
-          return false;
-        }
-      });
-
-      // 搜索
-      function Search() {
-        window.location.href = '{{route('admin.log.ip')}}?id' + $('#id').val() + '&email=' + $('#email').val() +
-            '&wechat=' + $('#wechat').val() + '&qq=' + $('#qq').val() + '&port=' + $('#port').val();
-      }
-    </script>
 @endsection

+ 5 - 19
resources/views/admin/logs/userTraffic.blade.php

@@ -9,20 +9,20 @@
                 <h3 class="panel-title">流量变动记录</h3>
             </div>
             <div class="panel-body">
-                <div class="form-row">
+                <form class="form-row">
                     <div class="form-group col-lg-4 col-sm-6">
-                        <input type="text" class="form-control" name="email" id="email" value="{{Request::input('email')}}" placeholder="用户名"/>
+                        <input type="text" class="form-control" name="email" value="{{Request::query('email')}}" placeholder="用户账号"/>
                     </div>
                     <div class="form-group col-lg-2 col-sm-6 btn-group">
-                        <button class="btn btn-primary" onclick="Search()">搜 索</button>
+                        <button type="submit" class="btn btn-primary">搜 索</button>
                         <a href="{{route('admin.log.flow')}}" class="btn btn-danger">{{trans('common.reset')}}</a>
                     </div>
-                </div>
+                </form>
                 <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                     <thead class="thead-default">
                     <tr>
                         <th> #</th>
-                        <th> 用户</th>
+                        <th> 用户账号</th>
                         <th> 订单</th>
                         <th> 变动前流量</th>
                         <th> 变动后流量</th>
@@ -81,18 +81,4 @@
 @section('javascript')
     <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js"></script>
     <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
-    <script>
-      //回车检测
-      $(document).on('keypress', 'input', function(e) {
-        if (e.which === 13) {
-          Search();
-          return false;
-        }
-      });
-
-      // 搜索
-      function Search() {
-        window.location.href = '{{route('admin.log.flow')}}?email=' + $('#email').val();
-      }
-    </script>
 @endsection

+ 11 - 15
resources/views/admin/marketing/emailList.blade.php

@@ -12,9 +12,9 @@
                 </div>
             </div>
             <div class="panel-body">
-                <div class="form-row">
+                <form class="form-row">
                     <div class="form-group col-lg-3 col-sm-6">
-                        <select class="form-control" name="status" id="status" onChange="Search()">
+                        <select class="form-control" name="status" id="status" onchange="this.form.submit()">
                             <option value="" hidden>状态</option>
                             <option value="0">待发送</option>
                             <option value="-1">失败</option>
@@ -22,10 +22,10 @@
                         </select>
                     </div>
                     <div class="form-group col-lg-3 col-sm-6 btn-group">
-                        <button class="btn btn-primary" onclick="Search()">搜 索</button>
+                        <button type="submit" class="btn btn-primary">搜 索</button>
                         <a href="{{route('admin.marketing.email')}}" class="btn btn-danger">{{trans('common.reset')}}</a>
                     </div>
-                </div>
+                </form>
                 <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                     <thead class="thead-default">
                     <tr>
@@ -70,17 +70,13 @@
     <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js"></script>
     <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
     <script>
-      $(document).ready(function() {
-        $('#status').val({{Request::input('status')}});
-      });
-
-      // 发送邮件
-      function send() {
-        swal.fire(trans('common.sorry'), '开发中!敬请期待', 'info');
-      }
+        $(document).ready(function() {
+            $('#status').val({{Request::query('status')}});
+        });
 
-      function Search() {
-        window.location.href = '{{route('admin.marketing.email')}}?status=' + $('#status option:selected').val();
-      }
+        // 发送邮件
+        function send() {
+            swal.fire(@json(trans('common.sorry')), '开发中!敬请期待', 'info');
+        }
     </script>
 @endsection

+ 40 - 44
resources/views/admin/marketing/pushList.blade.php

@@ -16,9 +16,9 @@
                 @endcan
             </div>
             <div class="panel-body">
-                <div class="form-row">
+                <form class="form-row">
                     <div class="form-group col-lg-3 col-sm-6">
-                        <select class="form-control" name="status" id="status" onChange="Search()">
+                        <select class="form-control" name="status" id="status">
                             <option value="" hidden>状态</option>
                             <option value="0">待发送</option>
                             <option value="-1">失败</option>
@@ -26,10 +26,10 @@
                         </select>
                     </div>
                     <div class="form-group col-lg-2 col-sm-6 btn-group">
-                        <button class="btn btn-primary" onclick="Search()">搜 索</button>
+                        <button type="submit" class="btn btn-primary">搜 索</button>
                         <a href="{{route('admin.marketing.push')}}" class="btn btn-danger">{{trans('common.reset')}}</a>
                     </div>
-                </div>
+                </form>
                 <div class="alert alert-info alert-dismissible" role="alert">
                     <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                         <span aria-hidden="true">×</span></button>
@@ -125,53 +125,49 @@
     <script src="/assets/global/vendor/bootstrap-markdown/bootstrap-markdown.min.js"></script>
     <script src="/assets/global/vendor/marked/marked.min.js"></script>
     <script>
-      $(document).ready(function() {
-        $('#status').val({{Request::input('status')}});
-      });
+        $(document).ready(function() {
+            $('#status').val({{Request::query('status')}});
+        });
 
-      function Search() {
-        window.location.href = '{{route('admin.marketing.push')}}?status=' + $('#status').val();
-      }
+        @can('admin.marketing.add')
+        // 发送通道消息
+        function send() {
+            const title = $('#title').val();
 
-      @can('admin.marketing.add')
-      // 发送通道消息
-      function send() {
-        const title = $('#title').val();
+            if (title.trim() === '') {
+                $('#msg').show().html('标题不能为空');
+                title.focus();
+                return false;
+            }
 
-        if (title.trim() === '') {
-          $('#msg').show().html('标题不能为空');
-          title.focus();
-          return false;
-        }
+            $.ajax({
+                url: '{{route('admin.marketing.add')}}',
+                method: 'POST',
+                data: {_token: '{{csrf_token()}}', title: title, content: $('#content').val()},
+                beforeSend: function() {
+                    $('#msg').show().html('正在添加...');
+                },
+                success: function(ret) {
+                    if (ret.status === 'fail') {
+                        $('#msg').show().html(ret.message);
+                        return false;
+                    }
 
-        $.ajax({
-          url: '{{route('admin.marketing.add')}}',
-          method: 'POST',
-          data: {_token: '{{csrf_token()}}', title: title, content: $('#content').val()},
-          beforeSend: function() {
-            $('#msg').show().html('正在添加...');
-          },
-          success: function(ret) {
-            if (ret.status === 'fail') {
-              $('#msg').show().html(ret.message);
-              return false;
-            }
+                    $('#send_modal').modal('hide');
 
-            $('#send_modal').modal('hide');
+                },
+                error: function() {
+                    $('#msg').show().html('请求错误,请重试');
+                },
+                complete: function() {
+                },
+            });
+        }
 
-          },
-          error: function() {
-            $('#msg').show().html('请求错误,请重试');
-          },
-          complete: function() {
-          },
+        // 关闭modal触发
+        $('#send_modal').on('hide.bs.modal', function() {
+            window.location.reload();
         });
-      }
-
-      // 关闭modal触发
-      $('#send_modal').on('hide.bs.modal', function() {
-        window.location.reload();
-      });
         @endcan
     </script>
 @endsection

+ 75 - 75
resources/views/admin/node/auth.blade.php

@@ -212,88 +212,88 @@
     <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js"></script>
     <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
     <script>
-      // 生成授权KEY
-      @can('admin.node.auth.store')
-      function addAuth() {
-        swal.fire({
-          title: '提示',
-          text: '确定生成所有节点的授权吗?',
-          icon: 'info',
-          showCancelButton: true,
-          cancelButtonText: '{{trans('common.close')}}',
-          confirmButtonText: '{{trans('common.confirm')}}',
-        }).then((result) => {
-          if (result.value) {
-            $.post('{{route('admin.node.auth.store')}}', {_token: '{{csrf_token()}}'}, function(ret) {
-              if (ret.status === 'success') {
-                swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
-              } else {
-                swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-              }
+        // 生成授权KEY
+        @can('admin.node.auth.store')
+        function addAuth() {
+            swal.fire({
+                title: '提示',
+                text: '确定生成所有节点的授权吗?',
+                icon: 'info',
+                showCancelButton: true,
+                cancelButtonText: '{{trans('common.close')}}',
+                confirmButtonText: '{{trans('common.confirm')}}',
+            }).then((result) => {
+                if (result.value) {
+                    $.post('{{route('admin.node.auth.store')}}', {_token: '{{csrf_token()}}'}, function(ret) {
+                        if (ret.status === 'success') {
+                            swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
+                        } else {
+                            swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+                        }
+                    });
+                }
             });
-          }
-        });
-      }
-      @endcan
+        }
+        @endcan
 
-      @can('admin.node.auth.destroy')
-      // 删除授权
-      function deleteAuth(id) {
-        swal.fire({
-          title: '提示',
-          text: '确定删除该授权吗?',
-          icon: 'info',
-          showCancelButton: true,
-          cancelButtonText: '{{trans('common.close')}}',
-          confirmButtonText: '{{trans('common.confirm')}}',
-        }).then((result) => {
-          if (result.value) {
-            $.ajax({
-              method: 'DELETE',
-              url: '{{route('admin.node.auth.destroy', '')}}/' + id,
-              data: {_token: '{{csrf_token()}}'},
-              dataType: 'json',
-              success: function(ret) {
-                if (ret.status === 'success') {
-                  swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
-                } else {
-                  swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+        @can('admin.node.auth.destroy')
+        // 删除授权
+        function deleteAuth(id) {
+            swal.fire({
+                title: '提示',
+                text: '确定删除该授权吗?',
+                icon: 'info',
+                showCancelButton: true,
+                cancelButtonText: '{{trans('common.close')}}',
+                confirmButtonText: '{{trans('common.confirm')}}',
+            }).then((result) => {
+                if (result.value) {
+                    $.ajax({
+                        method: 'DELETE',
+                        url: '{{route('admin.node.auth.destroy', '')}}/' + id,
+                        data: {_token: '{{csrf_token()}}'},
+                        dataType: 'json',
+                        success: function(ret) {
+                            if (ret.status === 'success') {
+                                swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
+                            } else {
+                                swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+                            }
+                        },
+                    });
                 }
-              },
             });
-          }
-        });
-      }
-      @endcan
+        }
+        @endcan
 
-      @can('admin.node.auth.update')
-      // 重置授权认证KEY
-      function refreshAuth(id) {
-        swal.fire({
-          title: '提示',
-          text: '确定继续操作吗?',
-          icon: 'info',
-          showCancelButton: true,
-          cancelButtonText: '{{trans('common.close')}}',
-          confirmButtonText: '{{trans('common.confirm')}}',
-        }).then((result) => {
-          if (result.value) {
-            $.ajax({
-              method: 'PUT',
-              url: '{{route('admin.node.auth.update', '')}}/' + id,
-              data: {_token: '{{csrf_token()}}'},
-              dataType: 'json',
-              success: function(ret) {
-                if (ret.status === 'success') {
-                  swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
-                } else {
-                  swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+        @can('admin.node.auth.update')
+        // 重置授权认证KEY
+        function refreshAuth(id) {
+            swal.fire({
+                title: '提示',
+                text: '确定继续操作吗?',
+                icon: 'info',
+                showCancelButton: true,
+                cancelButtonText: '{{trans('common.close')}}',
+                confirmButtonText: '{{trans('common.confirm')}}',
+            }).then((result) => {
+                if (result.value) {
+                    $.ajax({
+                        method: 'PUT',
+                        url: '{{route('admin.node.auth.update', '')}}/' + id,
+                        data: {_token: '{{csrf_token()}}'},
+                        dataType: 'json',
+                        success: function(ret) {
+                            if (ret.status === 'success') {
+                                swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
+                            } else {
+                                swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+                            }
+                        },
+                    });
                 }
-              },
             });
-          }
-        });
-      }
+        }
         @endcan
     </script>
 @endsection

+ 25 - 25
resources/views/admin/node/cert/index.blade.php

@@ -80,33 +80,33 @@
     <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
     @can('admin.node.cert.destroy')
         <script>
-          // 删除授权
-          function delCertificate(id) {
-            swal.fire({
-              title: '提示',
-              text: '确定删除该证书吗?',
-              icon: 'info',
-              showCancelButton: true,
-              cancelButtonText: '{{trans('common.close')}}',
-              confirmButtonText: '{{trans('common.confirm')}}',
-            }).then((result) => {
-              if (result.value) {
-                $.ajax({
-                  method: 'DELETE',
-                  url: '{{route('admin.node.cert.destroy', '')}}/' + id,
-                  data: {_token: '{{csrf_token()}}'},
-                  dataType: 'json',
-                  success: function(ret) {
-                    if (ret.status === 'success') {
-                      swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
-                    } else {
-                      swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+            // 删除授权
+            function delCertificate(id) {
+                swal.fire({
+                    title: '提示',
+                    text: '确定删除该证书吗?',
+                    icon: 'info',
+                    showCancelButton: true,
+                    cancelButtonText: '{{trans('common.close')}}',
+                    confirmButtonText: '{{trans('common.confirm')}}',
+                }).then((result) => {
+                    if (result.value) {
+                        $.ajax({
+                            method: 'DELETE',
+                            url: '{{route('admin.node.cert.destroy', '')}}/' + id,
+                            data: {_token: '{{csrf_token()}}'},
+                            dataType: 'json',
+                            success: function(ret) {
+                                if (ret.status === 'success') {
+                                    swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
+                                } else {
+                                    swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+                                }
+                            },
+                        });
                     }
-                  },
                 });
-              }
-            });
-          }
+            }
         </script>
     @endcan
 @endsection

+ 10 - 10
resources/views/admin/node/cert/info.blade.php

@@ -52,15 +52,15 @@
 @endsection
 @section('javascript')
     <script>
-      $(document).ready(function() {
-        $('#domain').val(@json(old('domain')));
-        $('#key').val(@json(old('key')));
-        $('#pem').val(@json(old('pem')));
-          @isset($cert)
-          $('#domain').val(@json(old('domain') ?? $cert->domain));
-        $('#key').val(@json(old('key') ?? $cert->key));
-        $('#pem').val(@json(old('pem') ?? $cert->pem));
-          @endisset
-      });
+        $(document).ready(function() {
+            $('#domain').val(@json(old('domain')));
+            $('#key').val(@json(old('key')));
+            $('#pem').val(@json(old('pem')));
+            @isset($cert)
+            $('#domain').val(@json(old('domain') ?? $cert->domain));
+            $('#key').val(@json(old('key') ?? $cert->key));
+            $('#pem').val(@json(old('pem') ?? $cert->pem));
+            @endisset
+        });
     </script>
 @endsection

+ 115 - 115
resources/views/admin/node/index.blade.php

@@ -81,7 +81,7 @@
                                         </button>
                                         <div class="dropdown-menu" role="menu">
                                             @can('admin.node.edit')
-                                                <a class="dropdown-item" href="{{route('admin.node.edit', [$node->id, 'page' => Request::input('page', 1)])}}" role="menuitem">
+                                                <a class="dropdown-item" href="{{route('admin.node.edit', [$node->id, 'page' => Request::query('page', 1)])}}" role="menuitem">
                                                     <i class="icon wb-edit" aria-hidden="true"></i> 编辑
                                                 </a>
                                             @endcan
@@ -150,146 +150,146 @@
         @can('admin.node.check')
         // 节点连通性测试
         function checkNode(id) {
-          $.ajax({
-            method: 'POST',
-            url: '{{route('admin.node.check', '')}}/' + id,
-            data: {_token: '{{csrf_token()}}'},
-            beforeSend: function() {
-              $('#node' + id).removeClass('wb-signal').addClass('wb-loop icon-spin');
-            },
-            success: function(ret) {
-              if (ret.status === 'success') {
-                swal.fire({
-                  title: ret.title,
-                  icon: 'info',
-                  html: '<table class="my-20"><thead class="thead-default"><tr><th> ICMP </th> <th> TCP </th></thead><tbody><tr><td>' +
-                      ret.message[0] + '</td><td>' + ret.message[1] + '</td></tr></tbody></table>',
-                  showConfirmButton: false,
-                });
-              } else {
-                swal.fire({title: ret.title, text: ret.message, icon: 'error'});
-              }
-            },
-            complete: function() {
-              $('#node' + id).removeClass('wb-loop icon-spin').addClass('wb-signal');
-            },
-          });
+            $.ajax({
+                method: 'POST',
+                url: '{{route('admin.node.check', '')}}/' + id,
+                data: {_token: '{{csrf_token()}}'},
+                beforeSend: function() {
+                    $('#node' + id).removeClass('wb-signal').addClass('wb-loop icon-spin');
+                },
+                success: function(ret) {
+                    if (ret.status === 'success') {
+                        swal.fire({
+                            title: ret.title,
+                            icon: 'info',
+                            html: '<table class="my-20"><thead class="thead-default"><tr><th> ICMP </th> <th> TCP </th></thead><tbody><tr><td>' +
+                                ret.message[0] + '</td><td>' + ret.message[1] + '</td></tr></tbody></table>',
+                            showConfirmButton: false,
+                        });
+                    } else {
+                        swal.fire({title: ret.title, text: ret.message, icon: 'error'});
+                    }
+                },
+                complete: function() {
+                    $('#node' + id).removeClass('wb-loop icon-spin').addClass('wb-signal');
+                },
+            });
         }
         @endcan
 
         @can('admin.node.ping')
         // Ping节点获取延迟
         function pingNode(id) {
-          $.ajax({
-            method: 'POST',
-            url: '{{route('admin.node.ping', '')}}/' + id,
-            data: {_token: '{{csrf_token()}}'},
-            beforeSend: function() {
-              $('#ping' + id).removeClass('wb-order').addClass('wb-loop icon-spin');
-            },
-            success: function(ret) {
-              if (ret.status === 'success') {
-                swal.fire({
-                  icon: 'info',
-                  html: ret.message,
-                  showConfirmButton: false,
-                });
-              } else {
-                swal.fire({title: ret.message, icon: 'error'});
-              }
-            },
-            complete: function() {
-              $('#ping' + id).removeClass('wb-loop icon-spin').addClass('wb-order');
-            },
-          });
-        }
-        @endcan
-
-        @can('admin.node.reload')
-        // 发送节点重载请求
-        function reload(id) {
-          swal.fire({
-            text: '确定重载节点?',
-            icon: 'question',
-            showCancelButton: true,
-            cancelButtonText: '{{trans('common.close')}}',
-            confirmButtonText: '{{trans('common.confirm')}}',
-          }).then((result) => {
-            if (result.value) {
-              $.ajax({
+            $.ajax({
                 method: 'POST',
-                url: '{{route('admin.node.reload', '')}}/' + id,
+                url: '{{route('admin.node.ping', '')}}/' + id,
                 data: {_token: '{{csrf_token()}}'},
                 beforeSend: function() {
-                  $('#reload' + id).removeClass('wb-reload').addClass('wb-loop icon-spin');
+                    $('#ping' + id).removeClass('wb-order').addClass('wb-loop icon-spin');
                 },
                 success: function(ret) {
-                  if (ret.status === 'success') {
-                    swal.fire({title: ret.message, icon: 'info', showConfirmButton: false});
-                  } else {
-                    swal.fire({title: ret.message, icon: 'error'});
-                  }
+                    if (ret.status === 'success') {
+                        swal.fire({
+                            icon: 'info',
+                            html: ret.message,
+                            showConfirmButton: false,
+                        });
+                    } else {
+                        swal.fire({title: ret.message, icon: 'error'});
+                    }
                 },
                 complete: function() {
-                  $('#reload' + id).removeClass('wb-loop icon-spin').addClass('wb-reload');
+                    $('#ping' + id).removeClass('wb-loop icon-spin').addClass('wb-order');
                 },
-              });
-            }
-          });
+            });
+        }
+        @endcan
+
+        @can('admin.node.reload')
+        // 发送节点重载请求
+        function reload(id) {
+            swal.fire({
+                text: '确定重载节点?',
+                icon: 'question',
+                showCancelButton: true,
+                cancelButtonText: '{{trans('common.close')}}',
+                confirmButtonText: '{{trans('common.confirm')}}',
+            }).then((result) => {
+                if (result.value) {
+                    $.ajax({
+                        method: 'POST',
+                        url: '{{route('admin.node.reload', '')}}/' + id,
+                        data: {_token: '{{csrf_token()}}'},
+                        beforeSend: function() {
+                            $('#reload' + id).removeClass('wb-reload').addClass('wb-loop icon-spin');
+                        },
+                        success: function(ret) {
+                            if (ret.status === 'success') {
+                                swal.fire({title: ret.message, icon: 'info', showConfirmButton: false});
+                            } else {
+                                swal.fire({title: ret.message, icon: 'error'});
+                            }
+                        },
+                        complete: function() {
+                            $('#reload' + id).removeClass('wb-loop icon-spin').addClass('wb-reload');
+                        },
+                    });
+                }
+            });
         }
         @endcan
 
         @can('admin.node.geo')
         // 刷新节点地理信息
         function refreshGeo(id = 0) {
-          $.ajax({
-            method: 'GET',
-            url: '{{route('admin.node.geo', '')}}/' + id,
-            data: {_token: '{{csrf_token()}}'},
-            beforeSend: function() {
-              $('#geo' + id).removeClass('wb-map').addClass('wb-loop icon-spin');
-            },
-            success: function(ret) {
-              if (ret.status === 'success') {
-                swal.fire({title: ret.message, icon: 'info', showConfirmButton: false});
-              } else {
-                swal.fire({title: ret.message, icon: 'error'});
-              }
-            },
-            complete: function() {
-              $('#geo' + id).removeClass('wb-loop icon-spin').addClass('wb-map');
-            },
-          });
+            $.ajax({
+                method: 'GET',
+                url: '{{route('admin.node.geo', '')}}/' + id,
+                data: {_token: '{{csrf_token()}}'},
+                beforeSend: function() {
+                    $('#geo' + id).removeClass('wb-map').addClass('wb-loop icon-spin');
+                },
+                success: function(ret) {
+                    if (ret.status === 'success') {
+                        swal.fire({title: ret.message, icon: 'info', showConfirmButton: false});
+                    } else {
+                        swal.fire({title: ret.message, icon: 'error'});
+                    }
+                },
+                complete: function() {
+                    $('#geo' + id).removeClass('wb-loop icon-spin').addClass('wb-map');
+                },
+            });
         }
         @endcan
 
         @can('admin.node.destroy')
         // 删除节点
         function delNode(id, name) {
-          swal.fire({
-            title: '{{trans('common.warning')}}',
-            text: '确定删除节点 【' + name + '】 ?',
-            icon: 'warning',
-            showCancelButton: true,
-            cancelButtonText: '{{trans('common.close')}}',
-            confirmButtonText: '{{trans('common.confirm')}}',
-          }).then((result) => {
-            if (result.value) {
-              $.ajax({
-                method: 'DELETE',
-                url: '{{route('admin.node.destroy', '')}}/' + id,
-                data: {_token: '{{csrf_token()}}'},
-                dataType: 'json',
-                success: function(ret) {
-                  if (ret.status === 'success') {
-                    swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
-                  } else {
-                    swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-                  }
-                },
-              });
-            }
-          });
+            swal.fire({
+                title: '{{trans('common.warning')}}',
+                text: '确定删除节点 【' + name + '】 ?',
+                icon: 'warning',
+                showCancelButton: true,
+                cancelButtonText: '{{trans('common.close')}}',
+                confirmButtonText: '{{trans('common.confirm')}}',
+            }).then((result) => {
+                if (result.value) {
+                    $.ajax({
+                        method: 'DELETE',
+                        url: '{{route('admin.node.destroy', '')}}/' + id,
+                        data: {_token: '{{csrf_token()}}'},
+                        dataType: 'json',
+                        success: function(ret) {
+                            if (ret.status === 'success') {
+                                swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
+                            } else {
+                                swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+                            }
+                        },
+                    });
+                }
+            });
         }
         @endcan
     </script>

+ 322 - 322
resources/views/admin/node/info.blade.php

@@ -409,346 +409,346 @@
     <script src="/assets/global/vendor/switchery/switchery.min.js"></script>
     <script src="/assets/global/js/Plugin/switchery.js"></script>
     <script>
-      const string = "{{strtolower(Str::random())}}";
-      $(document).ready(function() {
-        let v2_path = $('#v2_path');
-          @isset($node)
+        const string = "{{strtolower(Str::random())}}";
+        $(document).ready(function() {
+            let v2_path = $('#v2_path');
+            @isset($node)
 
-          @if($node->is_ddns)
-          $('#is_ddns').click();
-          @endif
-          $('#name').val('{{$node->name}}');
-        $('#server').val('{{$node->server}}');
-        $('#ip').val('{{$node->ip}}');
-        $('#ipv6').val('{{$node->ipv6}}');
-        $('#push_port').val('{{$node->push_port}}');
-        $('#traffic_rate').val('{{$node->traffic_rate}}');
-        $('#level').selectpicker('val', '{{$node->level}}');
-        $('#ruleGroup').selectpicker('val', '{{$node->rule_group_id}}');
-        $('#speed_limit').val('{{$node->speed_limit}}');
-        $('#client_limit').val('{{$node->client_limit}}');
-        $('#labels').selectpicker('val', {{$node->labels->pluck('id')}});
-        $('#country_code').selectpicker('val', '{{$node->country_code}}');
-        $('#description').val('{{$node->description}}');
-        $('#sort').val('{{$node->sort}}');
-          @if($node->is_udp)
-          $('#is_udp').click();
-          @endif
-          @if($node->status)
-          $('#status').click();
-          @endif
-          @if($node->is_subscribe)
-          $('#is_subscribe').click();
-          @endif
-          $("input[name='detection_type'][value='{{$node->detection_type}}']").click();
-          @if($node->single)
-          $('#single').click();
-          @endif
-          $('input[name = port]').val('{{$node->port}}');
-        $('#passwd').val('{{$node->passwd}}');
-        $("input[name='type'][value='{{$node->type}}']").click();
+            @if($node->is_ddns)
+            $('#is_ddns').click();
+            @endif
+            $('#name').val('{{$node->name}}');
+            $('#server').val('{{$node->server}}');
+            $('#ip').val('{{$node->ip}}');
+            $('#ipv6').val('{{$node->ipv6}}');
+            $('#push_port').val('{{$node->push_port}}');
+            $('#traffic_rate').val('{{$node->traffic_rate}}');
+            $('#level').selectpicker('val', '{{$node->level}}');
+            $('#ruleGroup').selectpicker('val', '{{$node->rule_group_id}}');
+            $('#speed_limit').val('{{$node->speed_limit}}');
+            $('#client_limit').val('{{$node->client_limit}}');
+            $('#labels').selectpicker('val', {{$node->labels->pluck('id')}});
+            $('#country_code').selectpicker('val', '{{$node->country_code}}');
+            $('#description').val('{{$node->description}}');
+            $('#sort').val('{{$node->sort}}');
+            @if($node->is_udp)
+            $('#is_udp').click();
+            @endif
+            @if($node->status)
+            $('#status').click();
+            @endif
+            @if($node->is_subscribe)
+            $('#is_subscribe').click();
+            @endif
+            $("input[name='detection_type'][value='{{$node->detection_type}}']").click();
+            @if($node->single)
+            $('#single').click();
+            @endif
+            $('input[name = port]').val('{{$node->port}}');
+            $('#passwd').val('{{$node->passwd}}');
+            $("input[name='type'][value='{{$node->type}}']").click();
 
-          @if($node->type == 1 || $node->type == 4)
-        // ShadowsocksR
-        $('#method').selectpicker('val', '{{$node->method}}');
-        $('#protocol').selectpicker('val', '{{$node->protocol}}');
-        $('#protocol_param').val('{{$node->protocol_param}}');
-        $('#obfs').selectpicker('val', '{{$node->obfs}}');
-        $('#obfs_param').val('{{$node->obfs_param}}');
-          @if($node->compatible)
-          $('#compatible').click();
-          @endif
-          @endif
+            @if($node->type == 1 || $node->type == 4)
+            // ShadowsocksR
+            $('#method').selectpicker('val', '{{$node->method}}');
+            $('#protocol').selectpicker('val', '{{$node->protocol}}');
+            $('#protocol_param').val('{{$node->protocol_param}}');
+            $('#obfs').selectpicker('val', '{{$node->obfs}}');
+            $('#obfs_param').val('{{$node->obfs_param}}');
+            @if($node->compatible)
+            $('#compatible').click();
+            @endif
+            @endif
 
-          @if($node->type === 2)
-        //V2Ray
-        $('#v2_alter_id').val('{{$node->v2_alter_id}}');
-        $('#v2_port').val('{{$node->v2_port}}');
-        $('#v2_method').selectpicker('val', '{{$node->v2_method}}');
-        $('#v2_net').selectpicker('val', '{{$node->v2_net}}');
-        $('#v2_type').selectpicker('val', '{{$node->v2_type}}');
-        $('#v2_host').val('{{$node->v2_host}}');
-        v2_path.val('{{$node->v2_path}}');
-          @if($node->v2_tls)
-          $('#v2_tls').click();
-          @endif
-          $('#tls_provider').val('{!! $node->tls_provider !!}');
-          @endif
+            @if($node->type === 2)
+            //V2Ray
+            $('#v2_alter_id').val('{{$node->v2_alter_id}}');
+            $('#v2_port').val('{{$node->v2_port}}');
+            $('#v2_method').selectpicker('val', '{{$node->v2_method}}');
+            $('#v2_net').selectpicker('val', '{{$node->v2_net}}');
+            $('#v2_type').selectpicker('val', '{{$node->v2_type}}');
+            $('#v2_host').val('{{$node->v2_host}}');
+            v2_path.val('{{$node->v2_path}}');
+            @if($node->v2_tls)
+            $('#v2_tls').click();
+            @endif
+            $('#tls_provider').val('{!! $node->tls_provider !!}');
+            @endif
 
-          @if($node->is_relay)
-        // 中转
-        $('#is_relay').click();
-        $('#relay_port').val('{{$node->relay_port}}');
-        $('#relay_server').val('{{$node->relay_server}}');
-          @endif
-          @else
-          $('#status').click();
-        $('#is_udp').click();
-        $('#is_subscribe').click();
-        v2_path.val('/' + string);
-          @endisset
-          if ($('#obfs').val() === 'plain') {
-            $('.obfs_param').hide();
-          }
-      });
-
-      // ajax同步提交
-      function Submit() {
-        const type = $('input[name=\'type\']:checked').val();
-        let port;
-        switch (type) {
-          case '2':
-            port = $('#v2ray_port').val();
-            break;
-          case '3':
-            port = $('#trojan_port').val();
-            break;
-          case '1':
-          case '4':
-          default:
-            port = $('#single_port').val();
-        }
-        $.ajax({
-          method: @isset($node) 'PUT' @else 'POST' @endisset,
-          url: '{{isset($node)? route('admin.node.update', $node) : route('admin.node.store')}}',
-          dataType: 'json',
-          data: {
-            _token: '{{csrf_token()}}',
-            is_ddns: document.getElementById('is_ddns').checked ? 1 : 0,
-            name: $('#name').val(),
-            server: $('#server').val(),
-            ip: $('#ip').val(),
-            ipv6: $('#ipv6').val(),
-            push_port: $('#push_port').val(),
-            traffic_rate: $('#traffic_rate').val(),
-            level: $('#level').val(),
-            rule_group_id: $('#ruleGroup').val(),
-            speed_limit: $('#speed_limit').val(),
-            client_limit: $('#client_limit').val(),
-            labels: $('#labels').val(),
-            country_code: $('#country_code option:selected').val(),
-            description: $('#description').val(),
-            sort: $('#sort').val(),
-            is_udp: document.getElementById('is_udp').checked ? 1 : 0,
-            status: document.getElementById('status').checked ? 1 : 0,
-            type: type,
-            method: $('#method').val(),
-            protocol: $('#protocol').val(),
-            protocol_param: $('#protocol_param').val(),
-            obfs: $('#obfs').val(),
-            obfs_param: $('#obfs_param').val(),
-            compatible: document.getElementById('compatible').checked ? 1 : 0,
-            is_subscribe: document.getElementById('is_subscribe').checked ? 1 : 0,
-            detection_type: $('input[name=\'detection_type\']:checked').val(),
-            single: document.getElementById('single').checked ? 1 : 0,
-            port: port,
-            passwd: $('#passwd').val(),
-            v2_alter_id: $('#v2_alter_id').val(),
-            v2_port: $('#v2_port').val(),
-            v2_method: $('#v2_method').val(),
-            v2_net: $('#v2_net').val(),
-            v2_type: $('#v2_type').val(),
-            v2_host: $('#v2_host').val(),
-            v2_path: $('#v2_path').val(),
-            v2_tls: document.getElementById('v2_tls').checked ? 1 : 0,
-            tls_provider: $('#tls_provider').val(),
-            is_relay: document.getElementById('is_relay').checked ? 1 : 0,
-            relay_port: $('#relay_port').val(),
-            relay_server: $('#relay_server').val(),
-          },
-          success: function(ret) {
-            if (ret.status === 'success') {
-              swal.fire({
-                title: ret.message,
-                icon: 'success',
-                timer: 1000,
-                showConfirmButton: false,
-              }).then(() => window.location.href = '{{route('admin.node.index').(Request::getQueryString()?('?'.Request::getQueryString()):'') }}');
-            } else {
-              swal.fire({title: '[错误 | Error]', text: ret.message, icon: 'error'});
-            }
-          },
-          error: function(data) {
-            let str = '';
-            const errors = data.responseJSON;
-            if ($.isEmptyObject(errors) === false) {
-              if ($.isEmptyObject(errors.message) === false && typeof errors.message === 'string') {
-                str += errors.message;
-              } else {
-                $.each(errors.errors, function(index, value) {
-                  str += '<li>' + value + '</li>';
-                });
-              }
-              swal.fire({title: '提示', html: str, icon: 'error', confirmButtonText: '{{trans('common.confirm')}}'});
+            @if($node->is_relay)
+            // 中转
+            $('#is_relay').click();
+            $('#relay_port').val('{{$node->relay_port}}');
+            $('#relay_server').val('{{$node->relay_server}}');
+            @endif
+            @else
+            $('#status').click();
+            $('#is_udp').click();
+            $('#is_subscribe').click();
+            v2_path.val('/' + string);
+            @endisset
+            if ($('#obfs').val() === 'plain') {
+                $('.obfs_param').hide();
             }
-          },
         });
 
-        return false;
-      }
-
-      function switchSetting(id) {
-        let check = document.getElementById(id).checked ? 1 : 0;
-        switch (id) {
-            // 设置单端口多用户
-          case 'single':
-            if (check) {
-              $('.single-setting').show();
-            } else {
-              $('#single_port').val('');
-              $('#passwd').val('');
-              $('.single-setting').hide();
+        // ajax同步提交
+        function Submit() {
+            const type = $('input[name=\'type\']:checked').val();
+            let port;
+            switch (type) {
+                case '2':
+                    port = $('#v2ray_port').val();
+                    break;
+                case '3':
+                    port = $('#trojan_port').val();
+                    break;
+                case '1':
+                case '4':
+                default:
+                    port = $('#single_port').val();
             }
-            break;
-            //设置中转
-          case 'is_relay':
-            if (check) {
-              $('.relay-setting').show();
-              $('#relay_port').attr('required', true);
-              $('#relay_server').attr('required', true);
-            } else {
-              $('.relay-setting').hide();
-              $('#relay_port').removeAttr('required');
-              $('#relay_server').removeAttr('required');
-            }
-            break;
-            // 设置是否使用DDNS
-          case 'is_ddns':
-            if (check) {
-              $('#ip').val('').attr('readonly', true);
-              $('#ipv6').val('').attr('readonly', true);
-              $('#server').attr('required', true);
-            } else {
-              $('#ip').removeAttr('readonly');
-              $('#ipv6').removeAttr('readonly');
-              $('#server').removeAttr('required');
-            }
-            break;
-          default:
-            break;
-        }
-      }
+            $.ajax({
+                method: @isset($node) 'PUT' @else 'POST' @endisset,
+                url: '{{isset($node)? route('admin.node.update', $node) : route('admin.node.store')}}',
+                dataType: 'json',
+                data: {
+                    _token: '{{csrf_token()}}',
+                    is_ddns: document.getElementById('is_ddns').checked ? 1 : 0,
+                    name: $('#name').val(),
+                    server: $('#server').val(),
+                    ip: $('#ip').val(),
+                    ipv6: $('#ipv6').val(),
+                    push_port: $('#push_port').val(),
+                    traffic_rate: $('#traffic_rate').val(),
+                    level: $('#level').val(),
+                    rule_group_id: $('#ruleGroup').val(),
+                    speed_limit: $('#speed_limit').val(),
+                    client_limit: $('#client_limit').val(),
+                    labels: $('#labels').val(),
+                    country_code: $('#country_code option:selected').val(),
+                    description: $('#description').val(),
+                    sort: $('#sort').val(),
+                    is_udp: document.getElementById('is_udp').checked ? 1 : 0,
+                    status: document.getElementById('status').checked ? 1 : 0,
+                    type: type,
+                    method: $('#method').val(),
+                    protocol: $('#protocol').val(),
+                    protocol_param: $('#protocol_param').val(),
+                    obfs: $('#obfs').val(),
+                    obfs_param: $('#obfs_param').val(),
+                    compatible: document.getElementById('compatible').checked ? 1 : 0,
+                    is_subscribe: document.getElementById('is_subscribe').checked ? 1 : 0,
+                    detection_type: $('input[name=\'detection_type\']:checked').val(),
+                    single: document.getElementById('single').checked ? 1 : 0,
+                    port: port,
+                    passwd: $('#passwd').val(),
+                    v2_alter_id: $('#v2_alter_id').val(),
+                    v2_port: $('#v2_port').val(),
+                    v2_method: $('#v2_method').val(),
+                    v2_net: $('#v2_net').val(),
+                    v2_type: $('#v2_type').val(),
+                    v2_host: $('#v2_host').val(),
+                    v2_path: $('#v2_path').val(),
+                    v2_tls: document.getElementById('v2_tls').checked ? 1 : 0,
+                    tls_provider: $('#tls_provider').val(),
+                    is_relay: document.getElementById('is_relay').checked ? 1 : 0,
+                    relay_port: $('#relay_port').val(),
+                    relay_server: $('#relay_server').val(),
+                },
+                success: function(ret) {
+                    if (ret.status === 'success') {
+                        swal.fire({
+                            title: ret.message,
+                            icon: 'success',
+                            timer: 1000,
+                            showConfirmButton: false,
+                        }).then(() => window.location.href = '{{route('admin.node.index').(Request::getQueryString()?('?'.Request::getQueryString()):'') }}');
+                    } else {
+                        swal.fire({title: '[错误 | Error]', text: ret.message, icon: 'error'});
+                    }
+                },
+                error: function(data) {
+                    let str = '';
+                    const errors = data.responseJSON;
+                    if ($.isEmptyObject(errors) === false) {
+                        if ($.isEmptyObject(errors.message) === false && typeof errors.message === 'string') {
+                            str += errors.message;
+                        } else {
+                            $.each(errors.errors, function(index, value) {
+                                str += '<li>' + value + '</li>';
+                            });
+                        }
+                        swal.fire({title: '提示', html: str, icon: 'error', confirmButtonText: '{{trans('common.confirm')}}'});
+                    }
+                },
+            });
 
-      // 设置服务类型
-      $('input:radio[name=\'type\']').on('change', function() {
-        const type = parseInt($(this).val());
-        const $ssr_setting = $('.ssr-setting');
-        const $v2ray_setting = $('.v2ray-setting');
-        const $trojan_setting = $('.trojan-setting');
-        $ssr_setting.hide();
-        $v2ray_setting.hide();
-        $trojan_setting.hide();
-        switch (type) {
-          case 1:
-            $ssr_setting.show();
-            break;
-          case 2:
-            $v2ray_setting.show();
-            $('#v2_net').selectpicker('val', 'tcp');
-            break;
-          case 3:
-            $trojan_setting.show();
-            break;
-          case 4:
-            $ssr_setting.show();
-            break;
-          default:
+            return false;
         }
-      });
 
-      $('#obfs').on('changed.bs.select', function() {
-        const obfs_param = $('.obfs_param');
-        if ($('#obfs').val() === 'plain') {
-          $('#obfs_param').val('');
-          obfs_param.hide();
-        } else {
-          obfs_param.show();
+        function switchSetting(id) {
+            let check = document.getElementById(id).checked ? 1 : 0;
+            switch (id) {
+                // 设置单端口多用户
+                case 'single':
+                    if (check) {
+                        $('.single-setting').show();
+                    } else {
+                        $('#single_port').val('');
+                        $('#passwd').val('');
+                        $('.single-setting').hide();
+                    }
+                    break;
+                //设置中转
+                case 'is_relay':
+                    if (check) {
+                        $('.relay-setting').show();
+                        $('#relay_port').attr('required', true);
+                        $('#relay_server').attr('required', true);
+                    } else {
+                        $('.relay-setting').hide();
+                        $('#relay_port').removeAttr('required');
+                        $('#relay_server').removeAttr('required');
+                    }
+                    break;
+                // 设置是否使用DDNS
+                case 'is_ddns':
+                    if (check) {
+                        $('#ip').val('').attr('readonly', true);
+                        $('#ipv6').val('').attr('readonly', true);
+                        $('#server').attr('required', true);
+                    } else {
+                        $('#ip').removeAttr('readonly');
+                        $('#ipv6').removeAttr('readonly');
+                        $('#server').removeAttr('required');
+                    }
+                    break;
+                default:
+                    break;
+            }
         }
-      });
 
-      $('#v2_ws').on('changed.bs.select', function() {
-        $('#v2_host').val($('#v2_ws').val());
-      });
+        // 设置服务类型
+        $('input:radio[name=\'type\']').on('change', function() {
+            const type = parseInt($(this).val());
+            const $ssr_setting = $('.ssr-setting');
+            const $v2ray_setting = $('.v2ray-setting');
+            const $trojan_setting = $('.trojan-setting');
+            $ssr_setting.hide();
+            $v2ray_setting.hide();
+            $trojan_setting.hide();
+            switch (type) {
+                case 1:
+                    $ssr_setting.show();
+                    break;
+                case 2:
+                    $v2ray_setting.show();
+                    $('#v2_net').selectpicker('val', 'tcp');
+                    break;
+                case 3:
+                    $trojan_setting.show();
+                    break;
+                case 4:
+                    $ssr_setting.show();
+                    break;
+                default:
+            }
+        });
 
-      // 设置V2Ray详细设置
-      $('#v2_net').on('changed.bs.select', function() {
-        const type = $('.v2_type');
-        const type_option = $('#type_option');
-        const host = $('.v2_host');
-        const path = $('#v2_path');
-        const v2_ws = $('[name="v2_ws"]');
-        const v2_other = $('[name="v2_other"]');
-        type.show();
-        host.show();
-        v2_other.show();
-        v2_ws.hide();
-        path.val('/' + string);
-        switch ($(this).val()) {
-          case 'kcp':
-            type_option.attr('disabled', false);
-            break;
-          case 'ws':
-            v2_ws.show();
-            type.hide();
-            v2_other.hide();
-            break;
-          case 'http':
-            type.hide();
-            break;
-          case 'domainsocket':
-            type.hide();
-            host.hide();
-            break;
-          case 'quic':
-            type_option.attr('disabled', false);
-            path.val(string);
-            break;
-          case 'tcp':
-          default:
-            type_option.attr('disabled', true);
-            break;
-        }
-        $('#v2_type').selectpicker('refresh');
-      });
+        $('#obfs').on('changed.bs.select', function() {
+            const obfs_param = $('.obfs_param');
+            if ($('#obfs').val() === 'plain') {
+                $('#obfs_param').val('');
+                obfs_param.hide();
+            } else {
+                obfs_param.show();
+            }
+        });
 
-      // 服务条款
-      function showTnc() {
-        const content =
-            '<ol>' +
-            '<li>请勿直接复制黏贴以下配置,SSR(R)会报错的</li>' +
-            '<li>确保服务器时间为CST</li>' +
-            '</ol>' +
-            '&emsp;&emsp;"additional_ports" : {<br />' +
-            '&emsp;&emsp;&emsp;"443": {<br />' +
-            '&emsp;&emsp;&emsp;&emsp;"passwd": "ProxyPanel",<br />' +
-            '&emsp;&emsp;&emsp;&emsp;"method": "none",<br />' +
-            '&emsp;&emsp;&emsp;&emsp;"protocol": "auth_chain_a",<br />' +
-            '&emsp;&emsp;&emsp;&emsp;"protocol_param": "#",<br />' +
-            '&emsp;&emsp;&emsp;&emsp;"obfs": "plain",<br />' +
-            '&emsp;&emsp;&emsp;&emsp;"obfs_param": "fe2.update.microsoft.com"<br />' +
-            '&emsp;&emsp;&emsp;}<br />' +
-            '&emsp;&emsp;},';
+        $('#v2_ws').on('changed.bs.select', function() {
+            $('#v2_host').val($('#v2_ws').val());
+        });
 
-        swal.fire({
-          title: '[节点 user-config.json 配置示例]',
-          html: '<div class="p-10 bg-grey-900 text-white font-weight-300 text-left" style="line-height: 22px;">' +
-              content + '</div>',
-          icon: 'info',
+        // 设置V2Ray详细设置
+        $('#v2_net').on('changed.bs.select', function() {
+            const type = $('.v2_type');
+            const type_option = $('#type_option');
+            const host = $('.v2_host');
+            const path = $('#v2_path');
+            const v2_ws = $('[name="v2_ws"]');
+            const v2_other = $('[name="v2_other"]');
+            type.show();
+            host.show();
+            v2_other.show();
+            v2_ws.hide();
+            path.val('/' + string);
+            switch ($(this).val()) {
+                case 'kcp':
+                    type_option.attr('disabled', false);
+                    break;
+                case 'ws':
+                    v2_ws.show();
+                    type.hide();
+                    v2_other.hide();
+                    break;
+                case 'http':
+                    type.hide();
+                    break;
+                case 'domainsocket':
+                    type.hide();
+                    host.hide();
+                    break;
+                case 'quic':
+                    type_option.attr('disabled', false);
+                    path.val(string);
+                    break;
+                case 'tcp':
+                default:
+                    type_option.attr('disabled', true);
+                    break;
+            }
+            $('#v2_type').selectpicker('refresh');
         });
-      }
 
-      // 模式提示
-      function showPortsOnlyConfig() {
-        const content = '严格模式:"additional_ports_only": "true"'
-            + '<br><br>'
-            + '兼容模式:"additional_ports_only": "false"';
+        // 服务条款
+        function showTnc() {
+            const content =
+                '<ol>' +
+                '<li>请勿直接复制黏贴以下配置,SSR(R)会报错的</li>' +
+                '<li>确保服务器时间为CST</li>' +
+                '</ol>' +
+                '&emsp;&emsp;"additional_ports" : {<br />' +
+                '&emsp;&emsp;&emsp;"443": {<br />' +
+                '&emsp;&emsp;&emsp;&emsp;"passwd": "ProxyPanel",<br />' +
+                '&emsp;&emsp;&emsp;&emsp;"method": "none",<br />' +
+                '&emsp;&emsp;&emsp;&emsp;"protocol": "auth_chain_a",<br />' +
+                '&emsp;&emsp;&emsp;&emsp;"protocol_param": "#",<br />' +
+                '&emsp;&emsp;&emsp;&emsp;"obfs": "plain",<br />' +
+                '&emsp;&emsp;&emsp;&emsp;"obfs_param": "fe2.update.microsoft.com"<br />' +
+                '&emsp;&emsp;&emsp;}<br />' +
+                '&emsp;&emsp;},';
 
-        swal.fire({
-          title: '[节点 user-config.json 配置示例]',
-          html: '<div class="p-10 bg-grey-900 text-white font-weight-300 text-left" style="line-height: 22px;">' +
-              content + '</div>',
-          icon: 'info',
-        });
-      }
+            swal.fire({
+                title: '[节点 user-config.json 配置示例]',
+                html: '<div class="p-10 bg-grey-900 text-white font-weight-300 text-left" style="line-height: 22px;">' +
+                    content + '</div>',
+                icon: 'info',
+            });
+        }
+
+        // 模式提示
+        function showPortsOnlyConfig() {
+            const content = '严格模式:"additional_ports_only": "true"'
+                + '<br><br>'
+                + '兼容模式:"additional_ports_only": "false"';
+
+            swal.fire({
+                title: '[节点 user-config.json 配置示例]',
+                html: '<div class="p-10 bg-grey-900 text-white font-weight-300 text-left" style="line-height: 22px;">' +
+                    content + '</div>',
+                icon: 'info',
+            });
+        }
     </script>
 @endsection

+ 88 - 88
resources/views/admin/node/monitor.blade.php

@@ -30,98 +30,98 @@
 @section('javascript')
     <script src="/assets/global/vendor/chart-js/Chart.min.js"></script>
     <script>
-      const dailyChart = new Chart(document.getElementById('dailyChart').getContext('2d'), {
-        type: 'line',
-        data: {
-          labels: {{$dayHours}},
-          datasets: [
-            {
-              fill: true,
-              backgroundColor: 'rgba(98, 168, 234, .1)',
-              borderColor: Config.colors('primary', 600),
-              pointRadius: 4,
-              borderDashOffset: 2,
-              pointBorderColor: '#fff',
-              pointBackgroundColor: Config.colors('primary', 600),
-              pointHoverBackgroundColor: '#fff',
-              pointHoverBorderColor: Config.colors('primary', 600),
-              data: {{$trafficHourly}},
-            }],
-        },
-        options: {
-          legend: {
-            display: false,
-          },
-          responsive: true,
-          scales: {
-            xAxes: [
-              {
-                display: true,
-                scaleLabel: {
-                  display: true,
-                  labelString: '小时',
+        const dailyChart = new Chart(document.getElementById('dailyChart').getContext('2d'), {
+            type: 'line',
+            data: {
+                labels: {{$dayHours}},
+                datasets: [
+                    {
+                        fill: true,
+                        backgroundColor: 'rgba(98, 168, 234, .1)',
+                        borderColor: Config.colors('primary', 600),
+                        pointRadius: 4,
+                        borderDashOffset: 2,
+                        pointBorderColor: '#fff',
+                        pointBackgroundColor: Config.colors('primary', 600),
+                        pointHoverBackgroundColor: '#fff',
+                        pointHoverBorderColor: Config.colors('primary', 600),
+                        data: {{$trafficHourly}},
+                    }],
+            },
+            options: {
+                legend: {
+                    display: false,
                 },
-              }],
-            yAxes: [
-              {
-                display: true,
-                ticks: {
-                  beginAtZero: true,
+                responsive: true,
+                scales: {
+                    xAxes: [
+                        {
+                            display: true,
+                            scaleLabel: {
+                                display: true,
+                                labelString: '小时',
+                            },
+                        }],
+                    yAxes: [
+                        {
+                            display: true,
+                            ticks: {
+                                beginAtZero: true,
+                            },
+                            scaleLabel: {
+                                display: true,
+                                labelString: '{{trans('user.traffic_logs.24hours')}}',
+                            },
+                        }],
                 },
-                scaleLabel: {
-                  display: true,
-                  labelString: '{{trans('user.traffic_logs.24hours')}}',
-                },
-              }],
-          },
-        },
-      });
+            },
+        });
 
-      const monthlyChart = new Chart(document.getElementById('monthlyChart').getContext('2d'), {
-        type: 'line',
-        data: {
-          labels: {{$monthDays}},
-          datasets: [
-            {
-              fill: true,
-              backgroundColor: 'rgba(98, 168, 234, .1)',
-              borderColor: Config.colors('primary', 600),
-              pointRadius: 4,
-              borderDashOffset: 2,
-              pointBorderColor: '#fff',
-              pointBackgroundColor: Config.colors('primary', 600),
-              pointHoverBackgroundColor: '#fff',
-              pointHoverBorderColor: Config.colors('primary', 600),
-              data: {{$trafficDaily}},
-            }],
-        },
-        options: {
-          legend: {
-            display: false,
-          },
-          responsive: true,
-          scales: {
-            xAxes: [
-              {
-                display: true,
-                scaleLabel: {
-                  display: true,
-                  labelString: '天',
-                },
-              }],
-            yAxes: [
-              {
-                display: true,
-                ticks: {
-                  beginAtZero: true,
+        const monthlyChart = new Chart(document.getElementById('monthlyChart').getContext('2d'), {
+            type: 'line',
+            data: {
+                labels: {{$monthDays}},
+                datasets: [
+                    {
+                        fill: true,
+                        backgroundColor: 'rgba(98, 168, 234, .1)',
+                        borderColor: Config.colors('primary', 600),
+                        pointRadius: 4,
+                        borderDashOffset: 2,
+                        pointBorderColor: '#fff',
+                        pointBackgroundColor: Config.colors('primary', 600),
+                        pointHoverBackgroundColor: '#fff',
+                        pointHoverBorderColor: Config.colors('primary', 600),
+                        data: {{$trafficDaily}},
+                    }],
+            },
+            options: {
+                legend: {
+                    display: false,
                 },
-                scaleLabel: {
-                  display: true,
-                  labelString: '{{trans('user.traffic_logs.30days')}}',
+                responsive: true,
+                scales: {
+                    xAxes: [
+                        {
+                            display: true,
+                            scaleLabel: {
+                                display: true,
+                                labelString: '天',
+                            },
+                        }],
+                    yAxes: [
+                        {
+                            display: true,
+                            ticks: {
+                                beginAtZero: true,
+                            },
+                            scaleLabel: {
+                                display: true,
+                                labelString: '{{trans('user.traffic_logs.30days')}}',
+                            },
+                        }],
                 },
-              }],
-          },
-        },
-      });
+            },
+        });
     </script>
 @endsection

+ 25 - 25
resources/views/admin/permission/index.blade.php

@@ -71,32 +71,32 @@
     <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
     @can('admin.permission.destroy')
         <script>
-          function delPermission(url, name) {
-            swal.fire({
-              title: '{{trans('common.warning')}}',
-              text: '确定删除 【' + name + '】 权限行为?',
-              icon: 'warning',
-              showCancelButton: true,
-              cancelButtonText: '{{trans('common.close')}}',
-              confirmButtonText: '{{trans('common.confirm')}}',
-            }).then((result) => {
-              if (result.value) {
-                $.ajax({
-                  method: 'DELETE',
-                  url: url,
-                  data: {_token: '{{csrf_token()}}'},
-                  dataType: 'json',
-                  success: function(ret) {
-                    if (ret.status === 'success') {
-                      swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
-                    } else {
-                      swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+            function delPermission(url, name) {
+                swal.fire({
+                    title: '{{trans('common.warning')}}',
+                    text: '确定删除 【' + name + '】 权限行为?',
+                    icon: 'warning',
+                    showCancelButton: true,
+                    cancelButtonText: '{{trans('common.close')}}',
+                    confirmButtonText: '{{trans('common.confirm')}}',
+                }).then((result) => {
+                    if (result.value) {
+                        $.ajax({
+                            method: 'DELETE',
+                            url: url,
+                            data: {_token: '{{csrf_token()}}'},
+                            dataType: 'json',
+                            success: function(ret) {
+                                if (ret.status === 'success') {
+                                    swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
+                                } else {
+                                    swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+                                }
+                            },
+                        });
                     }
-                  },
                 });
-              }
-            });
-          }
+            }
         </script>
     @endcan
-@endsection
+@endsection

+ 10 - 10
resources/views/admin/permission/info.blade.php

@@ -44,14 +44,14 @@
 @endsection
 @section('javascript')
     <script>
-      $(document).ready(function() {
-          @isset($permission)
-          $('#description').val(@json(old('description') ?? $permission->description));
-        $('#name').val(@json(old('name') ?? $permission->name));
-          @else
-          $('#description').val(@json(old('description')));
-        $('#name').val(@json(old('name')));
-          @endisset
-      });
+        $(document).ready(function() {
+            @isset($permission)
+            $('#description').val(@json(old('description') ?? $permission->description));
+            $('#name').val(@json(old('name') ?? $permission->name));
+            @else
+            $('#description').val(@json(old('description')));
+            $('#name').val(@json(old('name')));
+            @endisset
+        });
     </script>
-@endsection
+@endsection

+ 25 - 25
resources/views/admin/role/index.blade.php

@@ -78,32 +78,32 @@
     <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
     @can('admin.role.destroy')
         <script>
-          function delRole(url, name) {
-            swal.fire({
-              title: '{{trans('common.warning')}}',
-              text: '确定删除 【' + name + '】 权限角色?',
-              icon: 'warning',
-              showCancelButton: true,
-              cancelButtonText: '{{trans('common.close')}}',
-              confirmButtonText: '{{trans('common.confirm')}}',
-            }).then((result) => {
-              if (result.value) {
-                $.ajax({
-                  method: 'DELETE',
-                  url: url,
-                  data: {_token: '{{csrf_token()}}'},
-                  dataType: 'json',
-                  success: function(ret) {
-                    if (ret.status === 'success') {
-                      swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
-                    } else {
-                      swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+            function delRole(url, name) {
+                swal.fire({
+                    title: '{{trans('common.warning')}}',
+                    text: '确定删除 【' + name + '】 权限角色?',
+                    icon: 'warning',
+                    showCancelButton: true,
+                    cancelButtonText: '{{trans('common.close')}}',
+                    confirmButtonText: '{{trans('common.confirm')}}',
+                }).then((result) => {
+                    if (result.value) {
+                        $.ajax({
+                            method: 'DELETE',
+                            url: url,
+                            data: {_token: '{{csrf_token()}}'},
+                            dataType: 'json',
+                            success: function(ret) {
+                                if (ret.status === 'success') {
+                                    swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
+                                } else {
+                                    swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+                                }
+                            },
+                        });
                     }
-                  },
                 });
-              }
-            });
-          }
+            }
         </script>
     @endcan
-@endsection
+@endsection

+ 43 - 43
resources/views/admin/role/info.blade.php

@@ -34,13 +34,13 @@
                             <span class="text-help"> 唯一标识名称,例如:Administrator </span>
                         </div>
                     </div>
-                        <div class="form-group row">
-                            <label class="col-md-2 col-sm-3 col-form-label" for="description">描述名称</label>
-                            <div class="col-md-5 col-sm-9">
-                                <input type="text" class="form-control" name="description" id="description" required/>
-                                <span class="text-help"> 面板显示名称,例如:管理员 </span>
-                            </div>
+                    <div class="form-group row">
+                        <label class="col-md-2 col-sm-3 col-form-label" for="description">描述名称</label>
+                        <div class="col-md-5 col-sm-9">
+                            <input type="text" class="form-control" name="description" id="description" required/>
+                            <span class="text-help"> 面板显示名称,例如:管理员 </span>
                         </div>
+                    </div>
                     <div class="form-group row">
                         <label class="col-md-2 col-sm-3 col-form-label" for="permissions">选择权限</label>
                         <div class="col-md-9 col-sm-9">
@@ -70,56 +70,56 @@
     <script>
         @isset($role)
         $(document).ready(function() {
-          $('#description').val('{{$role->description}}');
-          $('#name').val('{{$role->name}}');
-          $('#permissions').multiSelect('select',@json($role->permissions->pluck('name')));
+            $('#description').val('{{$role->description}}');
+            $('#name').val('{{$role->name}}');
+            $('#permissions').multiSelect('select',@json($role->permissions->pluck('name')));
         });
         @endisset
         // 权限列表
         $('#permissions').multiSelect({
-          selectableHeader: '<input type=\'text\' class=\'search-input form-control\' autocomplete=\'off\' placeholder=\'待分配规则,此处可搜索\'>',
-          selectionHeader: '<input type=\'text\' class=\'search-input form-control\' autocomplete=\'off\' placeholder=\'已分配规则,此处可搜索\'>',
-          afterInit: function() {
-            const that = this,
-                $selectableSearch = that.$selectableUl.prev(),
-                $selectionSearch = that.$selectionUl.prev(),
-                selectableSearchString = '#' + that.$container.attr('id') + ' .ms-elem-selectable:not(.ms-selected)',
-                selectionSearchString = '#' + that.$container.attr('id') + ' .ms-elem-selection.ms-selected';
+            selectableHeader: '<input type=\'text\' class=\'search-input form-control\' autocomplete=\'off\' placeholder=\'待分配规则,此处可搜索\'>',
+            selectionHeader: '<input type=\'text\' class=\'search-input form-control\' autocomplete=\'off\' placeholder=\'已分配规则,此处可搜索\'>',
+            afterInit: function() {
+                const that = this,
+                    $selectableSearch = that.$selectableUl.prev(),
+                    $selectionSearch = that.$selectionUl.prev(),
+                    selectableSearchString = '#' + that.$container.attr('id') + ' .ms-elem-selectable:not(.ms-selected)',
+                    selectionSearchString = '#' + that.$container.attr('id') + ' .ms-elem-selection.ms-selected';
 
-            that.qs1 = $selectableSearch.quicksearch(selectableSearchString).on('keydown', function(e) {
-              if (e.which === 40) {
-                that.$selectableUl.focus();
-                return false;
-              }
-            });
+                that.qs1 = $selectableSearch.quicksearch(selectableSearchString).on('keydown', function(e) {
+                    if (e.which === 40) {
+                        that.$selectableUl.focus();
+                        return false;
+                    }
+                });
 
-            that.qs2 = $selectionSearch.quicksearch(selectionSearchString).on('keydown', function(e) {
-              if (e.which === 40) {
-                that.$selectionUl.focus();
-                return false;
-              }
-            });
-          },
-          afterSelect: function() {
-            this.qs1.cache();
-            this.qs2.cache();
-          },
-          afterDeselect: function() {
-            this.qs1.cache();
-            this.qs2.cache();
-          },
+                that.qs2 = $selectionSearch.quicksearch(selectionSearchString).on('keydown', function(e) {
+                    if (e.which === 40) {
+                        that.$selectionUl.focus();
+                        return false;
+                    }
+                });
+            },
+            afterSelect: function() {
+                this.qs1.cache();
+                this.qs2.cache();
+            },
+            afterDeselect: function() {
+                this.qs1.cache();
+                this.qs2.cache();
+            },
         });
 
         // 全选
         $('#select-all').click(function() {
-          $('#permissions').multiSelect('select_all');
-          return false;
+            $('#permissions').multiSelect('select_all');
+            return false;
         });
 
         // 反选
         $('#deselect-all').click(function() {
-          $('#permissions').multiSelect('deselect_all');
-          return false;
+            $('#permissions').multiSelect('deselect_all');
+            return false;
         });
     </script>
-@endsection
+@endsection

+ 25 - 25
resources/views/admin/rule/group/index.blade.php

@@ -73,33 +73,33 @@
     <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
     @can('admin.rule.group.destroy')
         <script>
-          // 删除规则分组
-          function delRuleGroup(url, name) {
-            swal.fire({
-              title: '{{trans('common.warning')}}',
-              text: '确定删除分组 【' + name + '】 ?',
-              icon: 'warning',
-              showCancelButton: true,
-              cancelButtonText: '{{trans('common.close')}}',
-              confirmButtonText: '{{trans('common.confirm')}}',
-            }).then((result) => {
-              if (result.value) {
-                $.ajax({
-                  method: 'DELETE',
-                  url: url,
-                  data: {_token: '{{csrf_token()}}'},
-                  dataType: 'json',
-                  success: function(ret) {
-                    if (ret.status === 'success') {
-                      swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
-                    } else {
-                      swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+            // 删除规则分组
+            function delRuleGroup(url, name) {
+                swal.fire({
+                    title: '{{trans('common.warning')}}',
+                    text: '确定删除分组 【' + name + '】 ?',
+                    icon: 'warning',
+                    showCancelButton: true,
+                    cancelButtonText: '{{trans('common.close')}}',
+                    confirmButtonText: '{{trans('common.confirm')}}',
+                }).then((result) => {
+                    if (result.value) {
+                        $.ajax({
+                            method: 'DELETE',
+                            url: url,
+                            data: {_token: '{{csrf_token()}}'},
+                            dataType: 'json',
+                            success: function(ret) {
+                                if (ret.status === 'success') {
+                                    swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
+                                } else {
+                                    swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+                                }
+                            },
+                        });
                     }
-                  },
                 });
-              }
-            });
-          }
+            }
         </script>
     @endcan
 @endsection

+ 36 - 36
resources/views/admin/rule/group/info.blade.php

@@ -75,56 +75,56 @@
     <script>
         @isset($ruleGroup)
         $(document).ready(function() {
-          $('#name').val('{{$ruleGroup->name}}');
-          $("input[name='type'][value='{{$ruleGroup->type}}']").click();
-          $('#rules').multiSelect('select', @json(array_map('strval', $ruleGroup->rules()->get()->pluck('id')->toArray())));
+            $('#name').val('{{$ruleGroup->name}}');
+            $("input[name='type'][value='{{$ruleGroup->type}}']").click();
+            $('#rules').multiSelect('select', @json(array_map('strval', $ruleGroup->rules()->get()->pluck('id')->toArray())));
         });
         @endisset
         // 权限列表
         $('#rules').multiSelect({
-          selectableHeader: '<input type=\'text\' class=\'search-input form-control\' autocomplete=\'off\' placeholder=\'待分配规则,此处可搜索\'>',
-          selectionHeader: '<input type=\'text\' class=\'search-input form-control\' autocomplete=\'off\' placeholder=\'已分配规则,此处可搜索\'>',
-          afterInit: function() {
-            const that = this,
-                $selectableSearch = that.$selectableUl.prev(),
-                $selectionSearch = that.$selectionUl.prev(),
-                selectableSearchString = '#' + that.$container.attr('id') + ' .ms-elem-selectable:not(.ms-selected)',
-                selectionSearchString = '#' + that.$container.attr('id') + ' .ms-elem-selection.ms-selected';
+            selectableHeader: '<input type=\'text\' class=\'search-input form-control\' autocomplete=\'off\' placeholder=\'待分配规则,此处可搜索\'>',
+            selectionHeader: '<input type=\'text\' class=\'search-input form-control\' autocomplete=\'off\' placeholder=\'已分配规则,此处可搜索\'>',
+            afterInit: function() {
+                const that = this,
+                    $selectableSearch = that.$selectableUl.prev(),
+                    $selectionSearch = that.$selectionUl.prev(),
+                    selectableSearchString = '#' + that.$container.attr('id') + ' .ms-elem-selectable:not(.ms-selected)',
+                    selectionSearchString = '#' + that.$container.attr('id') + ' .ms-elem-selection.ms-selected';
 
-            that.qs1 = $selectableSearch.quicksearch(selectableSearchString).on('keydown', function(e) {
-              if (e.which === 40) {
-                that.$selectableUl.focus();
-                return false;
-              }
-            });
+                that.qs1 = $selectableSearch.quicksearch(selectableSearchString).on('keydown', function(e) {
+                    if (e.which === 40) {
+                        that.$selectableUl.focus();
+                        return false;
+                    }
+                });
 
-            that.qs2 = $selectionSearch.quicksearch(selectionSearchString).on('keydown', function(e) {
-              if (e.which === 40) {
-                that.$selectionUl.focus();
-                return false;
-              }
-            });
-          },
-          afterSelect: function() {
-            this.qs1.cache();
-            this.qs2.cache();
-          },
-          afterDeselect: function() {
-            this.qs1.cache();
-            this.qs2.cache();
-          },
+                that.qs2 = $selectionSearch.quicksearch(selectionSearchString).on('keydown', function(e) {
+                    if (e.which === 40) {
+                        that.$selectionUl.focus();
+                        return false;
+                    }
+                });
+            },
+            afterSelect: function() {
+                this.qs1.cache();
+                this.qs2.cache();
+            },
+            afterDeselect: function() {
+                this.qs1.cache();
+                this.qs2.cache();
+            },
         });
 
         // 全选
         $('#select-all').click(function() {
-          $('#rules').multiSelect('select_all');
-          return false;
+            $('#rules').multiSelect('select_all');
+            return false;
         });
 
         // 反选
         $('#deselect-all').click(function() {
-          $('#rules').multiSelect('deselect_all');
-          return false;
+            $('#rules').multiSelect('deselect_all');
+            return false;
         });
     </script>
 @endsection

+ 98 - 111
resources/views/admin/rule/index.blade.php

@@ -17,9 +17,9 @@
                 @endcan
             </div>
             <div class="panel-body">
-                <div class="form-row">
+                <form class="form-row">
                     <div class="form-group col-xxl-1 col-lg-3 col-md-3 col-4">
-                        <select class="form-control" id="type" name="type" data-plugin="selectpicker" data-style="btn-outline btn-primary" onChange="Search()">
+                        <select class="form-control" name="type" data-plugin="selectpicker" data-style="btn-outline btn-primary" onchange="this.form.submit()">
                             <option value="" hidden>类型</option>
                             <option value="1">正则表达式</option>
                             <option value="2">域名</option>
@@ -30,7 +30,7 @@
                     <div class="form-group col-xxl-1 col-lg-3 col-md-3 col-4">
                         <a href="{{route('admin.rule.index')}}" class="btn btn-danger">{{trans('common.reset')}}</a>
                     </div>
-                </div>
+                </form>
                 <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                     <thead class="thead-default">
                     <tr>
@@ -143,120 +143,107 @@
     <script src="/assets/global/vendor/bootstrap-select/bootstrap-select.min.js"></script>
     <script src="/assets/global/js/Plugin/bootstrap-select.js"></script>
     <script>
-      $(document).ready(function() {
-        $('#type').selectpicker('val', {{Request::input('type')}});
-      });
-
-      @can('admin.rule.store')
-      // 添加规则
-      function addRule() {
-        $.ajax({
-          method: 'POST',
-          url: "{{route('admin.rule.store')}}",
-          data: {
-            _token: '{{csrf_token()}}',
-            type: $('#add_type').val(),
-            name: $('#name').val(),
-            pattern: $('#pattern').val(),
-          },
-          dataType: 'json',
-          success: function(ret) {
-            $('#add').modal('hide');
-            if (ret.status === 'success') {
-              swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
-            } else {
-              swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-            }
-          },
-          error: function(data) {
-            $('#add').modal('hide');
-            let str = '';
-            const errors = data.responseJSON;
-            if ($.isEmptyObject(errors) === false) {
-              $.each(errors.errors, function(index, value) {
-                str += '<li>' + value + '</li>';
-              });
-              swal.fire({title: '提示', html: str, icon: 'error', confirmButtonText: '{{trans('common.confirm')}}'});
-            }
-          },
-        });
-      }
-      @endcan
-
-      @can('admin.rule.update')
-      // 编辑规则
-      function editRule(id) {
-        $.ajax({
-          method: 'PUT',
-          url: '{{route('admin.rule.update','')}}/' + id,
-          data: {
-            _token: '{{csrf_token()}}',
-            name: $('#name_' + id).val(),
-            pattern: $('#pattern_' + id).val(),
-          },
-          dataType: 'json',
-          success: function(ret) {
-            if (ret.status === 'success') {
-              swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
-            } else {
-              swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-            }
-          },
-          error: function(data) {
-            let str = '';
-            const errors = data.responseJSON;
-            if ($.isEmptyObject(errors) === false) {
-              $.each(errors.errors, function(index, value) {
-                str += '<li>' + value + '</li>';
-              });
-              swal.fire({title: '提示', html: str, icon: 'error', confirmButtonText: '{{trans('common.confirm')}}'});
-            }
-          },
+        $(document).ready(function() {
+            $('select').selectpicker('val', {{Request::query('type')}});
         });
-      }
-      @endcan
 
-      @can('admin.rule.destroy')
-      // 删除规则
-      function delRule(url, name) {
-        swal.fire({
-          title: '{{trans('common.warning')}}',
-          text: '确定删除规则 【' + name + '】 ?',
-          icon: 'warning',
-          showCancelButton: true,
-          cancelButtonText: '{{trans('common.close')}}',
-          confirmButtonText: '{{trans('common.confirm')}}',
-        }).then((result) => {
-          if (result.value) {
+        @can('admin.rule.store')
+        // 添加规则
+        function addRule() {
             $.ajax({
-              method: 'DELETE',
-              url: url,
-              data: {_token: '{{csrf_token()}}'},
-              dataType: 'json',
-              success: function(ret) {
-                if (ret.status === 'success') {
-                  swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
-                } else {
-                  swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-                }
-              },
+                method: 'POST',
+                url: "{{route('admin.rule.store')}}",
+                data: {
+                    _token: '{{csrf_token()}}',
+                    type: $('#add_type').val(),
+                    name: $('#name').val(),
+                    pattern: $('#pattern').val(),
+                },
+                dataType: 'json',
+                success: function(ret) {
+                    $('#add').modal('hide');
+                    if (ret.status === 'success') {
+                        swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
+                    } else {
+                        swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+                    }
+                },
+                error: function(data) {
+                    $('#add').modal('hide');
+                    let str = '';
+                    const errors = data.responseJSON;
+                    if ($.isEmptyObject(errors) === false) {
+                        $.each(errors.errors, function(index, value) {
+                            str += '<li>' + value + '</li>';
+                        });
+                        swal.fire({title: '提示', html: str, icon: 'error', confirmButtonText: '{{trans('common.confirm')}}'});
+                    }
+                },
             });
-          }
-        });
-      }
-      @endcan
+        }
+        @endcan
 
-      //回车检测
-      $(document).on('keypress', 'input', function(e) {
-        if (e.which === 13) {
-          Search();
-          return false;
+        @can('admin.rule.update')
+        // 编辑规则
+        function editRule(id) {
+            $.ajax({
+                method: 'PUT',
+                url: '{{route('admin.rule.update','')}}/' + id,
+                data: {
+                    _token: '{{csrf_token()}}',
+                    name: $('#name_' + id).val(),
+                    pattern: $('#pattern_' + id).val(),
+                },
+                dataType: 'json',
+                success: function(ret) {
+                    if (ret.status === 'success') {
+                        swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
+                    } else {
+                        swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+                    }
+                },
+                error: function(data) {
+                    let str = '';
+                    const errors = data.responseJSON;
+                    if ($.isEmptyObject(errors) === false) {
+                        $.each(errors.errors, function(index, value) {
+                            str += '<li>' + value + '</li>';
+                        });
+                        swal.fire({title: '提示', html: str, icon: 'error', confirmButtonText: '{{trans('common.confirm')}}'});
+                    }
+                },
+            });
         }
-      });
+        @endcan
 
-      // 搜索
-      function Search() {
-        window.location.href = '{{route('admin.rule.index')}}?type=' + $('#type').val();
-      }
+        @can('admin.rule.destroy')
+        // 删除规则
+        function delRule(url, name) {
+            swal.fire({
+                title: '{{trans('common.warning')}}',
+                text: '确定删除规则 【' + name + '】 ?',
+                icon: 'warning',
+                showCancelButton: true,
+                cancelButtonText: '{{trans('common.close')}}',
+                confirmButtonText: '{{trans('common.confirm')}}',
+            }).then((result) => {
+                if (result.value) {
+                    $.ajax({
+                        method: 'DELETE',
+                        url: url,
+                        data: {_token: '{{csrf_token()}}'},
+                        dataType: 'json',
+                        success: function(ret) {
+                            if (ret.status === 'success') {
+                                swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
+                            } else {
+                                swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+                            }
+                        },
+                    });
+                }
+            });
+        }
+        @endcan
     </script>
 @endsection

+ 42 - 42
resources/views/admin/rule/log.blade.php

@@ -9,48 +9,47 @@
                 <h2 class="panel-title">触发记录</h2>
                 @can('admin.rule.clear')
                     <div class="panel-actions">
-                        <a href="javascript:clearLog();" class="btn btn-outline-primary">
+                        <button onclick="clearLog()" class="btn btn-outline-primary">
                             <i class="icon wb-rubber" aria-hidden="true"></i>清空记录
-                        </a>
+                        </button>
                     </div>
                 @endcan
             </div>
             <div class="panel-body">
-                <div class="form-row">
+                <form class="form-row">
                     <div class="form-group col-xxl-1 col-lg-2 col-md-1 col-sm-4">
-                        <input type="number" class="form-control" name="uid" value="{{Request::input('uid')}}" id="uid" placeholder="用户ID"/>
+                        <input type="number" class="form-control" name="user_id" value="{{Request::query('user_id')}}" placeholder="用户ID"/>
                     </div>
                     <div class="form-group col-xxl-2 col-lg-3 col-md-3 col-sm-4">
-                        <input type="text" class="form-control" id="email" name="email"
-                               value="{{Request::input('email')}}" placeholder="用户名"/>
+                        <input type="text" class="form-control" name="email" value="{{Request::query('email')}}" placeholder="用户账号"/>
                     </div>
                     <div class="form-group col-xxl-1 col-lg-3 col-md-3 col-4">
-                        <select class="form-control" id="node_id" name="node_id" onChange="Search()">
-                            <option value="" @if(Request::input('node_id') == '') selected @endif>节点</option>
+                        <select class="form-control" id="node_id" name="node_id">
+                            <option value="" hidden>节点</option>
                             @foreach($nodes as $node)
-                                <option value="{{$node->id}}" @if(Request::input('node_id') == $node->id) selected @endif>{{$node->id . ' - ' . $node->name}}</option>
+                                <option value="{{$node->id}}">{{$node->id . ' - ' . $node->name}}</option>
                             @endforeach
                         </select>
                     </div>
                     <div class="form-group col-xxl-1 col-lg-3 col-md-3 col-4">
-                        <select class="form-control" id="rule_id" name="rule_id" onChange="Search()">
-                            <option value="" @if(Request::input('rule_id') == '') selected @endif>规则</option>
+                        <select class="form-control" id="rule_id" name="rule_id">
+                            <option value="" hidden>规则</option>
                             @foreach($rules as $rule)
-                                <option value="{{$rule->id}}" @if(Request::input('rule_id') == $rule->id) selected @endif>{{$rule->name}}</option>
+                                <option value="{{$rule->id}}">{{$rule->name}}</option>
                             @endforeach
                         </select>
                     </div>
                     <div class="form-group col-xxl-1 col-lg-3 col-md-3 col-4 btn-group">
-                        <button class="btn btn-primary" onclick="Search()">搜 索</button>
+                        <button type="submit" class="btn btn-primary">搜 索</button>
                         <a href="{{route('admin.rule.log')}}" class="btn btn-danger">{{trans('common.reset')}}</a>
                     </div>
-                </div>
+                </form>
                 <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                     <thead class="thead-default">
                     <tr>
                         <th> #</th>
                         <th> 用户ID</th>
-                        <th> 用户</th>
+                        <th> 用户账号</th>
                         <th> 节点</th>
                         <th> 触发规则</th>
                         <th> 触发原因</th>
@@ -62,7 +61,7 @@
                         <tr>
                             <td> {{$ruleLog->id}} </td>
                             <td> {{$ruleLog->user->id ?? '【'.trans('common.deleted_item', ['attribute' => trans('common.account')]).'】'}} </td>
-                            <td> {{$ruleLog->user->username ?? '【'.trans('common.deleted_item', ['attribute' => trans('common.account')]).'】'}} </td>
+                            <td> {{$ruleLog->user->email ?? '【'.trans('common.deleted_item', ['attribute' => trans('common.account')]).'】'}} </td>
                             <td> {{empty($ruleLog->node) ? '【节点已删除】' : '【节点ID:' . $ruleLog->node_id . '】' . $ruleLog->node->name}} </td>
                             <td> {{$ruleLog->rule_id ? '⛔  ' . ($ruleLog->rule->name ?? '【规则已删除】') : '✅  访问非规则允许内容'}} </td>
                             <td> {{$ruleLog->reason}} </td>
@@ -91,34 +90,35 @@
     <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js"></script>
     <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
     <script>
-      // 搜索
-      function Search() {
-        window.location.href = '{{route('admin.rule.log')}}?uid=' + $('#uid').val() + '&email=' + $('#email').val() +
-            '&node_id=' + $('#node_id option:selected').val() + '&rule_id=' + $('#rule_id option:selected').val();
-      }
+        $(document).ready(function() {
+            $('#node_id').val({{Request::query('node_id')}});
+            $('#rule_id').val({{Request::query('rule_id')}});
 
-      @can('admin.rule.clear')
-      // 清除所有记录
-      function clearLog() {
-        swal.fire({
-          title: '{{trans('common.warning')}}',
-          text: '确定清空所有记录吗?',
-          icon: 'warning',
-          showCancelButton: true,
-          cancelButtonText: '{{trans('common.close')}}',
-          confirmButtonText: '{{trans('common.confirm')}}',
-        }).then((result) => {
-          if (result.value) {
-            $.post("{{route('admin.rule.clear')}}", {_token: '{{csrf_token()}}'}, function(ret) {
-              if (ret.status === 'success') {
-                swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
-              } else {
-                swal.fire({title: ret.message, icon: 'error'});
-              }
-            });
-          }
+            $('select').on('change', function() { this.form.submit(); });
         });
-      }
+
+        @can('admin.rule.clear')
+        // 清除所有记录
+        function clearLog() {
+            swal.fire({
+                title: '{{trans('common.warning')}}',
+                text: '确定清空所有记录吗?',
+                icon: 'warning',
+                showCancelButton: true,
+                cancelButtonText: '{{trans('common.close')}}',
+                confirmButtonText: '{{trans('common.confirm')}}',
+            }).then((result) => {
+                if (result.value) {
+                    $.post("{{route('admin.rule.clear')}}", {_token: '{{csrf_token()}}'}, function(ret) {
+                        if (ret.status === 'success') {
+                            swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
+                        } else {
+                            swal.fire({title: ret.message, icon: 'error'});
+                        }
+                    });
+                }
+            });
+        }
         @endcan
     </script>
 @endsection

+ 36 - 40
resources/views/admin/shop/index.blade.php

@@ -14,26 +14,26 @@
                 @endcan
             </div>
             <div class="panel-body">
-                <div class="form-row">
+                <form class="form-row">
                     <div class="form-group col-lg-2 col-sm-4">
-                        <select class="form-control" id="type" name="type" onChange="Search()">
+                        <select class="form-control" id="type" name="type">
                             <option value="" hidden>类型</option>
                             <option value="1">流量包</option>
                             <option value="2">套餐</option>
                         </select>
                     </div>
                     <div class="form-group col-lg-2 col-sm-4">
-                        <select class="form-control" id="status" name="status" onChange="Search()">
+                        <select class="form-control" id="status" name="status">
                             <option value="" hidden>状态</option>
                             <option value="1">上架</option>
                             <option value="0">下架</option>
                         </select>
                     </div>
                     <div class="form-group col-lg-2 col-sm-4 btn-group">
-                        <button class="btn btn-primary" onclick="Search()">搜 索</button>
+                        <button type="submit" class="btn btn-primary">搜 索</button>
                         <a href="{{route('admin.goods.index')}}" class="btn btn-danger">{{trans('common.reset')}}</a>
                     </div>
-                </div>
+                </form>
                 <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                     <thead class="thead-default">
                     <tr>
@@ -131,45 +131,41 @@
     <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js"></script>
     <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
     <script>
-      $(document).ready(function() {
-        $('#type').val({{Request::input('type')}});
-        $('#status').val({{Request::input('status')}});
-      });
+        $(document).ready(function() {
+            $('#type').val({{Request::query('type')}});
+            $('#status').val({{Request::query('status')}});
 
-      // 搜索
-      function Search() {
-        window.location.href = '{{route('admin.goods.index')}}?type=' + $('#type option:selected').val() + '&status=' +
-            $('#status option:selected').val();
-      }
+            $('select').on('change', function() { this.form.submit(); });
+        });
 
-      @can('admin.goods.destroy')
-      // 删除商品
-      function delGoods(url, name) {
-        swal.fire({
-          title: '{{trans('common.warning')}}',
-          text: '确定删除商品 【' + name + '】 ?',
-          icon: 'warning',
-          showCancelButton: true,
-          cancelButtonText: '取消',
-          confirmButtonText: '确定',
-        }).then((result) => {
-          if (result.value) {
-            $.ajax({
-              url: url,
-              method: 'DELETE',
-              data: {_token: '{{csrf_token()}}'},
-              dataType: 'json',
-              success: function(ret) {
-                if (ret.status === 'success') {
-                  swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
-                } else {
-                  swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+        @can('admin.goods.destroy')
+        // 删除商品
+        function delGoods(url, name) {
+            swal.fire({
+                title: '{{trans('common.warning')}}',
+                text: '确定删除商品 【' + name + '】 ?',
+                icon: 'warning',
+                showCancelButton: true,
+                cancelButtonText: '取消',
+                confirmButtonText: '确定',
+            }).then((result) => {
+                if (result.value) {
+                    $.ajax({
+                        url: url,
+                        method: 'DELETE',
+                        data: {_token: '{{csrf_token()}}'},
+                        dataType: 'json',
+                        success: function(ret) {
+                            if (ret.status === 'success') {
+                                swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
+                            } else {
+                                swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+                            }
+                        },
+                    });
                 }
-              },
             });
-          }
-        });
-      }
+        }
         @endcan
     </script>
 @endsection

+ 85 - 85
resources/views/admin/shop/info.blade.php

@@ -185,94 +185,94 @@
     <script src="/assets/global/js/Plugin/ascolorpicker.js"></script>
     <script src="/assets/global/js/Plugin/dropify.js"></script>
     <script>
-      $('[data-toggle="switch"]').bootstrapSwitch();
-      @isset($good)
-      $(document).ready(function() {
-        const type = $('input[name=\'type\']');
-        $('#id').val('{{$good->id}}');
-        $("input[name='type'][value='{{$good->type}}']").click();
-        type.attr('disabled', true);
-        $('#name').val('{{$good->name}}');
-        $('#price').val('{{$good->price}}');
-        $('#level').selectpicker('val', '{{$good->level}}');
-          @if ($good->type == 2)
-          $('#renew').val('{{$good->renew}}');
-        $('#period').val('{{$good->period}}');
-        $('#days').val('{{$good->days}}').attr('disabled', true);
-          @endif
-          $('#invite_num').val('{{$good->invite_num}}');
-        $('#limit_num').val('{{$good->limit_num}}');
-          @if ($good->is_hot)
-          $('#is_hot').click();
-          @endif
-          @if ($good->status)
-          $('#status').click();
-          @endif
-          $('#sort').val('{{$good->sort}}');
-        $('#color').asColorPicker('val', '{{$good->color}}');
-        $('#description').val(@json($good->description));
-        $('#info').val(@json($good->info));
-        const trafficUnit = $('#traffic_unit');
-        const traffic = $('#traffic');
-          @if($good->traffic >= 1073741824)
-          traffic.val('{{$good->traffic/1073741824}}');
-        trafficUnit.selectpicker('val', '1073741824');
-          @elseif($good->traffic >= 1048576)
-          traffic.val('{{$good->traffic/1048576}}');
-        trafficUnit.selectpicker('val', '1048576');
-          @elseif($good->traffic >= 1024)
-          traffic.val('{{$good->traffic/1024}}');
-        trafficUnit.selectpicker('val', '1024');
-          @else
-          traffic.val('{{$good->traffic}}');
-          @endif
-          traffic.attr('disabled', true);
-        trafficUnit.attr('disabled', true).selectpicker('refresh');
-      });
-      @elseif(old('type'))
-      $(document).ready(function() {
-        const type = $('input[name=\'type\']');
-        $('#id').val('{{old('id')}}');
-        $("input[name='type'][value='{{old('type')}}']").click();
-        $('#name').val('{{old('name')}}');
-        $('#price').val('{{old('price')}}');
-        $('#level').selectpicker('val', '{{old('level')}}');
-          @if (old('type') == 2)
-          $('#renew').val('{{old('renew',0)}}');
-        $('#period').val('{{old('period',0)}}');
-        $('#days').val('{{old('days',0)}}');
-          @endif
-          $('#traffic').val('{{old('traffic')}}');
-        $('#traffic_unit').selectpicker('val', '{{old('traffic_unit')}}');
-        $('#invite_num').val('{{old('invite_num')}}');
-        $('#limit_num').val('{{old('limit_num')}}');
-          @if (old('is_hot'))
-          $('#is_hot').click();
-          @endif
-          @if (old('status'))
-          $('#status').click();
-          @endif
-          $('#sort').val('{{old('sort')}}');
-        $('#color').asColorPicker('val', '{{old('color')}}');
-        $('#description').val('{{old('description')}}');
-        $('#info').val('{{old('info')}}');
-      });
-      @else
-      $('#status').click();
+        $('[data-toggle="switch"]').bootstrapSwitch();
+        @isset($good)
+        $(document).ready(function() {
+            const type = $('input[name=\'type\']');
+            $('#id').val('{{$good->id}}');
+            $("input[name='type'][value='{{$good->type}}']").click();
+            type.attr('disabled', true);
+            $('#name').val('{{$good->name}}');
+            $('#price').val('{{$good->price}}');
+            $('#level').selectpicker('val', '{{$good->level}}');
+            @if ($good->type == 2)
+            $('#renew').val('{{$good->renew}}');
+            $('#period').val('{{$good->period}}');
+            $('#days').val('{{$good->days}}').attr('disabled', true);
+            @endif
+            $('#invite_num').val('{{$good->invite_num}}');
+            $('#limit_num').val('{{$good->limit_num}}');
+            @if ($good->is_hot)
+            $('#is_hot').click();
+            @endif
+            @if ($good->status)
+            $('#status').click();
+            @endif
+            $('#sort').val('{{$good->sort}}');
+            $('#color').asColorPicker('val', '{{$good->color}}');
+            $('#description').val(@json($good->description));
+            $('#info').val(@json($good->info));
+            const trafficUnit = $('#traffic_unit');
+            const traffic = $('#traffic');
+            @if($good->traffic >= 1073741824)
+            traffic.val('{{$good->traffic/1073741824}}');
+            trafficUnit.selectpicker('val', '1073741824');
+            @elseif($good->traffic >= 1048576)
+            traffic.val('{{$good->traffic/1048576}}');
+            trafficUnit.selectpicker('val', '1048576');
+            @elseif($good->traffic >= 1024)
+            traffic.val('{{$good->traffic/1024}}');
+            trafficUnit.selectpicker('val', '1024');
+            @else
+            traffic.val('{{$good->traffic}}');
+            @endif
+            traffic.attr('disabled', true);
+            trafficUnit.attr('disabled', true).selectpicker('refresh');
+        });
+        @elseif(old('type'))
+        $(document).ready(function() {
+            const type = $('input[name=\'type\']');
+            $('#id').val('{{old('id')}}');
+            $("input[name='type'][value='{{old('type')}}']").click();
+            $('#name').val('{{old('name')}}');
+            $('#price').val('{{old('price')}}');
+            $('#level').selectpicker('val', '{{old('level')}}');
+            @if (old('type') == 2)
+            $('#renew').val('{{old('renew',0)}}');
+            $('#period').val('{{old('period',0)}}');
+            $('#days').val('{{old('days',0)}}');
+            @endif
+            $('#traffic').val('{{old('traffic')}}');
+            $('#traffic_unit').selectpicker('val', '{{old('traffic_unit')}}');
+            $('#invite_num').val('{{old('invite_num')}}');
+            $('#limit_num').val('{{old('limit_num')}}');
+            @if (old('is_hot'))
+            $('#is_hot').click();
+            @endif
+            @if (old('status'))
+            $('#status').click();
+            @endif
+            $('#sort').val('{{old('sort')}}');
+            $('#color').asColorPicker('val', '{{old('color')}}');
+            $('#description').val('{{old('description')}}');
+            $('#info').val('{{old('info')}}');
+        });
+        @else
+        $('#status').click();
 
-      @endisset
+        @endisset
 
-      function itemControl(value) {
-        if (value === 1) {
-          $('.package-renew').hide();
-        } else {
-          $('.package-renew').show();
+        function itemControl(value) {
+            if (value === 1) {
+                $('.package-renew').hide();
+            } else {
+                $('.package-renew').show();
+            }
         }
-      }
 
-      // 选择商品类型
-      $('input[name=\'type\']').change(function() {
-        itemControl(parseInt($(this).val()));
-      });
+        // 选择商品类型
+        $('input[name=\'type\']').change(function() {
+            itemControl(parseInt($(this).val()));
+        });
     </script>
 @endsection

+ 23 - 39
resources/views/admin/subscribe/index.blade.php

@@ -9,27 +9,25 @@
                 <h3 class="panel-title">订阅列表</h3>
             </div>
             <div class="panel-body">
-                <div class="form-row">
+                <form class="form-row">
                     <div class="form-group col-lg-2 col-sm-6">
-                        <input type="number" class="form-control" name="user_id" id="user_id"
-                               value="{{Request::input('user_id')}}" placeholder="ID"/>
+                        <input type="number" class="form-control" name="user_id" value="{{Request::query('user_id')}}" placeholder="ID"/>
                     </div>
                     <div class="form-group col-lg-4 col-sm-6">
-                        <input type="text" class="form-control" name="email" id="email"
-                               value="{{Request::input('email')}}" placeholder="用户名"/>
+                        <input type="text" class="form-control" name="email" value="{{Request::query('email')}}" placeholder="用户账号"/>
                     </div>
                     <div class="form-group col-lg-3 col-sm-6">
-                        <select name="status" id="status" class="form-control" onChange="Search()">
+                        <select name="status" id="status" class="form-control" onchange="this.form.submit()">
                             <option value="" hidden>状态</option>
                             <option value="0">禁用</option>
                             <option value="1">正常</option>
                         </select>
                     </div>
                     <div class="form-group col-lg-2 col-sm-6 btn-group">
-                        <button class="btn btn-primary" onclick="Search()">搜 索</button>
+                        <button type="submit" class="btn btn-primary">搜 索</button>
                         <a href="{{route('admin.subscribe.index')}}" class="btn btn-danger">{{trans('common.reset')}}</a>
                     </div>
-                </div>
+                </form>
                 <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                     <thead class="thead-default">
                     <tr>
@@ -99,39 +97,25 @@
     <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js"></script>
     <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
     <script>
-      $(document).ready(function() {
-        $('#status').val({{Request::input('status')}});
-      });
-
-      //回车检测
-      $(document).on('keypress', 'input', function(e) {
-        if (e.which === 13) {
-          Search();
-          return false;
-        }
-      });
-
-      // 搜索
-      function Search() {
-        window.location.href = '{{route('admin.subscribe.index')}}' + '?user_id=' + $('#user_id').val() + '&email=' + $('#email').val() + '&status=' +
-            $('#status option:selected').val();
-      }
+        $(document).ready(function() {
+            $('#status').val({{Request::query('status')}});
+        });
 
-      @can('admin.subscribe.set')
-      // 启用禁用用户的订阅
-      function setSubscribeStatus(url) {
-        $.post(url, {_token: '{{csrf_token()}}'}, function(ret) {
-          if (ret.status === 'success') {
-            swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => {
-              window.location.reload();
-            });
-          } else {
-            swal.fire({title: ret.message, icon: 'error', timer: 1000, showConfirmButton: false}).then(() => {
-              window.location.reload();
+        @can('admin.subscribe.set')
+        // 启用禁用用户的订阅
+        function setSubscribeStatus(url) {
+            $.post(url, {_token: '{{csrf_token()}}'}, function(ret) {
+                if (ret.status === 'success') {
+                    swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => {
+                        window.location.reload();
+                    });
+                } else {
+                    swal.fire({title: ret.message, icon: 'error', timer: 1000, showConfirmButton: false}).then(() => {
+                        window.location.reload();
+                    });
+                }
             });
-          }
-        });
-      }
+        }
         @endcan
     </script>
 @endsection

+ 64 - 77
resources/views/admin/ticket/index.blade.php

@@ -18,20 +18,20 @@
                 @endcan
             </div>
             <div class="panel-body">
-                <div class="form-row">
+                <form class="form-row">
                     <div class="form-group col-lg-3 col-sm-6">
-                        <input type="text" class="form-control" name="email" id="email" value="{{Request::input('email')}}" placeholder="用户名" autocomplete="off"/>
+                        <input type="text" class="form-control" name="email" value="{{Request::query('email')}}" placeholder="用户账号" autocomplete="off"/>
                     </div>
                     <div class="form-group col-lg-2 col-sm-6 btn-group">
-                        <button class="btn btn-primary" onclick="Search()">搜 索</button>
+                        <button type="submit" class="btn btn-primary">搜 索</button>
                         <a href="{{route('admin.ticket.index')}}" class="btn btn-danger">{{trans('common.reset')}}</a>
                     </div>
-                </div>
+                </form>
                 <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                     <thead class="thead-default">
                     <tr>
                         <th> #</th>
-                        <th> 用户</th>
+                        <th> 用户账号</th>
                         <th> 标题</th>
                         <th> {{trans('common.status')}}</th>
                         <th> {{trans('common.action')}}</th>
@@ -133,84 +133,71 @@
     <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js"></script>
     <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
     <script>
-      //回车检测
-      $(document).on('keypress', 'input', function(e) {
-        if (e.which === 13) {
-          Search();
-          return false;
-        }
-      });
+        @can('admin.ticket.store')
+        // 发起工单
+        function createTicket() {
+            const id = $('#user_id').val();
+            const email = $('#user_email').val();
+            const title = $('#title').val();
+            const content = $('#content').val();
 
-      // 搜索
-      function Search() {
-        window.location.href = '{{route('admin.ticket.index')}}?email=' + $('#email').val();
-      }
+            if (id.trim() === '' && email.trim() === '') {
+                swal.fire({title: '请填入目标用户信息!', icon: 'warning'});
+                return false;
+            }
 
-      @can('admin.ticket.store')
-      // 发起工单
-      function createTicket() {
-        const id = $('#user_id').val();
-        const email = $('#user_email').val();
-        const title = $('#title').val();
-        const content = $('#content').val();
+            if (title.trim() === '') {
+                swal.fire({title: '{{trans('validation.required', ['attribute' => trans('validation.attributes.title')])}}', icon: 'warning'});
+                return false;
+            }
 
-        if (id.trim() === '' && email.trim() === '') {
-          swal.fire({title: '请填入目标用户信息!', icon: 'warning'});
-          return false;
-        }
-
-        if (title.trim() === '') {
-          swal.fire({title: '{{trans('validation.required', ['attribute' => trans('validation.attributes.title')])}}', icon: 'warning'});
-          return false;
-        }
+            if (content.trim() === '') {
+                swal.fire({title: '{{trans('validation.required', ['attribute' => trans('validation.attributes.content')])}}', icon: 'warning'});
+                return false;
+            }
 
-        if (content.trim() === '') {
-          swal.fire({title: '{{trans('validation.required', ['attribute' => trans('validation.attributes.content')])}}', icon: 'warning'});
-          return false;
-        }
-
-        swal.fire({
-          title: '{{trans('user.ticket.submit_tips')}}',
-          icon: 'question',
-          showCancelButton: true,
-          cancelButtonText: '{{trans('common.close')}}',
-          confirmButtonText: '{{trans('common.confirm')}}',
-        }).then((result) => {
-          if (result.value) {
-            $.ajax({
-              method: 'POST',
-              url: "{{route('admin.ticket.store')}}",
-              data: {
-                _token: '{{csrf_token()}}',
-                id: id,
-                email: email,
-                title: title,
-                content: content,
-              },
-              dataType: 'json',
-              success: function(ret) {
-                $('#add_ticket_modal').modal('hide');
-                if (ret.status === 'success') {
-                  swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
-                } else {
-                  swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+            swal.fire({
+                title: '{{trans('user.ticket.submit_tips')}}',
+                icon: 'question',
+                showCancelButton: true,
+                cancelButtonText: '{{trans('common.close')}}',
+                confirmButtonText: '{{trans('common.confirm')}}',
+            }).then((result) => {
+                if (result.value) {
+                    $.ajax({
+                        method: 'POST',
+                        url: "{{route('admin.ticket.store')}}",
+                        data: {
+                            _token: '{{csrf_token()}}',
+                            id: id,
+                            email: email,
+                            title: title,
+                            content: content,
+                        },
+                        dataType: 'json',
+                        success: function(ret) {
+                            $('#add_ticket_modal').modal('hide');
+                            if (ret.status === 'success') {
+                                swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
+                            } else {
+                                swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+                            }
+                        },
+                        error: function(data) {
+                            $('#add_ticket_modal').modal('hide');
+                            let str = '';
+                            const errors = data.responseJSON;
+                            if ($.isEmptyObject(errors) === false) {
+                                $.each(errors.errors, function(index, value) {
+                                    str += '<li>' + value + '</li>';
+                                });
+                                swal.fire({title: '提示', html: str, icon: 'error', confirmButtonText: '{{trans('common.confirm')}}'});
+                            }
+                        },
+                    });
                 }
-              },
-              error: function(data) {
-                $('#add_ticket_modal').modal('hide');
-                let str = '';
-                const errors = data.responseJSON;
-                if ($.isEmptyObject(errors) === false) {
-                  $.each(errors.errors, function(index, value) {
-                    str += '<li>' + value + '</li>';
-                  });
-                  swal.fire({title: '提示', html: str, icon: 'error', confirmButtonText: '{{trans('common.confirm')}}'});
-                }
-              },
             });
-          }
-        });
-      }
+        }
         @endcan
     </script>
 @endsection

+ 67 - 67
resources/views/admin/ticket/reply.blade.php

@@ -45,85 +45,85 @@
         @can('admin.ticket.destroy')
         // 关闭工单
         function closeTicket() {
-          swal.fire({
-            title: '确定关闭工单?',
-            icon: 'question',
-            showCancelButton: true,
-            cancelButtonText: '{{trans('common.close')}}',
-            confirmButtonText: '{{trans('common.confirm')}}',
-          }).then((result) => {
-            if (result.value) {
-              $.ajax({
-                method: 'DELETE',
-                url: '{{route('admin.ticket.destroy', $ticket->id)}}',
-                async: true,
-                data: {_token: '{{csrf_token()}}'},
-                dataType: 'json',
-                success: function(ret) {
-                  if (ret.status === 'success') {
-                    swal.fire({
-                      title: ret.message,
-                      icon: 'success',
-                      timer: 1000,
-                      showConfirmButton: false,
-                    }).then(() => window.location.href = '{{route('admin.ticket.index')}}');
-                  } else {
-                    swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-                  }
-                },
-                error: function() {
-                  swal.fire({title: '{{trans('user.ticket.error')}}', icon: 'error'});
-                },
-              });
-            }
-          });
+            swal.fire({
+                title: '确定关闭工单?',
+                icon: 'question',
+                showCancelButton: true,
+                cancelButtonText: '{{trans('common.close')}}',
+                confirmButtonText: '{{trans('common.confirm')}}',
+            }).then((result) => {
+                if (result.value) {
+                    $.ajax({
+                        method: 'DELETE',
+                        url: '{{route('admin.ticket.destroy', $ticket->id)}}',
+                        async: true,
+                        data: {_token: '{{csrf_token()}}'},
+                        dataType: 'json',
+                        success: function(ret) {
+                            if (ret.status === 'success') {
+                                swal.fire({
+                                    title: ret.message,
+                                    icon: 'success',
+                                    timer: 1000,
+                                    showConfirmButton: false,
+                                }).then(() => window.location.href = '{{route('admin.ticket.index')}}');
+                            } else {
+                                swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+                            }
+                        },
+                        error: function() {
+                            swal.fire({title: '{{trans('user.ticket.error')}}', icon: 'error'});
+                        },
+                    });
+                }
+            });
         }
         @endcan
 
         @can('admin.ticket.update')
         //回车检测
         $(document).on('keypress', 'input', function(e) {
-          if (e.which === 13) {
-            replyTicket();
-            return false;
-          }
+            if (e.which === 13) {
+                replyTicket();
+                return false;
+            }
         });
 
         // 回复工单
         function replyTicket() {
-          const content = document.getElementById('editor').value;
+            const content = document.getElementById('editor').value;
 
-          if (content.trim() === '') {
-            swal.fire({title: '{{trans('validation.required', ['attribute' => trans('validation.attributes.content')])}}!', icon: 'warning', timer: 1500});
-            return false;
-          }
-          swal.fire({
-            title: '{{trans('user.ticket.reply_confirm')}}',
-            icon: 'question',
-            allowEnterKey: false,
-            showCancelButton: true,
-            cancelButtonText: '{{trans('common.close')}}',
-            confirmButtonText: '{{trans('common.confirm')}}',
-          }).then((result) => {
-            if (result.value) {
-              $.ajax({
-                method: 'PUT',
-                url: '{{route('admin.ticket.update', $ticket)}}',
-                data: {_token: '{{csrf_token()}}', content: content},
-                dataType: 'json',
-                success: function(ret) {
-                  if (ret.status === 'success') {
-                    swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
-                  } else {
-                    swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-                  }
-                },
-                error: function() {
-                  swal.fire({title: '未知错误!请查看运行日志', icon: 'error'});
-                },
-              });
+            if (content.trim() === '') {
+                swal.fire({title: '{{trans('validation.required', ['attribute' => trans('validation.attributes.content')])}}!', icon: 'warning', timer: 1500});
+                return false;
             }
-          });
+            swal.fire({
+                title: '{{trans('user.ticket.reply_confirm')}}',
+                icon: 'question',
+                allowEnterKey: false,
+                showCancelButton: true,
+                cancelButtonText: '{{trans('common.close')}}',
+                confirmButtonText: '{{trans('common.confirm')}}',
+            }).then((result) => {
+                if (result.value) {
+                    $.ajax({
+                        method: 'PUT',
+                        url: '{{route('admin.ticket.update', $ticket)}}',
+                        data: {_token: '{{csrf_token()}}', content: content},
+                        dataType: 'json',
+                        success: function(ret) {
+                            if (ret.status === 'success') {
+                                swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
+                            } else {
+                                swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+                            }
+                        },
+                        error: function() {
+                            swal.fire({title: '未知错误!请查看运行日志', icon: 'error'});
+                        },
+                    });
+                }
+            });
         }
         @endcan
     </script>

+ 41 - 41
resources/views/admin/tools/analysis.blade.php

@@ -43,46 +43,46 @@
     <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js"></script>
     <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
     <script>
-      const TableDatatablesScroller = function() {
-        const e = function() {
-          const e = $('#analysis');
-          e.dataTable({
-            language: {
-              aria: {
-                sortAscending: ': activate to sort column ascending',
-                sortDescending: ': activate to sort column descending',
-              },
-              emptyTable: '暂无数据',
-              info: '第 _START_ 到 _END_ 条,共计 _TOTAL_ 条',
-              infoEmpty: '未找到',
-              infoFiltered: '(filtered1 from _MAX_ total entries)',
-              lengthMenu: '_MENU_ entries',
-              search: '搜索:',
-              zeroRecords: '未找到',
-            },
-            buttons: [
-              {extend: 'print', className: 'btn btn-outline-dark'},
-              {extend: 'pdf', className: 'btn btn-outline-success'},
-              {extend: 'csv', className: 'btn btn-outline-primary'},
-            ],
-            scrollY: 300,
-            deferRender: !0,
-            scroller: !0,
-            stateSave: !0,
-            order: [[0, 'asc']],
-            lengthMenu: [[10, 15, 20, -1], [10, 15, 20, 'All']],
-            pageLength: 20,
-            dom: '<\'row\' <\'col-md-12\'B>><\'row\'<\'col-md-6 col-sm-12\'l><\'col-md-6 col-sm-12\'f>r><\'table-scrollable\'t><\'row\'<\'col-md-5 col-sm-12\'i><\'col-md-7 col-sm-12\'p>>',
-          });
-        };
-        return {
-          init: function() {
-            jQuery().dataTable && (e());
-          },
-        };
-      }();
-      jQuery(document).ready(function() {
-        TableDatatablesScroller.init();
-      });
+        const TableDatatablesScroller = function() {
+            const e = function() {
+                const e = $('#analysis');
+                e.dataTable({
+                    language: {
+                        aria: {
+                            sortAscending: ': activate to sort column ascending',
+                            sortDescending: ': activate to sort column descending',
+                        },
+                        emptyTable: '暂无数据',
+                        info: '第 _START_ 到 _END_ 条,共计 _TOTAL_ 条',
+                        infoEmpty: '未找到',
+                        infoFiltered: '(filtered1 from _MAX_ total entries)',
+                        lengthMenu: '_MENU_ entries',
+                        search: '搜索:',
+                        zeroRecords: '未找到',
+                    },
+                    buttons: [
+                        {extend: 'print', className: 'btn btn-outline-dark'},
+                        {extend: 'pdf', className: 'btn btn-outline-success'},
+                        {extend: 'csv', className: 'btn btn-outline-primary'},
+                    ],
+                    scrollY: 300,
+                    deferRender: !0,
+                    scroller: !0,
+                    stateSave: !0,
+                    order: [[0, 'asc']],
+                    lengthMenu: [[10, 15, 20, -1], [10, 15, 20, 'All']],
+                    pageLength: 20,
+                    dom: '<\'row\' <\'col-md-12\'B>><\'row\'<\'col-md-6 col-sm-12\'l><\'col-md-6 col-sm-12\'f>r><\'table-scrollable\'t><\'row\'<\'col-md-5 col-sm-12\'i><\'col-md-7 col-sm-12\'p>>',
+                });
+            };
+            return {
+                init: function() {
+                    jQuery().dataTable && (e());
+                },
+            };
+        }();
+        jQuery(document).ready(function() {
+            TableDatatablesScroller.init();
+        });
     </script>
 @endsection

+ 40 - 40
resources/views/admin/tools/convert.blade.php

@@ -75,48 +75,48 @@
 @endsection
 @section('javascript')
     <script>
-      // 转换
-      function Convert() {
-        const content = $('#content').val();
+        // 转换
+        function Convert() {
+            const content = $('#content').val();
 
-        if (content.trim() === '') {
-          swal.fire({title: '请填入要转换的配置信息', icon: 'warning', timer: 1000, showConfirmButton: false});
-          return;
-        }
-        swal.fire({
-          title: '确定继续转换吗?',
-          icon: 'question',
-          allowEnterKey: false,
-          showCancelButton: true,
-          cancelButtonText: '{{trans('common.close')}}',
-          confirmButtonText: '{{trans('common.confirm')}}',
-        }).then((result) => {
-          if (result.value) {
-            $.ajax({
-              method: 'POST',
-              url: '{{route('admin.tools.convert')}}',
-              dataType: 'json',
-              data: {
-                _token: '{{csrf_token()}}',
-                method: $('#method').val(),
-                transfer_enable: $('#transfer_enable').val(),
-                protocol: $('#protocol').val(),
-                protocol_param: $('#protocol_param').val(),
-                obfs: $('#obfs').val(),
-                obfs_param: $('#obfs_param').val(),
-                content: content,
-              },
-              success: function(ret) {
-                if (ret.status === 'success') {
-                  $('#result').val(ret.data);
-                } else {
-                  $('#result').val(ret.message);
+            if (content.trim() === '') {
+                swal.fire({title: '请填入要转换的配置信息', icon: 'warning', timer: 1000, showConfirmButton: false});
+                return;
+            }
+            swal.fire({
+                title: '确定继续转换吗?',
+                icon: 'question',
+                allowEnterKey: false,
+                showCancelButton: true,
+                cancelButtonText: '{{trans('common.close')}}',
+                confirmButtonText: '{{trans('common.confirm')}}',
+            }).then((result) => {
+                if (result.value) {
+                    $.ajax({
+                        method: 'POST',
+                        url: '{{route('admin.tools.convert')}}',
+                        dataType: 'json',
+                        data: {
+                            _token: '{{csrf_token()}}',
+                            method: $('#method').val(),
+                            transfer_enable: $('#transfer_enable').val(),
+                            protocol: $('#protocol').val(),
+                            protocol_param: $('#protocol_param').val(),
+                            obfs: $('#obfs').val(),
+                            obfs_param: $('#obfs_param').val(),
+                            content: content,
+                        },
+                        success: function(ret) {
+                            if (ret.status === 'success') {
+                                $('#result').val(ret.data);
+                            } else {
+                                $('#result').val(ret.message);
+                            }
+                        },
+                    });
                 }
-              },
             });
-          }
-        });
-        return false;
-      }
+            return false;
+        }
     </script>
 @endsection

+ 31 - 31
resources/views/admin/tools/decompile.blade.php

@@ -26,39 +26,39 @@
 @endsection
 @section('javascript')
     <script>
-      // 转换
-      function Decompile() {
-        const content = $('#content').val();
+        // 转换
+        function Decompile() {
+            const content = $('#content').val();
 
-        if (content.trim() === '') {
-          swal.fire({title: '请填入要反解析的链接信息', icon: 'warning', timer: 1000, showConfirmButton: false});
-          return;
-        }
-        swal.fire({
-          title: '确定继续反解析吗?',
-          icon: 'question',
-          allowEnterKey: false,
-          showCancelButton: true,
-          cancelButtonText: '{{trans('common.close')}}',
-          confirmButtonText: '{{trans('common.confirm')}}',
-        }).then((result) => {
-          if (result.value) {
-            $.ajax({
-              method: 'POST',
-              url: '{{route('admin.tools.decompile')}}',
-              dataType: 'json',
-              data: {_token: '{{csrf_token()}}', content: content},
-              success: function(ret) {
-                if (ret.status === 'success') {
-                  $('#result').val(ret.data);
-                } else {
-                  $('#result').val(ret.message);
+            if (content.trim() === '') {
+                swal.fire({title: '请填入要反解析的链接信息', icon: 'warning', timer: 1000, showConfirmButton: false});
+                return;
+            }
+            swal.fire({
+                title: '确定继续反解析吗?',
+                icon: 'question',
+                allowEnterKey: false,
+                showCancelButton: true,
+                cancelButtonText: '{{trans('common.close')}}',
+                confirmButtonText: '{{trans('common.confirm')}}',
+            }).then((result) => {
+                if (result.value) {
+                    $.ajax({
+                        method: 'POST',
+                        url: '{{route('admin.tools.decompile')}}',
+                        dataType: 'json',
+                        data: {_token: '{{csrf_token()}}', content: content},
+                        success: function(ret) {
+                            if (ret.status === 'success') {
+                                $('#result').val(ret.data);
+                            } else {
+                                $('#result').val(ret.message);
+                            }
+                        },
+                    });
                 }
-              },
             });
-          }
-        });
-        return false;
-      }
+            return false;
+        }
     </script>
 @endsection

+ 38 - 38
resources/views/admin/user/export.blade.php

@@ -80,44 +80,44 @@
     <script src="/assets/global/js/Plugin/webui-popover.js"></script>
     @can('admin.user.exportProxy')
         <script>
-          function getInfo(id, type) {
-            $.post("{{route('admin.user.exportProxy', $user)}}", {_token: '{{csrf_token()}}', id: id, type: type},
-                function(ret) {
-                  if (ret.status === 'success') {
-                    switch (type) {
-                      case 'code':
-                        swal.fire({
-                          html: '<textarea class="form-control" rows="8" readonly="readonly">' + ret.data +
-                              '</textarea>' +
-                              '<a href="' + ret.data + '" class="btn btn-danger btn-block mt-10">打开' +
-                              ret.title + '</a>',
-                          showConfirmButton: false,
-                        });
-                        break;
-                      case 'qrcode':
-                        swal.fire({
-                          title: '{{trans('user.scan_qrcode')}}',
-                          html: '<div id="qrcode"></div>',
-                          onBeforeOpen: () => {
-                            $('#qrcode').qrcode({text: ret.data});
-                          },
-                          showConfirmButton: false,
-                        });
-                        break;
-                      case 'text':
-                        swal.fire({
-                          title: '{{trans('user.node.info')}}',
-                          html: '<textarea class="form-control" rows="12" readonly="readonly">' + ret.data +
-                              '</textarea>',
-                          showConfirmButton: false,
-                        });
-                        break;
-                      default:
-                        swal.fire({title: ret.title, text: ret.data});
-                    }
-                  }
-                });
-          }
+            function getInfo(id, type) {
+                $.post("{{route('admin.user.exportProxy', $user)}}", {_token: '{{csrf_token()}}', id: id, type: type},
+                    function(ret) {
+                        if (ret.status === 'success') {
+                            switch (type) {
+                                case 'code':
+                                    swal.fire({
+                                        html: '<textarea class="form-control" rows="8" readonly="readonly">' + ret.data +
+                                            '</textarea>' +
+                                            '<a href="' + ret.data + '" class="btn btn-danger btn-block mt-10">打开' +
+                                            ret.title + '</a>',
+                                        showConfirmButton: false,
+                                    });
+                                    break;
+                                case 'qrcode':
+                                    swal.fire({
+                                        title: '{{trans('user.scan_qrcode')}}',
+                                        html: '<div id="qrcode"></div>',
+                                        onBeforeOpen: () => {
+                                            $('#qrcode').qrcode({text: ret.data});
+                                        },
+                                        showConfirmButton: false,
+                                    });
+                                    break;
+                                case 'text':
+                                    swal.fire({
+                                        title: '{{trans('user.node.info')}}',
+                                        html: '<textarea class="form-control" rows="12" readonly="readonly">' + ret.data +
+                                            '</textarea>',
+                                        showConfirmButton: false,
+                                    });
+                                    break;
+                                default:
+                                    swal.fire({title: ret.title, text: ret.data});
+                            }
+                        }
+                    });
+            }
         </script>
     @endcan
 @endsection

+ 25 - 25
resources/views/admin/user/group/index.blade.php

@@ -71,33 +71,33 @@
 
     @can('admin.user.group.edit')
         <script>
-          // 删除用户分组
-          function deleteUserGroup(url) {
-            swal.fire({
-              title: '提示',
-              text: '确定删除该分组吗?',
-              icon: 'info',
-              showCancelButton: true,
-              cancelButtonText: '{{trans('common.close')}}',
-              confirmButtonText: '{{trans('common.confirm')}}',
-            }).then((result) => {
-              if (result.value) {
-                $.ajax({
-                  method: 'DELETE',
-                  url: url,
-                  data: {_token: '{{csrf_token()}}'},
-                  dataType: 'json',
-                  success: function(ret) {
-                    if (ret.status === 'success') {
-                      swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
-                    } else {
-                      swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+            // 删除用户分组
+            function deleteUserGroup(url) {
+                swal.fire({
+                    title: '提示',
+                    text: '确定删除该分组吗?',
+                    icon: 'info',
+                    showCancelButton: true,
+                    cancelButtonText: '{{trans('common.close')}}',
+                    confirmButtonText: '{{trans('common.confirm')}}',
+                }).then((result) => {
+                    if (result.value) {
+                        $.ajax({
+                            method: 'DELETE',
+                            url: url,
+                            data: {_token: '{{csrf_token()}}'},
+                            dataType: 'json',
+                            success: function(ret) {
+                                if (ret.status === 'success') {
+                                    swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
+                                } else {
+                                    swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+                                }
+                            },
+                        });
                     }
-                  },
                 });
-              }
-            });
-          }
+            }
         </script>
     @endcan
 @endsection

+ 35 - 35
resources/views/admin/user/group/info.blade.php

@@ -57,55 +57,55 @@
     <script>
         @isset($group)
         $(document).ready(function() {
-          $('#name').val('{{$group->name}}');
-          $('#nodes').multiSelect('select', @json(array_map('strval', $group->nodes->pluck('id')->toArray())));
+            $('#name').val('{{$group->name}}');
+            $('#nodes').multiSelect('select', @json(array_map('strval', $group->nodes->pluck('id')->toArray())));
         });
         @endisset
         // 权限列表
         $('#nodes').multiSelect({
-          selectableHeader: '<input type=\'text\' class=\'search-input form-control\' autocomplete=\'off\' placeholder=\'待分配规则,此处可搜索\'>',
-          selectionHeader: '<input type=\'text\' class=\'search-input form-control\' autocomplete=\'off\' placeholder=\'已分配规则,此处可搜索\'>',
-          afterInit: function() {
-            const that = this,
-                $selectableSearch = that.$selectableUl.prev(),
-                $selectionSearch = that.$selectionUl.prev(),
-                selectableSearchString = '#' + that.$container.attr('id') + ' .ms-elem-selectable:not(.ms-selected)',
-                selectionSearchString = '#' + that.$container.attr('id') + ' .ms-elem-selection.ms-selected';
+            selectableHeader: '<input type=\'text\' class=\'search-input form-control\' autocomplete=\'off\' placeholder=\'待分配规则,此处可搜索\'>',
+            selectionHeader: '<input type=\'text\' class=\'search-input form-control\' autocomplete=\'off\' placeholder=\'已分配规则,此处可搜索\'>',
+            afterInit: function() {
+                const that = this,
+                    $selectableSearch = that.$selectableUl.prev(),
+                    $selectionSearch = that.$selectionUl.prev(),
+                    selectableSearchString = '#' + that.$container.attr('id') + ' .ms-elem-selectable:not(.ms-selected)',
+                    selectionSearchString = '#' + that.$container.attr('id') + ' .ms-elem-selection.ms-selected';
 
-            that.qs1 = $selectableSearch.quicksearch(selectableSearchString).on('keydown', function(e) {
-              if (e.which === 40) {
-                that.$selectableUl.focus();
-                return false;
-              }
-            });
+                that.qs1 = $selectableSearch.quicksearch(selectableSearchString).on('keydown', function(e) {
+                    if (e.which === 40) {
+                        that.$selectableUl.focus();
+                        return false;
+                    }
+                });
 
-            that.qs2 = $selectionSearch.quicksearch(selectionSearchString).on('keydown', function(e) {
-              if (e.which === 40) {
-                that.$selectionUl.focus();
-                return false;
-              }
-            });
-          },
-          afterSelect: function() {
-            this.qs1.cache();
-            this.qs2.cache();
-          },
-          afterDeselect: function() {
-            this.qs1.cache();
-            this.qs2.cache();
-          },
+                that.qs2 = $selectionSearch.quicksearch(selectionSearchString).on('keydown', function(e) {
+                    if (e.which === 40) {
+                        that.$selectionUl.focus();
+                        return false;
+                    }
+                });
+            },
+            afterSelect: function() {
+                this.qs1.cache();
+                this.qs2.cache();
+            },
+            afterDeselect: function() {
+                this.qs1.cache();
+                this.qs2.cache();
+            },
         });
 
         // 全选
         $('#select-all').click(function() {
-          $('#nodes').multiSelect('select_all');
-          return false;
+            $('#nodes').multiSelect('select_all');
+            return false;
         });
 
         // 反选
         $('#deselect-all').click(function() {
-          $('#nodes').multiSelect('deselect_all');
-          return false;
+            $('#nodes').multiSelect('deselect_all');
+            return false;
         });
     </script>
 @endsection

+ 118 - 132
resources/views/admin/user/index.blade.php

@@ -30,24 +30,24 @@
                 @endcanany
             </div>
             <div class="panel-body">
-                <div class="form-row">
+                <form class="form-row">
                     <div class="form-group col-xxl-1 col-lg-1 col-md-1 col-sm-4">
-                        <input type="number" class="form-control" id="id" name="id" value="{{Request::input('id')}}" placeholder="ID"/>
+                        <input type="number" class="form-control" name="id" value="{{Request::query('id')}}" placeholder="ID"/>
                     </div>
                     <div class="form-group col-xxl-2 col-lg-3 col-md-3 col-sm-4">
-                        <input type="text" class="form-control" id="email" name="email" value="{{Request::input('email')}}" placeholder="用户名"/>
+                        <input type="text" class="form-control" name="email" value="{{Request::query('email')}}" placeholder="用户账号"/>
                     </div>
                     <div class="form-group col-xxl-2 col-lg-3 col-md-3 col-sm-4">
-                        <input type="text" class="form-control" id="wechat" name="wechat" value="{{Request::input('wechat')}}" placeholder="微信"/>
+                        <input type="text" class="form-control" name="wechat" value="{{Request::query('wechat')}}" placeholder="微信"/>
                     </div>
                     <div class="form-group col-xxl-2 col-lg-3 col-md-3 col-sm-4">
-                        <input type="number" class="form-control" id="qq" name="qq" value="{{Request::input('qq')}}" placeholder="QQ"/>
+                        <input type="number" class="form-control" name="qq" value="{{Request::query('qq')}}" placeholder="QQ"/>
                     </div>
                     <div class="form-group col-xxl-1 col-lg-2 col-md-2 col-sm-4">
-                        <input type="number" class="form-control" id="port" name="port" value="{{Request::input('port')}}" placeholder="端口"/>
+                        <input type="number" class="form-control" name="port" value="{{Request::query('port')}}" placeholder="端口"/>
                     </div>
                     <div class="form-group col-xxl-1 col-lg-3 col-md-3 col-4">
-                        <select class="form-control" id="group" name="group" onChange="Search()">
+                        <select class="form-control" id="group" name="group">
                             <option value="" hidden>用户分组</option>
                             @foreach($userGroups as $key => $group)
                                 <option value="{{$key}}">{{$group}}</option>
@@ -55,7 +55,7 @@
                         </select>
                     </div>
                     <div class="form-group col-xxl-1 col-lg-3 col-md-3 col-4">
-                        <select class="form-control" id="level" name="level" onChange="Search()">
+                        <select class="form-control" id="level" name="level">
                             <option value="" hidden>用户等级</option>
                             @foreach($levels as $key => $level)
                                 <option value="{{$key}}">{{$level}}</option>
@@ -63,7 +63,7 @@
                         </select>
                     </div>
                     <div class="form-group col-xxl-1 col-lg-3 col-md-3 col-4">
-                        <select class="form-control" id="status" name="status" onChange="Search()">
+                        <select class="form-control" id="status" name="status">
                             <option value="" hidden>账号状态</option>
                             <option value="-1">禁用</option>
                             <option value="0">未激活</option>
@@ -71,22 +71,22 @@
                         </select>
                     </div>
                     <div class="form-group col-xxl-1 col-lg-3 col-md-3 col-4">
-                        <select class="form-control" id="enable" name="enable" onChange="Search()">
+                        <select class="form-control" id="enable" name="enable">
                             <option value="" hidden>代理状态</option>
                             <option value="1">启用</option>
                             <option value="0">禁用</option>
                         </select>
                     </div>
                     <div class="form-group col-xxl-1 col-lg-3 col-md-3 col-4 btn-group">
-                        <button class="btn btn-primary" onclick="Search()">搜 索</button>
+                        <button type="submit" class="btn btn-primary">搜 索</button>
                         <a href="{{route('admin.user.index')}}" class="btn btn-danger">{{trans('common.reset')}}</a>
                     </div>
-                </div>
+                </form>
                 <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                     <thead class="thead-default">
                     <tr>
                         <th> #</th>
-                        <th> 用户</th>
+                        <th> 用户账号</th>
                         <th> 余额</th>
                         <th> 端口</th>
                         <th> 订阅码</th>
@@ -216,138 +216,124 @@
     <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
     <script src="/assets/custom/clipboardjs/clipboard.min.js"></script>
     <script>
-      $(document).ready(function() {
-        $('#group').val({{Request::input('group')}});
-        $('#level').val({{Request::input('level')}});
-        $('#pay_way').val({{Request::input('pay_way')}});
-        $('#status').val({{Request::input('status')}});
-        $('#enable').val({{Request::input('enable')}});
-      });
+        $(document).ready(function() {
+            $('#group').val({{Request::query('group')}});
+            $('#level').val({{Request::query('level')}});
+            $('#status').val({{Request::query('status')}});
+            $('#enable').val({{Request::query('enable')}});
+
+            $('select').on('change', function() { this.form.submit(); });
+        });
 
-      //回车检测
-      $(document).on('keypress', 'input', function(e) {
-        if (e.which === 13) {
-          Search();
-          return false;
+        @can('admin.user.batch')
+        // 批量生成账号
+        function batchAddUsers() {
+            swal.fire({
+                title: '用户生成数量',
+                input: 'range',
+                inputAttributes: {min: 1, max: 10},
+                inputValue: 1,
+                icon: 'question',
+                showCancelButton: true,
+                cancelButtonText: '{{trans('common.close')}}',
+                confirmButtonText: '{{trans('common.confirm')}}',
+            }).then((result) => {
+                if (result.value) {
+                    $.post('{{route('admin.user.batch')}}', {_token: '{{csrf_token()}}', amount: result.value}, function(ret) {
+                        if (ret.status === 'success') {
+                            swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
+                        } else {
+                            swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+                        }
+                    });
+                }
+            });
         }
-      });
+        @endcan
 
-      // 搜索
-      function Search() {
-        window.location.href = '{{route('admin.user.index')}}' + '?id=' + $('#id').val() + '&email=' + $('#email').val() + '&wechat=' +
-            $('#wechat').val() + '&qq=' + $('#qq').val() + '&port=' + $('#port').val() + '&group=' + $('#group option:selected').val() + '&level='
-            + $('#level option:selected').val() + '&status=' + $('#status option:selected').val() + '&enable=' + $('#enable option:selected').val();
-      }
+        @can('admin.user.destroy')
+        // 删除账号
+        function delUser(url, email) {
+            swal.fire({
+                title: '{{trans('common.warning')}}',
+                text: '确定删除用户 【' + email + '】 ?',
+                icon: 'warning',
+                showCancelButton: true,
+                cancelButtonText: '{{trans('common.close')}}',
+                confirmButtonText: '{{trans('common.confirm')}}',
+            }).then((result) => {
+                if (result.value) {
+                    $.ajax({
+                        method: 'DELETE',
+                        url: url,
+                        data: {_token: '{{csrf_token()}}'},
+                        dataType: 'json',
+                        success: function(ret) {
+                            if (ret.status === 'success') {
+                                swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
+                            } else {
+                                swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+                            }
+                        },
+                    });
+                }
+            });
+        }
+        @endcan
 
-      @can('admin.user.batch')
-      // 批量生成账号
-      function batchAddUsers() {
-        swal.fire({
-          title: '用户生成数量',
-          input: 'range',
-          inputAttributes: {min: 1, max: 10},
-          inputValue: 1,
-          icon: 'question',
-          showCancelButton: true,
-          cancelButtonText: '{{trans('common.close')}}',
-          confirmButtonText: '{{trans('common.confirm')}}',
-        }).then((result) => {
-          if (result.value) {
-            $.post('{{route('admin.user.batch')}}', {_token: '{{csrf_token()}}', amount: result.value}, function(ret) {
-              if (ret.status === 'success') {
-                swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
-              } else {
-                swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-              }
+        @can('admin.user.reset')
+        // 重置流量
+        function resetTraffic(id, email) {
+            swal.fire({
+                title: '{{trans('common.warning')}}',
+                text: '确定重置 【' + email + '】 流量吗?',
+                icon: 'warning',
+                showCancelButton: true,
+                cancelButtonText: '{{trans('common.close')}}',
+                confirmButtonText: '{{trans('common.confirm')}}',
+            }).then((result) => {
+                if (result.value) {
+                    $.post('{{route('admin.user.reset', '')}}/' + id, {_token: '{{csrf_token()}}'}, function(ret) {
+                        if (ret.status === 'success') {
+                            swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
+                        } else {
+                            swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+                        }
+                    });
+                }
             });
-          }
-        });
-      }
-      @endcan
+        }
+        @endcan
 
-      @can('admin.user.destroy')
-      // 删除账号
-      function delUser(url, email) {
-        swal.fire({
-          title: '{{trans('common.warning')}}',
-          text: '确定删除用户 【' + email + '】 ?',
-          icon: 'warning',
-          showCancelButton: true,
-          cancelButtonText: '{{trans('common.close')}}',
-          confirmButtonText: '{{trans('common.confirm')}}',
-        }).then((result) => {
-          if (result.value) {
-            $.ajax({
-              method: 'DELETE',
-              url: url,
-              data: {_token: '{{csrf_token()}}'},
-              dataType: 'json',
-              success: function(ret) {
+        @can('admin.user.switch')
+        // 切换用户身份
+        function switchToUser(id) {
+            $.post('{{route('admin.user.switch', '')}}/' + id, {_token: '{{csrf_token()}}'}, function(ret) {
                 if (ret.status === 'success') {
-                  swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
+                    swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.href = '/');
                 } else {
-                  swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+                    swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
                 }
-              },
             });
-          }
-        });
-      }
-      @endcan
+        }
+        @endcan
 
-      @can('admin.user.reset')
-      // 重置流量
-      function resetTraffic(id, email) {
-        swal.fire({
-          title: '{{trans('common.warning')}}',
-          text: '确定重置 【' + email + '】 流量吗?',
-          icon: 'warning',
-          showCancelButton: true,
-          cancelButtonText: '{{trans('common.close')}}',
-          confirmButtonText: '{{trans('common.confirm')}}',
-        }).then((result) => {
-          if (result.value) {
-            $.post('{{route('admin.user.reset', '')}}/' + id, {_token: '{{csrf_token()}}'}, function(ret) {
-              if (ret.status === 'success') {
-                swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
-              } else {
-                swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-              }
+        const clipboard = new ClipboardJS('.copySubscribeLink');
+        clipboard.on('success', function() {
+            swal.fire({
+                title: '{{trans('common.copy.success')}}',
+                icon: 'success',
+                timer: 1000,
+                showConfirmButton: false,
             });
-          }
         });
-      }
-      @endcan
-
-      @can('admin.user.switch')
-      // 切换用户身份
-      function switchToUser(id) {
-        $.post('{{route('admin.user.switch', '')}}/' + id, {_token: '{{csrf_token()}}'}, function(ret) {
-          if (ret.status === 'success') {
-            swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.href = '/');
-          } else {
-            swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-          }
-        });
-      }
-      @endcan
-
-      const clipboard = new ClipboardJS('.copySubscribeLink');
-      clipboard.on('success', function() {
-        swal.fire({
-          title: '{{trans('common.copy.success')}}',
-          icon: 'success',
-          timer: 1000,
-          showConfirmButton: false,
-        });
-      });
-      clipboard.on('error', function() {
-        swal.fire({
-          title: '{{trans('common.copy.failed')}}',
-          icon: 'error',
-          timer: 1500,
-          showConfirmButton: false,
+        clipboard.on('error', function() {
+            swal.fire({
+                title: '{{trans('common.copy.failed')}}',
+                icon: 'error',
+                timer: 1500,
+                showConfirmButton: false,
+            });
         });
-      });
     </script>
 @endsection

+ 176 - 176
resources/views/admin/user/info.blade.php

@@ -339,194 +339,194 @@
     <script src="/assets/global/js/Plugin/bootstrap-select.js"></script>
     <script src="/assets/global/js/Plugin/bootstrap-datepicker.js"></script>
     <script>
-      $(document).ready(function() {
-          @isset($user)
-          $('#username').val('{{$user->username}}');
-        $('#email').val('{{$user->email}}');
-        $('#level').selectpicker('val', '{{$user->level}}');
-        $('#group').selectpicker('val', '{{$user->user_group_id}}');
-        $('#invite_num').val('{{$user->invite_num}}');
-        $('#reset_time').val('{{$user->reset_time}}');
-        $('#expired_at').val('{{$user->expired_at}}');
-        $("input[name='status'][value='{{$user->status}}']").click();
-        $('#wechat').val('{{$user->wechat}}');
-        $('#qq').val('{{$user->qq}}');
-        $('#remark').val('{{$user->remark}}');
-        $('#port').val('{{$user->port}}');
-        $('#passwd').val('{{$user->passwd}}');
-        $('#method').selectpicker('val', '{{$user->method}}');
-        $('#transfer_enable').val('{{$user->transfer_enable/GB}}');
-        $("input[name='enable'][value='{{$user->enable}}']").click();
-        $('#protocol').selectpicker('val', '{{$user->protocol}}');
-        $('#obfs').selectpicker('val', '{{$user->obfs}}');
-        $('#speed_limit').val('{{$user->speed_limit}}');
-        $('#uuid').val('{{$user->vmess_id}}');
-        $('#roles').selectpicker('val', @json($user->roles()->pluck('name')));
-          @else
-          $('#level').selectpicker('val', '0');
-          @endisset
-      });
-
-      $('.input-daterange>input').datepicker({
-        format: 'yyyy-mm-dd',
-      });
-
-      @isset($user)
-      @can('admin.user.switch')
-      // 切换用户身份
-      function switchToUser() {
-        $.ajax({
-          url: '{{route('admin.user.switch', $user)}}',
-          data: {'_token': '{{csrf_token()}}'},
-          dataType: 'json',
-          method: 'POST',
-          success: function(ret) {
-            if (ret.status === 'success') {
-              swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.href = '/');
-            } else {
-              swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-            }
-          },
+        $(document).ready(function() {
+            @isset($user)
+            $('#username').val('{{$user->username}}');
+            $('#email').val('{{$user->email}}');
+            $('#level').selectpicker('val', '{{$user->level}}');
+            $('#group').selectpicker('val', '{{$user->user_group_id}}');
+            $('#invite_num').val('{{$user->invite_num}}');
+            $('#reset_time').val('{{$user->reset_time}}');
+            $('#expired_at').val('{{$user->expired_at}}');
+            $("input[name='status'][value='{{$user->status}}']").click();
+            $('#wechat').val('{{$user->wechat}}');
+            $('#qq').val('{{$user->qq}}');
+            $('#remark').val('{{$user->remark}}');
+            $('#port').val('{{$user->port}}');
+            $('#passwd').val('{{$user->passwd}}');
+            $('#method').selectpicker('val', '{{$user->method}}');
+            $('#transfer_enable').val('{{$user->transfer_enable/GB}}');
+            $("input[name='enable'][value='{{$user->enable}}']").click();
+            $('#protocol').selectpicker('val', '{{$user->protocol}}');
+            $('#obfs').selectpicker('val', '{{$user->obfs}}');
+            $('#speed_limit').val('{{$user->speed_limit}}');
+            $('#uuid').val('{{$user->vmess_id}}');
+            $('#roles').selectpicker('val', @json($user->roles()->pluck('name')));
+            @else
+            $('#level').selectpicker('val', '0');
+            @endisset
         });
-      }
-      @endcan
 
-      @can('admin.user.updateCredit')
-      // 余额充值
-      function handleUserCredit() {
-        const amount = $('#amount').val();
-        const reg = /^(-?)\d+(\.\d+)?$/; //只可以是正负数字
+        $('.input-daterange>input').datepicker({
+            format: 'yyyy-mm-dd',
+        });
 
-        if (amount.trim() === '' || amount === 0 || !reg.test(amount)) {
-          $('#msg').show().html('请输入充值金额');
-          $('#name').focus();
-          return false;
+        @isset($user)
+        @can('admin.user.switch')
+        // 切换用户身份
+        function switchToUser() {
+            $.ajax({
+                url: '{{route('admin.user.switch', $user)}}',
+                data: {'_token': '{{csrf_token()}}'},
+                dataType: 'json',
+                method: 'POST',
+                success: function(ret) {
+                    if (ret.status === 'success') {
+                        swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.href = '/');
+                    } else {
+                        swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+                    }
+                },
+            });
         }
+        @endcan
 
-        $.ajax({
-          url: '{{route('admin.user.updateCredit', $user)}}',
-          method: 'POST',
-          data: {_token: '{{csrf_token()}}', amount: amount},
-          beforeSend: function() {
-            $('#msg').show().html('充值中...');
-          },
-          success: function(ret) {
-            if (ret.status === 'fail') {
-              $('#msg').show().html(ret.message);
-              return false;
-            } else {
-              $('#handle_user_credit').modal('hide');
-              if (ret.status === 'success') {
-                swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => {
-                  window.location.reload();
-                });
-              } else {
-                swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-              }
+        @can('admin.user.updateCredit')
+        // 余额充值
+        function handleUserCredit() {
+            const amount = $('#amount').val();
+            const reg = /^(-?)\d+(\.\d+)?$/; //只可以是正负数字
+
+            if (amount.trim() === '' || amount === 0 || !reg.test(amount)) {
+                $('#msg').show().html('请输入充值金额');
+                $('#name').focus();
+                return false;
             }
-          },
-          error: function() {
-            $('#msg').show().html('请求错误,请重试');
-          },
-          complete: function() {
-          },
-        });
-      }
-      @endcan
-      @endisset
 
-      // ajax同步提交
-      function Submit() {
-        // 用途
-        let usage = '';
-        $.each($('input:checkbox[name=\'usage\']'), function() {
-          if (this.checked) {
-            usage += $(this).val() + ',';
-          }
-        });
+            $.ajax({
+                url: '{{route('admin.user.updateCredit', $user)}}',
+                method: 'POST',
+                data: {_token: '{{csrf_token()}}', amount: amount},
+                beforeSend: function() {
+                    $('#msg').show().html('充值中...');
+                },
+                success: function(ret) {
+                    if (ret.status === 'fail') {
+                        $('#msg').show().html(ret.message);
+                        return false;
+                    } else {
+                        $('#handle_user_credit').modal('hide');
+                        if (ret.status === 'success') {
+                            swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => {
+                                window.location.reload();
+                            });
+                        } else {
+                            swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+                        }
+                    }
+                },
+                error: function() {
+                    $('#msg').show().html('请求错误,请重试');
+                },
+                complete: function() {
+                },
+            });
+        }
+        @endcan
+        @endisset
 
-        $.ajax({
-          method: @isset($user)'PUT' @else 'POST' @endisset,
-          url: '{{isset($user)? route('admin.user.update', $user) : route('admin.user.store')}}',
-          dataType: 'json',
-          data: {
-            _token: '{{csrf_token()}}',
-            username: $('#username').val(),
-            email: $('#email').val(),
-            password: $('#password').val(),
-            port: $('#port').val(),
-            passwd: $('#passwd').val(),
-            uuid: $('#uuid').val(),
-            transfer_enable: $('#transfer_enable').val(),
-            enable: $('input:radio[name=\'enable\']:checked').val(),
-            method: $('#method option:selected').val(),
-            protocol: $('#protocol option:selected').val(),
-            obfs: $('#obfs option:selected').val(),
-            speed_limit: $('#speed_limit').val(),
-            wechat: $('#wechat').val(),
-            qq: $('#qq').val(),
-            expired_at: $('#expired_at').val(),
-            remark: $('#remark').val(),
-            level: $('#level').val(),
-            user_group_id: $('#group').val(),
-            roles: $('#roles').val(),
-            reset_time: $('#reset_time').val(),
-            invite_num: $('#invite_num').val(),
-            status: $('input:radio[name=\'status\']:checked').val(),
-          },
-          success: function(ret) {
-            if (ret.status === 'success') {
-              swal.fire({
-                title: '提示',
-                text: '更新成功,是否返回?',
-                icon: 'question',
-                showCancelButton: true,
-                cancelButtonText: '{{trans('common.close')}}',
-                confirmButtonText: '{{trans('common.confirm')}}',
-              }).then((result) => {
-                    if (result.value) {
-                      window.location.href = '{!! route('admin.user.index').(Request::getQueryString()?('?'.Request::getQueryString()):'') !!}';
+        // ajax同步提交
+        function Submit() {
+            // 用途
+            let usage = '';
+            $.each($('input:checkbox[name=\'usage\']'), function() {
+                if (this.checked) {
+                    usage += $(this).val() + ',';
+                }
+            });
+
+            $.ajax({
+                method: @isset($user)'PUT' @else 'POST' @endisset,
+                url: '{{isset($user)? route('admin.user.update', $user) : route('admin.user.store')}}',
+                dataType: 'json',
+                data: {
+                    _token: '{{csrf_token()}}',
+                    username: $('#username').val(),
+                    email: $('#email').val(),
+                    password: $('#password').val(),
+                    port: $('#port').val(),
+                    passwd: $('#passwd').val(),
+                    uuid: $('#uuid').val(),
+                    transfer_enable: $('#transfer_enable').val(),
+                    enable: $('input:radio[name=\'enable\']:checked').val(),
+                    method: $('#method option:selected').val(),
+                    protocol: $('#protocol option:selected').val(),
+                    obfs: $('#obfs option:selected').val(),
+                    speed_limit: $('#speed_limit').val(),
+                    wechat: $('#wechat').val(),
+                    qq: $('#qq').val(),
+                    expired_at: $('#expired_at').val(),
+                    remark: $('#remark').val(),
+                    level: $('#level').val(),
+                    user_group_id: $('#group').val(),
+                    roles: $('#roles').val(),
+                    reset_time: $('#reset_time').val(),
+                    invite_num: $('#invite_num').val(),
+                    status: $('input:radio[name=\'status\']:checked').val(),
+                },
+                success: function(ret) {
+                    if (ret.status === 'success') {
+                        swal.fire({
+                            title: '提示',
+                            text: '更新成功,是否返回?',
+                            icon: 'question',
+                            showCancelButton: true,
+                            cancelButtonText: '{{trans('common.close')}}',
+                            confirmButtonText: '{{trans('common.confirm')}}',
+                        }).then((result) => {
+                                if (result.value) {
+                                    window.location.href = '{!! route('admin.user.index').(Request::getQueryString()?('?'.Request::getQueryString()):'') !!}';
+                                }
+                            },
+                        );
+                    } else {
+                        swal.fire({title: ret.message, icon: 'error', timer: 1000, showConfirmButton: false});
                     }
-                  },
-              );
-            } else {
-              swal.fire({title: ret.message, icon: 'error', timer: 1000, showConfirmButton: false});
-            }
-          },
-          error: function(data) {
-            let str = '';
-            const errors = data.responseJSON;
-            if ($.isEmptyObject(errors) === false) {
-              $.each(errors.errors, function(index, value) {
-                str += '<li>' + value + '</li>';
-              });
-              swal.fire({title: '提示', html: str, icon: 'error', confirmButtonText: '{{trans('common.confirm')}}'});
-            }
-          },
-        });
+                },
+                error: function(data) {
+                    let str = '';
+                    const errors = data.responseJSON;
+                    if ($.isEmptyObject(errors) === false) {
+                        $.each(errors.errors, function(index, value) {
+                            str += '<li>' + value + '</li>';
+                        });
+                        swal.fire({title: '提示', html: str, icon: 'error', confirmButtonText: '{{trans('common.confirm')}}'});
+                    }
+                },
+            });
 
-        return false;
-      }
+            return false;
+        }
 
-      // 生成随机端口
-      function makePort() {
-        $.get('{{route('getPort')}}', function(ret) {
-          $('#port').val(ret);
-        });
-      }
+        // 生成随机端口
+        function makePort() {
+            $.get('{{route('getPort')}}', function(ret) {
+                $('#port').val(ret);
+            });
+        }
 
-      // 生成UUID
-      function makeUUID() {
-        $.get('{{route('createUUID')}}', function(ret) {
-          $('#uuid').val(ret);
-        });
-      }
+        // 生成UUID
+        function makeUUID() {
+            $.get('{{route('createUUID')}}', function(ret) {
+                $('#uuid').val(ret);
+            });
+        }
 
-      // 生成随机密码
-      function makePasswd() {
-        $.get('{{route('createStr')}}', function(ret) {
-          $('#passwd').val(ret);
-        });
-      }
+        // 生成随机密码
+        function makePasswd() {
+            $.get('{{route('createStr')}}', function(ret) {
+                $('#passwd').val(ret);
+            });
+        }
     </script>
 @endsection

+ 1 - 1
resources/views/auth/activeUser.blade.php

@@ -14,7 +14,7 @@
                 <span class="form-title">{{trans('common.active_item', ['attribute' => trans('common.account')])}}</span>
             </div>
             <div class="form-group form-material floating" data-plugin="formMaterial">
-                <input type="email" class="form-control" name="email" value="{{Request::input('email')}}" required/>
+                <input type="email" class="form-control" name="email" value="{{Request::query('email')}}" required/>
                 <label class="floating-label" for="email">{{trans('validation.attributes.email')}}</label>
             </div>
         @else

+ 19 - 19
resources/views/auth/login.blade.php

@@ -40,24 +40,24 @@
 @endsection
 @section('javascript')
     <script>
-      $('#login-form').submit(function(event) {
-          @switch(sysConfig('is_captcha'))
-          @case(3)
-        // 先检查Google reCAPTCHA有没有进行验证
-        if ($('#g-recaptcha-response').val() === '') {
-          swal.fire({title: '{{trans('auth.captcha.required')}}', icon: 'error'});
-          return false;
-        }
-          @break
-          @case(4)
-        // 先检查Google reCAPTCHA有没有进行验证
-        if ($('#h-captcha-response').val() === '') {
-          swal.fire({title: '{{trans('auth.captcha.required')}}', icon: 'error'});
-          return false;
-        }
-          @break
-          @default
-          @endswitch
-      });
+        $('#login-form').submit(function(event) {
+            @switch(sysConfig('is_captcha'))
+            @case(3)
+            // 先检查Google reCAPTCHA有没有进行验证
+            if ($('#g-recaptcha-response').val() === '') {
+                swal.fire({title: '{{trans('auth.captcha.required')}}', icon: 'error'});
+                return false;
+            }
+            @break
+            @case(4)
+            // 先检查Google reCAPTCHA有没有进行验证
+            if ($('#h-captcha-response').val() === '') {
+                swal.fire({title: '{{trans('auth.captcha.required')}}', icon: 'error'});
+                return false;
+            }
+            @break
+            @default
+            @endswitch
+        });
     </script>
 @endsection

+ 16 - 16
resources/views/auth/maintenance.blade.php

@@ -15,21 +15,21 @@
 @endsection
 @section('layout_javascript')
     <script>
-      // 每秒更新计时器
-      const countDownDate = new Date("{{$time}}").getTime();
-      const x = setInterval(function() {
-        const distance = countDownDate - new Date().getTime();
-        const days = Math.floor(distance / 86400000);
-        const hours = Math.floor(distance % 86400000 / 3600000);
-        const minutes = Math.floor(distance % 3600000 / 60000);
-        const seconds = Math.floor(distance % 60000 / 1000);
-        document.getElementById('countdown').innerHTML = '<h2>' + days + ' <span> {{trans('validation.attributes.date')}} </span>: ' +
-            hours + ' <span>{{trans('validation.attributes.hour')}}</span>: ' + minutes + ' <span>{{trans('validation.attributes.minute')}} </span>: ' +
-            seconds + '<span> {{trans('validation.attributes.second')}}</span> </h2>';
-        if (distance <= 0) {
-          clearInterval(x);
-          document.getElementById('countdown').remove();
-        }
-      }, 1000);
+        // 每秒更新计时器
+        const countDownDate = new Date("{{$time}}").getTime();
+        const x = setInterval(function() {
+            const distance = countDownDate - new Date().getTime();
+            const days = Math.floor(distance / 86400000);
+            const hours = Math.floor(distance % 86400000 / 3600000);
+            const minutes = Math.floor(distance % 3600000 / 60000);
+            const seconds = Math.floor(distance % 60000 / 1000);
+            document.getElementById('countdown').innerHTML = '<h2>' + days + ' <span> {{trans('validation.attributes.date')}} </span>: ' +
+                hours + ' <span>{{trans('validation.attributes.hour')}}</span>: ' + minutes + ' <span>{{trans('validation.attributes.minute')}} </span>: ' +
+                seconds + '<span> {{trans('validation.attributes.second')}}</span> </h2>';
+            if (distance <= 0) {
+                clearInterval(x);
+                document.getElementById('countdown').remove();
+            }
+        }, 1000);
     </script>
 @endsection

+ 62 - 61
resources/views/auth/register.blade.php

@@ -11,9 +11,10 @@
             @endif
             @csrf
             <input type="hidden" name="register_token" value="{{Session::get('register_token')}}"/>
-            <input type="hidden" name="aff" value="{{Request::input('aff')}}"/>
+            <input type="hidden" name="aff" value="{{Request::query('aff')}}"/>
             <div class="form-group form-material floating" data-plugin="formMaterial">
-                <input type="text" class="form-control" name="username" id="username" value="{{Request::old('username') ? : Request::input('username')}}" autocomplete="off" required/>
+                <input type="text" class="form-control" name="username" id="username" 
+		value="{{Request::old('username') ? : Request::query('username')}}" autocomplete="off" required/>
                 <label class="floating-label" for="username">{{trans('validation.attributes.username')}}</label>
             </div>
             <div class="form-group form-material floating" data-plugin="formMaterial">
@@ -59,7 +60,7 @@
             </div>
             @if(sysConfig('is_invite_register'))
                 <div class="form-group form-material floating" data-plugin="formMaterial">
-                    <input type="password" class="form-control" name="code" value="{{Request::old('code') ?: Request::input('code')}}"
+                    <input type="password" class="form-control" name="code" value="{{Request::old('code') ?: Request::query('code')}}"
                            @if(sysConfig('is_invite_register') == 2) required @endif/>
                     <label class="floating-label" for="code">
                         {{trans('auth.invite.attribute')}}@if(sysConfig('is_invite_register') == 1)({{trans('auth.optional')}}) @endif
@@ -147,67 +148,67 @@
     <script>
         @if($emailList)
         function getEmail() {
-          let email = $('#emailHead').val().trim();
-          const emailTail = $('#emailTail').val();
-          if (email === '') {
-            swal.fire({title: '{{trans('validation.required', ['attribute' => trans('validation.attributes.email')])}}', icon: 'warning', timer: 1500});
-            return false;
-          }
-          email += '@' + emailTail;
-          $('#email').val(email);
-          return email;
+            let email = $('#emailHead').val().trim();
+            const emailTail = $('#emailTail').val();
+            if (email === '') {
+                swal.fire({title: '{{trans('validation.required', ['attribute' => trans('validation.attributes.email')])}}', icon: 'warning', timer: 1500});
+                return false;
+            }
+            email += '@' + emailTail;
+            $('#email').val(email);
+            return email;
         }
         @endif
 
         // 发送注册验证码
         function sendVerifyCode() {
-          let flag = true; // 请求成功与否标记
-          let email = $('#email').val().trim();
+            let flag = true; // 请求成功与否标记
+            let email = $('#email').val().trim();
             @if($emailList)
                 email = getEmail();
             @endif
 
             if (email === '') {
-              swal.fire({title: '{{trans('validation.required', ['attribute' => trans('validation.attributes.email')])}}', icon: 'warning', timer: 1500});
-              return false;
+                swal.fire({title: '{{trans('validation.required', ['attribute' => trans('validation.attributes.email')])}}', icon: 'warning', timer: 1500});
+                return false;
             }
 
-          $.ajax({
-            method: 'POST',
-            url: '{{route('sendVerificationCode')}}',
-            dataType: 'json',
-            data: {_token: '{{csrf_token()}}', email: email},
-            success: function(ret) {
-              if (ret.status === 'success') {
-                swal.fire({title: ret.message, icon: 'success'});
-                $('#sendCode').attr('disabled', true);
-                flag = true;
-              } else {
-                swal.fire({title: ret.message, icon: 'error', timer: 1000, showConfirmButton: false});
-                $('#sendCode').attr('disabled', false);
-                flag = false;
-              }
-            },
-            error: function() {
-              swal.fire({title: '发送失败', icon: 'error'});
-              flag = false;
-            },
-          });
+            $.ajax({
+                method: 'POST',
+                url: '{{route('sendVerificationCode')}}',
+                dataType: 'json',
+                data: {_token: '{{csrf_token()}}', email: email},
+                success: function(ret) {
+                    if (ret.status === 'success') {
+                        swal.fire({title: ret.message, icon: 'success'});
+                        $('#sendCode').attr('disabled', true);
+                        flag = true;
+                    } else {
+                        swal.fire({title: ret.message, icon: 'error', timer: 1000, showConfirmButton: false});
+                        $('#sendCode').attr('disabled', false);
+                        flag = false;
+                    }
+                },
+                error: function() {
+                    swal.fire({title: '发送失败', icon: 'error'});
+                    flag = false;
+                },
+            });
 
-          // 请求成功才开始倒计时
-          if (flag) {
-            // 60秒后才能重新申请发送
-            let left_time = 60;
-            const tt = window.setInterval(function() {
-              left_time--;
-              if (left_time <= 0) {
-                window.clearInterval(tt);
-                $('#sendCode').removeAttr('disabled').text('{{trans('auth.request')}}');
-              } else {
-                $('#sendCode').text(left_time + ' s');
-              }
-            }, 1000);
-          }
+            // 请求成功才开始倒计时
+            if (flag) {
+                // 60秒后才能重新申请发送
+                let left_time = 60;
+                const tt = window.setInterval(function() {
+                    left_time--;
+                    if (left_time <= 0) {
+                        window.clearInterval(tt);
+                        $('#sendCode').removeAttr('disabled').text('{{trans('auth.request')}}');
+                    } else {
+                        $('#sendCode').text(left_time + ' s');
+                    }
+                }, 1000);
+            }
         }
 
         $('#register-form').submit(function(event) {
@@ -217,18 +218,18 @@
 
             @switch(sysConfig('is_captcha'))
             @case(3)
-          // 先检查Google reCAPTCHA有没有进行验证
-          if ($('#g-recaptcha-response').val() === '') {
-            swal.fire({title: '{{trans('auth.captcha.required')}}', icon: 'error'});
-            return false;
-          }
+            // 先检查Google reCAPTCHA有没有进行验证
+            if ($('#g-recaptcha-response').val() === '') {
+                swal.fire({title: '{{trans('auth.captcha.required')}}', icon: 'error'});
+                return false;
+            }
             @break
             @case(4)
-          // 先检查Google reCAPTCHA有没有进行验证
-          if ($('#h-captcha-response').val() === '') {
-            swal.fire({title: '{{trans('auth.captcha.required')}}', icon: 'error'});
-            return false;
-          }
+            // 先检查Google reCAPTCHA有没有进行验证
+            if ($('#h-captcha-response').val() === '') {
+                swal.fire({title: '{{trans('auth.captcha.required')}}', icon: 'error'});
+                return false;
+            }
             @break
             @default
             @endswitch

+ 2 - 2
resources/views/components/chat-unit.blade.php

@@ -1,8 +1,8 @@
 <div class="chat
 @if (isset($ticket->admin_id) && $ticket->admin_id !== $user->id)
-        chat-left
+    chat-left
 @elseif(isset($ticket->user_id) && !isset($ticket->admin_id)  && $ticket->user_id !== $user->id)
-        chat-left
+    chat-left
 @endif">
     <div class="chat-avatar">
         <p class="avatar" data-toggle="tooltip" href="#" data-placement="right" title="" data-original-title="{{($ticket->admin ?? $ticket->user)->email}}">

+ 113 - 113
resources/views/user/buy.blade.php

@@ -48,7 +48,7 @@
                                 <span>¥{{$goods->price}}</span>
                             </p>
                             <p class="page-invoice-amount">{{trans('user.shop.total')}}
-                            <span class="grand-total">¥{{$goods->price}}</span>
+                                <span class="grand-total">¥{{$goods->price}}</span>
                             </p>
                         </div>
                     @endif
@@ -69,122 +69,122 @@
 @endsection
 @section('javascript')
     <script>
-      // 校验优惠券是否可用
-      function redeemCoupon() {
-        const coupon_sn = $('#coupon_sn').val();
-        const goods_price = '{{$goods->price}}';
-        $.ajax({
-          method: 'POST',
-          url: '{{route('redeemCoupon')}}',
-          dataType: 'json',
-          data: {_token: '{{csrf_token()}}', coupon_sn: coupon_sn, price: '{{$goods->price}}'},
-          success: function(ret) {
-            $('.input-group-prepend').remove();
-            if (ret.status === 'success') {
-              $('#coupon_sn').parent().prepend(
-                  '<div class="input-group-prepend"><span class="input-group-text bg-green-700"><i class="icon wb-check white" aria-hidden="true"></i></span></div>');
-              // 根据类型计算折扣后的总金额
-              let total_price = 0;
-              let coupon_text = document.getElementById('discount');
-              if (ret.data.type === 2) {
-                total_price = goods_price * (1 - ret.data.value / 100);
-                coupon_text.innerHTML = '【{{trans('user.coupon.attribute')}}】:' + ret.data.name + ' - '
-                    + (100 - ret.data.value) + '%<br> {{trans('user.coupon.discount')}} - ¥' + total_price.toFixed(2);
-                total_price = goods_price - total_price;
-              } else {
-                total_price = goods_price - ret.data.value;
-                total_price = total_price > 0 ? total_price : 0;
-                if (ret.data.type === 1) {
-                  coupon_text.innerHTML = '【{{trans('user.coupon.voucher')}}】:' + ret.data.name + ' -¥' + ret.data.value;
-                }
-              }
+        // 校验优惠券是否可用
+        function redeemCoupon() {
+            const coupon_sn = $('#coupon_sn').val();
+            const goods_price = '{{$goods->price}}';
+            $.ajax({
+                method: 'POST',
+                url: '{{route('redeemCoupon')}}',
+                dataType: 'json',
+                data: {_token: '{{csrf_token()}}', coupon_sn: coupon_sn, price: '{{$goods->price}}'},
+                success: function(ret) {
+                    $('.input-group-prepend').remove();
+                    if (ret.status === 'success') {
+                        $('#coupon_sn').parent().prepend(
+                            '<div class="input-group-prepend"><span class="input-group-text bg-green-700"><i class="icon wb-check white" aria-hidden="true"></i></span></div>');
+                        // 根据类型计算折扣后的总金额
+                        let total_price = 0;
+                        let coupon_text = document.getElementById('discount');
+                        if (ret.data.type === 2) {
+                            total_price = goods_price * (1 - ret.data.value / 100);
+                            coupon_text.innerHTML = '【{{trans('user.coupon.attribute')}}】:' + ret.data.name + ' - '
+                                + (100 - ret.data.value) + '%<br> {{trans('user.coupon.discount')}} - ¥' + total_price.toFixed(2);
+                            total_price = goods_price - total_price;
+                        } else {
+                            total_price = goods_price - ret.data.value;
+                            total_price = total_price > 0 ? total_price : 0;
+                            if (ret.data.type === 1) {
+                                coupon_text.innerHTML = '【{{trans('user.coupon.voucher')}}】:' + ret.data.name + ' -¥' + ret.data.value;
+                            }
+                        }
 
-              // 四舍五入,保留2位小数
-              $('.grand-total').text('¥' + total_price.toFixed(2));
-              swal.fire({
-                title: ret.message,
-                icon: 'success',
-                timer: 1300,
-                showConfirmButton: false,
-              });
-            } else {
-              $('.grand-total').text('¥' + goods_price);
-              $('#coupon_sn').parent().prepend(
-                  '<div class="input-group-prepend"><span class="input-group-text bg-red-700"><i class="icon wb-close white" aria-hidden="true"></i></span></div>');
-              swal.fire({
-                title: ret.title,
-                text: ret.message,
-                icon: 'error',
-              });
-            }
-          },
-        });
-      }
-
-      // 检查预支付
-      function pay(method, pay_type) {
-        // 存在套餐 和 购买类型为套餐时 出现提示
-        if ('{{$activePlan}}' === '1' && '{{$goods->type}}' === '2') {
-          swal.fire({
-            title: '{{trans('user.shop.conflict')}}',
-            html: '{!! trans('user.shop.conflict_tips') !!}',
-            icon: 'info',
-            showCancelButton: true,
-            cancelButtonText: '{{trans('common.back')}}',
-            confirmButtonText: '{{trans('common.continues')}}',
-          }).then((result) => {
-            if (result.value) {
-              contiousPay(method, pay_type);
-            }
-          });
-        } else {
-          contiousPay(method, pay_type);
+                        // 四舍五入,保留2位小数
+                        $('.grand-total').text('¥' + total_price.toFixed(2));
+                        swal.fire({
+                            title: ret.message,
+                            icon: 'success',
+                            timer: 1300,
+                            showConfirmButton: false,
+                        });
+                    } else {
+                        $('.grand-total').text('¥' + goods_price);
+                        $('#coupon_sn').parent().prepend(
+                            '<div class="input-group-prepend"><span class="input-group-text bg-red-700"><i class="icon wb-close white" aria-hidden="true"></i></span></div>');
+                        swal.fire({
+                            title: ret.title,
+                            text: ret.message,
+                            icon: 'error',
+                        });
+                    }
+                },
+            });
         }
-      }
 
-      function contiousPay(method, pay_type) {
-        const goods_id = '{{$goods->id}}';
-        const coupon_sn = $('#coupon_sn').val();
-        $.ajax({
-          method: 'POST',
-          url: '{{route('purchase')}}',
-          dataType: 'json',
-          data: {
-            _token: '{{csrf_token()}}',
-            goods_id: goods_id,
-            coupon_sn: coupon_sn,
-            method: method,
-            pay_type: pay_type,
-          },
-          success: function(ret) {
-            if (ret.status === 'success') {
-              swal.fire({
-                title: ret.message,
-                icon: 'success',
-                timer: 1300,
-                showConfirmButton: false,
-              });
-              if (method === 'credit') {
-                swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.href = '{{route('invoice')}}');
-              }
-              if (ret.data) {
-                window.location.href = '{{route('orderDetail', '')}}/' + ret.data;
-              } else if (ret.url) {
-                window.location.href = ret.url;
-              }
-            } else if (ret.status === 'info') {
-              swal.fire({title: ret.title, text: ret.message, icon: 'question'});
+        // 检查预支付
+        function pay(method, pay_type) {
+            // 存在套餐 和 购买类型为套餐时 出现提示
+            if ('{{$activePlan}}' === '1' && '{{$goods->type}}' === '2') {
+                swal.fire({
+                    title: '{{trans('user.shop.conflict')}}',
+                    html: '{!! trans('user.shop.conflict_tips') !!}',
+                    icon: 'info',
+                    showCancelButton: true,
+                    cancelButtonText: '{{trans('common.back')}}',
+                    confirmButtonText: '{{trans('common.continues')}}',
+                }).then((result) => {
+                    if (result.value) {
+                        contiousPay(method, pay_type);
+                    }
+                });
             } else {
-              swal.fire({
-                title: ret.message,
-                icon: 'error',
-              });
+                contiousPay(method, pay_type);
             }
-          },
-          error: function() {
-            swal.fire('{{trans('user.unknown').trans('common.error')}}', '{{trans('user.shop.call4help')}}', 'error');
-          },
-        });
-      }
+        }
+
+        function contiousPay(method, pay_type) {
+            const goods_id = '{{$goods->id}}';
+            const coupon_sn = $('#coupon_sn').val();
+            $.ajax({
+                method: 'POST',
+                url: '{{route('purchase')}}',
+                dataType: 'json',
+                data: {
+                    _token: '{{csrf_token()}}',
+                    goods_id: goods_id,
+                    coupon_sn: coupon_sn,
+                    method: method,
+                    pay_type: pay_type,
+                },
+                success: function(ret) {
+                    if (ret.status === 'success') {
+                        swal.fire({
+                            title: ret.message,
+                            icon: 'success',
+                            timer: 1300,
+                            showConfirmButton: false,
+                        });
+                        if (method === 'credit') {
+                            swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.href = '{{route('invoice')}}');
+                        }
+                        if (ret.data) {
+                            window.location.href = '{{route('orderDetail', '')}}/' + ret.data;
+                        } else if (ret.url) {
+                            window.location.href = ret.url;
+                        }
+                    } else if (ret.status === 'info') {
+                        swal.fire({title: ret.title, text: ret.message, icon: 'question'});
+                    } else {
+                        swal.fire({
+                            title: ret.message,
+                            icon: 'error',
+                        });
+                    }
+                },
+                error: function() {
+                    swal.fire('{{trans('user.unknown').trans('common.error')}}', '{{trans('user.shop.call4help')}}', 'error');
+                },
+            });
+        }
     </script>
 @endsection

+ 41 - 41
resources/views/user/help.blade.php

@@ -85,7 +85,7 @@
                                         <div class="panel-heading" id="question-2" role="tab">
                                             <a class="panel-title" aria-controls="answer-2" aria-expanded="true"
                                                data-toggle="collapse" href="#answer-2" data-parent="#accordion1"><i
-                                                        class="icon md-help-outline" aria-hidden="true"></i>客户端 下载与使用教程
+                                                    class="icon md-help-outline" aria-hidden="true"></i>客户端 下载与使用教程
                                             </a>
                                         </div>
                                         <div class="panel-collapse collapse show" id="answer-2"
@@ -99,7 +99,7 @@
                                         <div class="panel-heading" id="question-3" role="tab">
                                             <a class="panel-title" aria-controls="answer-3" aria-expanded="false"
                                                data-toggle="collapse" href="#answer-3" data-parent="#accordion1"><i
-                                                        class="icon wb-extension" aria-hidden="true"></i>客户端 相关问题解决
+                                                    class="icon wb-extension" aria-hidden="true"></i>客户端 相关问题解决
                                             </a>
                                         </div>
                                         <div class="panel-collapse collapse" id="answer-3" aria-labelledby="question-3"
@@ -295,49 +295,49 @@
     <script src="/assets/global/js/Plugin/tabs.js"></script>
     <script src="/assets/custom/jump-tab.js"></script>
     <script>
-      function linkManager($type) {
-        $('#sub_link').val('{{$link}}?type=' + $type);
-        return false;
-      }
+        function linkManager($type) {
+            $('#sub_link').val('{{$link}}?type=' + $type);
+            return false;
+        }
 
-      // 更换订阅地址
-      function exchangeSubscribe() {
-        swal.fire({
-          title: '{{trans('common.warning')}}',
-          text: '{{trans('user.subscribe.exchange_warning')}}',
-          icon: 'warning',
-          showCancelButton: true,
-          cancelButtonText: '{{trans('common.close')}}',
-          confirmButtonText: '{{trans('common.confirm')}}',
-        }).then((result) => {
-          if (result.value) {
-            $.post('{{route('changeSub')}}', {_token: '{{csrf_token()}}'}, function(ret) {
-              if (ret.status === 'success') {
-                swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
-              } else {
-                swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-              }
+        // 更换订阅地址
+        function exchangeSubscribe() {
+            swal.fire({
+                title: '{{trans('common.warning')}}',
+                text: '{{trans('user.subscribe.exchange_warning')}}',
+                icon: 'warning',
+                showCancelButton: true,
+                cancelButtonText: '{{trans('common.close')}}',
+                confirmButtonText: '{{trans('common.confirm')}}',
+            }).then((result) => {
+                if (result.value) {
+                    $.post('{{route('changeSub')}}', {_token: '{{csrf_token()}}'}, function(ret) {
+                        if (ret.status === 'success') {
+                            swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
+                        } else {
+                            swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+                        }
+                    });
+                }
             });
-          }
-        });
-      }
+        }
 
-      const clipboard = new ClipboardJS('.mt-clipboard');
-      clipboard.on('success', function() {
-        swal.fire({
-          title: '{{trans('common.copy.success')}}',
-          icon: 'success',
-          timer: 1300,
-          showConfirmButton: false,
+        const clipboard = new ClipboardJS('.mt-clipboard');
+        clipboard.on('success', function() {
+            swal.fire({
+                title: '{{trans('common.copy.success')}}',
+                icon: 'success',
+                timer: 1300,
+                showConfirmButton: false,
+            });
         });
-      });
-      clipboard.on('error', function() {
-        swal.fire({
-          title: '{{trans('common.copy.failed')}}',
-          icon: 'error',
-          timer: 1500,
-          showConfirmButton: false,
+        clipboard.on('error', function() {
+            swal.fire({
+                title: '{{trans('common.copy.failed')}}',
+                icon: 'error',
+                timer: 1500,
+                showConfirmButton: false,
+            });
         });
-      });
     </script>
 @endsection

+ 178 - 178
resources/views/user/index.blade.php

@@ -289,200 +289,200 @@
     @if(sysConfig('is_push_bear') && sysConfig('push_bear_qrcode'))
         <script src="/assets/custom/easy.qrcode.min.js"></script>
         <script>
-          // Options
-          const options = {
-            text: @json(sysConfig('push_bear_qrcode')),
-            width: 150,
-            height: 150,
-            backgroundImage: '{{asset('/assets/images/wechat.png')}}',
-            autoColor: true,
-          };
+            // Options
+            const options = {
+                text: @json(sysConfig('push_bear_qrcode')),
+                width: 150,
+                height: 150,
+                backgroundImage: '{{asset('/assets/images/wechat.png')}}',
+                autoColor: true,
+            };
 
-          // Create QRCode Object
-          new QRCode(document.getElementById('qrcode'), options);
+            // Create QRCode Object
+            new QRCode(document.getElementById('qrcode'), options);
         </script>
     @endif
     <script>
-      // 更换订阅地址
-      function exchangeSubscribe() {
-        swal.fire({
-          title: '{{trans('common.warning')}}',
-          text: '{{trans('user.subscribe.exchange_warning')}}',
-          icon: 'warning',
-          showCancelButton: true,
-          cancelButtonText: '{{trans('common.close')}}',
-          confirmButtonText: '{{trans('common.confirm')}}',
-        }).then((result) => {
-          if (result.value) {
-            $.post('{{route('changeSub')}}', {_token: '{{csrf_token()}}'}, function(ret) {
-              if (ret.status === 'success') {
-                swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
-              } else {
-                swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-              }
+        // 更换订阅地址
+        function exchangeSubscribe() {
+            swal.fire({
+                title: '{{trans('common.warning')}}',
+                text: '{{trans('user.subscribe.exchange_warning')}}',
+                icon: 'warning',
+                showCancelButton: true,
+                cancelButtonText: '{{trans('common.close')}}',
+                confirmButtonText: '{{trans('common.confirm')}}',
+            }).then((result) => {
+                if (result.value) {
+                    $.post('{{route('changeSub')}}', {_token: '{{csrf_token()}}'}, function(ret) {
+                        if (ret.status === 'success') {
+                            swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
+                        } else {
+                            swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+                        }
+                    });
+                }
             });
-          }
-        });
-      }
+        }
 
-      const clipboard = new ClipboardJS('.mt-clipboard', {
-        text: function(trigger) {
-          let base = @json($subUrl);
-          const client = $('#client').val();
-          const subType = $('#subType').val();
-          if (subType && client) {
-            base += '?target=' + client + '&type=' + subType;
-          } else if (subType) {
-            base += '?type=' + subType;
-          } else if (client) {
-            base += '?target=' + client;
-          }
-          return base;
-        },
-      });
-      clipboard.on('success', function() {
-        swal.fire({
-          title: '{{trans('common.copy.success')}}',
-          icon: 'success',
-          timer: 1300,
-          showConfirmButton: false,
+        const clipboard = new ClipboardJS('.mt-clipboard', {
+            text: function(trigger) {
+                let base = @json($subUrl);
+                const client = $('#client').val();
+                const subType = $('#subType').val();
+                if (subType && client) {
+                    base += '?target=' + client + '&type=' + subType;
+                } else if (subType) {
+                    base += '?type=' + subType;
+                } else if (client) {
+                    base += '?target=' + client;
+                }
+                return base;
+            },
         });
-      });
-      clipboard.on('error', function() {
-        swal.fire({
-          title: '{{trans('common.copy.failed')}}',
-          icon: 'error',
-          timer: 1500,
-          showConfirmButton: false,
+        clipboard.on('success', function() {
+            swal.fire({
+                title: '{{trans('common.copy.success')}}',
+                icon: 'success',
+                timer: 1300,
+                showConfirmButton: false,
+            });
         });
-      });
-
-      // 签到
-      function checkIn() {
-        $.post('{{route('checkIn')}}', {_token: '{{csrf_token()}}'}, function(ret) {
-          if (ret.status === 'success') {
-            swal.fire(ret.title, ret.message, 'success');
-          } else {
-            swal.fire(ret.title, ret.message, 'error');
-          }
+        clipboard.on('error', function() {
+            swal.fire({
+                title: '{{trans('common.copy.failed')}}',
+                icon: 'error',
+                timer: 1500,
+                showConfirmButton: false,
+            });
         });
-      }
 
-      const dailyChart = new Chart(document.getElementById('dailyChart').getContext('2d'), {
-        type: 'line',
-        data: {
-          labels: {{$dayHours}},
-          datasets: [
-            {
-              fill: true,
-              backgroundColor: 'rgba(98, 168, 234, .1)',
-              borderColor: Config.colors('primary', 600),
-              pointRadius: 4,
-              borderDashOffset: 2,
-              pointBorderColor: '#fff',
-              pointBackgroundColor: Config.colors('primary', 600),
-              pointHoverBackgroundColor: '#fff',
-              pointHoverBorderColor: Config.colors('primary', 600),
-              data: {{$trafficHourly}},
-            }],
-        },
-        options: {
-          legend: {
-            display: false,
-          },
-          responsive: true,
-          scales: {
-            xAxes: [
-              {
-                display: true,
-                scaleLabel: {
-                  display: true,
-                  labelString: '{{trans('validation.attributes.hour')}}',
-                },
-              }],
-            yAxes: [
-              {
-                display: true,
-                ticks: {
-                  beginAtZero: true,
-                  userCallback: function(tick) {
-                    return tick.toString() + ' GB';
-                  },
+        // 签到
+        function checkIn() {
+            $.post('{{route('checkIn')}}', {_token: '{{csrf_token()}}'}, function(ret) {
+                if (ret.status === 'success') {
+                    swal.fire(ret.title, ret.message, 'success');
+                } else {
+                    swal.fire(ret.title, ret.message, 'error');
+                }
+            });
+        }
+
+        const dailyChart = new Chart(document.getElementById('dailyChart').getContext('2d'), {
+            type: 'line',
+            data: {
+                labels: {{$dayHours}},
+                datasets: [
+                    {
+                        fill: true,
+                        backgroundColor: 'rgba(98, 168, 234, .1)',
+                        borderColor: Config.colors('primary', 600),
+                        pointRadius: 4,
+                        borderDashOffset: 2,
+                        pointBorderColor: '#fff',
+                        pointBackgroundColor: Config.colors('primary', 600),
+                        pointHoverBackgroundColor: '#fff',
+                        pointHoverBorderColor: Config.colors('primary', 600),
+                        data: {{$trafficHourly}},
+                    }],
+            },
+            options: {
+                legend: {
+                    display: false,
                 },
-                scaleLabel: {
-                  display: true,
-                  labelString: '{{trans('user.traffic_logs.24hours')}}',
+                responsive: true,
+                scales: {
+                    xAxes: [
+                        {
+                            display: true,
+                            scaleLabel: {
+                                display: true,
+                                labelString: '{{trans('validation.attributes.hour')}}',
+                            },
+                        }],
+                    yAxes: [
+                        {
+                            display: true,
+                            ticks: {
+                                beginAtZero: true,
+                                userCallback: function(tick) {
+                                    return tick.toString() + ' GB';
+                                },
+                            },
+                            scaleLabel: {
+                                display: true,
+                                labelString: '{{trans('user.traffic_logs.24hours')}}',
+                            },
+                        }],
                 },
-              }],
-          },
-        },
-      });
+            },
+        });
 
-      const monthlyChart = new Chart(document.getElementById('monthlyChart').getContext('2d'), {
-        type: 'line',
-        data: {
-          labels: {{$monthDays}},
-          datasets: [
-            {
-              fill: true,
-              backgroundColor: 'rgba(98, 168, 234, .1)',
-              borderColor: Config.colors('primary', 600),
-              pointRadius: 4,
-              borderDashOffset: 2,
-              pointBorderColor: '#fff',
-              pointBackgroundColor: Config.colors('primary', 600),
-              pointHoverBackgroundColor: '#fff',
-              pointHoverBorderColor: Config.colors('primary', 600),
-              data: {{$trafficDaily}},
-            }],
-        },
-        options: {
-          legend: {
-            display: false,
-          },
-          responsive: true,
-          scales: {
-            xAxes: [
-              {
-                display: true,
-                scaleLabel: {
-                  display: true,
-                  labelString: '{{trans('validation.attributes.day')}}',
+        const monthlyChart = new Chart(document.getElementById('monthlyChart').getContext('2d'), {
+            type: 'line',
+            data: {
+                labels: {{$monthDays}},
+                datasets: [
+                    {
+                        fill: true,
+                        backgroundColor: 'rgba(98, 168, 234, .1)',
+                        borderColor: Config.colors('primary', 600),
+                        pointRadius: 4,
+                        borderDashOffset: 2,
+                        pointBorderColor: '#fff',
+                        pointBackgroundColor: Config.colors('primary', 600),
+                        pointHoverBackgroundColor: '#fff',
+                        pointHoverBorderColor: Config.colors('primary', 600),
+                        data: {{$trafficDaily}},
+                    }],
+            },
+            options: {
+                legend: {
+                    display: false,
                 },
-              }],
-            yAxes: [
-              {
-                display: true,
-                ticks: {
-                  beginAtZero: true,
-                  userCallback: function(tick) {
-                    return tick.toString() + ' GB';
-                  },
+                responsive: true,
+                scales: {
+                    xAxes: [
+                        {
+                            display: true,
+                            scaleLabel: {
+                                display: true,
+                                labelString: '{{trans('validation.attributes.day')}}',
+                            },
+                        }],
+                    yAxes: [
+                        {
+                            display: true,
+                            ticks: {
+                                beginAtZero: true,
+                                userCallback: function(tick) {
+                                    return tick.toString() + ' GB';
+                                },
+                            },
+                            scaleLabel: {
+                                display: true,
+                                labelString: '{{trans('user.traffic_logs.30days')}}',
+                            },
+                        }],
                 },
-                scaleLabel: {
-                  display: true,
-                  labelString: '{{trans('user.traffic_logs.30days')}}',
-                },
-              }],
-          },
-        },
-      });
+            },
+        });
 
-      @if($banedTime)
-      // 每秒更新计时器
-      const countDownDate = new Date("{{$banedTime}}").getTime();
-      const x = setInterval(function() {
-        const distance = countDownDate - new Date().getTime();
-        const hours = Math.floor(distance % 86400000 / 3600000);
-        const minutes = Math.floor((distance % 3600000) / 60000);
-        const seconds = Math.floor((distance % 60000) / 1000);
-        document.getElementById('countdown').innerHTML = hours + '{{trans('validation.attributes.hour')}} ' + minutes
-            + '{{trans('validation.attributes.minute')}} ' + seconds + '{{trans('validation.attributes.second')}}';
-        if (distance <= 0) {
-          clearInterval(x);
-          document.getElementById('countdown').remove();
-        }
-      }, 1000);
+        @if($banedTime)
+        // 每秒更新计时器
+        const countDownDate = new Date("{{$banedTime}}").getTime();
+        const x = setInterval(function() {
+            const distance = countDownDate - new Date().getTime();
+            const hours = Math.floor(distance % 86400000 / 3600000);
+            const minutes = Math.floor((distance % 3600000) / 60000);
+            const seconds = Math.floor((distance % 60000) / 1000);
+            document.getElementById('countdown').innerHTML = hours + '{{trans('validation.attributes.hour')}} ' + minutes
+                + '{{trans('validation.attributes.minute')}} ' + seconds + '{{trans('validation.attributes.second')}}';
+            if (distance <= 0) {
+                clearInterval(x);
+                document.getElementById('countdown').remove();
+            }
+        }, 1000);
         @endif
     </script>
 @endsection

+ 32 - 32
resources/views/user/invite.blade.php

@@ -80,40 +80,40 @@
     <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js"></script>
     <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
     <script>
-      // 生成邀请码
-      function makeInvite() {
-        $.ajax({
-          method: 'POST',
-          dataType: 'json',
-          url: '{{route('createInvite')}}',
-          data: {_token: '{{csrf_token()}}'},
-          success: function(ret) {
-            if (ret.status === 'success') {
-              swal.fire({title: ret.message, icon: 'success'}).then(() => window.location.reload());
-            } else {
-              swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-            }
-          },
-        });
-        return false;
-      }
+        // 生成邀请码
+        function makeInvite() {
+            $.ajax({
+                method: 'POST',
+                dataType: 'json',
+                url: '{{route('createInvite')}}',
+                data: {_token: '{{csrf_token()}}'},
+                success: function(ret) {
+                    if (ret.status === 'success') {
+                        swal.fire({title: ret.message, icon: 'success'}).then(() => window.location.reload());
+                    } else {
+                        swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+                    }
+                },
+            });
+            return false;
+        }
 
-      const clipboard = new ClipboardJS('.mt-clipboard');
-      clipboard.on('success', function() {
-        swal.fire({
-          title: '{{trans('common.copy.success')}}',
-          icon: 'success',
-          timer: 1300,
-          showConfirmButton: false,
+        const clipboard = new ClipboardJS('.mt-clipboard');
+        clipboard.on('success', function() {
+            swal.fire({
+                title: '{{trans('common.copy.success')}}',
+                icon: 'success',
+                timer: 1300,
+                showConfirmButton: false,
+            });
         });
-      });
-      clipboard.on('error', function() {
-        swal.fire({
-          title: '{{trans('common.copy.failed')}}',
-          icon: 'error',
-          timer: 1500,
-          showConfirmButton: false,
+        clipboard.on('error', function() {
+            swal.fire({
+                title: '{{trans('common.copy.failed')}}',
+                icon: 'error',
+                timer: 1500,
+                showConfirmButton: false,
+            });
         });
-      });
     </script>
 @endsection

+ 47 - 47
resources/views/user/invoices.blade.php

@@ -77,57 +77,57 @@
     <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js"></script>
     <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
     <script>
-      function closePlan() {
-        swal.fire({
-          title: '{{trans('user.invoice.active_prepaid_question')}}',
-          html: @json(trans('user.invoice.active_prepaid_tips')),
-          icon: 'warning',
-          showCancelButton: true,
-          cancelButtonText: '{{trans('common.close')}}',
-          confirmButtonText: '{{trans('common.confirm')}}',
-        }).then((result) => {
-          if (result.value) {
-            $.ajax({
-              method: 'POST',
-              url: '{{route('cancelPlan')}}',
-              dataType: 'json',
-              data: {_token: '{{csrf_token()}}'},
-              success: function(ret) {
-                if (ret.status === 'success') {
-                  swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
-                } else {
-                  swal.fire({title: ret.message, icon: 'error'});
+        function closePlan() {
+            swal.fire({
+                title: '{{trans('user.invoice.active_prepaid_question')}}',
+                html: @json(trans('user.invoice.active_prepaid_tips')),
+                icon: 'warning',
+                showCancelButton: true,
+                cancelButtonText: '{{trans('common.close')}}',
+                confirmButtonText: '{{trans('common.confirm')}}',
+            }).then((result) => {
+                if (result.value) {
+                    $.ajax({
+                        method: 'POST',
+                        url: '{{route('cancelPlan')}}',
+                        dataType: 'json',
+                        data: {_token: '{{csrf_token()}}'},
+                        success: function(ret) {
+                            if (ret.status === 'success') {
+                                swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
+                            } else {
+                                swal.fire({title: ret.message, icon: 'error'});
+                            }
+                        },
+                    });
                 }
-              },
             });
-          }
-        });
-      }
+        }
 
-      function closeOrder(url) {
-        swal.fire({
-          title: '{{trans('common.close_item', ['attribute' => trans('user.invoice.attribute')])}}?',
-          icon: 'warning',
-          showCancelButton: true,
-          cancelButtonText: '{{trans('common.close')}}',
-          confirmButtonText: '{{trans('common.confirm')}}',
-        }).then((result) => {
-          if (result.value) {
-            $.ajax({
-              method: 'PUT',
-              url: url,
-              dataType: 'json',
-              data: {_token: '{{csrf_token()}}'},
-              success: function(ret) {
-                if (ret.status === 'success') {
-                  swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
-                } else {
-                  swal.fire({title: ret.message, icon: 'error'});
+        function closeOrder(url) {
+            swal.fire({
+                title: '{{trans('common.close_item', ['attribute' => trans('user.invoice.attribute')])}}?',
+                icon: 'warning',
+                showCancelButton: true,
+                cancelButtonText: '{{trans('common.close')}}',
+                confirmButtonText: '{{trans('common.confirm')}}',
+            }).then((result) => {
+                if (result.value) {
+                    $.ajax({
+                        method: 'PUT',
+                        url: url,
+                        dataType: 'json',
+                        data: {_token: '{{csrf_token()}}'},
+                        success: function(ret) {
+                            if (ret.status === 'success') {
+                                swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
+                            } else {
+                                swal.fire({title: ret.message, icon: 'error'});
+                            }
+                        },
+                    });
                 }
-              },
             });
-          }
-        });
-      }
+        }
     </script>
 @endsection

+ 22 - 22
resources/views/user/layouts.blade.php

@@ -186,30 +186,30 @@
         @yield('javascript')
         @if(Session::get('admin'))
             <script>
-              $('#return_to_admin').click(function() {
-                $.ajax({
-                  method: 'POST',
-                  url: '{{route('switch')}}',
-                  data: {'_token': '{{csrf_token()}}'},
-                  dataType: 'json',
-                  success: function(ret) {
-                    swal.fire({
-                      title: ret.message,
-                      icon: 'success',
-                      timer: 1000,
-                      showConfirmButton: false,
-                    }).then(() => window.location.href = '{{route('admin.index')}}');
-                  },
-                  error: function(ret) {
-                    swal.fire({
-                      title: ret.message,
-                      icon: 'error',
-                      timer: 1500,
-                      showConfirmButton: false,
+                $('#return_to_admin').click(function() {
+                    $.ajax({
+                        method: 'POST',
+                        url: '{{route('switch')}}',
+                        data: {'_token': '{{csrf_token()}}'},
+                        dataType: 'json',
+                        success: function(ret) {
+                            swal.fire({
+                                title: ret.message,
+                                icon: 'success',
+                                timer: 1000,
+                                showConfirmButton: false,
+                            }).then(() => window.location.href = '{{route('admin.index')}}');
+                        },
+                        error: function(ret) {
+                            swal.fire({
+                                title: ret.message,
+                                icon: 'error',
+                                timer: 1500,
+                                showConfirmButton: false,
+                            });
+                        },
                     });
-                  },
                 });
-              });
             </script>
         @endif
         <!-- 统计 -->

+ 91 - 91
resources/views/user/nodeList.blade.php

@@ -114,98 +114,98 @@
     <script src="/assets/custom/maps/jquery-jvectormap-world-mill-cn.js"></script>
 
     <script type="text/javascript">
-      $(function() {
-        $('#world-map').vectorMap({
-          map: 'world_mill',
-          scaleColors: ['#C8EEFF', '#0071A4'],
-          normalizeFunction: 'polynomial',
-          zoomAnimate: true,
-          hoverOpacity: 0.7,
-          hoverColor: false,
-          regionStyle: {
-            initial: {
-              fill: '#3E8EF7',
-            },
-            hover: {
-              fill: '#589FFC',
-            },
-            selected: {
-              fill: '#0B69E3',
-            },
-            selectedHover: {
-              fill: '#589FFC',
-            },
-          },
-          markerStyle: {
-            initial: {
-              r: 3,
-              fill: '#FF4C52',
-              'stroke-width': 0,
-            },
-            hover: {
-              r: 6,
-              stroke: '#FF4C52',
-              'stroke-width': 0,
-            },
-          },
-          backgroundColor: '#fff',
-          markers: [
-                  @foreach($nodesGeo as $name => $geo)
-            {
-              latLng: [{{$name}}], name: '{{$geo}}',
-            },
-              @endforeach
-          ],
-        });
-        $('.node').matchHeight();
-        $('.map').matchHeight();
-      });
-
-      function getInfo(id, type) {
-        const oldClass = $('#' + type + id).attr('class');
-        $.ajax({
-          method: 'POST',
-          url: '{{route('node')}}',
-          data: {_token: '{{csrf_token()}}', id: id, type: type},
-          beforeSend: function() {
-            $('#' + type + id).removeAttr('class').addClass('icon wb-loop icon-spin');
-          },
-          success: function(ret) {
-            if (ret.status === 'success') {
-              switch (type) {
-                case 'code':
-                  swal.fire({
-                    html: '<textarea class="form-control" rows="8" readonly="readonly">' + ret.data + '</textarea>' +
-                        '<a href="' + ret.data + '" class="btn btn-danger btn-block mt-10">{{trans('common.open')}}' + ret.title + '</a>',
-                    showConfirmButton: false,
-                  });
-                  break;
-                case 'qrcode':
-                  swal.fire({
-                    title: '{{trans('user.scan_qrcode')}}',
-                    html: '<div id="qrcode"></div>',
-                    onBeforeOpen: () => {
-                      $('#qrcode').qrcode({text: ret.data});
+        $(function() {
+            $('#world-map').vectorMap({
+                map: 'world_mill',
+                scaleColors: ['#C8EEFF', '#0071A4'],
+                normalizeFunction: 'polynomial',
+                zoomAnimate: true,
+                hoverOpacity: 0.7,
+                hoverColor: false,
+                regionStyle: {
+                    initial: {
+                        fill: '#3E8EF7',
+                    },
+                    hover: {
+                        fill: '#589FFC',
+                    },
+                    selected: {
+                        fill: '#0B69E3',
+                    },
+                    selectedHover: {
+                        fill: '#589FFC',
                     },
-                    showConfirmButton: false,
-                  });
-                  break;
-                case 'text':
-                  swal.fire({
-                    title: '{{trans('user.node.info')}}',
-                    html: '<textarea class="form-control" rows="12" readonly="readonly">' + ret.data + '</textarea>',
-                    showConfirmButton: false,
-                  });
-                  break;
-                default:
-                  swal.fire({title: ret.title, text: ret.data, icon: 'error'});
-              }
-            }
-          },
-          complete: function() {
-            $('#' + type + id).removeAttr('class').addClass(oldClass);
-          },
+                },
+                markerStyle: {
+                    initial: {
+                        r: 3,
+                        fill: '#FF4C52',
+                        'stroke-width': 0,
+                    },
+                    hover: {
+                        r: 6,
+                        stroke: '#FF4C52',
+                        'stroke-width': 0,
+                    },
+                },
+                backgroundColor: '#fff',
+                markers: [
+                        @foreach($nodesGeo as $name => $geo)
+                    {
+                        latLng: [{{$name}}], name: '{{$geo}}',
+                    },
+                    @endforeach
+                ],
+            });
+            $('.node').matchHeight();
+            $('.map').matchHeight();
         });
-      }
+
+        function getInfo(id, type) {
+            const oldClass = $('#' + type + id).attr('class');
+            $.ajax({
+                method: 'POST',
+                url: '{{route('node')}}',
+                data: {_token: '{{csrf_token()}}', id: id, type: type},
+                beforeSend: function() {
+                    $('#' + type + id).removeAttr('class').addClass('icon wb-loop icon-spin');
+                },
+                success: function(ret) {
+                    if (ret.status === 'success') {
+                        switch (type) {
+                            case 'code':
+                                swal.fire({
+                                    html: '<textarea class="form-control" rows="8" readonly="readonly">' + ret.data + '</textarea>' +
+                                        '<a href="' + ret.data + '" class="btn btn-danger btn-block mt-10">{{trans('common.open')}}' + ret.title + '</a>',
+                                    showConfirmButton: false,
+                                });
+                                break;
+                            case 'qrcode':
+                                swal.fire({
+                                    title: '{{trans('user.scan_qrcode')}}',
+                                    html: '<div id="qrcode"></div>',
+                                    onBeforeOpen: () => {
+                                        $('#qrcode').qrcode({text: ret.data});
+                                    },
+                                    showConfirmButton: false,
+                                });
+                                break;
+                            case 'text':
+                                swal.fire({
+                                    title: '{{trans('user.node.info')}}',
+                                    html: '<textarea class="form-control" rows="12" readonly="readonly">' + ret.data + '</textarea>',
+                                    showConfirmButton: false,
+                                });
+                                break;
+                            default:
+                                swal.fire({title: ret.title, text: ret.data, icon: 'error'});
+                        }
+                    }
+                },
+                complete: function() {
+                    $('#' + type + id).removeAttr('class').addClass(oldClass);
+                },
+            });
+        }
     </script>
 @endsection

+ 29 - 29
resources/views/user/payment.blade.php

@@ -41,39 +41,39 @@
     @if($payment->qr_code && $payment->url)
         <script src="/assets/custom/easy.qrcode.min.js"></script>
         <script>
-          // Options
-          const options = {
-            text: @json($payment->url),
-            backgroundImage: '{{asset($pay_type_icon)}}',
-            autoColor: true,
-          };
+            // Options
+            const options = {
+                text: @json($payment->url),
+                backgroundImage: '{{asset($pay_type_icon)}}',
+                autoColor: true,
+            };
 
-          // Create QRCode Object
-          new QRCode(document.getElementById('qrcode'), options);
+            // Create QRCode Object
+            new QRCode(document.getElementById('qrcode'), options);
         </script>
     @endif
 
     <script>
-      // 检查支付单状态
-      const r = window.setInterval(function() {
-        $.ajax({
-          method: 'GET',
-          url: '{{route('orderStatus')}}',
-          data: {trade_no: '{{$payment->trade_no}}'},
-          dataType: 'json',
-          success: function(ret) {
-            window.clearInterval();
-            if (ret.status === 'success') {
-              swal.fire({title: ret.message, icon: 'success', timer: 1500, showConfirmButton: false}).then(() => {
-                window.location.href = '{{route('invoice')}}';
-              });
-            } else if (ret.status === 'error') {
-              swal.fire({title: ret.message, icon: 'error', timer: 1500, showConfirmButton: false}).then(() => {
-                window.location.href = '{{route('invoice')}}';
-              });
-            }
-          },
-        });
-      }, 3000);
+        // 检查支付单状态
+        const r = window.setInterval(function() {
+            $.ajax({
+                method: 'GET',
+                url: '{{route('orderStatus')}}',
+                data: {trade_no: '{{$payment->trade_no}}'},
+                dataType: 'json',
+                success: function(ret) {
+                    window.clearInterval();
+                    if (ret.status === 'success') {
+                        swal.fire({title: ret.message, icon: 'success', timer: 1500, showConfirmButton: false}).then(() => {
+                            window.location.href = '{{route('invoice')}}';
+                        });
+                    } else if (ret.status === 'error') {
+                        swal.fire({title: ret.message, icon: 'error', timer: 1500, showConfirmButton: false}).then(() => {
+                            window.location.href = '{{route('invoice')}}';
+                        });
+                    }
+                },
+            });
+        }, 3000);
     </script>
 @endsection

+ 27 - 27
resources/views/user/referral.blade.php

@@ -114,7 +114,7 @@
                 <div class="card">
                     <div class="card-block">
                         <h4 class="card-title cyan-600"><i
-                                    class="icon wb-star-outline"></i> {{trans('user.withdraw_logs')}}</h4>
+                                class="icon wb-star-outline"></i> {{trans('user.withdraw_logs')}}</h4>
                         <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                             <thead class="thead-default">
                             <tr>
@@ -153,35 +153,35 @@
     <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
     <script src="/assets/custom/clipboardjs/clipboard.min.js"></script>
     <script>
-      // 申请提现
-      function extractMoney() {
-        $.post('{{route('applyCommission')}}', {_token: '{{csrf_token()}}'}, function(ret) {
-          if (ret.status === 'success') {
-            swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => {
-              window.location.reload();
+        // 申请提现
+        function extractMoney() {
+            $.post('{{route('applyCommission')}}', {_token: '{{csrf_token()}}'}, function(ret) {
+                if (ret.status === 'success') {
+                    swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => {
+                        window.location.reload();
+                    });
+                } else {
+                    swal.fire(ret.title, ret.message, 'error');
+                }
             });
-          } else {
-            swal.fire(ret.title, ret.message, 'error');
-          }
-        });
-      }
+        }
 
-      const clipboard = new ClipboardJS('.mt-clipboard');
-      clipboard.on('success', function() {
-        swal.fire({
-          title: '{{trans('common.copy.success')}}',
-          icon: 'success',
-          timer: 1300,
-          showConfirmButton: false,
+        const clipboard = new ClipboardJS('.mt-clipboard');
+        clipboard.on('success', function() {
+            swal.fire({
+                title: '{{trans('common.copy.success')}}',
+                icon: 'success',
+                timer: 1300,
+                showConfirmButton: false,
+            });
         });
-      });
-      clipboard.on('error', function() {
-        swal.fire({
-          title: '{{trans('common.copy.failed')}}',
-          icon: 'error',
-          timer: 1500,
-          showConfirmButton: false,
+        clipboard.on('error', function() {
+            swal.fire({
+                title: '{{trans('common.copy.failed')}}',
+                icon: 'error',
+                timer: 1500,
+                showConfirmButton: false,
+            });
         });
-      });
     </script>
 @endsection

+ 71 - 71
resources/views/user/replyTicket.blade.php

@@ -37,81 +37,81 @@
 @endsection
 @section('javascript')
     <script>
-      //回车检测
-      $(document).on('keypress', 'input', function(e) {
-        if (e.which === 13) {
-          replyTicket();
-          return false;
-        }
-      });
+        //回车检测
+        $(document).on('keypress', 'input', function(e) {
+            if (e.which === 13) {
+                replyTicket();
+                return false;
+            }
+        });
 
-      // 关闭工单
-      function closeTicket() {
-        swal.fire({
-          title: '{{trans('user.ticket.close')}}',
-          text: '{{trans('user.ticket.close_tips')}}',
-          icon: 'question',
-          showCancelButton: true,
-          cancelButtonText: '{{trans('common.close')}}',
-          confirmButtonText: '{{trans('common.confirm')}}',
-        }).then((result) => {
-          if (result.value) {
-            $.ajax({
-              method: 'POST',
-              url: '{{route('closeTicket')}}',
-              async: true,
-              data: {_token: '{{csrf_token()}}', id: '{{$ticket->id}}'},
-              dataType: 'json',
-              success: function(ret) {
-                swal.fire({
-                  title: ret.message,
-                  icon: 'success',
-                  timer: 1300,
-                }).then(() => window.location.href = '{{route('ticket')}}');
-              },
-              error: function() {
-                swal.fire({title: '{{trans('user.ticket.error')}}', icon: 'error'});
-              },
+        // 关闭工单
+        function closeTicket() {
+            swal.fire({
+                title: '{{trans('user.ticket.close')}}',
+                text: '{{trans('user.ticket.close_tips')}}',
+                icon: 'question',
+                showCancelButton: true,
+                cancelButtonText: '{{trans('common.close')}}',
+                confirmButtonText: '{{trans('common.confirm')}}',
+            }).then((result) => {
+                if (result.value) {
+                    $.ajax({
+                        method: 'POST',
+                        url: '{{route('closeTicket')}}',
+                        async: true,
+                        data: {_token: '{{csrf_token()}}', id: '{{$ticket->id}}'},
+                        dataType: 'json',
+                        success: function(ret) {
+                            swal.fire({
+                                title: ret.message,
+                                icon: 'success',
+                                timer: 1300,
+                            }).then(() => window.location.href = '{{route('ticket')}}');
+                        },
+                        error: function() {
+                            swal.fire({title: '{{trans('user.ticket.error')}}', icon: 'error'});
+                        },
+                    });
+                }
             });
-          }
-        });
-      }
+        }
 
-      // 回复工单
-      function replyTicket() {
-        const content = document.getElementById('editor').value;
+        // 回复工单
+        function replyTicket() {
+            const content = document.getElementById('editor').value;
 
-        if (content.trim() === '') {
-          swal.fire({title: '{{trans('validation.required', ['attribute' => trans('validation.attributes.content')])}}!', icon: 'warning', timer: 1500});
-          return false;
-        }
-        swal.fire({
-          title: '{{trans('user.ticket.reply_confirm')}}',
-          icon: 'question',
-          allowEnterKey: false,
-          showCancelButton: true,
-          cancelButtonText: '{{trans('common.close')}}',
-          confirmButtonText: '{{trans('common.confirm')}}',
-        }).then((result) => {
-          if (result.value) {
-            $.post('{{route('replyTicket')}}', {
-              _token: '{{csrf_token()}}',
-              id: '{{$ticket->id}}',
-              content: content,
-            }, function(ret) {
-              if (ret.status === 'success') {
-                swal.fire({
-                  title: ret.message,
-                  icon: 'success',
-                  timer: 1000,
-                  showConfirmButton: false,
-                }).then(() => window.location.reload());
-              } else {
-                swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-              }
+            if (content.trim() === '') {
+                swal.fire({title: '{{trans('validation.required', ['attribute' => trans('validation.attributes.content')])}}!', icon: 'warning', timer: 1500});
+                return false;
+            }
+            swal.fire({
+                title: '{{trans('user.ticket.reply_confirm')}}',
+                icon: 'question',
+                allowEnterKey: false,
+                showCancelButton: true,
+                cancelButtonText: '{{trans('common.close')}}',
+                confirmButtonText: '{{trans('common.confirm')}}',
+            }).then((result) => {
+                if (result.value) {
+                    $.post('{{route('replyTicket')}}', {
+                        _token: '{{csrf_token()}}',
+                        id: '{{$ticket->id}}',
+                        content: content,
+                    }, function(ret) {
+                        if (ret.status === 'success') {
+                            swal.fire({
+                                title: ret.message,
+                                icon: 'success',
+                                timer: 1000,
+                                showConfirmButton: false,
+                            }).then(() => window.location.reload());
+                        } else {
+                            swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+                        }
+                    });
+                }
             });
-          }
-        });
-      }
+        }
     </script>
 @endsection

+ 114 - 114
resources/views/user/services.blade.php

@@ -168,131 +168,131 @@
     <script src="assets/global/vendor/ionrangeslider/ion.rangeSlider.min.js"></script>
     <script src="assets/global/js/Plugin/ionrangeslider.js"></script>
     <script>
-      function itemControl(value) {
-        if (value === 1) {
-          $('.charge_credit').show();
-          $('#change_btn').hide();
-          $('#charge_qrcode').hide();
-          $('#charge_coupon_code').hide();
-        } else if (value === 2) {
-          $('.charge_credit').hide();
-          $('#change_btn').hide();
-          $('#charge_qrcode').show();
-          $('#charge_coupon_code').hide();
-        } else {
-          $('.charge_credit').hide();
-          $('#charge_qrcode').hide();
-          $('#charge_coupon_code').show();
-          $('#change_btn').show();
+        function itemControl(value) {
+            if (value === 1) {
+                $('.charge_credit').show();
+                $('#change_btn').hide();
+                $('#charge_qrcode').hide();
+                $('#charge_coupon_code').hide();
+            } else if (value === 2) {
+                $('.charge_credit').hide();
+                $('#change_btn').hide();
+                $('#charge_qrcode').show();
+                $('#charge_coupon_code').hide();
+            } else {
+                $('.charge_credit').hide();
+                $('#charge_qrcode').hide();
+                $('#charge_coupon_code').show();
+                $('#change_btn').show();
+            }
         }
-      }
 
-      $(document).ready(function() {
-        let which_selected = 3;
-          @if(sysConfig('is_onlinePay'))
-              which_selected = 1;
-          @elseif(sysConfig('alipay_qrcode') || sysConfig('wechat_qrcode'))
-              which_selected = 2;
-          @endif
+        $(document).ready(function() {
+            let which_selected = 3;
+            @if(sysConfig('is_onlinePay'))
+                which_selected = 1;
+            @elseif(sysConfig('alipay_qrcode') || sysConfig('wechat_qrcode'))
+                which_selected = 2;
+            @endif
 
-          itemControl(which_selected);
-        $('charge_type').val(which_selected);
-      });
+            itemControl(which_selected);
+            $('charge_type').val(which_selected);
+        });
 
-      // 切换充值方式
-      $('#charge_type').change(function() {
-        itemControl(parseInt($(this).val()));
-      });
+        // 切换充值方式
+        $('#charge_type').change(function() {
+            itemControl(parseInt($(this).val()));
+        });
 
-      // 重置流量
-      function resetTraffic() {
-        swal.fire({
-          title: '{{trans('user.reset_data.')}}',
-          text: '{{trans('user.reset_data.cost_tips', ['amount' => $renewTraffic])}}',
-          icon: 'question',
-          showCancelButton: true,
-          cancelButtonText: '{{trans('common.close')}}',
-          confirmButtonText: '{{trans('common.confirm')}}',
-        }).then((result) => {
-          if (result.value) {
-            $.post('{{route('resetTraffic')}}', {_token: '{{csrf_token()}}'}, function(ret) {
-              if (ret.status === 'success') {
-                swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
-              } else {
-                swal.fire({
-                  title: ret.message,
-                  text: ret.data,
-                  icon: 'error',
-                }).then(() => window.location.reload());
-              }
+        // 重置流量
+        function resetTraffic() {
+            swal.fire({
+                title: '{{trans('user.reset_data.')}}',
+                text: '{{trans('user.reset_data.cost_tips', ['amount' => $renewTraffic])}}',
+                icon: 'question',
+                showCancelButton: true,
+                cancelButtonText: '{{trans('common.close')}}',
+                confirmButtonText: '{{trans('common.confirm')}}',
+            }).then((result) => {
+                if (result.value) {
+                    $.post('{{route('resetTraffic')}}', {_token: '{{csrf_token()}}'}, function(ret) {
+                        if (ret.status === 'success') {
+                            swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
+                        } else {
+                            swal.fire({
+                                title: ret.message,
+                                text: ret.data,
+                                icon: 'error',
+                            }).then(() => window.location.reload());
+                        }
+                    });
+                }
             });
-          }
-        });
-      }
+        }
 
-      // 充值
-      function pay(method, pay_type) {
-        const paymentType = parseInt($('#charge_type').val() ?? 3);
-        const charge_coupon = $('#charge_coupon').val().trim();
-        const amount = parseInt($('#amount').val());
-        if (paymentType === 1) {
-          if (amount <= 0) {
-            swal.fire({title: '{{trans('common.error')}}', text: '{{trans('user.payment.error')}}', icon: 'warning', timer: 1000, showConfirmButton: false});
-            return false;
-          }
+        // 充值
+        function pay(method, pay_type) {
+            const paymentType = parseInt($('#charge_type').val() ?? 3);
+            const charge_coupon = $('#charge_coupon').val().trim();
+            const amount = parseInt($('#amount').val());
+            if (paymentType === 1) {
+                if (amount <= 0) {
+                    swal.fire({title: '{{trans('common.error')}}', text: '{{trans('user.payment.error')}}', icon: 'warning', timer: 1000, showConfirmButton: false});
+                    return false;
+                }
 
-          $.ajax({
-            method: 'POST',
-            url: '{{route('purchase')}}',
-            data: {_token: '{{csrf_token()}}', amount: amount, method: method, pay_type: pay_type},
-            dataType: 'json',
-            beforeSend: function() {
-              $('#charge_msg').show().html('{{trans('user.payment.creating')}}');
-            },
-            success: function(ret) {
-              if (ret.status === 'fail') {
-                return false;
-              } else {
-                $('#charge_msg').show().html(ret.message);
-                if (ret.data) {
-                  window.location.href = '{{route('orderDetail' , '')}}/' + ret.data;
-                } else if (ret.url) {
-                  window.location.href = ret.url;
+                $.ajax({
+                    method: 'POST',
+                    url: '{{route('purchase')}}',
+                    data: {_token: '{{csrf_token()}}', amount: amount, method: method, pay_type: pay_type},
+                    dataType: 'json',
+                    beforeSend: function() {
+                        $('#charge_msg').show().html('{{trans('user.payment.creating')}}');
+                    },
+                    success: function(ret) {
+                        if (ret.status === 'fail') {
+                            return false;
+                        } else {
+                            $('#charge_msg').show().html(ret.message);
+                            if (ret.data) {
+                                window.location.href = '{{route('orderDetail' , '')}}/' + ret.data;
+                            } else if (ret.url) {
+                                window.location.href = ret.url;
+                            }
+                        }
+                    },
+                    error: function() {
+                        $('#charge_msg').show().html("{{trans('user.error_response')}}");
+                    },
+                });
+            } else if (paymentType === 3) {
+                if (charge_coupon === '') {
+                    $('#charge_msg').show().html("{{trans('validation.required', ['attribute' => trans('user.coupon.attribute')])}}");
+                    $('#charge_coupon').focus();
+                    return false;
                 }
-              }
-            },
-            error: function() {
-              $('#charge_msg').show().html("{{trans('user.error_response')}}");
-            },
-          });
-        } else if (paymentType === 3) {
-          if (charge_coupon === '') {
-            $('#charge_msg').show().html("{{trans('validation.required', ['attribute' => trans('user.coupon.attribute')])}}");
-            $('#charge_coupon').focus();
-            return false;
-          }
 
-          $.ajax({
-            method: 'POST',
-            url: '{{route('recharge')}}',
-            data: {_token: '{{csrf_token()}}', coupon_sn: charge_coupon},
-            beforeSend: function() {
-              $('#charge_msg').show().html("{{trans('user.recharging')}}");
-            },
-            success: function(ret) {
-              if (ret.status === 'fail') {
-                $('#charge_msg').show().html(ret.message);
-                return false;
-              }
+                $.ajax({
+                    method: 'POST',
+                    url: '{{route('recharge')}}',
+                    data: {_token: '{{csrf_token()}}', coupon_sn: charge_coupon},
+                    beforeSend: function() {
+                        $('#charge_msg').show().html("{{trans('user.recharging')}}");
+                    },
+                    success: function(ret) {
+                        if (ret.status === 'fail') {
+                            $('#charge_msg').show().html(ret.message);
+                            return false;
+                        }
 
-              $('#charge_modal').modal('hide');
-              window.location.reload();
-            },
-            error: function() {
-              $('#charge_msg').show().html("{{trans('user.error_response')}}");
-            },
-          });
+                        $('#charge_modal').modal('hide');
+                        window.location.reload();
+                    },
+                    error: function() {
+                        $('#charge_msg').show().html("{{trans('user.error_response')}}");
+                    },
+                });
+            }
         }
-      }
     </script>
 @endsection

+ 3 - 3
resources/views/user/stripe-checkout.blade.php

@@ -12,8 +12,8 @@
 @section('javascript')
     <script src="https://js.stripe.com/v3/"></script>
     <script>
-      let stripe = Stripe('{{ sysConfig('stripe_public_key') }}');
-      let redirectData = stripe.redirectToCheckout({sessionId: '{{ $session_id  }}'});
-      console.log(redirectData);
+        let stripe = Stripe('{{ sysConfig('stripe_public_key') }}');
+        let redirectData = stripe.redirectToCheckout({sessionId: '{{ $session_id  }}'});
+        console.log(redirectData);
     </script>
 @endsection

+ 34 - 34
resources/views/user/ticketList.blade.php

@@ -24,7 +24,7 @@
                             <table class="table table-hover text-center">
                                 <thead class="thead-default">
                                 <tr>
-                                    <th data-cell-style="cellStyle"> # </th>
+                                    <th data-cell-style="cellStyle"> #</th>
                                     <th> {{trans('validation.attributes.title')}} </th>
                                     <th> {{trans('common.status')}} </th>
                                     <th></th>
@@ -129,42 +129,42 @@
 @endsection
 @section('javascript')
     <script>
-      // 发起工单
-      function createTicket() {
-        const title = $('#title').val();
-        const content = $('#content').val();
+        // 发起工单
+        function createTicket() {
+            const title = $('#title').val();
+            const content = $('#content').val();
 
-        if (title.trim() === '') {
-          swal.fire({title: '{{trans('validation.required', ['attribute' => trans('validation.attributes.title')])}}!', icon: 'warning'});
-          return false;
-        }
+            if (title.trim() === '') {
+                swal.fire({title: '{{trans('validation.required', ['attribute' => trans('validation.attributes.title')])}}!', icon: 'warning'});
+                return false;
+            }
 
-        if (content.trim() === '') {
-          swal.fire({title: '{{trans('validation.required', ['attribute' => trans('validation.attributes.content')])}}!', icon: 'warning'});
-          return false;
-        }
+            if (content.trim() === '') {
+                swal.fire({title: '{{trans('validation.required', ['attribute' => trans('validation.attributes.content')])}}!', icon: 'warning'});
+                return false;
+            }
 
-        swal.fire({
-          title: '{{trans('user.ticket.submit_tips')}}',
-          icon: 'question',
-          showCancelButton: true,
-          cancelButtonText: '{{trans('common.close')}}',
-          confirmButtonText: '{{trans('common.confirm')}}',
-        }).then((result) => {
-          if (result.value) {
-            $.post('{{route('openTicket')}}', {
-              _token: '{{csrf_token()}}',
-              title: title,
-              content: content,
-            }, function(ret) {
-              if (ret.status === 'success') {
-                swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
-              } else {
-                swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-              }
+            swal.fire({
+                title: '{{trans('user.ticket.submit_tips')}}',
+                icon: 'question',
+                showCancelButton: true,
+                cancelButtonText: '{{trans('common.close')}}',
+                confirmButtonText: '{{trans('common.confirm')}}',
+            }).then((result) => {
+                if (result.value) {
+                    $.post('{{route('openTicket')}}', {
+                        _token: '{{csrf_token()}}',
+                        title: title,
+                        content: content,
+                    }, function(ret) {
+                        if (ret.status === 'success') {
+                            swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
+                        } else {
+                            swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+                        }
+                    });
+                }
             });
-          }
-        });
-      }
+        }
     </script>
 @endsection

部分文件因为文件数量过多而无法显示