Add Opencode (opencode.ai) integration via SSH tunnel

Features:
- Opencode AI chat interface
- SSH tunnel for secure API communication
- Auto-install Opencode on remote servers
- API key management with server-side storage
- Session history and management
- Integration with flutter_server_box server list
This commit is contained in:
root
2026-04-03 00:41:32 +08:00
parent 1d3534242c
commit 0f4fe33003
10 changed files with 2500 additions and 1 deletions

View File

@@ -13,7 +13,8 @@ enum ServerFuncBtn {
iperf(),
// pve(),
systemd(1058),
portForward(1340);
portForward(1340),
opencode(1352); // 添加 Opencode 按钮
final int? addedVersion;
@@ -36,6 +37,13 @@ enum ServerFuncBtn {
}
}
// 自动添加 Opencode 按钮
if (opencode.addedVersion != null && cur >= opencode.addedVersion!) {
if (!list.contains(opencode.index)) {
list.add(opencode.index);
}
}
if (list.length > originalLength) {
prop.put(list);
}
@@ -62,6 +70,7 @@ enum ServerFuncBtn {
iperf => Icons.speed,
systemd => MingCute.plugin_2_fill,
portForward => Icons.compare_arrows,
opencode => Icons.smart_toy, // Opencode 图标
};
String get toStr => switch (this) {
@@ -74,5 +83,6 @@ enum ServerFuncBtn {
iperf => 'iperf',
systemd => 'Systemd',
portForward => libL10n.portForward,
opencode => 'Opencode', // Opencode 按钮文字
};
}