fix: ssh virt keys (#260)

This commit is contained in:
lollipopkit
2024-01-29 10:55:33 +08:00
parent d1441fbafe
commit e04fede462
6 changed files with 39 additions and 31 deletions

View File

@@ -2,9 +2,9 @@
class BuildData {
static const String name = "ServerBox";
static const int build = 726;
static const int build = 729;
static const String engine = "3.16.8";
static const String buildAt = "2024-01-27 23:32:47";
static const int modifications = 3;
static const String buildAt = "2024-01-28 23:13:08";
static const int modifications = 5;
static const int script = 36;
}

View File

@@ -33,8 +33,10 @@ class _ServerDetailOrderPageState extends State<ServerFuncBtnsOrderPage> {
for (final key in keys_) {
keys.add(key);
}
final disabled =
ServerFuncBtn.values.map((e) => e.index).where((e) => !keys.contains(e)).toList();
final disabled = ServerFuncBtn.values
.map((e) => e.index)
.where((e) => !keys.contains(e))
.toList();
final allKeys = [...keys, ...disabled];
return ReorderableListView.builder(
padding: const EdgeInsets.all(7),

View File

@@ -34,7 +34,10 @@ class _SSHVirtKeySettingPageState extends State<SSHVirtKeySettingPage> {
for (final key in keys_) {
keys.add(key);
}
final disabled = VirtKey.values.map((e) => e.index).where((e) => !keys.contains(e)).toList();
final disabled = VirtKey.values
.map((e) => e.index)
.where((e) => !keys.contains(e))
.toList();
final allKeys = [...keys, ...disabled];
return ReorderableListView.builder(
padding: const EdgeInsets.all(7),

View File

@@ -317,7 +317,10 @@ class _SSHPageState extends State<SSHPage> with AutomaticKeepAliveClientMixin {
}
void _initVirtKeys() {
final virtKeys = List<VirtKey>.from(Stores.setting.sshVirtKeys.fetch());
final virtKeys = Stores.setting.sshVirtKeys
.fetch()
.map((e) => VirtKey.values[e])
.toList();
for (int len = 0; len < virtKeys.length; len += 7) {
if (len + 7 > virtKeys.length) {