Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
09907db
fix: 修复控制台日志递归爆炸问题
GoldenTangerine Dec 8, 2025
2e8ac57
Merge branch 'Rogers-F:main' into main
GoldenTangerine Dec 8, 2025
b8da451
Merge branch 'Rogers-F:main' into main
GoldenTangerine Dec 9, 2025
d3dccf0
Merge branch 'Rogers-F:main' into main
GoldenTangerine Dec 19, 2025
621def3
Merge branch 'Rogers-F:main' into main
GoldenTangerine Jan 21, 2026
cc32385
✨ feat(heatmap): 添加自适应热力图和图标搜索功能
GoldenTangerine Jan 21, 2026
a6fa272
chore: bump version to v2.6.14
GoldenTangerine Jan 21, 2026
f459d87
🐎 ci(release): 为构建产物添加版本号后缀
GoldenTangerine Jan 21, 2026
ffb1d59
✨ feat(logs): token 数值支持 k/M/B 单位换算
GoldenTangerine Jan 21, 2026
739e73b
✨ feat(main): 首页 token 数值支持 k/M/B 单位换算
GoldenTangerine Jan 21, 2026
307753f
✨ feat(logs): 增强日志界面统计功能
GoldenTangerine Jan 21, 2026
cef3fea
💄 style(logs): 优化缓存命中率显示样式
GoldenTangerine Jan 21, 2026
aa48cc6
✨ feat(tray): 添加托盘菜单预算进度功能
GoldenTangerine Jan 22, 2026
cea261a
🐛 fix(tray): 修复托盘菜单禁用项 API 调用
GoldenTangerine Jan 22, 2026
1b4b612
✨ feat(tray): 添加独立托盘窗口和预算周期功能
GoldenTangerine Jan 22, 2026
9f8334d
💄 style(tray): 优化托盘窗口 UI 和 macOS 窗口行为
GoldenTangerine Jan 22, 2026
dae35b8
💄 style(tray): 优化预算周期显示和主窗口尺寸
GoldenTangerine Jan 22, 2026
80d2b05
✨ feat(tray): 添加托盘头部品牌标识和托管状态
GoldenTangerine Jan 22, 2026
ddd7f12
✨ feat(budget): 添加用量调整和预测方法配置功能
GoldenTangerine Jan 23, 2026
ccc5c72
✨ feat(budget): 为 Codex 平台添加独立预算配置系统
GoldenTangerine Jan 23, 2026
7505417
💄 style(ui): 优化面板标题和等级徽章样式
GoldenTangerine Jan 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .claude/settings.local.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
"permissions": {
"allow": [
"WebSearch",
"Bash(find:*)"
"Bash(find:*)",
"mcp__exa__web_search_exa",
"mcp__ace-tool__search_context"
],
"deny": [],
"ask": []
Expand Down
143 changes: 86 additions & 57 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ jobs:
- uses: actions/checkout@v4

- name: Update version from tag
id: version
run: |
VERSION=${GITHUB_REF#refs/tags/v}
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
echo "Updating version to: $VERSION"
sed -i '' "s/const AppVersion = \"v[^\"]*\"/const AppVersion = \"v$VERSION\"/" version_service.go
echo "Updated version_service.go:"
Expand Down Expand Up @@ -64,13 +66,13 @@ jobs:
- name: Archive macOS app
run: |
cd bin
ditto -c -k --sequesterRsrc --keepParent "$(basename ${{ steps.find-app.outputs.app_path }})" codeswitch-macos-${{ matrix.arch }}.zip
ditto -c -k --sequesterRsrc --keepParent "$(basename ${{ steps.find-app.outputs.app_path }})" CodeSwitch-v${{ steps.version.outputs.VERSION }}-macos-${{ matrix.arch }}.zip

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: macos-${{ matrix.arch }}
path: bin/codeswitch-macos-${{ matrix.arch }}.zip
path: bin/CodeSwitch-v${{ steps.version.outputs.VERSION }}-macos-${{ matrix.arch }}.zip

build-windows:
name: Build Windows
Expand All @@ -79,9 +81,11 @@ jobs:
- uses: actions/checkout@v4

- name: Update version from tag
id: version
shell: pwsh
run: |
$VERSION = "${{ github.ref_name }}".TrimStart('v')
"VERSION=$VERSION" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
Write-Host "Updating version to: $VERSION"

# Update version_service.go
Expand Down Expand Up @@ -161,11 +165,30 @@ jobs:
go build -ldflags="-w -s -H windowsgui" -o bin/updater.exe ./cmd/updater
Remove-Item cmd/updater/*.syso -ErrorAction SilentlyContinue

- name: Rename files with version
shell: pwsh
run: |
$VERSION = "${{ steps.version.outputs.VERSION }}"
Push-Location bin
Rename-Item "CodeSwitch.exe" "CodeSwitch-v$VERSION.exe"
Rename-Item "updater.exe" "updater-v$VERSION.exe"
Pop-Location
# Rename installer (generated by NSIS)
if (Test-Path "build/windows/nsis/CodeSwitch-amd64-installer.exe") {
Move-Item "build/windows/nsis/CodeSwitch-amd64-installer.exe" "bin/CodeSwitch-v$VERSION-amd64-installer.exe"
} elseif (Test-Path "bin/CodeSwitch-amd64-installer.exe") {
Rename-Item "bin/CodeSwitch-amd64-installer.exe" "CodeSwitch-v$VERSION-amd64-installer.exe"
}
Write-Host "Files renamed:"
Get-ChildItem bin

- name: Generate SHA256 Checksums
shell: pwsh
run: |
$VERSION = "${{ steps.version.outputs.VERSION }}"
Push-Location bin
Get-FileHash -Algorithm SHA256 CodeSwitch.exe | ForEach-Object { "$($_.Hash.ToLower()) CodeSwitch.exe" } | Out-File -Encoding ascii CodeSwitch.exe.sha256
Get-FileHash -Algorithm SHA256 updater.exe | ForEach-Object { "$($_.Hash.ToLower()) updater.exe" } | Out-File -Encoding ascii updater.exe.sha256
Get-FileHash -Algorithm SHA256 "CodeSwitch-v$VERSION.exe" | ForEach-Object { "$($_.Hash.ToLower()) CodeSwitch-v$VERSION.exe" } | Out-File -Encoding ascii "CodeSwitch-v$VERSION.exe.sha256"
Get-FileHash -Algorithm SHA256 "updater-v$VERSION.exe" | ForEach-Object { "$($_.Hash.ToLower()) updater-v$VERSION.exe" } | Out-File -Encoding ascii "updater-v$VERSION.exe.sha256"
Write-Host "SHA256 checksums generated:"
Get-Content *.sha256
Pop-Location
Expand All @@ -175,11 +198,11 @@ jobs:
with:
name: windows-amd64
path: |
bin/CodeSwitch-amd64-installer.exe
bin/CodeSwitch.exe
bin/CodeSwitch.exe.sha256
bin/updater.exe
bin/updater.exe.sha256
bin/CodeSwitch-v${{ steps.version.outputs.VERSION }}-amd64-installer.exe
bin/CodeSwitch-v${{ steps.version.outputs.VERSION }}.exe
bin/CodeSwitch-v${{ steps.version.outputs.VERSION }}.exe.sha256
bin/updater-v${{ steps.version.outputs.VERSION }}.exe
bin/updater-v${{ steps.version.outputs.VERSION }}.exe.sha256

build-linux:
name: Build Linux
Expand All @@ -188,8 +211,10 @@ jobs:
- uses: actions/checkout@v4

- name: Update version from tag
id: version
run: |
VERSION=${GITHUB_REF#refs/tags/v}
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
echo "Updating version to: $VERSION"
sed -i "s/const AppVersion = \"v[^\"]*\"/const AppVersion = \"v$VERSION\"/" version_service.go
echo "Updated version_service.go:"
Expand Down Expand Up @@ -237,18 +262,19 @@ jobs:

- name: Rename AppImage
run: |
VERSION=${{ steps.version.outputs.VERSION }}
cd bin
echo "Files in bin/:"
ls -la
# linuxdeploy creates AppImage with lowercase name and arch suffix
for f in *-x86_64.AppImage *-aarch64.AppImage; do
if [ -f "$f" ]; then
mv "$f" CodeSwitch.AppImage
echo "Renamed $f -> CodeSwitch.AppImage"
mv "$f" "CodeSwitch-v${VERSION}.AppImage"
echo "Renamed $f -> CodeSwitch-v${VERSION}.AppImage"
break
fi
done
ls -la CodeSwitch.AppImage
ls -la "CodeSwitch-v${VERSION}.AppImage"

- name: Set nfpm script permissions
run: |
Expand All @@ -269,8 +295,9 @@ jobs:

- name: Generate SHA256 Checksums
run: |
VERSION=${{ steps.version.outputs.VERSION }}
cd bin
sha256sum CodeSwitch.AppImage > CodeSwitch.AppImage.sha256
sha256sum "CodeSwitch-v${VERSION}.AppImage" > "CodeSwitch-v${VERSION}.AppImage.sha256"
for f in codeswitch_*.deb; do [ -f "$f" ] && sha256sum "$f" > "${f}.sha256"; done
for f in codeswitch-*.rpm; do [ -f "$f" ] && sha256sum "$f" > "${f}.sha256"; done
echo "SHA256 checksums:"
Expand All @@ -281,8 +308,8 @@ jobs:
with:
name: linux-amd64
path: |
bin/CodeSwitch.AppImage
bin/CodeSwitch.AppImage.sha256
bin/CodeSwitch-v${{ steps.version.outputs.VERSION }}.AppImage
bin/CodeSwitch-v${{ steps.version.outputs.VERSION }}.AppImage.sha256
bin/codeswitch_*.deb
bin/codeswitch_*.deb.sha256
bin/codeswitch-*.rpm
Expand All @@ -305,22 +332,23 @@ jobs:

- name: Prepare release assets
run: |
VERSION=${GITHUB_REF#refs/tags/v}
mkdir -p release-assets

# macOS
cp artifacts/macos-arm64/codeswitch-macos-arm64.zip release-assets/
cp artifacts/macos-amd64/codeswitch-macos-amd64.zip release-assets/
cp artifacts/macos-arm64/CodeSwitch-v${VERSION}-macos-arm64.zip release-assets/
cp artifacts/macos-amd64/CodeSwitch-v${VERSION}-macos-amd64.zip release-assets/

# Windows
cp artifacts/windows-amd64/CodeSwitch-amd64-installer.exe release-assets/
cp artifacts/windows-amd64/CodeSwitch.exe release-assets/
cp artifacts/windows-amd64/CodeSwitch.exe.sha256 release-assets/
cp artifacts/windows-amd64/updater.exe release-assets/
cp artifacts/windows-amd64/updater.exe.sha256 release-assets/
cp artifacts/windows-amd64/CodeSwitch-v${VERSION}-amd64-installer.exe release-assets/
cp artifacts/windows-amd64/CodeSwitch-v${VERSION}.exe release-assets/
cp artifacts/windows-amd64/CodeSwitch-v${VERSION}.exe.sha256 release-assets/
cp artifacts/windows-amd64/updater-v${VERSION}.exe release-assets/
cp artifacts/windows-amd64/updater-v${VERSION}.exe.sha256 release-assets/

# Linux
cp artifacts/linux-amd64/CodeSwitch.AppImage release-assets/
cp artifacts/linux-amd64/CodeSwitch.AppImage.sha256 release-assets/
cp artifacts/linux-amd64/CodeSwitch-v${VERSION}.AppImage release-assets/
cp artifacts/linux-amd64/CodeSwitch-v${VERSION}.AppImage.sha256 release-assets/
cp artifacts/linux-amd64/codeswitch_*.deb release-assets/ 2>/dev/null || true
cp artifacts/linux-amd64/codeswitch_*.deb.sha256 release-assets/ 2>/dev/null || true
cp artifacts/linux-amd64/codeswitch-*.rpm release-assets/ 2>/dev/null || true
Expand All @@ -330,34 +358,35 @@ jobs:
- name: Generate latest.json
run: |
VERSION=${GITHUB_REF#refs/tags/}
VERSION_NUM=${GITHUB_REF#refs/tags/v}
REPO="${{ github.repository }}"
BASE_URL="https://github.com/${REPO}/releases/download/${VERSION}"

# Read SHA256 checksums from existing .sha256 files
WIN_SHA=$(cut -d' ' -f1 release-assets/CodeSwitch.exe.sha256)
LINUX_SHA=$(cut -d' ' -f1 release-assets/CodeSwitch.AppImage.sha256)
WIN_SHA=$(cut -d' ' -f1 release-assets/CodeSwitch-${VERSION}.exe.sha256)
LINUX_SHA=$(cut -d' ' -f1 release-assets/CodeSwitch-${VERSION}.AppImage.sha256)

cat > release-assets/latest.json << EOF
{
"version": "${VERSION}",
"release_date": "$(date -u +%Y-%m-%dT%H:%M:%SZ)",
"files": {
"windows": {
"name": "CodeSwitch.exe",
"url": "${BASE_URL}/CodeSwitch.exe",
"name": "CodeSwitch-${VERSION}.exe",
"url": "${BASE_URL}/CodeSwitch-${VERSION}.exe",
"sha256": "${WIN_SHA}"
},
"darwin-arm64": {
"name": "codeswitch-macos-arm64.zip",
"url": "${BASE_URL}/codeswitch-macos-arm64.zip"
"name": "CodeSwitch-${VERSION}-macos-arm64.zip",
"url": "${BASE_URL}/CodeSwitch-${VERSION}-macos-arm64.zip"
},
"darwin-amd64": {
"name": "codeswitch-macos-amd64.zip",
"url": "${BASE_URL}/codeswitch-macos-amd64.zip"
"name": "CodeSwitch-${VERSION}-macos-amd64.zip",
"url": "${BASE_URL}/CodeSwitch-${VERSION}-macos-amd64.zip"
},
"linux": {
"name": "CodeSwitch.AppImage",
"url": "${BASE_URL}/CodeSwitch.AppImage",
"name": "CodeSwitch-${VERSION}.AppImage",
"url": "${BASE_URL}/CodeSwitch-${VERSION}.AppImage",
"sha256": "${LINUX_SHA}"
}
}
Expand Down Expand Up @@ -386,54 +415,54 @@ jobs:
# 组合完整的 release body
cat /tmp/version_notes.md > /tmp/release_body.md

cat >> /tmp/release_body.md << 'EOF'
cat >> /tmp/release_body.md << EOF

---

## 下载说明

| 平台 | 文件 | 说明 |
|------|------|------|
| **Windows (首次)** | `CodeSwitch-amd64-installer.exe` | NSIS 安装器 |
| **Windows (便携)** | `CodeSwitch.exe` | 直接运行 |
| **Windows (更新)** | `updater.exe` | 静默更新辅助 |
| **macOS (ARM)** | `codeswitch-macos-arm64.zip` | Apple Silicon |
| **macOS (Intel)** | `codeswitch-macos-amd64.zip` | Intel 芯片 |
| **Linux (通用)** | `CodeSwitch.AppImage` | 跨发行版便携 |
| **Linux (Debian/Ubuntu)** | `codeswitch_*.deb` | apt 安装 |
| **Linux (RHEL/Fedora)** | `codeswitch-*.rpm` | dnf/yum 安装 |
| **Windows (首次)** | \`CodeSwitch-v${VERSION}-amd64-installer.exe\` | NSIS 安装器 |
| **Windows (便携)** | \`CodeSwitch-v${VERSION}.exe\` | 直接运行 |
| **Windows (更新)** | \`updater-v${VERSION}.exe\` | 静默更新辅助 |
| **macOS (ARM)** | \`CodeSwitch-v${VERSION}-macos-arm64.zip\` | Apple Silicon |
| **macOS (Intel)** | \`CodeSwitch-v${VERSION}-macos-amd64.zip\` | Intel 芯片 |
| **Linux (通用)** | \`CodeSwitch-v${VERSION}.AppImage\` | 跨发行版便携 |
| **Linux (Debian/Ubuntu)** | \`codeswitch_*.deb\` | apt 安装 |
| **Linux (RHEL/Fedora)** | \`codeswitch-*.rpm\` | dnf/yum 安装 |

## Linux 安装

### AppImage (推荐)
```bash
chmod +x CodeSwitch.AppImage
./CodeSwitch.AppImage
```
如遇 FUSE 问题:`./CodeSwitch.AppImage --appimage-extract-and-run`
\`\`\`bash
chmod +x CodeSwitch-v${VERSION}.AppImage
./CodeSwitch-v${VERSION}.AppImage
\`\`\`
如遇 FUSE 问题:\`./CodeSwitch-v${VERSION}.AppImage --appimage-extract-and-run\`

### Debian/Ubuntu
```bash
\`\`\`bash
sudo dpkg -i codeswitch_*.deb
sudo apt-get install -f # 安装依赖
```
\`\`\`

### RHEL/Fedora
```bash
\`\`\`bash
sudo rpm -i codeswitch-*.rpm
# 或
sudo dnf install codeswitch-*.rpm
```
\`\`\`

## 文件校验
所有平台均提供 SHA256 校验文件(`.sha256`),下载后可验证完整性:
```bash
所有平台均提供 SHA256 校验文件(\`.sha256\`),下载后可验证完整性:
\`\`\`bash
# Linux/macOS
sha256sum -c CodeSwitch.AppImage.sha256
sha256sum -c CodeSwitch-v${VERSION}.AppImage.sha256

# Windows PowerShell
Get-FileHash CodeSwitch.exe | Format-List
```
Get-FileHash CodeSwitch-v${VERSION}.exe | Format-List
\`\`\`
EOF

echo "Generated release body:"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ frontend/dist
.task
bin
CLAUDE.md
.ace-tool/
11 changes: 11 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# Code Switch v2.6.14

## 新功能
- **自适应热力图**:新增供应商使用热力图功能,直观展示各供应商的请求分布情况,支持按时间范围筛选
- **图标搜索**:新增供应商图标搜索功能,方便快速查找和选择合适的图标

## 修复
- 修复控制台日志递归爆炸问题

---

# Code Switch v2.0.0

## 新功能
Expand Down
Binary file removed codeswitch.exe
Binary file not shown.
Binary file removed codeswitch_test.exe
Binary file not shown.
20 changes: 17 additions & 3 deletions frontend/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup lang="ts">
import { RouterView } from 'vue-router'
import { onMounted } from 'vue'
import { RouterView, useRoute } from 'vue-router'
import { computed, onMounted } from 'vue'
import Sidebar from './components/Sidebar.vue'
import UpdateNotification from './components/common/UpdateNotification.vue'

Expand All @@ -21,10 +21,18 @@ onMounted(() => {
applyTheme()
})
})

const route = useRoute()
const isTray = computed(() => route.path === '/tray')
</script>

<template>
<div class="app-layout">
<div v-if="isTray" class="tray-layout">
<RouterView v-slot="{ Component }">
<component :is="Component" />
</RouterView>
</div>
<div v-else class="app-layout">
<Sidebar />
<main class="main-content">
<RouterView v-slot="{ Component }">
Expand All @@ -39,6 +47,12 @@ onMounted(() => {
</template>

<style scoped>
.tray-layout {
width: 100vw;
height: 100vh;
overflow: hidden;
}

.app-layout {
display: flex;
height: 100vh;
Expand Down
Loading