mirror of
https://github.com/v2board/v2board.git
synced 2024-11-10 09:39:10 +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\Services\ServerService;
|
||||
use App\Services\UserService;
|
||||
use App\Utils\Clash;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Models\ServerV2ray;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
|
||||
|
@ -26,8 +26,7 @@ class ServerController extends Controller
|
||||
$serverService = new ServerService();
|
||||
$servers = $serverService->getAvailableServers($user);
|
||||
}
|
||||
|
||||
$eTag = sha1(json_encode(array_column($servers, 'updated_at')));
|
||||
$eTag = sha1(json_encode(array_column($servers, 'is_online', 'updated_at')));
|
||||
if (strpos($request->header('If-None-Match'), $eTag) !== false ) {
|
||||
abort(304);
|
||||
}
|
||||
|
@ -103,6 +103,7 @@ class ServerService
|
||||
array_multisort($tmp, SORT_ASC, $servers);
|
||||
$servers = array_map(function ($server) {
|
||||
$server['port'] = (int)$server['port'];
|
||||
$server['is_online'] = (time() - 300 > $server['last_check_at']) ? 0 : 1;
|
||||
return $server;
|
||||
}, $servers);
|
||||
return $servers;
|
||||
|
@ -237,5 +237,5 @@ return [
|
||||
| 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