From c7b539f2c54f04354d359e2bab0e97273095d2b4 Mon Sep 17 00:00:00 2001 From: William Date: Tue, 30 Jun 2026 14:11:33 +0600 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=87=8D=E6=9E=84=E4=BE=A7=E8=BE=B9?= =?UTF-8?q?=E6=A0=8F=E5=B8=83=E5=B1=80=EF=BC=8C=E5=BD=93=E5=89=8D=E8=B4=A6?= =?UTF-8?q?=E5=8F=B7=E7=A7=BB=E8=87=B3=E5=BA=95=E9=83=A8=E5=8D=A1=E7=89=87?= =?UTF-8?q?=E5=B9=B6=E6=94=AF=E6=8C=81=E5=BF=AB=E9=80=9F=E5=88=87=E6=8D=A2?= =?UTF-8?q?=EF=BC=8C=E4=B8=8B=E8=BD=BD=E4=BB=BB=E5=8A=A1=E7=8B=AC=E7=AB=8B?= =?UTF-8?q?=E4=B8=BA=E9=A1=B6=E7=BA=A7=E8=8F=9C=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../VODManager/Views/ContentView.swift | 80 ++++++++++++++----- 1 file changed, 61 insertions(+), 19 deletions(-) diff --git a/apps/macos/VODManager/Sources/VODManager/Views/ContentView.swift b/apps/macos/VODManager/Sources/VODManager/Views/ContentView.swift index 06beec1..7d71514 100644 --- a/apps/macos/VODManager/Sources/VODManager/Views/ContentView.swift +++ b/apps/macos/VODManager/Sources/VODManager/Views/ContentView.swift @@ -22,35 +22,77 @@ struct ContentView: View { struct SidebarView: View { @EnvironmentObject var accountStore: AccountStore + @State private var showAccountPicker = false var body: some View { - List { - Section("媒体库") { - NavigationLink(destination: VideoListView()) { - Label("视频库", systemImage: "film") + VStack(spacing: 0) { + List { + Section("媒体库") { + NavigationLink(destination: VideoListView()) { + Label("视频库", systemImage: "film") + } } - } - Section("管理") { - NavigationLink(destination: AccountListView()) { - Label("账号配置", systemImage: "key") + Section("下载") { + NavigationLink(destination: DownloadTaskListView()) { + Label("下载任务", systemImage: "arrow.down.circle") + } } - NavigationLink(destination: DownloadTaskListView()) { - Label("下载任务", systemImage: "arrow.down.circle") - } - NavigationLink(destination: LogListView()) { - Label("操作日志", systemImage: "doc.text") + + Section("管理") { + NavigationLink(destination: AccountListView()) { + Label("账号配置", systemImage: "key") + } + NavigationLink(destination: LogListView()) { + Label("操作日志", systemImage: "doc.text") + } } } if let account = accountStore.activeAccount { - Section("当前账号") { - Label(account.name, systemImage: "checkmark.circle.fill") - .foregroundStyle(.green) - Text(account.region) - .font(.caption) - .foregroundStyle(.secondary) + Divider() + VStack(spacing: 8) { + HStack { + Image(systemName: "checkmark.circle.fill") + .foregroundStyle(.green) + Text(account.name) + .font(.headline) + .lineLimit(1) + Spacer() + } + HStack { + Text(account.region) + .font(.caption) + .foregroundStyle(.secondary) + Spacer() + } + + if accountStore.accounts.count > 1 { + Menu { + ForEach(accountStore.accounts) { acct in + Button { + Task { await accountStore.switchActive(acct) } + } label: { + HStack { + Text(acct.name) + if acct.id == account.id { + Image(systemName: "checkmark") + } + } + } + } + } label: { + Label("切换账号", systemImage: "arrow.triangle.2.circlepath") + .font(.caption) + } + .buttonStyle(.bordered) + .controlSize(.small) + } } + .padding(12) + .background(.quaternary.opacity(0.5), in: RoundedRectangle(cornerRadius: 10)) + .padding(.horizontal, 8) + .padding(.bottom, 8) } } .navigationTitle("火炬VOD管理器")