Исправлена страница Дашборда ННБ

This commit is contained in:
goodmice 2022-12-28 12:19:46 +05:00
parent e9cc5f14e7
commit 0f2251b8d0
No known key found for this signature in database
GPG Key ID: EA4AA16454AC96C8
4 changed files with 19 additions and 10 deletions

View File

@ -28,9 +28,9 @@ export const defaultSettings: WidgetSettings = {
label: 'Виджет', label: 'Виджет',
formatter: defaultFormatter, formatter: defaultFormatter,
labelColor: '#000000', labelColor: '#FFFFFF',
valueColor: '#000000', valueColor: '#FFFFFF',
backgroundColor: '#f6f6f6', backgroundColor: '#2F2F2F',
unitColor: '#a0a0a0', unitColor: '#a0a0a0',
} }

View File

@ -118,15 +118,16 @@ const DashboardNNB = memo(({ enableEditing = false }) => {
const navigate = useNavigate() const navigate = useNavigate()
const selectedGroup = getTabname() const selectedGroup = getTabname()
if (!selectedGroup && groups?.length > 0)
navigate(`${rootPath}/${groups[0].id}`)
const group = useMemo(() => ({ const group = useMemo(() => ({
editable: true, editable: true,
...groups.find(({ id }) => `${id}` === selectedGroup), ...groups.find(({ id }) => `${id}` === selectedGroup),
}), [groups, selectedGroup]) }), [groups, selectedGroup])
useEffect(() => {
if (!selectedGroup && groups?.length > 0)
navigate(`${rootPath}/${groups[0].id}`)
}, [selectedGroup, groups, rootPath, navigate])
useEffect(() => { useEffect(() => {
invokeWebApiWrapperAsync( invokeWebApiWrapperAsync(
async () => { async () => {
@ -249,7 +250,7 @@ const DashboardNNB = memo(({ enableEditing = false }) => {
/> />
))} ))}
<WidgetSettingsWindow <WidgetSettingsWindow
visible={!!selectedSettings} open={!!selectedSettings}
onCancel={() => setSelectedSettings(null)} onCancel={() => setSelectedSettings(null)}
settings={selectedSettings} settings={selectedSettings}
onEdit={onEdit} onEdit={onEdit}

View File

@ -68,3 +68,11 @@
@alert-error-border-color: @error; @alert-error-border-color: @error;
@alert-error-bg-color: darken(@error, 20%); @alert-error-bg-color: darken(@error, 20%);
@alert-error-icon-color: @error; @alert-error-icon-color: @error;
.ant-menu-item:active, .ant-menu-submenu-title:active {
background-color: darken(@primary, 10%);
}
.ant-menu:not(.ant-menu-horizontal) .ant-menu-item-selected {
background-color: @primary;
}

View File

@ -7,8 +7,8 @@
align-items: stretch; align-items: stretch;
margin: 10px; margin: 10px;
padding: 5px 10px; padding: 5px 10px;
border-radius: 5px; border-radius: 6px;
background: #00000009; background: #2F2F2F;
height: @size; height: @size;
min-width: @size * 1.75; min-width: @size * 1.75;