Skip to content

Commit

Permalink
Database level Info
Browse files Browse the repository at this point in the history
  • Loading branch information
guanlisheng committed Sep 19, 2024
1 parent bbf6d66 commit 630477d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 5 additions & 1 deletion MMEX/Views/Info/InfoTableView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,25 @@ struct InfoTableView: View {
}

var body: some View {
List {
VStack {
if let userVersion = repository.db?.userVersion {
keyValueRow(key: "Schema Version", value: "\(userVersion)")
Divider()
}

if let baseCurrencyID = infoItems[.baseCurrencyID]?.getValue(Int.self) {
keyValueRow(key: "Base Currency", value: "\(baseCurrencyID)")
Divider()
}

if let uid = infoItems[.uid]?.getValue(String.self) {
keyValueRow(key: "UID", value: uid)
Divider()
}

if let dateFormat = infoItems[.dateFormat]?.getValue(String.self) {
keyValueRow(key: "Date Format", value: dateFormat)
Divider()
}
}
.onAppear {
Expand Down
6 changes: 2 additions & 4 deletions MMEX/Views/ManagementView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,8 @@ struct ManagementView: View {
Text("Manage Currencies")
}
}
Section(header: Text("Manage Info")) {
NavigationLink(destination: InfoTableView(databaseURL: databaseURL)) {
Text("Per Database Info")
}
Section(header: Text("Database Level Info")) {
InfoTableView(databaseURL: databaseURL)
}
Section(header: Text("Database")) {
Button("Re-open Database") {
Expand Down

0 comments on commit 630477d

Please sign in to comment.