Parcourir la source

Fixed 检测任务因为中转字段修改而报错的问题

兔姬桑 il y a 3 ans
Parent
commit
f417dc7fb6

+ 2 - 2
app/Console/Commands/NodeStatusDetection.php

@@ -43,7 +43,7 @@ class NodeStatusDetection extends Command
     {
         $offlineCheckTimes = sysConfig('offline_check_times');
         $onlineNode = NodeHeartbeat::recently()->distinct()->pluck('node_id')->toArray();
-        foreach (Node::whereIsRelay(0)->whereStatus(1)->whereNotIn('id', $onlineNode)->get() as $node) {
+        foreach (Node::whereRelayNodeId(null)->whereStatus(1)->whereNotIn('id', $onlineNode)->get() as $node) {
             // 近期无节点负载信息则认为是后端炸了
             if ($offlineCheckTimes) {
                 // 已通知次数
@@ -74,7 +74,7 @@ class NodeStatusDetection extends Command
     {
         $detectionCheckTimes = sysConfig('detection_check_times');
 
-        foreach (Node::whereIsRelay(0)->whereStatus(1)->where('detection_type', '<>', 0)->get() as $node) {
+        foreach (Node::whereRelayNodeId(null)->whereStatus(1)->where('detection_type', '<>', 0)->get() as $node) {
             $node_id = $node->id;
             // 使用DDNS的node先通过gethostbyname获取ipv4地址
             foreach ($node->ips() as $ip) {

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

@@ -19,8 +19,8 @@
                 @canany(['admin.node.geo', 'admin.node.create'])
                     <div class="panel-actions btn-group">
                         @can('admin.node.geo')
-                            <button type="button" onclick="refreshGeo()" class="btn btn-info">
-                                <i class="icon wb-map"></i> 刷新节点地理信息
+                            <button type="button" onclick="refreshGeo(0)" class="btn btn-info">
+                                <i id="geo0" class="icon wb-map" aria-hidden="true"></i> 刷新【全部】节点地理信息
                             </button>
                         @endcan
                         @can('admin.node.create')
@@ -254,7 +254,7 @@
 
         @can('admin.node.geo')
         // 刷新节点地理信息
-        function refreshGeo(id = 0) {
+        function refreshGeo(id) {
             $.ajax({
                 method: 'GET',
                 url: '{{route('admin.node.geo', '')}}/' + id,