mirror of
https://git.sr.ht/~ashkeel/strimertul
synced 2024-09-18 01:50:50 +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,6 +82,7 @@ const LevelToggle = styled(MultiToggleItem, {
|
|||
info: {},
|
||||
warn: {
|
||||
backgroundColor: '$yellow4',
|
||||
'&:not(:disabled)': {
|
||||
'&:hover': {
|
||||
backgroundColor: '$yellow5',
|
||||
},
|
||||
|
@ -89,8 +90,10 @@ const LevelToggle = styled(MultiToggleItem, {
|
|||
backgroundColor: '$yellow8',
|
||||
},
|
||||
},
|
||||
},
|
||||
error: {
|
||||
backgroundColor: '$red4',
|
||||
'&:not(:disabled)': {
|
||||
'&:hover': {
|
||||
backgroundColor: '$red5',
|
||||
},
|
||||
|
@ -100,6 +103,7 @@ const LevelToggle = styled(MultiToggleItem, {
|
|||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
interface LogItemProps {
|
||||
|
@ -289,14 +293,14 @@ const LogEntriesContainer = styled('div', {
|
|||
});
|
||||
|
||||
interface LogDialogProps {
|
||||
initialFilter: LogLevel;
|
||||
initialFilter: LogLevel[];
|
||||
}
|
||||
|
||||
function LogDialog({ initialFilter }: LogDialogProps) {
|
||||
const logEntries = useSelector((state: RootState) => state.logging.messages);
|
||||
const [filter, setFilter] = useState({
|
||||
...emptyFilter,
|
||||
[initialFilter]: true,
|
||||
...Object.fromEntries(initialFilter.map((f) => [f, true])),
|
||||
});
|
||||
const { t } = useTranslation();
|
||||
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>
|
||||
</div>
|
||||
);
|
||||
|
|
|
@ -272,7 +272,7 @@ export const MultiToggleItem = styled(ToggleGroup.Item, {
|
|||
},
|
||||
"&[data-state='on']": {
|
||||
...button['&:not(:disabled)']['&:active'],
|
||||
background: '$gray8',
|
||||
backgroundColor: '$gray8',
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue