🐛 fix: Update minimum ratio value to 0 in protocol fields and adjust related schemas; enhance unit conversion in ServerConfig
This commit is contained in:
@@ -27,7 +27,7 @@ export const PROTOCOL_FIELDS: Record<string, FieldConfig[]> = {
|
||||
name: 'ratio',
|
||||
type: 'number',
|
||||
label: 'traffic_ratio',
|
||||
min: 1,
|
||||
min: 0,
|
||||
step: 0.01,
|
||||
defaultValue: 1,
|
||||
group: 'basic',
|
||||
@@ -134,7 +134,7 @@ export const PROTOCOL_FIELDS: Record<string, FieldConfig[]> = {
|
||||
name: 'ratio',
|
||||
type: 'number',
|
||||
label: 'traffic_ratio',
|
||||
min: 1,
|
||||
min: 0,
|
||||
step: 0.01,
|
||||
defaultValue: 1,
|
||||
group: 'basic',
|
||||
@@ -242,7 +242,7 @@ export const PROTOCOL_FIELDS: Record<string, FieldConfig[]> = {
|
||||
name: 'ratio',
|
||||
type: 'number',
|
||||
label: 'traffic_ratio',
|
||||
min: 1,
|
||||
min: 0,
|
||||
step: 0.01,
|
||||
defaultValue: 1,
|
||||
group: 'basic',
|
||||
@@ -500,7 +500,7 @@ export const PROTOCOL_FIELDS: Record<string, FieldConfig[]> = {
|
||||
name: 'ratio',
|
||||
type: 'number',
|
||||
label: 'traffic_ratio',
|
||||
min: 1,
|
||||
min: 0,
|
||||
step: 0.01,
|
||||
defaultValue: 1,
|
||||
group: 'basic',
|
||||
@@ -608,7 +608,7 @@ export const PROTOCOL_FIELDS: Record<string, FieldConfig[]> = {
|
||||
name: 'ratio',
|
||||
type: 'number',
|
||||
label: 'traffic_ratio',
|
||||
min: 1,
|
||||
min: 0,
|
||||
step: 0.01,
|
||||
defaultValue: 1,
|
||||
group: 'basic',
|
||||
@@ -716,7 +716,7 @@ export const PROTOCOL_FIELDS: Record<string, FieldConfig[]> = {
|
||||
name: 'ratio',
|
||||
type: 'number',
|
||||
label: 'traffic_ratio',
|
||||
min: 1,
|
||||
min: 0,
|
||||
step: 0.01,
|
||||
defaultValue: 1,
|
||||
group: 'basic',
|
||||
@@ -789,7 +789,7 @@ export const PROTOCOL_FIELDS: Record<string, FieldConfig[]> = {
|
||||
name: 'ratio',
|
||||
type: 'number',
|
||||
label: 'traffic_ratio',
|
||||
min: 1,
|
||||
min: 0,
|
||||
step: 0.01,
|
||||
defaultValue: 1,
|
||||
group: 'basic',
|
||||
@@ -809,7 +809,7 @@ export const PROTOCOL_FIELDS: Record<string, FieldConfig[]> = {
|
||||
name: 'ratio',
|
||||
type: 'number',
|
||||
label: 'traffic_ratio',
|
||||
min: 1,
|
||||
min: 0,
|
||||
step: 0.01,
|
||||
defaultValue: 1,
|
||||
group: 'basic',
|
||||
@@ -886,7 +886,7 @@ export const PROTOCOL_FIELDS: Record<string, FieldConfig[]> = {
|
||||
name: 'ratio',
|
||||
type: 'number',
|
||||
label: 'traffic_ratio',
|
||||
min: 1,
|
||||
min: 0,
|
||||
step: 0.01,
|
||||
defaultValue: 1,
|
||||
group: 'basic',
|
||||
@@ -963,7 +963,7 @@ export const PROTOCOL_FIELDS: Record<string, FieldConfig[]> = {
|
||||
name: 'ratio',
|
||||
type: 'number',
|
||||
label: 'traffic_ratio',
|
||||
min: 1,
|
||||
min: 0,
|
||||
step: 0.01,
|
||||
defaultValue: 1,
|
||||
group: 'basic',
|
||||
@@ -999,7 +999,7 @@ export const PROTOCOL_FIELDS: Record<string, FieldConfig[]> = {
|
||||
name: 'ratio',
|
||||
type: 'number',
|
||||
label: 'traffic_ratio',
|
||||
min: 1,
|
||||
min: 0,
|
||||
step: 0.01,
|
||||
defaultValue: 1,
|
||||
group: 'basic',
|
||||
|
||||
@@ -17,7 +17,7 @@ import {
|
||||
const nullableString = z.string().nullish();
|
||||
const nullableBool = z.boolean().nullish();
|
||||
const nullablePort = z.number().int().min(0).max(65535).nullish();
|
||||
const nullableRatio = z.number().min(1).nullish();
|
||||
const nullableRatio = z.number().min(0).nullish();
|
||||
|
||||
const ss = z.object({
|
||||
ratio: nullableRatio,
|
||||
|
||||
Reference in New Issue
Block a user