mirror of
https://github.com/JGeek00/adguard-home-manager.git
synced 2025-05-14 14:02:48 +00:00
Added open web admin panel
This commit is contained in:
parent
786b14e9ba
commit
427b87ba55
5 changed files with 39 additions and 2 deletions
|
@ -166,5 +166,6 @@
|
||||||
"generalSettings": "General settings",
|
"generalSettings": "General settings",
|
||||||
"generalSettingsDescription": "Various different settings",
|
"generalSettingsDescription": "Various different settings",
|
||||||
"hideZeroValues": "Hide zero values",
|
"hideZeroValues": "Hide zero values",
|
||||||
"hideZeroValuesDescription": "On homescreen, hide blocks with zero value"
|
"hideZeroValuesDescription": "On homescreen, hide blocks with zero value",
|
||||||
|
"webAdminPanel": "Web admin. panel"
|
||||||
}
|
}
|
|
@ -166,5 +166,6 @@
|
||||||
"generalSettings": "Ajustes generales",
|
"generalSettings": "Ajustes generales",
|
||||||
"generalSettingsDescription": "Varios ajustes generales",
|
"generalSettingsDescription": "Varios ajustes generales",
|
||||||
"hideZeroValues": "Oculta valores a cero",
|
"hideZeroValues": "Oculta valores a cero",
|
||||||
"hideZeroValuesDescription": "En la pantalla de inicio, oculta bloqueos con valor cero"
|
"hideZeroValuesDescription": "En la pantalla de inicio, oculta bloqueos con valor cero",
|
||||||
|
"webAdminPanel": "Panel de admin. web"
|
||||||
}
|
}
|
|
@ -1,6 +1,7 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||||
|
import 'package:flutter_web_browser/flutter_web_browser.dart';
|
||||||
|
|
||||||
import 'package:adguard_home_manager/screens/servers/servers.dart';
|
import 'package:adguard_home_manager/screens/servers/servers.dart';
|
||||||
|
|
||||||
|
@ -24,6 +25,22 @@ class HomeAppBar extends StatelessWidget with PreferredSizeWidget {
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void openWebAdminPanel() {
|
||||||
|
FlutterWebBrowser.openWebPage(
|
||||||
|
url: "${server.connectionMethod}://${server.domain}${server.path ?? ""}${server.port != null ? ':${server.port}' : ""}",
|
||||||
|
customTabsOptions: const CustomTabsOptions(
|
||||||
|
instantAppsEnabled: true,
|
||||||
|
showTitle: true,
|
||||||
|
urlBarHidingEnabled: false,
|
||||||
|
),
|
||||||
|
safariVCOptions: const SafariViewControllerOptions(
|
||||||
|
barCollapsingEnabled: true,
|
||||||
|
dismissButtonStyle: SafariViewControllerDismissButtonStyle.close,
|
||||||
|
modalPresentationCapturesStatusBarAppearance: true,
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return AppBar(
|
return AppBar(
|
||||||
toolbarHeight: 70,
|
toolbarHeight: 70,
|
||||||
title: Padding(
|
title: Padding(
|
||||||
|
@ -80,6 +97,16 @@ class HomeAppBar extends StatelessWidget with PreferredSizeWidget {
|
||||||
Text(AppLocalizations.of(context)!.servers)
|
Text(AppLocalizations.of(context)!.servers)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
if (serversProvider.serverStatus.loadStatus == 1) PopupMenuItem(
|
||||||
|
onTap: openWebAdminPanel,
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
const Icon(Icons.web_rounded),
|
||||||
|
const SizedBox(width: 10),
|
||||||
|
Text(AppLocalizations.of(context)!.webAdminPanel)
|
||||||
|
],
|
||||||
|
),
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
|
@ -226,6 +226,13 @@ packages:
|
||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
version: "0.0.0"
|
||||||
|
flutter_web_browser:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: flutter_web_browser
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "0.17.1"
|
||||||
flutter_web_plugins:
|
flutter_web_plugins:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description: flutter
|
description: flutter
|
||||||
|
|
|
@ -45,6 +45,7 @@ dependencies:
|
||||||
uuid: ^3.0.6
|
uuid: ^3.0.6
|
||||||
expandable: ^5.0.1
|
expandable: ^5.0.1
|
||||||
fl_chart: ^0.55.2
|
fl_chart: ^0.55.2
|
||||||
|
flutter_web_browser: ^0.17.1
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue