|
@@ -23,6 +23,7 @@ import {
|
|
DialogActions,
|
|
DialogActions,
|
|
DialogContent,
|
|
DialogContent,
|
|
DialogTitle,
|
|
DialogTitle,
|
|
|
|
+ InputAdornment,
|
|
List,
|
|
List,
|
|
ListItem,
|
|
ListItem,
|
|
ListItemText,
|
|
ListItemText,
|
|
@@ -273,7 +274,7 @@ export const GroupsEditorViewer = (props: Props) => {
|
|
const validateGroup = () => {
|
|
const validateGroup = () => {
|
|
let group = formIns.getValues();
|
|
let group = formIns.getValues();
|
|
if (group.name === "") {
|
|
if (group.name === "") {
|
|
- throw new Error(t("Group Name Cannot Be Empty"));
|
|
|
|
|
|
+ throw new Error(t("Group Name Required"));
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
@@ -342,6 +343,11 @@ export const GroupsEditorViewer = (props: Props) => {
|
|
"relay",
|
|
"relay",
|
|
]}
|
|
]}
|
|
value={field.value}
|
|
value={field.value}
|
|
|
|
+ renderOption={(props, option) => (
|
|
|
|
+ <li {...props} title={t(option)}>
|
|
|
|
+ {option}
|
|
|
|
+ </li>
|
|
|
|
+ )}
|
|
onChange={(_, value) => value && field.onChange(value)}
|
|
onChange={(_, value) => value && field.onChange(value)}
|
|
renderInput={(params) => <TextField {...params} />}
|
|
renderInput={(params) => <TextField {...params} />}
|
|
/>
|
|
/>
|
|
@@ -370,7 +376,7 @@ export const GroupsEditorViewer = (props: Props) => {
|
|
control={control}
|
|
control={control}
|
|
render={({ field }) => (
|
|
render={({ field }) => (
|
|
<Item>
|
|
<Item>
|
|
- <ListItemText primary={t("Icon")} />
|
|
|
|
|
|
+ <ListItemText primary={t("Proxy Group Icon")} />
|
|
<TextField
|
|
<TextField
|
|
autoComplete="new-password"
|
|
autoComplete="new-password"
|
|
size="small"
|
|
size="small"
|
|
@@ -418,7 +424,6 @@ export const GroupsEditorViewer = (props: Props) => {
|
|
</Item>
|
|
</Item>
|
|
)}
|
|
)}
|
|
/>
|
|
/>
|
|
-
|
|
|
|
<Controller
|
|
<Controller
|
|
name="url"
|
|
name="url"
|
|
control={control}
|
|
control={control}
|
|
@@ -427,6 +432,7 @@ export const GroupsEditorViewer = (props: Props) => {
|
|
<ListItemText primary={t("Health Check Url")} />
|
|
<ListItemText primary={t("Health Check Url")} />
|
|
<TextField
|
|
<TextField
|
|
autoComplete="new-password"
|
|
autoComplete="new-password"
|
|
|
|
+ placeholder="https://www.gstatic.com/generate_204"
|
|
size="small"
|
|
size="small"
|
|
sx={{ width: "calc(100% - 150px)" }}
|
|
sx={{ width: "calc(100% - 150px)" }}
|
|
{...field}
|
|
{...field}
|
|
@@ -434,6 +440,24 @@ export const GroupsEditorViewer = (props: Props) => {
|
|
</Item>
|
|
</Item>
|
|
)}
|
|
)}
|
|
/>
|
|
/>
|
|
|
|
+ <Controller
|
|
|
|
+ name="expected-status"
|
|
|
|
+ control={control}
|
|
|
|
+ render={({ field }) => (
|
|
|
|
+ <Item>
|
|
|
|
+ <ListItemText primary={t("Expected Status")} />
|
|
|
|
+ <TextField
|
|
|
|
+ autoComplete="new-password"
|
|
|
|
+ placeholder="*"
|
|
|
|
+ size="small"
|
|
|
|
+ sx={{ width: "calc(100% - 150px)" }}
|
|
|
|
+ onChange={(e) => {
|
|
|
|
+ field.onChange(parseInt(e.target.value));
|
|
|
|
+ }}
|
|
|
|
+ />
|
|
|
|
+ </Item>
|
|
|
|
+ )}
|
|
|
|
+ />
|
|
<Controller
|
|
<Controller
|
|
name="interval"
|
|
name="interval"
|
|
control={control}
|
|
control={control}
|
|
@@ -442,12 +466,20 @@ export const GroupsEditorViewer = (props: Props) => {
|
|
<ListItemText primary={t("Interval")} />
|
|
<ListItemText primary={t("Interval")} />
|
|
<TextField
|
|
<TextField
|
|
autoComplete="new-password"
|
|
autoComplete="new-password"
|
|
|
|
+ placeholder="300"
|
|
type="number"
|
|
type="number"
|
|
size="small"
|
|
size="small"
|
|
sx={{ width: "calc(100% - 150px)" }}
|
|
sx={{ width: "calc(100% - 150px)" }}
|
|
onChange={(e) => {
|
|
onChange={(e) => {
|
|
field.onChange(parseInt(e.target.value));
|
|
field.onChange(parseInt(e.target.value));
|
|
}}
|
|
}}
|
|
|
|
+ InputProps={{
|
|
|
|
+ endAdornment: (
|
|
|
|
+ <InputAdornment position="end">
|
|
|
|
+ {t("seconds")}
|
|
|
|
+ </InputAdornment>
|
|
|
|
+ ),
|
|
|
|
+ }}
|
|
/>
|
|
/>
|
|
</Item>
|
|
</Item>
|
|
)}
|
|
)}
|
|
@@ -460,12 +492,20 @@ export const GroupsEditorViewer = (props: Props) => {
|
|
<ListItemText primary={t("Timeout")} />
|
|
<ListItemText primary={t("Timeout")} />
|
|
<TextField
|
|
<TextField
|
|
autoComplete="new-password"
|
|
autoComplete="new-password"
|
|
|
|
+ placeholder="5000"
|
|
type="number"
|
|
type="number"
|
|
size="small"
|
|
size="small"
|
|
sx={{ width: "calc(100% - 150px)" }}
|
|
sx={{ width: "calc(100% - 150px)" }}
|
|
onChange={(e) => {
|
|
onChange={(e) => {
|
|
field.onChange(parseInt(e.target.value));
|
|
field.onChange(parseInt(e.target.value));
|
|
}}
|
|
}}
|
|
|
|
+ InputProps={{
|
|
|
|
+ endAdornment: (
|
|
|
|
+ <InputAdornment position="end">
|
|
|
|
+ {t("millis")}
|
|
|
|
+ </InputAdornment>
|
|
|
|
+ ),
|
|
|
|
+ }}
|
|
/>
|
|
/>
|
|
</Item>
|
|
</Item>
|
|
)}
|
|
)}
|
|
@@ -478,6 +518,7 @@ export const GroupsEditorViewer = (props: Props) => {
|
|
<ListItemText primary={t("Max Failed Times")} />
|
|
<ListItemText primary={t("Max Failed Times")} />
|
|
<TextField
|
|
<TextField
|
|
autoComplete="new-password"
|
|
autoComplete="new-password"
|
|
|
|
+ placeholder="5"
|
|
type="number"
|
|
type="number"
|
|
size="small"
|
|
size="small"
|
|
sx={{ width: "calc(100% - 150px)" }}
|
|
sx={{ width: "calc(100% - 150px)" }}
|
|
@@ -599,23 +640,6 @@ export const GroupsEditorViewer = (props: Props) => {
|
|
</Item>
|
|
</Item>
|
|
)}
|
|
)}
|
|
/>
|
|
/>
|
|
- <Controller
|
|
|
|
- name="expected-status"
|
|
|
|
- control={control}
|
|
|
|
- render={({ field }) => (
|
|
|
|
- <Item>
|
|
|
|
- <ListItemText primary={t("Expected Status")} />
|
|
|
|
- <TextField
|
|
|
|
- autoComplete="new-password"
|
|
|
|
- size="small"
|
|
|
|
- sx={{ width: "calc(100% - 150px)" }}
|
|
|
|
- onChange={(e) => {
|
|
|
|
- field.onChange(parseInt(e.target.value));
|
|
|
|
- }}
|
|
|
|
- />
|
|
|
|
- </Item>
|
|
|
|
- )}
|
|
|
|
- />
|
|
|
|
<Controller
|
|
<Controller
|
|
name="include-all"
|
|
name="include-all"
|
|
control={control}
|
|
control={control}
|
|
@@ -684,7 +708,7 @@ export const GroupsEditorViewer = (props: Props) => {
|
|
onClick={() => {
|
|
onClick={() => {
|
|
try {
|
|
try {
|
|
validateGroup();
|
|
validateGroup();
|
|
- for (const item of prependSeq) {
|
|
|
|
|
|
+ for (const item of [...prependSeq, ...groupList]) {
|
|
if (item.name === formIns.getValues().name) {
|
|
if (item.name === formIns.getValues().name) {
|
|
throw new Error(t("Group Name Already Exists"));
|
|
throw new Error(t("Group Name Already Exists"));
|
|
}
|
|
}
|
|
@@ -705,7 +729,7 @@ export const GroupsEditorViewer = (props: Props) => {
|
|
onClick={() => {
|
|
onClick={() => {
|
|
try {
|
|
try {
|
|
validateGroup();
|
|
validateGroup();
|
|
- for (const item of appendSeq) {
|
|
|
|
|
|
+ for (const item of [...appendSeq, ...groupList]) {
|
|
if (item.name === formIns.getValues().name) {
|
|
if (item.name === formIns.getValues().name) {
|
|
throw new Error(t("Group Name Already Exists"));
|
|
throw new Error(t("Group Name Already Exists"));
|
|
}
|
|
}
|
|
@@ -727,10 +751,7 @@ export const GroupsEditorViewer = (props: Props) => {
|
|
padding: "0 10px",
|
|
padding: "0 10px",
|
|
}}
|
|
}}
|
|
>
|
|
>
|
|
- <BaseSearchBox
|
|
|
|
- matchCase={false}
|
|
|
|
- onSearch={(match) => setMatch(() => match)}
|
|
|
|
- />
|
|
|
|
|
|
+ <BaseSearchBox onSearch={(match) => setMatch(() => match)} />
|
|
<Virtuoso
|
|
<Virtuoso
|
|
style={{ height: "calc(100% - 24px)", marginTop: "8px" }}
|
|
style={{ height: "calc(100% - 24px)", marginTop: "8px" }}
|
|
totalCount={
|
|
totalCount={
|