diff --git a/client/src/components/Logs/Filters/Form.tsx b/client/src/components/Logs/Filters/Form.tsx
index 3714f308..634a6a5d 100644
--- a/client/src/components/Logs/Filters/Form.tsx
+++ b/client/src/components/Logs/Filters/Form.tsx
@@ -6,6 +6,8 @@ import { useDispatch } from 'react-redux';
import { useHistory } from 'react-router-dom';
import classNames from 'classnames';
import { useFormContext } from 'react-hook-form';
+import queryString from 'query-string';
+
import {
DEBOUNCE_FILTER_TIMEOUT,
DEFAULT_LOGS_FILTER,
@@ -54,9 +56,17 @@ export const Form = ({ className, setIsLoading }: Props) => {
}
}, [responseStatusValue, setValue]);
+ useEffect(() => {
+ const { search: searchUrlParam } = queryString.parse(history.location.search);
+
+ if (searchUrlParam !== searchValue) {
+ setValue('search', searchUrlParam ? searchUrlParam.toString() : '');
+ }
+ }, [history.location.search]);
+
const onInputClear = async () => {
setIsLoading(true);
- setValue('search', DEFAULT_LOGS_FILTER.search);
+ history.push(getLogsUrlParams(DEFAULT_LOGS_FILTER.search, responseStatusValue));
setIsLoading(false);
};
@@ -74,6 +84,7 @@ export const Form = ({ className, setIsLoading }: Props) => {
}}>
setValue('search', val)}
onKeyDown={onEnterPress}
diff --git a/client/src/components/Logs/Logs.css b/client/src/components/Logs/Logs.css
index 8ab03da9..3714a06e 100644
--- a/client/src/components/Logs/Logs.css
+++ b/client/src/components/Logs/Logs.css
@@ -337,7 +337,8 @@
}
.button-action--arrow-option:disabled {
- display: none;
+ opacity: 0.5;
+ cursor: default;
}
.tooltip-custom__container .button-action--arrow-option {
diff --git a/client/src/components/Settings/Dns/Cache/Form.tsx b/client/src/components/Settings/Dns/Cache/Form.tsx
index aea6a299..62323e2d 100644
--- a/client/src/components/Settings/Dns/Cache/Form.tsx
+++ b/client/src/components/Settings/Dns/Cache/Form.tsx
@@ -32,6 +32,7 @@ const INPUTS_FIELDS = [
];
type FormData = {
+ cache_enabled: boolean;
cache_size: number;
cache_ttl_min: number;
cache_ttl_max: number;
@@ -54,10 +55,11 @@ const Form = ({ initialValues, onSubmit }: CacheFormProps) => {
handleSubmit,
watch,
control,
- formState: { isSubmitting, isDirty },
+ formState: { isSubmitting },
} = useForm({
mode: 'onBlur',
defaultValues: {
+ cache_enabled: initialValues?.cache_enabled || false,
cache_size: initialValues?.cache_size || 0,
cache_ttl_min: initialValues?.cache_ttl_min || 0,
cache_ttl_max: initialValues?.cache_ttl_max || 0,
@@ -65,10 +67,13 @@ const Form = ({ initialValues, onSubmit }: CacheFormProps) => {
},
});
+ const cache_enabled = watch('cache_enabled');
+ const cache_size = watch('cache_size');
const cache_ttl_min = watch('cache_ttl_min');
const cache_ttl_max = watch('cache_ttl_max');
const minExceedsMax = cache_ttl_min > 0 && cache_ttl_max > 0 && cache_ttl_min > cache_ttl_max;
+ const cacheSizeZeroWhenEnabled = cache_enabled && cache_size === 0;
const handleClearCache = () => {
if (window.confirm(t('confirm_dns_cache_clear'))) {
@@ -79,6 +84,24 @@ const Form = ({ initialValues, onSubmit }: CacheFormProps) => {
return (