fix: preferTempDev

This commit is contained in:
lollipopkit
2024-04-21 11:57:51 +08:00
parent a0ea95b1c3
commit d94b2a7805
6 changed files with 50 additions and 39 deletions

View File

@@ -10,12 +10,12 @@ final class ServerCustom {
final String? pveAddr;
@HiveField(2, defaultValue: false)
final bool pveIgnoreCert;
@HiveField(3)
final String? preferTempDev;
/// {"title": "cmd"}
@HiveField(3)
final Map<String, String>? cmds;
@HiveField(4)
final String? preferTempDev;
const ServerCustom({
//this.temperature,
@@ -58,4 +58,9 @@ final class ServerCustom {
}
return json;
}
@override
String toString() {
return toJson().toString();
}
}

View File

@@ -20,19 +20,22 @@ class ServerCustomAdapter extends TypeAdapter<ServerCustom> {
pveAddr: fields[1] as String?,
pveIgnoreCert: fields[2] == null ? false : fields[2] as bool,
cmds: (fields[3] as Map?)?.cast<String, String>(),
preferTempDev: fields[4] as String?,
);
}
@override
void write(BinaryWriter writer, ServerCustom obj) {
writer
..writeByte(3)
..writeByte(4)
..writeByte(1)
..write(obj.pveAddr)
..writeByte(2)
..write(obj.pveIgnoreCert)
..writeByte(3)
..write(obj.cmds);
..write(obj.cmds)
..writeByte(4)
..write(obj.preferTempDev);
}
@override

View File

@@ -2,9 +2,9 @@
class BuildData {
static const String name = "ServerBox";
static const int build = 852;
static const int build = 867;
static const String engine = "3.19.5";
static const String buildAt = "2024-04-15 09:41:06";
static const int modifications = 4;
static const int script = 44;
static const String buildAt = "2024-04-21 01:05:20";
static const int modifications = 2;
static const int script = 45;
}

View File

@@ -346,9 +346,9 @@ class _ServerEditPageState extends State<ServerEditPage> {
ListTile(
title: Text(l10n.addPrivateKey),
contentPadding: const EdgeInsets.symmetric(horizontal: 17),
trailing: IconButton(
icon: const Icon(Icons.add),
onPressed: () {},
trailing: const Padding(
padding: EdgeInsets.only(right: 13),
child: Icon(Icons.add),
),
onTap: () => AppRoute.keyEdit().go(context),
),
@@ -457,7 +457,10 @@ class _ServerEditPageState extends State<ServerEditPage> {
.toList();
children.add(ListTile(
title: Text(l10n.clear),
trailing: IconButton(onPressed: () {}, icon: const Icon(Icons.clear)),
trailing: const Padding(
padding: EdgeInsets.only(right: 13),
child: Icon(Icons.clear),
),
onTap: () => _jumpServer.value = null,
contentPadding: const EdgeInsets.symmetric(horizontal: 17),
));
@@ -493,7 +496,7 @@ class _ServerEditPageState extends State<ServerEditPage> {
)
],
);
if (cancel ?? true) {
if (cancel != false) {
return;
}
}
@@ -531,12 +534,12 @@ class _ServerEditPageState extends State<ServerEditPage> {
ip: _ipController.text,
port: int.parse(_portController.text),
user: _usernameController.text,
pwd: _passwordController.text.isEmpty ? null : _passwordController.text,
pwd: _passwordController.text.selfIfNotNullEmpty,
keyId: _keyIdx.value != null
? Pros.key.pkis.elementAt(_keyIdx.value!).id
: null,
tags: _tags,
alterUrl: _altUrlController.text.isEmpty ? null : _altUrlController.text,
alterUrl: _altUrlController.text.selfIfNotNullEmpty,
autoConnect: _autoConnect.value,
jumpId: _jumpServer.value,
custom: custom,