mirror of
https://git.sr.ht/~ashkeel/strimertul
synced 2024-09-20 02:00:49 +00:00
fix: always show log messages with higher severity than chosen one
This commit is contained in:
parent
7b9c773b51
commit
7e7b796450
2 changed files with 22 additions and 14 deletions
|
@ -82,20 +82,24 @@ const LevelToggle = styled(MultiToggleItem, {
|
||||||
info: {},
|
info: {},
|
||||||
warn: {
|
warn: {
|
||||||
backgroundColor: '$yellow4',
|
backgroundColor: '$yellow4',
|
||||||
'&:hover': {
|
'&:not(:disabled)': {
|
||||||
backgroundColor: '$yellow5',
|
'&:hover': {
|
||||||
},
|
backgroundColor: '$yellow5',
|
||||||
"&[data-state='on']": {
|
},
|
||||||
backgroundColor: '$yellow8',
|
"&[data-state='on']": {
|
||||||
|
backgroundColor: '$yellow8',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
error: {
|
error: {
|
||||||
backgroundColor: '$red4',
|
backgroundColor: '$red4',
|
||||||
'&:hover': {
|
'&:not(:disabled)': {
|
||||||
backgroundColor: '$red5',
|
'&:hover': {
|
||||||
},
|
backgroundColor: '$red5',
|
||||||
"&[data-state='on']": {
|
},
|
||||||
backgroundColor: '$red8',
|
"&[data-state='on']": {
|
||||||
|
backgroundColor: '$red8',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -289,14 +293,14 @@ const LogEntriesContainer = styled('div', {
|
||||||
});
|
});
|
||||||
|
|
||||||
interface LogDialogProps {
|
interface LogDialogProps {
|
||||||
initialFilter: LogLevel;
|
initialFilter: LogLevel[];
|
||||||
}
|
}
|
||||||
|
|
||||||
function LogDialog({ initialFilter }: LogDialogProps) {
|
function LogDialog({ initialFilter }: LogDialogProps) {
|
||||||
const logEntries = useSelector((state: RootState) => state.logging.messages);
|
const logEntries = useSelector((state: RootState) => state.logging.messages);
|
||||||
const [filter, setFilter] = useState({
|
const [filter, setFilter] = useState({
|
||||||
...emptyFilter,
|
...emptyFilter,
|
||||||
[initialFilter]: true,
|
...Object.fromEntries(initialFilter.map((f) => [f, true])),
|
||||||
});
|
});
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const enabled = levels.filter((level) => filter[level]);
|
const enabled = levels.filter((level) => filter[level]);
|
||||||
|
@ -413,7 +417,11 @@ function LogViewer() {
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{activeDialog ? <LogDialog initialFilter={activeDialog} /> : null}
|
{activeDialog ? (
|
||||||
|
<LogDialog
|
||||||
|
initialFilter={levels.slice(levels.indexOf(activeDialog))}
|
||||||
|
/>
|
||||||
|
) : null}
|
||||||
</Dialog>
|
</Dialog>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
@ -272,7 +272,7 @@ export const MultiToggleItem = styled(ToggleGroup.Item, {
|
||||||
},
|
},
|
||||||
"&[data-state='on']": {
|
"&[data-state='on']": {
|
||||||
...button['&:not(:disabled)']['&:active'],
|
...button['&:not(:disabled)']['&:active'],
|
||||||
background: '$gray8',
|
backgroundColor: '$gray8',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue