Fix scaling of logos
This commit is contained in:
@@ -7,13 +7,15 @@ import VideoLibrary from '@mui/icons-material/VideoLibrary';
|
||||
import Grid from '@mui/material/Grid2';
|
||||
import React from 'react';
|
||||
|
||||
import { useItemCounts } from 'apps/dashboard/features/metrics/api/useItemCounts';
|
||||
import MetricCard from 'apps/dashboard/features/metrics/components/MetricCard';
|
||||
import globalize from 'lib/globalize';
|
||||
import type { ItemCounts } from '@jellyfin/sdk/lib/generated-client/models/item-counts';
|
||||
|
||||
const ItemCountsWidget = () => {
|
||||
const { data: counts } = useItemCounts();
|
||||
type IProps = {
|
||||
counts?: ItemCounts;
|
||||
};
|
||||
|
||||
const ItemCountsWidget = ({ counts }: IProps) => {
|
||||
return (
|
||||
<Grid
|
||||
container
|
||||
|
||||
@@ -184,7 +184,8 @@ const DeviceCard = ({ device }: IProps) => {
|
||||
src={nowPlayingName.image}
|
||||
style={{
|
||||
maxHeight: '24px',
|
||||
maxWidth: '130px'
|
||||
maxWidth: '130px',
|
||||
alignSelf: 'flex-start'
|
||||
}}
|
||||
alt='Media Icon'
|
||||
/>
|
||||
|
||||
@@ -22,7 +22,8 @@ const getItemCountsQuery = (
|
||||
) => queryOptions({
|
||||
queryKey: [ 'ItemCounts', params ],
|
||||
queryFn: ({ signal }) => fetchItemCounts(api!, params, { signal }),
|
||||
enabled: !!api
|
||||
enabled: !!api,
|
||||
refetchOnWindowFocus: false
|
||||
});
|
||||
|
||||
export const useItemCounts = (
|
||||
|
||||
@@ -19,7 +19,8 @@ const getSystemStorageQuery = (
|
||||
) => queryOptions({
|
||||
queryKey: [ 'SystemStorage' ],
|
||||
queryFn: ({ signal }) => fetchSystemStorage(api!, { signal }),
|
||||
enabled: !!api
|
||||
enabled: !!api,
|
||||
refetchOnWindowFocus: false
|
||||
});
|
||||
|
||||
export const useSystemStorage = () => {
|
||||
|
||||
@@ -25,6 +25,7 @@ import useLiveSessions from '../features/sessions/hooks/useLiveSessions';
|
||||
import { useStartTask } from '../features/tasks/api/useStartTask';
|
||||
import Link from '@mui/material/Link';
|
||||
import ItemCountsWidget from '../components/widgets/ItemCountsWidget';
|
||||
import { useItemCounts } from '../features/metrics/api/useItemCounts';
|
||||
|
||||
export const Component = () => {
|
||||
const theme = useTheme();
|
||||
@@ -67,6 +68,7 @@ export const Component = () => {
|
||||
|
||||
const { data: systemStorage, isPending: isSystemStoragePending } = useSystemStorage();
|
||||
const { data: systemInfo, isPending: isSystemInfoPending } = useSystemInfo();
|
||||
const { data: itemCounts, isPending: isItemCountsPending } = useItemCounts();
|
||||
|
||||
const promptRestart = useCallback(() => {
|
||||
setIsRestartConfirmDialogOpen(true);
|
||||
@@ -105,7 +107,7 @@ export const Component = () => {
|
||||
}, [ shutdownServer ]);
|
||||
|
||||
const isPending = isLogsPending || isAlertsPending || isSystemStoragePending
|
||||
|| isSystemInfoPending || isTasksPending;
|
||||
|| isSystemInfoPending || isTasksPending || isItemCountsPending;
|
||||
|
||||
if (isPending) {
|
||||
return <Loading />;
|
||||
@@ -145,7 +147,7 @@ export const Component = () => {
|
||||
onRestartClick={promptRestart}
|
||||
onShutdownClick={promptShutdown}
|
||||
/>
|
||||
<ItemCountsWidget />
|
||||
<ItemCountsWidget counts={itemCounts} />
|
||||
<RunningTasksWidget tasks={tasks} />
|
||||
<DevicesWidget devices={devices} />
|
||||
</Stack>
|
||||
|
||||
Reference in New Issue
Block a user