mirror of
https://github.com/JGeek00/adguard-home-manager.git
synced 2025-05-04 20:30:35 +00:00
Change order home and fixes
This commit is contained in:
parent
520a14fcda
commit
d69da88b01
3 changed files with 122 additions and 80 deletions
|
@ -175,88 +175,107 @@ class _HomeState extends State<Home> {
|
|||
child: CombinedHomeChart(),
|
||||
),
|
||||
|
||||
if (width <= 700) ...[
|
||||
TopItems(
|
||||
label: AppLocalizations.of(context)!.topQueriedDomains,
|
||||
data: statusProvider.serverStatus!.stats.topQueriedDomains,
|
||||
type: 'topQueriedDomains',
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Divider(
|
||||
thickness: 1,
|
||||
color: Theme.of(context).colorScheme.onSurface.withOpacity(0.2),
|
||||
),
|
||||
),
|
||||
|
||||
const SizedBox(height: 16),
|
||||
|
||||
TopItems(
|
||||
label: AppLocalizations.of(context)!.topBlockedDomains,
|
||||
data: statusProvider.serverStatus!.stats.topBlockedDomains,
|
||||
type: 'topBlockedDomains',
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Divider(
|
||||
thickness: 1,
|
||||
color: Theme.of(context).colorScheme.onSurface.withOpacity(0.2),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
|
||||
TopItems(
|
||||
label: AppLocalizations.of(context)!.topClients,
|
||||
data: statusProvider.serverStatus!.stats.topClients,
|
||||
type: 'topClients',
|
||||
clients: true,
|
||||
),
|
||||
],
|
||||
if (width <= 700) ...appConfigProvider.homeTopItemsOrder.asMap().entries.map((item) {
|
||||
Widget list() {
|
||||
switch (item.value) {
|
||||
case HomeTopItems.queriedDomains:
|
||||
return TopItems(
|
||||
label: AppLocalizations.of(context)!.topQueriedDomains,
|
||||
data: statusProvider.serverStatus!.stats.topQueriedDomains,
|
||||
type: 'topQueriedDomains',
|
||||
);
|
||||
|
||||
case HomeTopItems.blockedDomains:
|
||||
return TopItems(
|
||||
label: AppLocalizations.of(context)!.topBlockedDomains,
|
||||
data: statusProvider.serverStatus!.stats.topBlockedDomains,
|
||||
type: 'topBlockedDomains',
|
||||
);
|
||||
|
||||
case HomeTopItems.recurrentClients:
|
||||
return TopItems(
|
||||
label: AppLocalizations.of(context)!.topClients,
|
||||
data: statusProvider.serverStatus!.stats.topClients,
|
||||
type: 'topClients',
|
||||
clients: true,
|
||||
);
|
||||
|
||||
default:
|
||||
return const SizedBox();
|
||||
}
|
||||
}
|
||||
|
||||
return Column(
|
||||
children: [
|
||||
list(),
|
||||
if (item.key < appConfigProvider.homeTopItemsOrder.length - 1) ...[
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Divider(
|
||||
thickness: 1,
|
||||
color: Theme.of(context).colorScheme.onSurface.withOpacity(0.2),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
]
|
||||
],
|
||||
);
|
||||
}),
|
||||
if (width > 700) Column(
|
||||
children: [
|
||||
Wrap(
|
||||
alignment: WrapAlignment.center,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 16),
|
||||
child: ConstrainedBox(
|
||||
constraints: const BoxConstraints(
|
||||
maxWidth: 500
|
||||
),
|
||||
child: TopItems(
|
||||
label: AppLocalizations.of(context)!.topQueriedDomains,
|
||||
data: statusProvider.serverStatus!.stats.topQueriedDomains,
|
||||
type: 'topQueriedDomains',
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 16),
|
||||
child: ConstrainedBox(
|
||||
constraints: const BoxConstraints(
|
||||
maxWidth: 500
|
||||
),
|
||||
child: TopItems(
|
||||
label: AppLocalizations.of(context)!.topBlockedDomains,
|
||||
data: statusProvider.serverStatus!.stats.topBlockedDomains,
|
||||
type: 'topBlockedDomains',
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 16),
|
||||
child: ConstrainedBox(
|
||||
constraints: const BoxConstraints(
|
||||
maxWidth: 500
|
||||
),
|
||||
child: TopItems(
|
||||
label: AppLocalizations.of(context)!.topClients,
|
||||
data: statusProvider.serverStatus!.stats.topClients,
|
||||
type: 'topClients',
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
children: appConfigProvider.homeTopItemsOrder.map((item) {
|
||||
switch (item) {
|
||||
case HomeTopItems.queriedDomains:
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(bottom: 16),
|
||||
child: ConstrainedBox(
|
||||
constraints: const BoxConstraints(
|
||||
maxWidth: 500
|
||||
),
|
||||
child: TopItems(
|
||||
label: AppLocalizations.of(context)!.topQueriedDomains,
|
||||
data: statusProvider.serverStatus!.stats.topQueriedDomains,
|
||||
type: 'topQueriedDomains',
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
case HomeTopItems.blockedDomains:
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(bottom: 16),
|
||||
child: ConstrainedBox(
|
||||
constraints: const BoxConstraints(
|
||||
maxWidth: 500
|
||||
),
|
||||
child: TopItems(
|
||||
label: AppLocalizations.of(context)!.topBlockedDomains,
|
||||
data: statusProvider.serverStatus!.stats.topBlockedDomains,
|
||||
type: 'topBlockedDomains',
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
case HomeTopItems.recurrentClients:
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(bottom: 16),
|
||||
child: ConstrainedBox(
|
||||
constraints: const BoxConstraints(
|
||||
maxWidth: 500
|
||||
),
|
||||
child: TopItems(
|
||||
label: AppLocalizations.of(context)!.topClients,
|
||||
data: statusProvider.serverStatus!.stats.topClients,
|
||||
type: 'topClients',
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
default:
|
||||
return const SizedBox();
|
||||
}
|
||||
}).toList(),
|
||||
),
|
||||
],
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue