mirror of
https://github.com/JGeek00/adguard-home-manager.git
synced 2025-05-04 20:30:35 +00:00
Added top upstreams and average processing time
This commit is contained in:
parent
28229311c0
commit
07bd3dcb9a
15 changed files with 441 additions and 188 deletions
|
@ -32,8 +32,11 @@ class _HomeState extends State<Home> {
|
|||
late bool isVisible;
|
||||
|
||||
@override
|
||||
initState(){
|
||||
Provider.of<StatusProvider>(context, listen: false).getServerStatus();
|
||||
initState() {
|
||||
final statusProvider = Provider.of<StatusProvider>(context, listen: false);
|
||||
statusProvider.getServerStatus(
|
||||
withLoadingIndicator: statusProvider.serverStatus != null ? false : true
|
||||
);
|
||||
|
||||
super.initState();
|
||||
|
||||
|
@ -239,9 +242,9 @@ class TopItemsLists extends StatelessWidget {
|
|||
final List<HomeTopItems> order;
|
||||
|
||||
const TopItemsLists({
|
||||
Key? key,
|
||||
super.key,
|
||||
required this.order,
|
||||
}) : super(key: key);
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
@ -266,8 +269,7 @@ class TopItemsLists extends StatelessWidget {
|
|||
children: [
|
||||
TopItems(
|
||||
label: AppLocalizations.of(context)!.topQueriedDomains,
|
||||
data: statusProvider.serverStatus!.stats.topQueriedDomains,
|
||||
type: 'topQueriedDomains',
|
||||
type: HomeTopItems.queriedDomains,
|
||||
),
|
||||
if (item.key < order.length - 1) ...bottom
|
||||
],
|
||||
|
@ -278,8 +280,7 @@ class TopItemsLists extends StatelessWidget {
|
|||
children: [
|
||||
TopItems(
|
||||
label: AppLocalizations.of(context)!.topBlockedDomains,
|
||||
data: statusProvider.serverStatus!.stats.topBlockedDomains,
|
||||
type: 'topBlockedDomains',
|
||||
type: HomeTopItems.blockedDomains,
|
||||
),
|
||||
if (item.key < order.length - 1) ...bottom
|
||||
],
|
||||
|
@ -290,13 +291,37 @@ class TopItemsLists extends StatelessWidget {
|
|||
children: [
|
||||
TopItems(
|
||||
label: AppLocalizations.of(context)!.topClients,
|
||||
data: statusProvider.serverStatus!.stats.topClients,
|
||||
type: 'topClients',
|
||||
clients: true,
|
||||
type: HomeTopItems.recurrentClients,
|
||||
),
|
||||
if (item.key < order.length - 1) ...bottom
|
||||
],
|
||||
);
|
||||
|
||||
case HomeTopItems.topUpstreams:
|
||||
return statusProvider.serverStatus!.stats.topUpstreamResponses != null
|
||||
? Column(
|
||||
children: [
|
||||
TopItems(
|
||||
label: AppLocalizations.of(context)!.topUpstreams,
|
||||
type: HomeTopItems.topUpstreams,
|
||||
),
|
||||
if (item.key < order.length - 1) ...bottom
|
||||
],
|
||||
)
|
||||
: const SizedBox();
|
||||
|
||||
case HomeTopItems.avgUpstreamResponseTime:
|
||||
return statusProvider.serverStatus!.stats.topUpstreamsAvgTime != null
|
||||
? Column(
|
||||
children: [
|
||||
TopItems(
|
||||
label: AppLocalizations.of(context)!.averageUpstreamResponseTime,
|
||||
type: HomeTopItems.avgUpstreamResponseTime,
|
||||
),
|
||||
if (item.key < order.length - 1) ...bottom
|
||||
],
|
||||
)
|
||||
: const SizedBox();
|
||||
|
||||
default:
|
||||
return const SizedBox();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue