add wrapper for min modifications
Signed-off-by: dignow <linlong1265@gmail.com>
This commit is contained in:
parent
b80051bb35
commit
dfd5ea8a7f
@ -525,6 +525,8 @@ class _SafetyState extends State<_Safety> with AutomaticKeepAliveClientMixin {
|
||||
|
||||
Widget permissions(context) {
|
||||
bool enabled = !locked;
|
||||
// Simple temp wrapper for PR check
|
||||
tmpWrapper() {
|
||||
String accessMode = bind.mainGetOptionSync(key: 'access-mode');
|
||||
_AccessMode mode;
|
||||
if (accessMode == 'full') {
|
||||
@ -596,6 +598,9 @@ class _SafetyState extends State<_Safety> with AutomaticKeepAliveClientMixin {
|
||||
]);
|
||||
}
|
||||
|
||||
return tmpWrapper();
|
||||
}
|
||||
|
||||
Widget password(BuildContext context) {
|
||||
return ChangeNotifierProvider.value(
|
||||
value: gFFI.serverModel,
|
||||
@ -752,6 +757,8 @@ class _SafetyState extends State<_Safety> with AutomaticKeepAliveClientMixin {
|
||||
_OptionCheckBox(context, 'Enable Direct IP Access', 'direct-server',
|
||||
update: update, enabled: !locked),
|
||||
() {
|
||||
// Simple temp wrapper for PR check
|
||||
tmpWrapper() {
|
||||
bool enabled = option2bool(
|
||||
'direct-server', bind.mainGetOptionSync(key: 'direct-server'));
|
||||
if (!enabled) applyEnabled.value = false;
|
||||
@ -796,16 +803,22 @@ class _SafetyState extends State<_Safety> with AutomaticKeepAliveClientMixin {
|
||||
enabled: enabled && !locked,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return tmpWrapper();
|
||||
}(),
|
||||
];
|
||||
}
|
||||
|
||||
Widget whitelist() {
|
||||
bool enabled = !locked;
|
||||
// Simple temp wrapper for PR check
|
||||
tmpWrapper() {
|
||||
RxBool hasWhitelist =
|
||||
bind.mainGetOptionSync(key: 'whitelist').isNotEmpty.obs;
|
||||
update() async {
|
||||
hasWhitelist.value = bind.mainGetOptionSync(key: 'whitelist').isNotEmpty;
|
||||
hasWhitelist.value =
|
||||
bind.mainGetOptionSync(key: 'whitelist').isNotEmpty;
|
||||
}
|
||||
|
||||
onChanged(bool? checked) async {
|
||||
@ -830,7 +843,8 @@ class _SafetyState extends State<_Safety> with AutomaticKeepAliveClientMixin {
|
||||
Expanded(
|
||||
child: Text(
|
||||
translate('Use IP Whitelisting'),
|
||||
style: TextStyle(color: _disabledTextColor(context, enabled)),
|
||||
style:
|
||||
TextStyle(color: _disabledTextColor(context, enabled)),
|
||||
))
|
||||
],
|
||||
)),
|
||||
@ -841,6 +855,9 @@ class _SafetyState extends State<_Safety> with AutomaticKeepAliveClientMixin {
|
||||
).marginOnly(left: _kCheckBoxLeftMargin);
|
||||
}
|
||||
|
||||
return tmpWrapper();
|
||||
}
|
||||
|
||||
Widget hide_cm(bool enabled) {
|
||||
return ChangeNotifierProvider.value(
|
||||
value: gFFI.serverModel,
|
||||
@ -923,6 +940,8 @@ class _NetworkState extends State<_Network> with AutomaticKeepAliveClientMixin {
|
||||
}
|
||||
|
||||
server(bool enabled) {
|
||||
// Simple temp wrapper for PR check
|
||||
tmpWrapper() {
|
||||
// Setting page is not modal, oldOptions should only be used when getting options, never when setting.
|
||||
Map<String, dynamic> oldOptions =
|
||||
jsonDecode(bind.mainGetOptionsSync() as String);
|
||||
@ -1055,11 +1074,12 @@ class _NetworkState extends State<_Network> with AutomaticKeepAliveClientMixin {
|
||||
children: [
|
||||
Obx(() => _LabeledTextField(context, 'ID Server', idController,
|
||||
idErrMsg.value, enabled, secure)),
|
||||
Obx(() => _LabeledTextField(context, 'Relay Server', relayController,
|
||||
relayErrMsg.value, enabled, secure)),
|
||||
Obx(() => _LabeledTextField(context, 'Relay Server',
|
||||
relayController, relayErrMsg.value, enabled, secure)),
|
||||
Obx(() => _LabeledTextField(context, 'API Server', apiController,
|
||||
apiErrMsg.value, enabled, secure)),
|
||||
_LabeledTextField(context, 'Key', keyController, '', enabled, secure),
|
||||
_LabeledTextField(
|
||||
context, 'Key', keyController, '', enabled, secure),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [_Button('Apply', submit, enabled: enabled)],
|
||||
@ -1068,6 +1088,9 @@ class _NetworkState extends State<_Network> with AutomaticKeepAliveClientMixin {
|
||||
)
|
||||
]);
|
||||
}
|
||||
|
||||
return tmpWrapper();
|
||||
}
|
||||
}
|
||||
|
||||
class _Display extends StatefulWidget {
|
||||
|
Loading…
x
Reference in New Issue
Block a user