Browse Source

Merge branch 'v2board:dev' into dev

DesperadoJ 3 years ago
parent
commit
85c52f6499

+ 1 - 1
app/Http/Controllers/Client/Protocols/Clash.php

@@ -97,7 +97,7 @@ class Clash
         $array['server'] = $server['host'];
         $array['port'] = $server['port'];
         $array['uuid'] = $uuid;
-        $array['alterId'] = $server['alter_id'];
+        $array['alterId'] = 0;
         $array['cipher'] = 'auto';
         $array['udp'] = true;
 

+ 1 - 1
app/Http/Controllers/Client/Protocols/Passwall.php

@@ -54,7 +54,7 @@ class Passwall
             "add" => $server['host'],
             "port" => (string)$server['port'],
             "id" => $uuid,
-            "aid" => (string)$server['alter_id'],
+            "aid" => '0',
             "net" => $server['network'],
             "type" => "none",
             "host" => "",

+ 1 - 1
app/Http/Controllers/Client/Protocols/SSRPlus.php

@@ -54,7 +54,7 @@ class SSRPlus
             "add" => $server['host'],
             "port" => (string)$server['port'],
             "id" => $uuid,
-            "aid" => (string)$server['alter_id'],
+            "aid" => '0',
             "net" => $server['network'],
             "type" => "none",
             "host" => "",

+ 1 - 1
app/Http/Controllers/Client/Protocols/Shadowrocket.php

