Minor style tweaks

This commit is contained in:
Haishan 2022-09-10 14:38:32 +08:00
parent b823e60097
commit 310192dd53
4 changed files with 12 additions and 3 deletions

View file

@ -70,3 +70,7 @@
.logPlaceholderIcon { .logPlaceholderIcon {
opacity: 0.3; opacity: 0.3;
} }
.search {
max-width: 1000px;
}

View file

@ -76,7 +76,9 @@ function Logs({ dispatch, logLevel, apiConfig, logs, logStreamingPaused }) {
return ( return (
<div> <div>
<ContentHeader title={t('Logs')} /> <ContentHeader title={t('Logs')} />
<div className={s.search}>
<LogSearch /> <LogSearch />
</div>
<div ref={refLogsContainer} style={{ paddingBottom }}> <div ref={refLogsContainer} style={{ paddingBottom }}>
{logs.length === 0 ? ( {logs.length === 0 ? (
<div className={s.logPlaceholder} style={{ height: containerHeight - paddingBottom }}> <div className={s.logPlaceholder} style={{ height: containerHeight - paddingBottom }}>

View file

@ -37,4 +37,7 @@
top: 50%; top: 50%;
transform: translateY(-50%); transform: translateY(-50%);
left: 10px; left: 10px;
display: flex;
justify-content: center;
align-items: center;
} }

View file

@ -7,7 +7,7 @@ import s0 from './Search.module.scss';
function RuleSearch({ dispatch, searchText, updateSearchText }) { function RuleSearch({ dispatch, searchText, updateSearchText }) {
const [text, setText] = useState(searchText); const [text, setText] = useState(searchText);
const updateSearchTextInternal = useCallback( const updateSearchTextInternal = useCallback(
(v) => { (v: string) => {
dispatch(updateSearchText(v)); dispatch(updateSearchText(v));
}, },
[dispatch, updateSearchText] [dispatch, updateSearchText]
@ -16,7 +16,7 @@ function RuleSearch({ dispatch, searchText, updateSearchText }) {
() => debounce(updateSearchTextInternal, 300), () => debounce(updateSearchTextInternal, 300),
[updateSearchTextInternal] [updateSearchTextInternal]
); );
const onChange = (e) => { const onChange = (e: React.ChangeEvent<HTMLInputElement>) => {
setText(e.target.value); setText(e.target.value);
updateSearchTextDebounced(e.target.value); updateSearchTextDebounced(e.target.value);
}; };