feat: add route to services in storage page
This commit is contained in:
parent
a4737e9f05
commit
456574002b
|
@ -95,6 +95,11 @@ class ServerStorageSection extends StatelessWidget {
|
||||||
(final service) => ServerConsumptionListTile(
|
(final service) => ServerConsumptionListTile(
|
||||||
service: service,
|
service: service,
|
||||||
volume: volume,
|
volume: volume,
|
||||||
|
onTap: () {
|
||||||
|
context.pushRoute(
|
||||||
|
ServiceRoute(serviceId: service.id),
|
||||||
|
);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (volume.isResizable) ...[
|
if (volume.isResizable) ...[
|
||||||
|
@ -117,33 +122,38 @@ class ServerConsumptionListTile extends StatelessWidget {
|
||||||
const ServerConsumptionListTile({
|
const ServerConsumptionListTile({
|
||||||
required this.service,
|
required this.service,
|
||||||
required this.volume,
|
required this.volume,
|
||||||
|
required this.onTap,
|
||||||
super.key,
|
super.key,
|
||||||
});
|
});
|
||||||
|
|
||||||
final Service service;
|
final Service service;
|
||||||
final DiskVolume volume;
|
final DiskVolume volume;
|
||||||
|
final VoidCallback onTap;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(final BuildContext context) => Padding(
|
Widget build(BuildContext context) => GestureDetector(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 8),
|
onTap: onTap,
|
||||||
child: ConsumptionListItem(
|
child: Padding(
|
||||||
title: service.displayName,
|
padding: const EdgeInsets.symmetric(vertical: 8),
|
||||||
icon: SvgPicture.string(
|
child: ConsumptionListItem(
|
||||||
service.svgIcon,
|
title: service.displayName,
|
||||||
width: 24.0,
|
icon: SvgPicture.string(
|
||||||
height: 24.0,
|
service.svgIcon,
|
||||||
colorFilter: ColorFilter.mode(
|
width: 24.0,
|
||||||
Theme.of(context).colorScheme.onBackground,
|
height: 24.0,
|
||||||
BlendMode.srcIn,
|
colorFilter: ColorFilter.mode(
|
||||||
|
Theme.of(context).colorScheme.onBackground,
|
||||||
|
BlendMode.srcIn,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
|
rightSideText: service.storageUsage.used.toString(),
|
||||||
|
percentage: service.storageUsage.used.byte / volume.sizeTotal.byte,
|
||||||
|
color: volume.root
|
||||||
|
? Theme.of(context).colorScheme.primary
|
||||||
|
: Theme.of(context).colorScheme.secondary,
|
||||||
|
backgroundColor: Theme.of(context).colorScheme.surfaceVariant,
|
||||||
|
dense: true,
|
||||||
),
|
),
|
||||||
rightSideText: service.storageUsage.used.toString(),
|
|
||||||
percentage: service.storageUsage.used.byte / volume.sizeTotal.byte,
|
|
||||||
color: volume.root
|
|
||||||
? Theme.of(context).colorScheme.primary
|
|
||||||
: Theme.of(context).colorScheme.secondary,
|
|
||||||
backgroundColor: Theme.of(context).colorScheme.surfaceVariant,
|
|
||||||
dense: true,
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue