tweak: adjust codex styling and fix hint
This commit is contained in:
@@ -36,7 +36,7 @@ export function createDialogProviderOptions() {
|
|||||||
description: {
|
description: {
|
||||||
opencode: "(Recommended)",
|
opencode: "(Recommended)",
|
||||||
anthropic: "(Claude Max or API key)",
|
anthropic: "(Claude Max or API key)",
|
||||||
openai: "ChatGPT Plus/Pro or API key",
|
openai: "(ChatGPT Plus/Pro or API key)",
|
||||||
}[provider.id],
|
}[provider.id],
|
||||||
category: provider.id in PROVIDER_PRIORITY ? "Popular" : "Other",
|
category: provider.id in PROVIDER_PRIORITY ? "Popular" : "Other",
|
||||||
async onSelect() {
|
async onSelect() {
|
||||||
|
|||||||
@@ -98,45 +98,94 @@ async function refreshAccessToken(refreshToken: string): Promise<TokenResponse>
|
|||||||
return response.json()
|
return response.json()
|
||||||
}
|
}
|
||||||
|
|
||||||
const HTML_SUCCESS = `<!DOCTYPE html>
|
const HTML_SUCCESS = `<!doctype html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>OpenCode - Codex Authorization Successful</title>
|
<title>OpenCode - Codex Authorization Successful</title>
|
||||||
<style>
|
<style>
|
||||||
body { font-family: system-ui, -apple-system, sans-serif; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; background: #1a1a2e; color: #eee; }
|
body {
|
||||||
.container { text-align: center; padding: 2rem; }
|
font-family:
|
||||||
h1 { color: #4ade80; margin-bottom: 1rem; }
|
system-ui,
|
||||||
p { color: #aaa; }
|
-apple-system,
|
||||||
</style>
|
sans-serif;
|
||||||
</head>
|
display: flex;
|
||||||
<body>
|
justify-content: center;
|
||||||
<div class="container">
|
align-items: center;
|
||||||
<h1>Authorization Successful</h1>
|
height: 100vh;
|
||||||
<p>You can close this window and return to OpenCode.</p>
|
margin: 0;
|
||||||
</div>
|
background: #131010;
|
||||||
<script>setTimeout(() => window.close(), 2000);</script>
|
color: #f1ecec;
|
||||||
</body>
|
}
|
||||||
|
.container {
|
||||||
|
text-align: center;
|
||||||
|
padding: 2rem;
|
||||||
|
}
|
||||||
|
h1 {
|
||||||
|
color: #f1ecec;
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
}
|
||||||
|
p {
|
||||||
|
color: #b7b1b1;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="container">
|
||||||
|
<h1>Authorization Successful</h1>
|
||||||
|
<p>You can close this window and return to OpenCode.</p>
|
||||||
|
</div>
|
||||||
|
<script>
|
||||||
|
setTimeout(() => window.close(), 2000)
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
</html>`
|
</html>`
|
||||||
|
|
||||||
const HTML_ERROR = (error: string) => `<!DOCTYPE html>
|
const HTML_ERROR = (error: string) => `<!doctype html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>OpenCode - Codex Authorization Failed</title>
|
<title>OpenCode - Codex Authorization Failed</title>
|
||||||
<style>
|
<style>
|
||||||
body { font-family: system-ui, -apple-system, sans-serif; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; background: #1a1a2e; color: #eee; }
|
body {
|
||||||
.container { text-align: center; padding: 2rem; }
|
font-family:
|
||||||
h1 { color: #f87171; margin-bottom: 1rem; }
|
system-ui,
|
||||||
p { color: #aaa; }
|
-apple-system,
|
||||||
.error { color: #fca5a5; font-family: monospace; margin-top: 1rem; padding: 1rem; background: rgba(248,113,113,0.1); border-radius: 0.5rem; }
|
sans-serif;
|
||||||
</style>
|
display: flex;
|
||||||
</head>
|
justify-content: center;
|
||||||
<body>
|
align-items: center;
|
||||||
<div class="container">
|
height: 100vh;
|
||||||
<h1>Authorization Failed</h1>
|
margin: 0;
|
||||||
<p>An error occurred during authorization.</p>
|
background: #131010;
|
||||||
<div class="error">${error}</div>
|
color: #f1ecec;
|
||||||
</div>
|
}
|
||||||
</body>
|
.container {
|
||||||
|
text-align: center;
|
||||||
|
padding: 2rem;
|
||||||
|
}
|
||||||
|
h1 {
|
||||||
|
color: #fc533a;
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
}
|
||||||
|
p {
|
||||||
|
color: #b7b1b1;
|
||||||
|
}
|
||||||
|
.error {
|
||||||
|
color: #ff917b;
|
||||||
|
font-family: monospace;
|
||||||
|
margin-top: 1rem;
|
||||||
|
padding: 1rem;
|
||||||
|
background: #3c140d;
|
||||||
|
border-radius: 0.5rem;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="container">
|
||||||
|
<h1>Authorization Failed</h1>
|
||||||
|
<p>An error occurred during authorization.</p>
|
||||||
|
<div class="error">${error}</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
</html>`
|
</html>`
|
||||||
|
|
||||||
interface PendingOAuth {
|
interface PendingOAuth {
|
||||||
|
|||||||
Reference in New Issue
Block a user