mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 23:34:24 +01:00
new: customCmds tips
This commit is contained in:
@@ -14,10 +14,8 @@ import 'package:toolbox/core/utils/sync/icloud.dart';
|
||||
import 'package:toolbox/core/utils/platform/base.dart';
|
||||
import 'package:toolbox/core/utils/share.dart';
|
||||
import 'package:toolbox/core/utils/sync/webdav.dart';
|
||||
import 'package:toolbox/core/utils/ui.dart';
|
||||
import 'package:toolbox/data/model/app/backup.dart';
|
||||
import 'package:toolbox/data/model/server/server_private_info.dart';
|
||||
import 'package:toolbox/data/res/color.dart';
|
||||
import 'package:toolbox/data/res/logger.dart';
|
||||
import 'package:toolbox/data/res/path.dart';
|
||||
import 'package:toolbox/data/res/store.dart';
|
||||
@@ -27,6 +25,7 @@ import 'package:toolbox/view/widget/appbar.dart';
|
||||
import 'package:toolbox/view/widget/expand_tile.dart';
|
||||
import 'package:toolbox/view/widget/cardx.dart';
|
||||
import 'package:toolbox/view/widget/input_field.dart';
|
||||
import 'package:toolbox/view/widget/markdown.dart';
|
||||
import 'package:toolbox/view/widget/store_switch.dart';
|
||||
|
||||
class BackupPage extends StatelessWidget {
|
||||
@@ -225,15 +224,11 @@ class BackupPage extends StatelessWidget {
|
||||
return CardX(
|
||||
child: ListTile(
|
||||
title: Text(l10n.bulkImportServers),
|
||||
subtitle: MarkdownBody(
|
||||
subtitle: SimpleMarkdown(
|
||||
data: l10n.bulkImportServersTip(Urls.appWiki),
|
||||
styleSheet: MarkdownStyleSheet(
|
||||
p: UIs.textGrey,
|
||||
a: TextStyle(color: primaryColor),
|
||||
),
|
||||
onTapLink: (text, href, title) {
|
||||
if (href != null) openUrl(href);
|
||||
},
|
||||
),
|
||||
leading: const Icon(Icons.import_export),
|
||||
onTap: () => _onBulkImportServers(context),
|
||||
|
||||
@@ -3,7 +3,6 @@ import 'dart:convert';
|
||||
import 'package:after_layout/after_layout.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
import 'package:flutter_markdown/flutter_markdown.dart';
|
||||
import 'package:get_it/get_it.dart';
|
||||
import 'package:toolbox/core/channel/bg_run.dart';
|
||||
import 'package:toolbox/core/channel/home_widget.dart';
|
||||
@@ -13,11 +12,11 @@ import 'package:toolbox/core/persistant_store.dart';
|
||||
import 'package:toolbox/core/update.dart';
|
||||
import 'package:toolbox/core/utils/platform/auth.dart';
|
||||
import 'package:toolbox/core/utils/platform/base.dart';
|
||||
import 'package:toolbox/data/res/color.dart';
|
||||
import 'package:toolbox/data/res/github_id.dart';
|
||||
import 'package:toolbox/data/res/logger.dart';
|
||||
import 'package:toolbox/data/res/provider.dart';
|
||||
import 'package:toolbox/data/res/store.dart';
|
||||
import 'package:toolbox/view/widget/markdown.dart';
|
||||
|
||||
import '../../core/route.dart';
|
||||
import '../../core/utils/ui.dart';
|
||||
@@ -47,6 +46,7 @@ class _HomePageState extends State<HomePage>
|
||||
final _selectIndex = ValueNotifier(0);
|
||||
|
||||
bool _switchingPage = false;
|
||||
bool _shouldAuth = false;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@@ -82,13 +82,16 @@ class _HomePageState extends State<HomePage>
|
||||
|
||||
switch (state) {
|
||||
case AppLifecycleState.resumed:
|
||||
if (_shouldAuth) {
|
||||
BioAuth.go().then((_) => _shouldAuth = false);
|
||||
}
|
||||
if (!Pros.server.isAutoRefreshOn) {
|
||||
Pros.server.startAutoRefresh();
|
||||
}
|
||||
HomeWidgetMC.update();
|
||||
break;
|
||||
case AppLifecycleState.paused:
|
||||
BioAuth.go();
|
||||
_shouldAuth = true;
|
||||
// Keep running in background on Android device
|
||||
if (isAndroid && Stores.setting.bgRun.fetch()) {
|
||||
// Keep this if statement single
|
||||
@@ -271,13 +274,7 @@ class _HomePageState extends State<HomePage>
|
||||
return SingleChildScrollView(
|
||||
child: SizedBox(
|
||||
width: MediaQuery.of(context).size.width * 0.8,
|
||||
child: MarkdownBody(
|
||||
styleSheet: MarkdownStyleSheet(a: TextStyle(color: primaryColor)),
|
||||
onTapLink: (text, href, title) {
|
||||
if (href != null) {
|
||||
openUrl(href);
|
||||
}
|
||||
},
|
||||
child: SimpleMarkdown(
|
||||
data: '''
|
||||
${l10n.madeWithLove('[lollipopkit](${Urls.myGithub})')}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:icons_plus/icons_plus.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:toolbox/core/extension/context/common.dart';
|
||||
import 'package:toolbox/core/extension/context/dialog.dart';
|
||||
@@ -8,6 +9,7 @@ import 'package:toolbox/core/extension/context/locale.dart';
|
||||
import 'package:toolbox/core/extension/context/snackbar.dart';
|
||||
import 'package:toolbox/core/extension/stringx.dart';
|
||||
import 'package:toolbox/core/extension/widget.dart';
|
||||
import 'package:toolbox/core/utils/ui.dart';
|
||||
import 'package:toolbox/data/model/app/shell_func.dart';
|
||||
import 'package:toolbox/data/model/server/custom.dart';
|
||||
import 'package:toolbox/data/res/provider.dart';
|
||||
@@ -198,7 +200,7 @@ class _ServerEditPageState extends State<ServerEditPage> {
|
||||
onSubmitted: (_) => _focusScope.requestFocus(_ipFocus),
|
||||
hint: l10n.exampleName,
|
||||
label: l10n.name,
|
||||
icon: Icons.info,
|
||||
icon: BoxIcons.bx_rename,
|
||||
obscureText: false,
|
||||
autoCorrect: true,
|
||||
suggestiion: true,
|
||||
@@ -209,7 +211,7 @@ class _ServerEditPageState extends State<ServerEditPage> {
|
||||
onSubmitted: (_) => _focusScope.requestFocus(_portFocus),
|
||||
node: _ipFocus,
|
||||
label: l10n.host,
|
||||
icon: Icons.computer,
|
||||
icon: BoxIcons.bx_server,
|
||||
hint: 'example.com',
|
||||
),
|
||||
Input(
|
||||
@@ -218,7 +220,7 @@ class _ServerEditPageState extends State<ServerEditPage> {
|
||||
node: _portFocus,
|
||||
onSubmitted: (_) => _focusScope.requestFocus(_usernameFocus),
|
||||
label: l10n.port,
|
||||
icon: Icons.format_list_numbered,
|
||||
icon: Bootstrap.number_123,
|
||||
hint: '22',
|
||||
),
|
||||
Input(
|
||||
@@ -235,7 +237,7 @@ class _ServerEditPageState extends State<ServerEditPage> {
|
||||
type: TextInputType.url,
|
||||
node: _alterUrlFocus,
|
||||
label: l10n.alterUrl,
|
||||
icon: Icons.computer,
|
||||
icon: MingCute.link_line,
|
||||
hint: 'user@ip:port',
|
||||
),
|
||||
TagEditor(
|
||||
@@ -361,10 +363,12 @@ class _ServerEditPageState extends State<ServerEditPage> {
|
||||
Input(
|
||||
controller: _pveAddrCtrl,
|
||||
type: TextInputType.url,
|
||||
icon: MingCute.web_line,
|
||||
label: l10n.addr,
|
||||
hint: 'https://example.com:8006',
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(MingCute.certificate_line),
|
||||
title: Text(l10n.ignoreCert),
|
||||
subtitle: Text(l10n.pveIgnoreCertTip, style: UIs.text12Grey),
|
||||
trailing: ListenableBuilder(
|
||||
@@ -382,13 +386,24 @@ class _ServerEditPageState extends State<ServerEditPage> {
|
||||
}
|
||||
|
||||
Widget _buildCustomCmd() {
|
||||
return Input(
|
||||
controller: _customCmdCtrl,
|
||||
type: TextInputType.text,
|
||||
maxLines: 3,
|
||||
label: l10n.customCmd,
|
||||
icon: Icons.code,
|
||||
hint: '{${l10n.customCmdHint}}',
|
||||
return ExpandTile(
|
||||
title: Text(l10n.customCmd),
|
||||
children: [
|
||||
Input(
|
||||
controller: _customCmdCtrl,
|
||||
type: TextInputType.text,
|
||||
maxLines: 3,
|
||||
label: 'Json',
|
||||
icon: Icons.code,
|
||||
hint: '{${l10n.customCmdHint}}',
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(MingCute.doc_line),
|
||||
title: Text(l10n.doc),
|
||||
trailing: const Icon(Icons.open_in_new, size: 17),
|
||||
onTap: () => openUrl(l10n.customCmdDocUrl),
|
||||
).card,
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ import 'package:toolbox/core/extension/context/snackbar.dart';
|
||||
import 'package:toolbox/data/res/provider.dart';
|
||||
import 'package:toolbox/view/widget/cardx.dart';
|
||||
import 'package:toolbox/view/widget/input_field.dart';
|
||||
import 'package:toolbox/view/widget/markdown.dart';
|
||||
|
||||
import '../../../data/model/server/snippet.dart';
|
||||
import '../../../data/res/ui.dart';
|
||||
@@ -196,7 +197,7 @@ class _SnippetEditPageState extends State<SnippetEditPage>
|
||||
return CardX(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(13),
|
||||
child: MarkdownBody(
|
||||
child: SimpleMarkdown(
|
||||
data: '''
|
||||
📌 ${l10n.supportFmtArgs}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user