@@ -58,7 +58,7 @@ class Shadowrocket
         $config = [
             'tfo' => 1,
             'remark' => $server['name'],
-            'alterId' => $server['alter_id']
+            'alterId' => 0
         ];
         if ($server['tls']) {
             $config['tls'] = 1;

+ 1 - 1
app/Http/Controllers/Client/Protocols/Stash.php

@@ -98,7 +98,7 @@ class Stash
         $array['server'] = $server['host'];
         $array['port'] = $server['port'];
         $array['uuid'] = $uuid;
-        $array['alterId'] = $server['alter_id'];
+        $array['alterId'] = 0;
         $array['cipher'] = 'auto';
         $array['udp'] = true;
 

+ 1 - 1
app/Http/Controllers/Client/Protocols/V2rayN.php

@@ -54,7 +54,7 @@ class V2rayN
             "add" => $server['host'],
             "port" => (string)$server['port'],
             "id" => $uuid,
-            "aid" => (string)$server['alter_id'],
+            "aid" => '0',
             "net" => $server['network'],
             "type" => "none",
             "host" => "",

+ 1 - 1
app/Http/Controllers/Client/Protocols/V2rayNG.php

@@ -54,7 +54,7 @@ class V2rayNG
             "add" => $server['host'],
             "port" => (string)$server['port'],
             "id" => $uuid,
-            "aid" => (string)$server['alter_id'],
+            "aid" => '0',
             "net" => $server['network'],
             "type" => "none",
             "host" => "",

+ 1 - 1
app/Http/Controllers/Server/DeepbworkController.php

@@ -47,7 +47,7 @@ class DeepbworkController extends Controller
             $user->v2ray_user = [
                 "uuid" => $user->uuid,
                 "email" => sprintf("%s@v2board.user", $user->uuid),
-                "alter_id" => $server->alter_id,
+                "alter_id" => 0,
                 "level" => 0,
             ];
             unset($user['uuid']);

+ 10 - 1
app/Http/Controllers/User/ServerController.php

@@ -13,6 +13,7 @@ use App\Models\ServerLog;
 use App\Models\User;
 
 use App\Utils\Helper;
+use Illuminate\Support\Facades\DB;
 
 class ServerController extends Controller
 {
@@ -35,7 +36,15 @@ class ServerController extends Controller
         $type = $request->input('type') ? $request->input('type') : 0;
         $current = $request->input('current') ? $request->input('current') : 1;
         $pageSize = $request->input('pageSize') >= 10 ? $request->input('pageSize') : 10;
-        $serverLogModel = ServerLog::where('user_id', $request->session()->get('id'))
+        $serverLogModel = ServerLog::select([
+            DB::raw('sum(u) as u'),
+            DB::raw('sum(d) as d'),
+            'log_at',
+            'user_id',
+            'updated_at'
+        ])
+            ->where('user_id', $request->session()->get('id'))
+            ->groupBy('log_at', 'user_id')
             ->orderBy('log_at', 'DESC');
         switch ($type) {
             case 0:

+ 0 - 1
app/Http/Requests/Admin/ServerV2raySave.php

@@ -24,7 +24,6 @@ class ServerV2raySave extends FormRequest
             'tls' => 'required',
             'tags' => 'nullable|array',
             'rate' => 'required|numeric',
-            'alter_id' => 'required|integer',
             'network' => 'required|in:tcp,kcp,ws,http,domainsocket,quic,grpc',
             'networkSettings' => 'nullable|array',
             'ruleSettings' => 'nullable|array',

+ 1 - 1
config/app.php

@@ -237,5 +237,5 @@ return [
     | The only modification by laravel config
     |
     */
-    'version' => '1.5.4.1640966110216'
+    'version' => '1.5.5.1641274817595'
 ];

+ 1 - 2
database/install.sql

@@ -257,7 +257,6 @@ CREATE TABLE `v2_server_v2ray` (
                                    `tags` varchar(255) DEFAULT NULL,
                                    `rate` varchar(11) NOT NULL,
                                    `network` text NOT NULL,
-                                   `alter_id` int(11) NOT NULL DEFAULT '1',
                                    `settings` text,
                                    `rules` text,
                                    `networkSettings` text,
@@ -370,4 +369,4 @@ CREATE TABLE `v2_user` (
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
 
--- 2021-12-27 17:37:09
+-- 2022-01-04 05:39:52

+ 3 - 0
database/update.sql

@@ -471,3 +471,6 @@ ALTER TABLE `v2_coupon`
 
 ALTER TABLE `v2_order`
     CHANGE `cycle` `period` varchar(255) COLLATE 'utf8_general_ci' NOT NULL AFTER `type`;
+
+ALTER TABLE `v2_server_v2ray`
+DROP `alter_id`;

File diff suppressed because it is too large
+ 0 - 0
public/assets/admin/components.async.js


File diff suppressed because it is too large
+ 0 - 0
public/assets/admin/components.chunk.css


File diff suppressed because it is too large
+ 0 - 0
public/assets/admin/umi.js


File diff suppressed because it is too large
+ 0 - 0
public/assets/admin/vendors.async.js


File diff suppressed because it is too large
+ 0 - 0
public/theme/v2board/assets/umi.js


+ 6 - 1
public/theme/v2board/dashboard.blade.php

@@ -4,7 +4,9 @@
 <head>
     <link rel="stylesheet" href="/theme/{{$theme}}/assets/components.chunk.css?v={{$verison}}">
     <link rel="stylesheet" href="/theme/{{$theme}}/assets/umi.css?v={{$verison}}">
-    <link rel="stylesheet" href="/theme/{{$theme}}/assets/custom.css?v={{$verison}}">
+    @if (file_exists(public_path("/theme/{$theme}/assets/custom.css")))
+        <link rel="stylesheet" href="/theme/{{$theme}}/assets/custom.css?v={{$verison}}">
+    @endif
     <meta charset="utf-8">
     <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no">
     @php ($colors = [
@@ -57,6 +59,9 @@
 
     gtag('config', 'G-P1E9Z5LRRK');
 </script>
+@if (file_exists(public_path("/theme/{$theme}/assets/custom.js")))
+    <script src="/theme/{{$theme}}/assets/custom.js?v={{$verison}}"></script>
+@endif
 </body>
 
 </html>

Some files were not shown because too many files changed in this diff