@round2ai/r2-cli 1.0.12-beta.0 → 1.0.12-beta.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.
@@ -1,67 +1,244 @@
1
- <!DOCTYPE html>
2
- <html lang="zh-CN"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
3
- <title>闲鱼店铺授权</title>
4
- <style>
5
- *{box-sizing:border-box;margin:0;padding:0}
6
- :root{--primary:#FFE60F;--primary-light:#FFE60F1a;--primary-dark:#FFE60Fcc;--text:#1a1a1a;--text-muted:#8c8c8c;--bg:#f7f8fa;--card:#fff;--border:#e8e8e8;--radius:16px;--shadow:0 2px 16px #FFE60F1a;--success:#52c41a;--error:#ff4d4f;--info:#1890ff}
7
- body{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:100vh;font-family:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;background:var(--bg);color:var(--text)}
8
- .card{background:var(--card);border-radius:var(--radius);padding:40px 32px 32px;box-shadow:var(--shadow);border:1px solid var(--border);text-align:center;max-width:360px;width:90%;transition:all .3s ease}
9
- .brand{margin-bottom:24px}
10
- .brand-name{font-size:22px;font-weight:700;color:var(--text);letter-spacing:2px}
11
- .brand-sub{font-size:10px;color:var(--text-muted);margin-top:4px;letter-spacing:3px;text-transform:uppercase;font-weight:500}
12
- img#qr{max-width:200px;border-radius:12px;transition:all .3s ease}
13
- img#qr.dimmed{opacity:.15;filter:blur(4px);transform:scale(.95)}
14
- .status-text{font-size:16px;font-weight:600;color:var(--text);margin-top:16px}
15
- .hint{color:var(--text-muted);font-size:13px;margin-top:6px}
16
- .scan-hint{color:var(--text-muted);font-size:12px;margin-top:16px}
17
- .auth-btn{display:inline-block;margin-top:16px;padding:10px 32px;border-radius:8px;background:var(--primary);color:var(--text);font-size:14px;font-weight:600;text-decoration:none;letter-spacing:1px;transition:all .2s ease}
18
- .auth-btn:hover{background:var(--primary-dark);transform:translateY(-1px);box-shadow:0 4px 12px #FFE60F33}
19
- .status-icon{font-size:56px;margin-bottom:8px;animation:popIn .4s cubic-bezier(.175,.885,.32,1.275)}
20
- @keyframes popIn{0%{transform:scale(0);opacity:0}100%{transform:scale(1);opacity:1}}
21
- .success-bg .card{border-color:var(--success);box-shadow:0 2px 16px rgba(82,196,26,.12)}
22
- .success-bg .status-text{color:var(--success)}
23
- .expired-bg .card{border-color:var(--error);box-shadow:0 2px 16px rgba(255,77,79,.1)}
24
- .expired-bg .status-text{color:var(--error)}
25
- .scanning-bg .card{border-color:var(--info);box-shadow:0 2px 16px rgba(24,144,255,.1)}
26
- .scanning-bg .status-text{color:var(--info)}
27
- .pulse{display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--info);animation:pulse 1.4s infinite;margin-right:6px;vertical-align:middle}
28
- @keyframes pulse{0%{opacity:1;transform:scale(1)}50%{opacity:.4;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}
29
- </style></head>
30
- <body>
31
- <div class="card" id="app">
32
- <div class="brand"><div class="brand-name">闲鱼授权</div><div class="brand-sub">Round2AI</div></div>
33
- <img id="qr" src="./qr.png" alt="闲鱼店铺授权"/>
34
- <p class="status-text" id="statusText">请扫码授权</p>
35
- <p class="scan-hint">支持 浏览器 / 微信 扫码</p>
36
- <a class="auth-btn" id="auth-btn" style="display:none" href="#" target="_blank">点击授权</a>
37
- <p class="hint" id="hint"></p>
38
- </div>
39
- <script>
40
- const qr=document.getElementById("qr"),st=document.getElementById("statusText"),ht=document.getElementById("hint"),app=document.getElementById("app"),bd=document.body;
41
- const states={
42
- waiting:{icon:"",text:"请扫码授权",hint:"",bg:"",dim:false},
43
- scanning:{icon:"",text:'<span class="pulse"></span>处理中...',hint:"等待确认中...",bg:"scanning-bg",dim:true},
44
- success:{icon:"✅",text:"授权成功!",hint:"可关闭此页面",bg:"success-bg",dim:true},
45
- expired:{icon:"⏰",text:"二维码已过期",hint:"请重新获取",bg:"expired-bg",dim:true}
46
- };
47
- function render(s){
48
- const d=states[s]||states.waiting;
49
- bd.className=d.bg;
50
- if(d.icon){
51
- qr.style.display="none";
52
- app.innerHTML='<div class="brand"><div class="brand-name">闲鱼授权</div><div class="brand-sub">Round2AI</div></div><div class="status-icon">'+d.icon+'</div><p class="status-text">'+d.text+'</p>'+(d.hint?'<p class="hint">'+d.hint+'</p>':'');
53
- }else{
54
- qr.style.display="";qr.classList.toggle("dimmed",d.dim);st.innerHTML=d.text;ht.textContent=d.hint;
55
- }
56
- }
57
- fetch("./config").then(function(r){return r.json()}).then(function(data){
58
- if(data.authUrl){
59
- var btn=document.getElementById("auth-btn");
60
- btn.href=data.authUrl;
61
- btn.style.display="";
62
- }
63
- }).catch(function(){});
64
- const es=new EventSource("./events");
65
- es.onmessage=function(e){try{const d=JSON.parse(e.data);if(d.status)render(d.status)}catch(ex){}};
66
- es.onerror=function(){es.close()};
67
- </script></body></html>
1
+ <!doctype html>
2
+ <html lang="zh-CN">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta name="viewport" content="width=device-width,initial-scale=1" />
6
+ <title>闲鱼店铺授权</title>
7
+ <style>
8
+ * {
9
+ box-sizing: border-box;
10
+ margin: 0;
11
+ padding: 0;
12
+ }
13
+ :root {
14
+ --primary: #ffe60f;
15
+ --primary-light: #ffe60f1a;
16
+ --primary-dark: #ffe60fcc;
17
+ --text: #1a1a1a;
18
+ --text-muted: #8c8c8c;
19
+ --bg: #f7f8fa;
20
+ --card: #fff;
21
+ --border: #e8e8e8;
22
+ --radius: 16px;
23
+ --shadow: 0 2px 16px #ffe60f1a;
24
+ --success: #52c41a;
25
+ --error: #ff4d4f;
26
+ --info: #1890ff;
27
+ }
28
+ body {
29
+ display: flex;
30
+ flex-direction: column;
31
+ align-items: center;
32
+ justify-content: center;
33
+ min-height: 100vh;
34
+ font-family:
35
+ system-ui,
36
+ -apple-system,
37
+ "Segoe UI",
38
+ Roboto,
39
+ sans-serif;
40
+ background: var(--bg);
41
+ color: var(--text);
42
+ }
43
+ .card {
44
+ background: var(--card);
45
+ border-radius: var(--radius);
46
+ padding: 40px 32px 32px;
47
+ box-shadow: var(--shadow);
48
+ border: 1px solid var(--border);
49
+ text-align: center;
50
+ max-width: 360px;
51
+ width: 90%;
52
+ transition: all 0.3s ease;
53
+ }
54
+ .brand {
55
+ margin-bottom: 24px;
56
+ }
57
+ .brand-name {
58
+ font-size: 22px;
59
+ font-weight: 700;
60
+ color: var(--text);
61
+ letter-spacing: 2px;
62
+ }
63
+ .brand-sub {
64
+ font-size: 10px;
65
+ color: var(--text-muted);
66
+ margin-top: 4px;
67
+ letter-spacing: 3px;
68
+ text-transform: uppercase;
69
+ font-weight: 500;
70
+ }
71
+ img#qr {
72
+ max-width: 200px;
73
+ border-radius: 12px;
74
+ transition: all 0.3s ease;
75
+ }
76
+ img#qr.dimmed {
77
+ opacity: 0.15;
78
+ filter: blur(4px);
79
+ transform: scale(0.95);
80
+ }
81
+ .status-text {
82
+ font-size: 16px;
83
+ font-weight: 600;
84
+ color: var(--text);
85
+ margin-top: 16px;
86
+ }
87
+ .hint {
88
+ color: var(--text-muted);
89
+ font-size: 13px;
90
+ margin-top: 6px;
91
+ }
92
+ .scan-hint {
93
+ color: var(--text-muted);
94
+ font-size: 12px;
95
+ margin-top: 16px;
96
+ }
97
+ .auth-btn {
98
+ display: inline-block;
99
+ margin-top: 16px;
100
+ padding: 10px 32px;
101
+ border-radius: 8px;
102
+ background: var(--primary);
103
+ color: var(--text);
104
+ font-size: 14px;
105
+ font-weight: 600;
106
+ text-decoration: none;
107
+ letter-spacing: 1px;
108
+ transition: all 0.2s ease;
109
+ }
110
+ .auth-btn:hover {
111
+ background: var(--primary-dark);
112
+ transform: translateY(-1px);
113
+ box-shadow: 0 4px 12px #ffe60f33;
114
+ }
115
+ .status-icon {
116
+ font-size: 56px;
117
+ margin-bottom: 8px;
118
+ animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
119
+ }
120
+ @keyframes popIn {
121
+ 0% {
122
+ transform: scale(0);
123
+ opacity: 0;
124
+ }
125
+ 100% {
126
+ transform: scale(1);
127
+ opacity: 1;
128
+ }
129
+ }
130
+ .success-bg .card {
131
+ border-color: var(--success);
132
+ box-shadow: 0 2px 16px rgba(82, 196, 26, 0.12);
133
+ }
134
+ .success-bg .status-text {
135
+ color: var(--success);
136
+ }
137
+ .expired-bg .card {
138
+ border-color: var(--error);
139
+ box-shadow: 0 2px 16px rgba(255, 77, 79, 0.1);
140
+ }
141
+ .expired-bg .status-text {
142
+ color: var(--error);
143
+ }
144
+ .scanning-bg .card {
145
+ border-color: var(--info);
146
+ box-shadow: 0 2px 16px rgba(24, 144, 255, 0.1);
147
+ }
148
+ .scanning-bg .status-text {
149
+ color: var(--info);
150
+ }
151
+ .pulse {
152
+ display: inline-block;
153
+ width: 6px;
154
+ height: 6px;
155
+ border-radius: 50%;
156
+ background: var(--info);
157
+ animation: pulse 1.4s infinite;
158
+ margin-right: 6px;
159
+ vertical-align: middle;
160
+ }
161
+ @keyframes pulse {
162
+ 0% {
163
+ opacity: 1;
164
+ transform: scale(1);
165
+ }
166
+ 50% {
167
+ opacity: 0.4;
168
+ transform: scale(0.8);
169
+ }
170
+ 100% {
171
+ opacity: 1;
172
+ transform: scale(1);
173
+ }
174
+ }
175
+ </style>
176
+ </head>
177
+ <body>
178
+ <div class="card" id="app">
179
+ <div class="brand">
180
+ <div class="brand-name">闲鱼授权</div>
181
+ <div class="brand-sub">Round2AI</div>
182
+ </div>
183
+ <img id="qr" src="./qr.png" alt="闲鱼店铺授权" />
184
+ <p class="status-text" id="statusText">请扫码授权</p>
185
+ <p class="scan-hint">支持 浏览器 / 微信 扫码</p>
186
+ <a class="auth-btn" id="auth-btn" style="display: none" href="#" target="_blank">点击授权</a>
187
+ <p class="hint" id="hint"></p>
188
+ </div>
189
+ <script>
190
+ const qr = document.getElementById("qr"),
191
+ st = document.getElementById("statusText"),
192
+ ht = document.getElementById("hint"),
193
+ app = document.getElementById("app"),
194
+ bd = document.body;
195
+ const states = {
196
+ waiting: { icon: "", text: "请扫码授权", hint: "", bg: "", dim: false },
197
+ scanning: { icon: "", text: '<span class="pulse"></span>处理中...', hint: "等待确认中...", bg: "scanning-bg", dim: true },
198
+ success: { icon: "✅", text: "授权成功!", hint: "可关闭此页面", bg: "success-bg", dim: true },
199
+ expired: { icon: "⏰", text: "二维码已过期", hint: "请重新获取", bg: "expired-bg", dim: true },
200
+ };
201
+ function render(s) {
202
+ const d = states[s] || states.waiting;
203
+ bd.className = d.bg;
204
+ if (d.icon) {
205
+ qr.style.display = "none";
206
+ app.innerHTML =
207
+ '<div class="brand"><div class="brand-name">闲鱼授权</div><div class="brand-sub">Round2AI</div></div><div class="status-icon">' +
208
+ d.icon +
209
+ '</div><p class="status-text">' +
210
+ d.text +
211
+ "</p>" +
212
+ (d.hint ? '<p class="hint">' + d.hint + "</p>" : "");
213
+ } else {
214
+ qr.style.display = "";
215
+ qr.classList.toggle("dimmed", d.dim);
216
+ st.innerHTML = d.text;
217
+ ht.textContent = d.hint;
218
+ }
219
+ }
220
+ fetch("./config")
221
+ .then(function (r) {
222
+ return r.json();
223
+ })
224
+ .then(function (data) {
225
+ if (data.authUrl) {
226
+ var btn = document.getElementById("auth-btn");
227
+ btn.href = data.authUrl;
228
+ btn.style.display = "";
229
+ }
230
+ })
231
+ .catch(function () {});
232
+ const es = new EventSource("./events");
233
+ es.onmessage = function (e) {
234
+ try {
235
+ const d = JSON.parse(e.data);
236
+ if (d.status) render(d.status);
237
+ } catch (ex) {}
238
+ };
239
+ es.onerror = function () {
240
+ es.close();
241
+ };
242
+ </script>
243
+ </body>
244
+ </html>