Allow start services in pause mode

This commit is contained in:
DomySh
2022-06-18 00:18:50 +02:00
parent 4caf7c2bce
commit a53184c7a0
2 changed files with 8 additions and 8 deletions

View File

@@ -11,7 +11,7 @@ type RegexAddInfo = {
regex:string, regex:string,
type:string, type:string,
mode:string, mode:string,
is_case_sensitive:boolean, is_case_insensitive:boolean,
regex_exact:boolean, regex_exact:boolean,
percentage_encoding:boolean percentage_encoding:boolean
} }
@@ -23,7 +23,7 @@ function AddNewRegex({ opened, onClose, service }:{ opened:boolean, onClose:()=>
regex:"", regex:"",
type:"blacklist", type:"blacklist",
mode:"C <-> S", mode:"C <-> S",
is_case_sensitive:true, is_case_insensitive:false,
regex_exact:false, regex_exact:false,
percentage_encoding:false percentage_encoding:false
}, },
@@ -57,7 +57,7 @@ function AddNewRegex({ opened, onClose, service }:{ opened:boolean, onClose:()=>
const request:RegexAddForm = { const request:RegexAddForm = {
is_blacklist:values.type !== "whitelist", is_blacklist:values.type !== "whitelist",
is_case_sensitive: values.is_case_sensitive, is_case_sensitive: !values.is_case_insensitive,
service_id: service, service_id: service,
mode: filter_mode?filter_mode:"B", mode: filter_mode?filter_mode:"B",
regex: b64encode(final_regex) regex: b64encode(final_regex)
@@ -101,8 +101,8 @@ function AddNewRegex({ opened, onClose, service }:{ opened:boolean, onClose:()=>
</Tooltip> </Tooltip>
<Space h="md" /> <Space h="md" />
<Switch <Switch
label="Case sensitive" label="Case insensitive"
{...form.getInputProps('is_case_sensitive', { type: 'checkbox' })} {...form.getInputProps('is_case_insensitive', { type: 'checkbox' })}
/> />
<Space h="md" /> <Space h="md" />
<Switch <Switch

View File

@@ -123,10 +123,10 @@ function ServiceRow({ service, onClick, additional_buttons }:{ service:Service,
<FaStop size="20px" /> <FaStop size="20px" />
</ActionIcon> </ActionIcon>
</Tooltip>: </Tooltip>:
<Tooltip label="Pause service" zIndex={0} transition="pop" transitionDuration={200} /*openDelay={500}*/ transitionTimingFunction="ease" color="red"> <Tooltip label={service.status === "stop"?"Start in pause mode":"Pause service"} zIndex={0} transition="pop" transitionDuration={200} /*openDelay={500}*/ transitionTimingFunction="ease" color={service.status === "stop"?"cyan":"red"}>
<ActionIcon color="red" loading={buttonLoading} <ActionIcon color={service.status === "stop"?"cyan":"red"} loading={buttonLoading}
onClick={pauseService} size="xl" radius="md" variant="filled" onClick={pauseService} size="xl" radius="md" variant="filled"
disabled={service.status === "stop"}> /*disabled={service.status === "stop"}*/>
<FaPause size="20px" /> <FaPause size="20px" />
</ActionIcon> </ActionIcon>
</Tooltip> </Tooltip>