Procházet zdrojové kódy

chore: for dashboad add a 'minimum' attribute for duration_s type

Zaiming (Stone) Shi před 2 roky
rodič
revize
652e977b3c
1 změnil soubory, kde provedl 2 přidání a 2 odebrání
  1. 2 2
      apps/emqx_conf/src/emqx_conf_schema_types.erl

+ 2 - 2
apps/emqx_conf/src/emqx_conf_schema_types.erl

@@ -172,7 +172,7 @@ readable("duration()") ->
 readable("duration_s()") ->
 readable("duration_s()") ->
     #{
     #{
         swagger => #{type => string, example => <<"1h">>},
         swagger => #{type => string, example => <<"1h">>},
-        dashboard => #{type => duration},
+        dashboard => #{type => duration, minimum => <<"1s">>},
         docgen => #{type => "Duration(s)", example => <<"1h">>, desc => ?DESC(duration)}
         docgen => #{type => "Duration(s)", example => <<"1h">>, desc => ?DESC(duration)}
     };
     };
 readable("duration_ms()") ->
 readable("duration_ms()") ->
@@ -190,7 +190,7 @@ readable("timeout_duration()") ->
 readable("timeout_duration_s()") ->
 readable("timeout_duration_s()") ->
     #{
     #{
         swagger => #{type => string, example => <<"1h">>},
         swagger => #{type => string, example => <<"1h">>},
-        dashboard => #{type => duration},
+        dashboard => #{type => duration, minimum => <<"1s">>},
         docgen => #{type => "Duration(s)", example => <<"1h">>, desc => ?DESC(duration)}
         docgen => #{type => "Duration(s)", example => <<"1h">>, desc => ?DESC(duration)}
     };
     };
 readable("timeout_duration_ms()") ->
 readable("timeout_duration_ms()") ->