mirror of
https://github.com/v2board/v2board.git
synced 2024-11-14 07:29:13 +08:00
update: fix node status
This commit is contained in:
parent
908696a54d
commit
63566fbd2c
@ -5,9 +5,7 @@ namespace App\Http\Controllers\Client;
|
|||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Services\ServerService;
|
use App\Services\ServerService;
|
||||||
use App\Services\UserService;
|
use App\Services\UserService;
|
||||||
use App\Utils\Clash;
|
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use App\Models\ServerV2ray;
|
|
||||||
use Illuminate\Support\Facades\File;
|
use Illuminate\Support\Facades\File;
|
||||||
use Symfony\Component\Yaml\Yaml;
|
use Symfony\Component\Yaml\Yaml;
|
||||||
|
|
||||||
|
@ -26,8 +26,7 @@ class ServerController extends Controller
|
|||||||
$serverService = new ServerService();
|
$serverService = new ServerService();
|
||||||
$servers = $serverService->getAvailableServers($user);
|
$servers = $serverService->getAvailableServers($user);
|
||||||
}
|
}
|
||||||
|
$eTag = sha1(json_encode(array_column($servers, 'is_online', 'updated_at')));
|
||||||
$eTag = sha1(json_encode(array_column($servers, 'updated_at')));
|
|
||||||
if (strpos($request->header('If-None-Match'), $eTag) !== false ) {
|
if (strpos($request->header('If-None-Match'), $eTag) !== false ) {
|
||||||
abort(304);
|
abort(304);
|
||||||
}
|
}
|
||||||
|
@ -103,6 +103,7 @@ class ServerService
|
|||||||
array_multisort($tmp, SORT_ASC, $servers);
|
array_multisort($tmp, SORT_ASC, $servers);
|
||||||
$servers = array_map(function ($server) {
|
$servers = array_map(function ($server) {
|
||||||
$server['port'] = (int)$server['port'];
|
$server['port'] = (int)$server['port'];
|
||||||
|
$server['is_online'] = (time() - 300 > $server['last_check_at']) ? 0 : 1;
|
||||||
return $server;
|
return $server;
|
||||||
}, $servers);
|
}, $servers);
|
||||||
return $servers;
|
return $servers;
|
||||||
|
@ -237,5 +237,5 @@ return [
|
|||||||
| The only modification by laravel config
|
| The only modification by laravel config
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
'version' => '1.7.2.1671471846226'
|
'version' => '1.7.3.1672843907081'
|
||||||
];
|
];
|
||||||
|
2
public/assets/admin/umi.js
vendored
2
public/assets/admin/umi.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
public/theme/v2board/assets/umi.js
vendored
2
public/theme/v2board/assets/umi.js
vendored
File diff suppressed because one or more lines are too long
2
public/theme/v2board/assets/vendors.async.js
vendored
2
public/theme/v2board/assets/vendors.async.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user