new: remember pwd in mem

This commit is contained in:
lollipopkit
2024-03-10 19:15:24 -06:00
parent 5e9f0bf8a1
commit f187bc6ccf
17 changed files with 62 additions and 8 deletions

View File

@@ -261,6 +261,7 @@ class _ServerPageState extends State<ServerPage>
srv.client?.execWithPwd(
ShellFunc.suspend.exec,
context: context,
id: srv.id,
);
},
typ: l10n.suspend,
@@ -274,6 +275,7 @@ class _ServerPageState extends State<ServerPage>
func: () => srv.client?.execWithPwd(
ShellFunc.shutdown.exec,
context: context,
id: srv.id,
),
typ: l10n.shutdown,
name: srv.spi.name,
@@ -286,6 +288,7 @@ class _ServerPageState extends State<ServerPage>
func: () => srv.client?.execWithPwd(
ShellFunc.reboot.exec,
context: context,
id: srv.id,
),
typ: l10n.reboot,
name: srv.spi.name,

View File

@@ -1048,6 +1048,7 @@ class _SettingPageState extends State<SettingPage> {
return ExpandTile(
title: Text(l10n.more),
children: [
_buildRememberPwdInMem(),
_buildTextScaler(),
_buildPreferTemperatureDeviceList(),
_buildKeepStatusWhenErr(),
@@ -1081,4 +1082,12 @@ class _SettingPageState extends State<SettingPage> {
},
);
}
Widget _buildRememberPwdInMem() {
return ListTile(
title: Text(l10n.rememberPwdInMem),
subtitle: Text(l10n.rememberPwdInMemTip, style: UIs.textGrey),
trailing: StoreSwitch(prop: _setting.rememberPwdInMem),
);
}
}

View File

@@ -245,7 +245,11 @@ Future<void> _onPkg(BuildContext context, ServerPrivateInfo spi) async {
fn: () async {
final updateCmd = pkg.update;
if (updateCmd != null) {
await client.execWithPwd(updateCmd, context: context);
await client.execWithPwd(
updateCmd,
context: context,
id: spi.id,
);
}
},
barrierDismiss: true,