Skip to content

CodexBar 是一个 macOS 菜单栏应用,用于查看本机 Codex 账号状态、额度、Token 用量、详细统计信息

feat: 添加 GitHub 项目入口

Bob5c88841f8f3f
diff --git a/CodexBar/Resources/Localizable.xcstrings b/CodexBar/Resources/Localizable.xcstrings
index b654428..5b821da 100644
--- a/CodexBar/Resources/Localizable.xcstrings
+++ b/CodexBar/Resources/Localizable.xcstrings
@@ -914,6 +914,22 @@
}
}
},
+ "GitHub 项目" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "GitHub Project"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "GitHub 项目"
+ }
+ }
+ }
+ },
"CodexBar 设置" : {
"localizations" : {
"en" : {
@@ -4308,4 +4324,4 @@
}
},
"version" : "1.0"
-}
\ No newline at end of file
+}
diff --git a/CodexBar/Views/Settings/AppSettingsView.swift b/CodexBar/Views/Settings/AppSettingsView.swift
index cbeb4f9..aa7619a 100644
--- a/CodexBar/Views/Settings/AppSettingsView.swift
+++ b/CodexBar/Views/Settings/AppSettingsView.swift
@@ -157,6 +157,8 @@ private extension AppSettingsView {
static let statusAnimation = Animation.codexStatus
}
+ static let githubProjectURL = URL(string: "https://github.com/bob-zebedy/CodexBar")!
+
// MARK: - 分页骨架
var settingsTabBar: some View {
@@ -262,6 +264,8 @@ private extension AppSettingsView {
codexVersionSection
LiquidGlassDivider()
versionRow
+ LiquidGlassDivider()
+ githubProjectRow
}
.padding(Metrics.panelPadding)
.liquidGlassSurface(cornerRadius: Metrics.panelCornerRadius)
@@ -881,6 +885,27 @@ private extension AppSettingsView {
)
}
+ var githubProjectRow: some View {
+ Link(destination: Self.githubProjectURL) {
+ HStack(spacing: SettingsRowMetrics.spacing) {
+ Image(systemName: "globe")
+ .frame(width: SettingsRowMetrics.iconWidth)
+ .foregroundStyle(.tint)
+
+ Text("GitHub 项目")
+ .foregroundStyle(.primary)
+
+ Spacer()
+
+ Image(systemName: "arrow.up.right")
+ .imageScale(.small)
+ .foregroundStyle(.secondary)
+ }
+ .contentShape(Rectangle())
+ }
+ .buttonStyle(.plain)
+ }
+
func refreshCodexVersionSection() {
// 版本检测较慢且内部会合并并发请求; 连接信息只是缓存读取
codexVersions.refresh()