소스 검색

fix server rules maybe not defined

Tokumeikoi 5 년 전
부모
커밋
0446e7d99f
2개의 변경된 파일14개의 추가작업 그리고 13개의 파일을 삭제
  1. 14 13
      app/Http/Controllers/Server/DeepbworkController.php
  2. 0 0
      public/assets/admin/umi.js

+ 14 - 13
app/Http/Controllers/Server/DeepbworkController.php

@@ -146,20 +146,21 @@ class DeepbworkController extends Controller
         if ($server->rules) {
             $rules = json_decode($server->rules);
             // domain
-            $domainObj = new \StdClass();
-            $domainObj->type = 'field';
-            $domainObj->domain = $rules->domain;
-            $domainObj->outboundTag = 'block';
+            if (isset($rules->domain)) {
+                $domainObj = new \StdClass();
+                $domainObj->type = 'field';
+                $domainObj->domain = $rules->domain;
+                $domainObj->outboundTag = 'block';
+                array_push($json->routing->settings->rules, $domainObj);
+            }
             // protocol
-            $protocolObj = new \StdClass();
-            $protocolObj->type = 'field';
-            $protocolObj->protocol = $rules->protocol;
-            $protocolObj->outboundTag = 'block';
-            array_push(
-                $json->routing->settings->rules,
-                $domainObj,
-                $protocolObj
-            );
+            if (isset($rules->protocol)) {
+                $protocolObj = new \StdClass();
+                $protocolObj->type = 'field';
+                $protocolObj->protocol = $rules->protocol;
+                $protocolObj->outboundTag = 'block';
+                array_push($json->routing->settings->rules, $protocolObj);
+            }
         }
 
         if ((int)$server->tls) {

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
public/assets/admin/umi.js


이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.