This commit is contained in:
@@ -22,35 +22,77 @@ struct ContentView: View {
|
|||||||
|
|
||||||
struct SidebarView: View {
|
struct SidebarView: View {
|
||||||
@EnvironmentObject var accountStore: AccountStore
|
@EnvironmentObject var accountStore: AccountStore
|
||||||
|
@State private var showAccountPicker = false
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
List {
|
VStack(spacing: 0) {
|
||||||
Section("媒体库") {
|
List {
|
||||||
NavigationLink(destination: VideoListView()) {
|
Section("媒体库") {
|
||||||
Label("视频库", systemImage: "film")
|
NavigationLink(destination: VideoListView()) {
|
||||||
|
Label("视频库", systemImage: "film")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Section("管理") {
|
Section("下载") {
|
||||||
NavigationLink(destination: AccountListView()) {
|
NavigationLink(destination: DownloadTaskListView()) {
|
||||||
Label("账号配置", systemImage: "key")
|
Label("下载任务", systemImage: "arrow.down.circle")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
NavigationLink(destination: DownloadTaskListView()) {
|
|
||||||
Label("下载任务", systemImage: "arrow.down.circle")
|
Section("管理") {
|
||||||
}
|
NavigationLink(destination: AccountListView()) {
|
||||||
NavigationLink(destination: LogListView()) {
|
Label("账号配置", systemImage: "key")
|
||||||
Label("操作日志", systemImage: "doc.text")
|
}
|
||||||
|
NavigationLink(destination: LogListView()) {
|
||||||
|
Label("操作日志", systemImage: "doc.text")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if let account = accountStore.activeAccount {
|
if let account = accountStore.activeAccount {
|
||||||
Section("当前账号") {
|
Divider()
|
||||||
Label(account.name, systemImage: "checkmark.circle.fill")
|
VStack(spacing: 8) {
|
||||||
.foregroundStyle(.green)
|
HStack {
|
||||||
Text(account.region)
|
Image(systemName: "checkmark.circle.fill")
|
||||||
.font(.caption)
|
.foregroundStyle(.green)
|
||||||
.foregroundStyle(.secondary)
|
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管理器")
|
.navigationTitle("火炬VOD管理器")
|
||||||
|
|||||||
Reference in New Issue
Block a user