@lijinzhao8/opencode-usage 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/cli/index.js +34 -34
  2. package/package.json +1 -1
package/cli/index.js CHANGED
@@ -47,54 +47,54 @@ function getAdminHTML() {
47
47
  <title>opencode-usage 管理界面</title>
48
48
  <style>
49
49
  * { box-sizing: border-box; margin: 0; padding: 0; }
50
- body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #0f1117; color: #e4e4e7; line-height: 1.6; }
51
- .header { background: #1a1b26; border-bottom: 1px solid #2a2b3d; padding: 16px 24px; display: flex; align-items: center; justify-content: space-between; }
52
- .header h1 { font-size: 20px; color: #7aa2f7; }
53
- .header .badge { background: #3b5bdb; color: #fff; padding: 2px 10px; border-radius: 12px; font-size: 12px; }
50
+ body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f0f4f8; color: #1a202c; line-height: 1.6; }
51
+ .header { background: #fff; border-bottom: 1px solid #d1dbe8; padding: 16px 24px; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
52
+ .header h1 { font-size: 20px; color: #2563eb; }
53
+ .header .badge { background: #2563eb; color: #fff; padding: 2px 10px; border-radius: 12px; font-size: 12px; }
54
54
  .container { max-width: 1200px; margin: 0 auto; padding: 24px; }
55
- .tabs { display: flex; gap: 0; margin-bottom: 24px; border-bottom: 2px solid #2a2b3d; }
56
- .tab { padding: 10px 20px; cursor: pointer; color: #787c99; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.2s; }
57
- .tab:hover { color: #a9b1d6; }
58
- .tab.active { color: #7aa2f7; border-bottom-color: #7aa2f7; }
55
+ .tabs { display: flex; gap: 0; margin-bottom: 24px; border-bottom: 2px solid #d1dbe8; }
56
+ .tab { padding: 10px 20px; cursor: pointer; color: #6b7a8d; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.2s; }
57
+ .tab:hover { color: #2563eb; }
58
+ .tab.active { color: #2563eb; border-bottom-color: #2563eb; font-weight: 600; }
59
59
  .panel { display: none; }
60
60
  .panel.active { display: block; }
61
- .card { background: #1a1b26; border: 1px solid #2a2b3d; border-radius: 8px; padding: 20px; margin-bottom: 16px; }
61
+ .card { background: #fff; border: 1px solid #d1dbe8; border-radius: 10px; padding: 20px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
62
62
  .card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
63
- .card-title { font-size: 16px; font-weight: 600; color: #c0caf5; display: flex; align-items: center; gap: 8px; }
63
+ .card-title { font-size: 16px; font-weight: 600; color: #1a202c; display: flex; align-items: center; gap: 8px; }
64
64
  .card-title .dot { width: 8px; height: 8px; border-radius: 50%; }
65
- .card-title .dot.green { background: #9ece6a; }
66
- .card-title .dot.gray { background: #565f89; }
65
+ .card-title .dot.green { background: #22c55e; }
66
+ .card-title .dot.gray { background: #9ca3af; }
67
67
  .btn { padding: 6px 14px; border-radius: 6px; border: none; cursor: pointer; font-size: 13px; font-weight: 500; transition: all 0.15s; }
68
- .btn-primary { background: #3b5bdb; color: #fff; }
69
- .btn-primary:hover { background: #4c6ef5; }
70
- .btn-danger { background: #e03131; color: #fff; }
71
- .btn-danger:hover { background: #f03e3e; }
72
- .btn-ghost { background: transparent; color: #787c99; border: 1px solid #2a2b3d; }
73
- .btn-ghost:hover { color: #c0caf5; border-color: #3b5bdb; }
68
+ .btn-primary { background: #2563eb; color: #fff; }
69
+ .btn-primary:hover { background: #1d4ed8; }
70
+ .btn-danger { background: #ef4444; color: #fff; }
71
+ .btn-danger:hover { background: #dc2626; }
72
+ .btn-ghost { background: transparent; color: #6b7a8d; border: 1px solid #d1dbe8; }
73
+ .btn-ghost:hover { color: #2563eb; border-color: #2563eb; }
74
74
  .btn-sm { padding: 4px 10px; font-size: 12px; }
75
75
  .form-group { margin-bottom: 14px; }
76
- .form-group label { display: block; font-size: 13px; color: #787c99; margin-bottom: 4px; }
77
- .form-group input, .form-group textarea, .form-group select { width: 100%; padding: 8px 12px; background: #24283b; border: 1px solid #2a2b3d; border-radius: 6px; color: #c0caf5; font-size: 14px; font-family: inherit; }
78
- .form-group input:focus, .form-group textarea:focus { outline: none; border-color: #7aa2f7; }
76
+ .form-group label { display: block; font-size: 13px; color: #6b7a8d; margin-bottom: 4px; }
77
+ .form-group input, .form-group textarea, .form-group select { width: 100%; padding: 8px 12px; background: #f7f9fc; border: 1px solid #d1dbe8; border-radius: 6px; color: #1a202c; font-size: 14px; font-family: inherit; transition: border-color 0.15s; }
78
+ .form-group input:focus, .form-group textarea:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
79
79
  .form-group textarea { min-height: 100px; font-family: 'SF Mono', 'Fira Code', monospace; font-size: 13px; resize: vertical; }
80
80
  .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
81
81
  .form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
82
- .tag { display: inline-block; background: #2a2b3d; color: #787c99; padding: 2px 8px; border-radius: 4px; font-size: 12px; margin: 2px; }
83
- .tag.blue { background: #1e3a5f; color: #7aa2f7; }
84
- .divider { height: 1px; background: #2a2b3d; margin: 16px 0; }
85
- .empty { text-align: center; padding: 40px; color: #565f89; }
86
- .save-bar { position: fixed; bottom: 0; left: 0; right: 0; background: #1a1b26; border-top: 1px solid #2a2b3d; padding: 12px 24px; display: flex; justify-content: space-between; align-items: center; z-index: 100; }
87
- .save-bar .status { color: #9ece6a; font-size: 13px; opacity: 0; transition: opacity 0.3s; }
82
+ .tag { display: inline-block; background: #e8eef5; color: #4b6584; padding: 2px 8px; border-radius: 4px; font-size: 12px; margin: 2px; }
83
+ .tag.blue { background: #dbeafe; color: #2563eb; }
84
+ .divider { height: 1px; background: #d1dbe8; margin: 16px 0; }
85
+ .empty { text-align: center; padding: 40px; color: #9ca3af; }
86
+ .save-bar { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid #d1dbe8; padding: 12px 24px; display: flex; justify-content: space-between; align-items: center; z-index: 100; box-shadow: 0 -1px 3px rgba(0,0,0,0.04); }
87
+ .save-bar .status { color: #22c55e; font-size: 13px; opacity: 0; transition: opacity 0.3s; }
88
88
  .save-bar .status.show { opacity: 1; }
89
- .help { font-size: 12px; color: #565f89; margin-top: 4px; }
90
- .rate-preview { background: #24283b; border: 1px solid #2a2b3d; border-radius: 6px; padding: 12px; font-family: 'SF Mono', monospace; font-size: 13px; color: #9ece6a; white-space: pre-wrap; margin-top: 8px; }
89
+ .help { font-size: 12px; color: #9ca3af; margin-top: 4px; }
90
+ .rate-preview { background: #f7f9fc; border: 1px solid #d1dbe8; border-radius: 6px; padding: 12px; font-family: 'SF Mono', monospace; font-size: 13px; color: #22c55e; white-space: pre-wrap; margin-top: 8px; }
91
91
  .inline-flex { display: flex; align-items: center; gap: 8px; }
92
92
  .switch { position: relative; width: 36px; height: 20px; }
93
93
  .switch input { opacity: 0; width: 0; height: 0; }
94
- .switch .slider { position: absolute; cursor: pointer; inset: 0; background: #2a2b3d; border-radius: 20px; transition: 0.2s; }
95
- .switch .slider:before { content: ""; position: absolute; height: 14px; width: 14px; left: 3px; bottom: 3px; background: #565f89; border-radius: 50%; transition: 0.2s; }
96
- .switch input:checked + .slider { background: #3b5bdb; }
97
- .switch input:checked + .slider:before { transform: translateX(16px); background: #fff; }
94
+ .switch .slider { position: absolute; cursor: pointer; inset: 0; background: #d1dbe8; border-radius: 20px; transition: 0.2s; }
95
+ .switch .slider:before { content: ""; position: absolute; height: 14px; width: 14px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: 0.2s; box-shadow: 0 1px 2px rgba(0,0,0,0.15); }
96
+ .switch input:checked + .slider { background: #2563eb; }
97
+ .switch input:checked + .slider:before { transform: translateX(16px); }
98
98
  body { padding-bottom: 60px; }
99
99
  </style>
100
100
  </head>
@@ -102,7 +102,7 @@ function getAdminHTML() {
102
102
 
103
103
  <div class="header">
104
104
  <h1>opencode-usage 管理界面</h1>
105
- <span class="badge">v1.0.0</span>
105
+ <span class="badge">v1.1.1</span>
106
106
  </div>
107
107
 
108
108
  <div class="container">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lijinzhao8/opencode-usage",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "OpenCode plugin that displays real-time API usage and cost tracking, replicating API-Proxy's pricing logic",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",