mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-18 15:54:35 +01:00
new: settings of containerTrySudo usePodman
This commit is contained in:
@@ -59,7 +59,7 @@ class _ContainerPageState extends State<ContainerPage> {
|
||||
return Scaffold(
|
||||
appBar: CustomAppBar(
|
||||
centerTitle: true,
|
||||
title: TwoLineText(up: 'Container', down: widget.spi.name),
|
||||
title: TwoLineText(up: l10n.container, down: widget.spi.name),
|
||||
actions: [
|
||||
IconButton(
|
||||
onPressed: () async {
|
||||
@@ -358,7 +358,7 @@ class _ContainerPageState extends State<ContainerPage> {
|
||||
|
||||
Future<void> _showEditHostDialog() async {
|
||||
final id = widget.spi.id;
|
||||
final host = Stores.docker.fetch(id);
|
||||
final host = Stores.container.fetch(id);
|
||||
final ctrl = TextEditingController(text: host);
|
||||
await context.showRoundDialog(
|
||||
title: Text(l10n.dockerEditHost),
|
||||
@@ -379,7 +379,7 @@ class _ContainerPageState extends State<ContainerPage> {
|
||||
|
||||
void _onSaveDockerHost(String val) {
|
||||
context.pop();
|
||||
Stores.docker.put(widget.spi.id, val.trim());
|
||||
Stores.container.put(widget.spi.id, val.trim());
|
||||
_container.refresh();
|
||||
}
|
||||
|
||||
|
||||
@@ -120,12 +120,7 @@ class _SettingPageState extends State<SettingPage> {
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
if (!BuildMode.isDebug) return;
|
||||
Stores.docker.box.deleteFromDisk();
|
||||
Stores.server.box.deleteFromDisk();
|
||||
Stores.setting.box.deleteFromDisk();
|
||||
Stores.history.box.deleteFromDisk();
|
||||
Stores.snippet.box.deleteFromDisk();
|
||||
Stores.key.box.deleteFromDisk();
|
||||
Stores.all.map((e) => e.box.deleteFromDisk());
|
||||
exit(0);
|
||||
},
|
||||
child: Text(l10n.ok,
|
||||
@@ -144,6 +139,8 @@ class _SettingPageState extends State<SettingPage> {
|
||||
_buildApp(),
|
||||
_buildTitle(l10n.server),
|
||||
_buildServer(),
|
||||
_buildTitle(l10n.container),
|
||||
_buildContainer(),
|
||||
_buildTitle('SSH'),
|
||||
_buildSSH(),
|
||||
_buildTitle('SFTP'),
|
||||
@@ -180,6 +177,7 @@ class _SettingPageState extends State<SettingPage> {
|
||||
_buildAppColor(),
|
||||
//_buildLaunchPage(),
|
||||
_buildCheckUpdate(),
|
||||
_buildCollapseUI(),
|
||||
];
|
||||
|
||||
/// Platform specific settings
|
||||
@@ -204,7 +202,6 @@ class _SettingPageState extends State<SettingPage> {
|
||||
Widget _buildServer() {
|
||||
return Column(
|
||||
children: [
|
||||
_buildCollapseUI(),
|
||||
_buildServerFuncBtns(),
|
||||
_buildServerSeq(),
|
||||
_buildServerDetailCardSeq(),
|
||||
@@ -219,6 +216,15 @@ class _SettingPageState extends State<SettingPage> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildContainer() {
|
||||
return Column(
|
||||
children: [
|
||||
_buildUsePodman(),
|
||||
_buildContainerTrySudo(),
|
||||
].map((e) => CardX(child: e)).toList(),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildSSH() {
|
||||
return Column(
|
||||
children: [
|
||||
@@ -1136,4 +1142,19 @@ class _SettingPageState extends State<SettingPage> {
|
||||
trailing: StoreSwitch(prop: _setting.collapseUIDefault),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildUsePodman() {
|
||||
return ListTile(
|
||||
title: Text(l10n.usePodmanByDefault),
|
||||
trailing: StoreSwitch(prop: _setting.usePodman),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildContainerTrySudo() {
|
||||
return ListTile(
|
||||
title: Text(l10n.trySudo),
|
||||
subtitle: Text(l10n.containerTrySudoTip, style: UIs.textGrey),
|
||||
trailing: StoreSwitch(prop: _setting.containerTrySudo),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user