Merge branch 'master' of ssh://gitea.ttstd.com:2222/tt/VibeCoding
# Conflicts: # WebRTCController/app/src/main/res/layout/activity_main.xml
This commit is contained in:
@@ -123,7 +123,7 @@ class _ControllerHomeState extends State<ControllerHome> {
|
||||
return;
|
||||
}
|
||||
|
||||
String selectedType = 'CODE';
|
||||
String selectedType = 'NONE';
|
||||
final valueController = TextEditingController();
|
||||
|
||||
await showCupertinoDialog<void>(
|
||||
@@ -136,6 +136,10 @@ class _ControllerHomeState extends State<ControllerHome> {
|
||||
const SizedBox(height: 12),
|
||||
CupertinoSegmentedControl<String>(
|
||||
children: const {
|
||||
'NONE': Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 8),
|
||||
child: Text('免密连接'),
|
||||
),
|
||||
'CODE': Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 8),
|
||||
child: Text('动态验证码'),
|
||||
@@ -149,12 +153,18 @@ class _ControllerHomeState extends State<ControllerHome> {
|
||||
onValueChanged: (v) => setDialogState(() => selectedType = v),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
CupertinoTextField(
|
||||
controller: valueController,
|
||||
placeholder: '请输入验证码或密码',
|
||||
obscureText: true,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 10),
|
||||
),
|
||||
if (selectedType == 'NONE')
|
||||
const Text(
|
||||
'免密连接:被控端将弹出手动确认对话框,无需输入验证码或密码。',
|
||||
style: TextStyle(fontSize: 13, color: CupertinoColors.systemGrey),
|
||||
)
|
||||
else
|
||||
CupertinoTextField(
|
||||
controller: valueController,
|
||||
placeholder: selectedType == 'PASSWORD' ? '请输入固定密码' : '请输入动态验证码',
|
||||
obscureText: true,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 10),
|
||||
),
|
||||
],
|
||||
),
|
||||
actions: [
|
||||
@@ -166,12 +176,15 @@ class _ControllerHomeState extends State<ControllerHome> {
|
||||
child: const Text('连接'),
|
||||
onPressed: () {
|
||||
final val = valueController.text.trim();
|
||||
if (val.isEmpty) {
|
||||
if (selectedType != 'NONE' && val.isEmpty) {
|
||||
_showAlert('请输入验证码或密码');
|
||||
return;
|
||||
}
|
||||
Navigator.of(ctx).pop();
|
||||
_connect(authType: selectedType, authValue: val);
|
||||
_connect(
|
||||
authType: selectedType,
|
||||
authValue: selectedType == 'NONE' ? '' : val,
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user