mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 15:24:35 +01:00
opt.: container asks pwd repeatly
This commit is contained in:
@@ -70,13 +70,16 @@ class ContainerProvider extends ChangeNotifier {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> refresh() async {
|
Future<void> refresh({bool isAuto = false}) async {
|
||||||
var raw = '';
|
|
||||||
|
|
||||||
final sudo =
|
final sudo =
|
||||||
await _requiresSudo() && Stores.setting.containerTrySudo.fetch();
|
await _requiresSudo() && Stores.setting.containerTrySudo.fetch();
|
||||||
|
|
||||||
|
/// If sudo is required and auto refresh is enabled, skip the refresh.
|
||||||
|
/// Or this will ask for pwd again and again.
|
||||||
|
if (sudo && isAuto) return;
|
||||||
final includeStats = Stores.setting.containerParseStat.fetch();
|
final includeStats = Stores.setting.containerParseStat.fetch();
|
||||||
|
|
||||||
|
var raw = '';
|
||||||
final code = await client?.execWithPwd(
|
final code = await client?.execWithPwd(
|
||||||
_wrap(ContainerCmdType.execAll(
|
_wrap(ContainerCmdType.execAll(
|
||||||
type,
|
type,
|
||||||
@@ -264,7 +267,7 @@ enum ContainerCmdType {
|
|||||||
bool includeStats = false,
|
bool includeStats = false,
|
||||||
}) {
|
}) {
|
||||||
return ContainerCmdType.values
|
return ContainerCmdType.values
|
||||||
.map((e) => e.exec(type, sudo: sudo))
|
.map((e) => e.exec(type, sudo: sudo, includeStats: includeStats))
|
||||||
.join(' && echo $seperator && ');
|
.join(' && echo $seperator && ');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -592,7 +592,7 @@ class _ContainerPageState extends State<ContainerPage> {
|
|||||||
Duration(seconds: Stores.setting.serverStatusUpdateInterval.fetch()),
|
Duration(seconds: Stores.setting.serverStatusUpdateInterval.fetch()),
|
||||||
(timer) {
|
(timer) {
|
||||||
if (mounted) {
|
if (mounted) {
|
||||||
_container.refresh();
|
_container.refresh(isAuto: true);
|
||||||
} else {
|
} else {
|
||||||
timer.cancel();
|
timer.cancel();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user