mirror of
https://wget.la/https://github.com/leookun/cursor-byok
synced 2026-08-17 19:47:10 +08:00
feat(cursor): 支持独立控制面账号登录
This commit is contained in:
@@ -0,0 +1,142 @@
|
||||
<script setup>
|
||||
import Button from "@/components/ui/Button.vue";
|
||||
import Card from "@/components/ui/Card.vue";
|
||||
import { showModal } from "@/composables/useModal";
|
||||
import {
|
||||
disconnectCursorAccount,
|
||||
getCursorAccountStatus,
|
||||
startCursorAccountLogin,
|
||||
} from "@/services/clientApi";
|
||||
import { toUserError } from "@/state/appState";
|
||||
import { computed, onMounted, onUnmounted, ref } from "vue";
|
||||
|
||||
const cursorAccountStatus = ref({
|
||||
state: "signed_out",
|
||||
authId: "",
|
||||
email: "",
|
||||
error: "",
|
||||
});
|
||||
const cursorAccountBusy = ref(false);
|
||||
let cursorAccountTimer = null;
|
||||
|
||||
const cursorAccountSignedIn = computed(
|
||||
() => cursorAccountStatus.value.state === "signed_in",
|
||||
);
|
||||
const cursorAccountWaiting = computed(
|
||||
() => cursorAccountStatus.value.state === "waiting",
|
||||
);
|
||||
const cursorAccountStateText = computed(() => {
|
||||
if (cursorAccountSignedIn.value) return "已经登录";
|
||||
if (cursorAccountWaiting.value) return "等待浏览器登录";
|
||||
return "未连接";
|
||||
});
|
||||
|
||||
async function showActionError(title, error) {
|
||||
await showModal({
|
||||
title,
|
||||
content: String(error || "服务错误").trim() || "服务错误",
|
||||
});
|
||||
}
|
||||
|
||||
async function refreshCursorAccountStatus() {
|
||||
cursorAccountStatus.value = await getCursorAccountStatus();
|
||||
}
|
||||
|
||||
async function handleCursorAccountLogin() {
|
||||
cursorAccountBusy.value = true;
|
||||
try {
|
||||
cursorAccountStatus.value = await startCursorAccountLogin();
|
||||
} catch (error) {
|
||||
await showActionError("登录失败", toUserError(error));
|
||||
await refreshCursorAccountStatus().catch(() => {});
|
||||
} finally {
|
||||
cursorAccountBusy.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
async function handleCursorAccountDisconnect() {
|
||||
const confirmed = await showModal({
|
||||
title: "退出登录",
|
||||
content: "只会退出 cursor-byok 中的 Cursor 账号,不会退出 Cursor 客户端。是否继续?",
|
||||
confirmText: "退出登录",
|
||||
cancelText: "取消",
|
||||
showCancel: true,
|
||||
});
|
||||
if (!confirmed) return;
|
||||
|
||||
cursorAccountBusy.value = true;
|
||||
try {
|
||||
cursorAccountStatus.value = await disconnectCursorAccount();
|
||||
} catch (error) {
|
||||
await showActionError("退出登录失败", toUserError(error));
|
||||
} finally {
|
||||
cursorAccountBusy.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
await refreshCursorAccountStatus().catch(() => {});
|
||||
cursorAccountTimer = window.setInterval(() => {
|
||||
if (cursorAccountWaiting.value) {
|
||||
void refreshCursorAccountStatus().catch(() => {});
|
||||
}
|
||||
}, 1500);
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
if (cursorAccountTimer) {
|
||||
window.clearInterval(cursorAccountTimer);
|
||||
cursorAccountTimer = null;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Card>
|
||||
<div class="flex items-center justify-between gap-4">
|
||||
<div class="min-w-0">
|
||||
<div class="flex items-center gap-2">
|
||||
<h2 class="text-base font-medium text-white">Cursor 控制面账号</h2>
|
||||
<span
|
||||
class="rounded-full border border-[#3a3a3a] bg-[#202020] px-2 py-0.5 text-xs text-[#b8b8b8]"
|
||||
>
|
||||
{{ cursorAccountStateText }}
|
||||
</span>
|
||||
</div>
|
||||
<div
|
||||
v-if="cursorAccountSignedIn && (cursorAccountStatus.email || cursorAccountStatus.authId)"
|
||||
class="mt-1 truncate text-sm text-[#d0d0d0]"
|
||||
>
|
||||
{{ cursorAccountStatus.email || cursorAccountStatus.authId }}
|
||||
</div>
|
||||
<div class="mt-1 text-sm text-[#a3a3a3]">
|
||||
独立用于插件、Skills 和 MCP;不会改变 Cursor 客户端当前账号
|
||||
</div>
|
||||
<div v-if="cursorAccountWaiting" class="mt-1 text-sm text-[#d6a84b]">
|
||||
请在浏览器完成登录,完成后返回 Cursor 重新打开插件市场
|
||||
</div>
|
||||
<div
|
||||
v-if="cursorAccountStatus.error"
|
||||
class="mt-1 break-all text-sm text-[#e06c75]"
|
||||
>
|
||||
{{ cursorAccountStatus.error }}
|
||||
</div>
|
||||
</div>
|
||||
<Button
|
||||
v-if="cursorAccountSignedIn"
|
||||
:disabled="cursorAccountBusy"
|
||||
@click="handleCursorAccountDisconnect"
|
||||
>
|
||||
退出登录
|
||||
</Button>
|
||||
<Button
|
||||
v-else
|
||||
variant="primary"
|
||||
:disabled="cursorAccountBusy || cursorAccountWaiting"
|
||||
@click="handleCursorAccountLogin"
|
||||
>
|
||||
{{ cursorAccountWaiting ? "等待登录..." : "登录 Cursor" }}
|
||||
</Button>
|
||||
</div>
|
||||
</Card>
|
||||
</template>
|
||||
@@ -19,8 +19,8 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "src/views/ModelConfig.vue",
|
||||
"line": 256,
|
||||
"column": 1
|
||||
"line": 255,
|
||||
"column": 165
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -43,8 +43,8 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "src/views/Config.vue",
|
||||
"line": 72,
|
||||
"column": 1
|
||||
"line": 71,
|
||||
"column": 48
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -108,8 +108,8 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "src/views/Config.vue",
|
||||
"line": 58,
|
||||
"column": 1
|
||||
"line": 57,
|
||||
"column": 48
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -197,8 +197,8 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "src/components/HomeMetricsCard.vue",
|
||||
"line": 338,
|
||||
"column": 1
|
||||
"line": 337,
|
||||
"column": 65
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -298,6 +298,18 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"1c631615c1d85c9e": {
|
||||
"source": "登录 Cursor",
|
||||
"kind": "text",
|
||||
"placeholders": 0,
|
||||
"refs": [
|
||||
{
|
||||
"file": "src/components/CursorAccountCard.vue",
|
||||
"line": 138,
|
||||
"column": 12
|
||||
}
|
||||
]
|
||||
},
|
||||
"1e238093b79b3165": {
|
||||
"source": "留空时默认 65536",
|
||||
"kind": "text",
|
||||
@@ -349,12 +361,12 @@
|
||||
},
|
||||
{
|
||||
"file": "src/views/Home.vue",
|
||||
"line": 118,
|
||||
"line": 119,
|
||||
"column": 27
|
||||
},
|
||||
{
|
||||
"file": "src/views/Home.vue",
|
||||
"line": 126,
|
||||
"line": 127,
|
||||
"column": 27
|
||||
},
|
||||
{
|
||||
@@ -407,8 +419,8 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "src/views/Config.vue",
|
||||
"line": 90,
|
||||
"column": 1
|
||||
"line": 89,
|
||||
"column": 48
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -429,6 +441,11 @@
|
||||
"kind": "text",
|
||||
"placeholders": 0,
|
||||
"refs": [
|
||||
{
|
||||
"file": "src/components/CursorAccountCard.vue",
|
||||
"line": 62,
|
||||
"column": 17
|
||||
},
|
||||
{
|
||||
"file": "src/components/ModelAdapterModal.vue",
|
||||
"line": 297,
|
||||
@@ -531,8 +548,8 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "src/components/ModelAdapterTestCard.vue",
|
||||
"line": 151,
|
||||
"column": 1
|
||||
"line": 150,
|
||||
"column": 7
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -579,8 +596,8 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "src/components/ModelAdapterTestCard.vue",
|
||||
"line": 130,
|
||||
"column": 1
|
||||
"line": 129,
|
||||
"column": 60
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -659,6 +676,28 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"3ab8cc15939f3b5c": {
|
||||
"source": "退出登录",
|
||||
"kind": "text",
|
||||
"placeholders": 0,
|
||||
"refs": [
|
||||
{
|
||||
"file": "src/components/CursorAccountCard.vue",
|
||||
"line": 59,
|
||||
"column": 12
|
||||
},
|
||||
{
|
||||
"file": "src/components/CursorAccountCard.vue",
|
||||
"line": 61,
|
||||
"column": 18
|
||||
},
|
||||
{
|
||||
"file": "src/components/CursorAccountCard.vue",
|
||||
"line": 130,
|
||||
"column": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
"3af7e5489e61ea51": {
|
||||
"source": "刷新中",
|
||||
"kind": "text",
|
||||
@@ -717,6 +756,18 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"3d52574ce1500561": {
|
||||
"source": "未连接",
|
||||
"kind": "text",
|
||||
"placeholders": 0,
|
||||
"refs": [
|
||||
{
|
||||
"file": "src/components/CursorAccountCard.vue",
|
||||
"line": 31,
|
||||
"column": 10
|
||||
}
|
||||
]
|
||||
},
|
||||
"3ea83f9f55062582": {
|
||||
"source": "发布时间:{0}",
|
||||
"kind": "template",
|
||||
@@ -892,8 +943,8 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "src/components/ModelAdapterTestCard.vue",
|
||||
"line": 125,
|
||||
"column": 1
|
||||
"line": 124,
|
||||
"column": 9
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -1010,7 +1061,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "src/views/Home.vue",
|
||||
"line": 106,
|
||||
"line": 107,
|
||||
"column": 27
|
||||
}
|
||||
]
|
||||
@@ -1150,6 +1201,18 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"688102a402ba015a": {
|
||||
"source": "等待登录...",
|
||||
"kind": "text",
|
||||
"placeholders": 0,
|
||||
"refs": [
|
||||
{
|
||||
"file": "src/components/CursorAccountCard.vue",
|
||||
"line": 138,
|
||||
"column": 12
|
||||
}
|
||||
]
|
||||
},
|
||||
"699fe7ade5407687": {
|
||||
"source": "直连模式",
|
||||
"kind": "text",
|
||||
@@ -1157,7 +1220,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "src/views/Home.vue",
|
||||
"line": 185,
|
||||
"line": 186,
|
||||
"column": 11
|
||||
}
|
||||
]
|
||||
@@ -1196,6 +1259,16 @@
|
||||
"kind": "text",
|
||||
"placeholders": 0,
|
||||
"refs": [
|
||||
{
|
||||
"file": "src/components/CursorAccountCard.vue",
|
||||
"line": 37,
|
||||
"column": 30
|
||||
},
|
||||
{
|
||||
"file": "src/components/CursorAccountCard.vue",
|
||||
"line": 37,
|
||||
"column": 48
|
||||
},
|
||||
{
|
||||
"file": "src/state/appState.js",
|
||||
"line": 23,
|
||||
@@ -1213,12 +1286,12 @@
|
||||
},
|
||||
{
|
||||
"file": "src/views/Home.vue",
|
||||
"line": 89,
|
||||
"line": 90,
|
||||
"column": 30
|
||||
},
|
||||
{
|
||||
"file": "src/views/Home.vue",
|
||||
"line": 89,
|
||||
"line": 90,
|
||||
"column": 48
|
||||
},
|
||||
{
|
||||
@@ -1426,7 +1499,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "src/views/Home.vue",
|
||||
"line": 96,
|
||||
"line": 97,
|
||||
"column": 27
|
||||
}
|
||||
]
|
||||
@@ -1455,8 +1528,8 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "src/components/HomeMetricsCard.vue",
|
||||
"line": 390,
|
||||
"column": 1
|
||||
"line": 389,
|
||||
"column": 65
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -1484,6 +1557,18 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"83be9cac28873059": {
|
||||
"source": "Cursor 控制面账号",
|
||||
"kind": "text",
|
||||
"placeholders": 0,
|
||||
"refs": [
|
||||
{
|
||||
"file": "src/components/CursorAccountCard.vue",
|
||||
"line": 99,
|
||||
"column": 56
|
||||
}
|
||||
]
|
||||
},
|
||||
"8672864e90417138": {
|
||||
"source": "最高",
|
||||
"kind": "text",
|
||||
@@ -1556,7 +1641,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "src/views/Home.vue",
|
||||
"line": 188,
|
||||
"line": 189,
|
||||
"column": 11
|
||||
}
|
||||
]
|
||||
@@ -1595,7 +1680,7 @@
|
||||
},
|
||||
{
|
||||
"file": "src/views/Home.vue",
|
||||
"line": 205,
|
||||
"line": 208,
|
||||
"column": 68
|
||||
}
|
||||
]
|
||||
@@ -1708,8 +1793,8 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "src/components/HomeMetricsCard.vue",
|
||||
"line": 342,
|
||||
"column": 1
|
||||
"line": 341,
|
||||
"column": 23
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -1845,7 +1930,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "src/views/Home.vue",
|
||||
"line": 136,
|
||||
"line": 137,
|
||||
"column": 29
|
||||
}
|
||||
]
|
||||
@@ -1893,8 +1978,8 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "src/views/ModelEditor.vue",
|
||||
"line": 297,
|
||||
"column": 1
|
||||
"line": 296,
|
||||
"column": 97
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -2016,7 +2101,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "src/views/Home.vue",
|
||||
"line": 187,
|
||||
"line": 188,
|
||||
"column": 11
|
||||
}
|
||||
]
|
||||
@@ -2147,7 +2232,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "src/views/Home.vue",
|
||||
"line": 201,
|
||||
"line": 204,
|
||||
"column": 47
|
||||
}
|
||||
]
|
||||
@@ -2222,7 +2307,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "src/views/Home.vue",
|
||||
"line": 136,
|
||||
"line": 137,
|
||||
"column": 50
|
||||
}
|
||||
]
|
||||
@@ -2400,6 +2485,18 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"c3d46b387eeadb23": {
|
||||
"source": "只会退出 cursor-byok 中的 Cursor 账号,不会退出 Cursor 客户端。是否继续?",
|
||||
"kind": "text",
|
||||
"placeholders": 0,
|
||||
"refs": [
|
||||
{
|
||||
"file": "src/components/CursorAccountCard.vue",
|
||||
"line": 60,
|
||||
"column": 14
|
||||
}
|
||||
]
|
||||
},
|
||||
"c3e9c3c60020b8b7": {
|
||||
"source": "选择模式",
|
||||
"kind": "text",
|
||||
@@ -2431,11 +2528,23 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "src/views/Home.vue",
|
||||
"line": 204,
|
||||
"line": 207,
|
||||
"column": 63
|
||||
}
|
||||
]
|
||||
},
|
||||
"c8a52b66651d294c": {
|
||||
"source": "退出登录失败",
|
||||
"kind": "text",
|
||||
"placeholders": 0,
|
||||
"refs": [
|
||||
{
|
||||
"file": "src/components/CursorAccountCard.vue",
|
||||
"line": 71,
|
||||
"column": 27
|
||||
}
|
||||
]
|
||||
},
|
||||
"c8c14507b2d37395": {
|
||||
"source": "推理强度",
|
||||
"kind": "text",
|
||||
@@ -2525,11 +2634,23 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "src/views/Home.vue",
|
||||
"line": 186,
|
||||
"line": 187,
|
||||
"column": 11
|
||||
}
|
||||
]
|
||||
},
|
||||
"cfa6c803eb3fc713": {
|
||||
"source": "等待浏览器登录",
|
||||
"kind": "text",
|
||||
"placeholders": 0,
|
||||
"refs": [
|
||||
{
|
||||
"file": "src/components/CursorAccountCard.vue",
|
||||
"line": 30,
|
||||
"column": 42
|
||||
}
|
||||
]
|
||||
},
|
||||
"d0325067fed88e5a": {
|
||||
"source": "缓存命中率 {0}",
|
||||
"kind": "template",
|
||||
@@ -2549,7 +2670,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "src/views/Home.vue",
|
||||
"line": 133,
|
||||
"line": 134,
|
||||
"column": 27
|
||||
}
|
||||
]
|
||||
@@ -2653,6 +2774,18 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"d6ce4f0f88178144": {
|
||||
"source": "独立用于插件、Skills 和 MCP;不会改变 Cursor 客户端当前账号",
|
||||
"kind": "text",
|
||||
"placeholders": 0,
|
||||
"refs": [
|
||||
{
|
||||
"file": "src/components/CursorAccountCard.vue",
|
||||
"line": 113,
|
||||
"column": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
"d7889896c5b7732a": {
|
||||
"source": "Anthropic 额外参数 JSON",
|
||||
"kind": "text",
|
||||
@@ -2771,8 +2904,8 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "src/views/Config.vue",
|
||||
"line": 102,
|
||||
"column": 1
|
||||
"line": 101,
|
||||
"column": 48
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -2812,11 +2945,35 @@
|
||||
},
|
||||
{
|
||||
"file": "src/views/Home.vue",
|
||||
"line": 200,
|
||||
"line": 203,
|
||||
"column": 56
|
||||
}
|
||||
]
|
||||
},
|
||||
"e4343921c928a856": {
|
||||
"source": "登录失败",
|
||||
"kind": "text",
|
||||
"placeholders": 0,
|
||||
"refs": [
|
||||
{
|
||||
"file": "src/components/CursorAccountCard.vue",
|
||||
"line": 50,
|
||||
"column": 27
|
||||
}
|
||||
]
|
||||
},
|
||||
"e53580f8031f13c0": {
|
||||
"source": "请在浏览器完成登录,完成后返回 Cursor 重新打开插件市场",
|
||||
"kind": "text",
|
||||
"placeholders": 0,
|
||||
"refs": [
|
||||
{
|
||||
"file": "src/components/CursorAccountCard.vue",
|
||||
"line": 116,
|
||||
"column": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
"e552c2accdbf5178": {
|
||||
"source": "新增模型",
|
||||
"kind": "text",
|
||||
@@ -2841,6 +2998,18 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"e8a0a6053998ebfa": {
|
||||
"source": "已经登录",
|
||||
"kind": "text",
|
||||
"placeholders": 0,
|
||||
"refs": [
|
||||
{
|
||||
"file": "src/components/CursorAccountCard.vue",
|
||||
"line": 29,
|
||||
"column": 43
|
||||
}
|
||||
]
|
||||
},
|
||||
"eaffd48cd2ea9f1a": {
|
||||
"source": "例如:https://api.anthropic.com",
|
||||
"kind": "text",
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
"1af38868896cf53d": "Routing mode only supports local or upstream",
|
||||
"1baddde657dd2720": "Current outbound requests use system proxy",
|
||||
"1bc77f5ab979f4c1": "Add Model Settings",
|
||||
"1c631615c1d85c9e": "Log in to Cursor",
|
||||
"1e238093b79b3165": "Uses 65536 by default when left blank",
|
||||
"21296ab18ad9af25": "Extra Params JSON",
|
||||
"24343a2096988d42": "Failed to open",
|
||||
@@ -46,10 +47,12 @@
|
||||
"37d23612f78a2e63": "Restart Now to Update",
|
||||
"392d0dceb45998d3": "Extreme",
|
||||
"393df9bb13ea4900": "Hit",
|
||||
"3ab8cc15939f3b5c": "Log out",
|
||||
"3af7e5489e61ea51": "Refreshing",
|
||||
"3bf8512aa520ed21": "Local Service Mode",
|
||||
"3c2a9f9901109e75": "{0} type only supports OpenAI or Anthropic",
|
||||
"3d13868593ae4eeb": "Interface Language",
|
||||
"3d52574ce1500561": "Not connected",
|
||||
"3ea83f9f55062582": "Release date: {0}",
|
||||
"3edda85621fd03b2": "model adapters",
|
||||
"3fd47edce45b3603": "Close",
|
||||
@@ -84,6 +87,7 @@
|
||||
"66af574b8948fe83": "{0} API key cannot be empty",
|
||||
"6744b4c6a9aa0038": "Disabled",
|
||||
"675109292da4eb36": "Not tested yet",
|
||||
"688102a402ba015a": "Waiting for login...",
|
||||
"699fe7ade5407687": "Direct Mode",
|
||||
"6a7b96f399e58138": "e.g. sk-xxxxxx",
|
||||
"6aa8f49cc992dfd7": "Test",
|
||||
@@ -106,6 +110,7 @@
|
||||
"80296f4aa3f4543b": "Cache Read/Write",
|
||||
"81123c56d5d880d0": "API Key",
|
||||
"8139cb3dd11f5a67": "When enabled, the JSON object will override the final request headers. Duplicate headers are determined by this field, and values must be strings.",
|
||||
"83be9cac28873059": "Cursor Control Plane Account",
|
||||
"8672864e90417138": "Max",
|
||||
"86df7ec743047234": "Service running",
|
||||
"87ed126f7bd1121e": "Routing Mode",
|
||||
@@ -174,9 +179,11 @@
|
||||
"bddd504af0c92fd0": "System PAC/automatic proxy detected; current version is handled as a direct connection",
|
||||
"bef280f9eb392495": "Conversation Turns",
|
||||
"c228558cf257fc49": "Delete failed",
|
||||
"c3d46b387eeadb23": "This only logs the Cursor account out of cursor-byok; it does not log out of the Cursor client. Continue?",
|
||||
"c3e9c3c60020b8b7": "Select Mode",
|
||||
"c5af02060847d167": "Thinking effort for Anthropic adaptive thinking. Requests will consistently use the new thinking.type=adaptive.",
|
||||
"c69f5bce63b9f14c": "Settings Folder",
|
||||
"c8a52b66651d294c": "Failed to log out",
|
||||
"c8c14507b2d37395": "Reasoning Effort",
|
||||
"c98e118e0a43f078": "Model",
|
||||
"c9dd59beefd7144f": "Cache Read / (Cache Read + Non-cache Input)",
|
||||
@@ -184,6 +191,7 @@
|
||||
"ca1d1059408b3837": "Invalid turns: {0}",
|
||||
"cd7ca5fb221e1c53": "{0} cannot be empty",
|
||||
"ce46f23cea3bf3c5": "When enabled, Cursor connects directly to the official service. Do not enable this.",
|
||||
"cfa6c803eb3fc713": "Waiting for browser login",
|
||||
"d0325067fed88e5a": "Cache hit rate {0}",
|
||||
"d08fd4224abcd69d": "Switch failed",
|
||||
"d1bde4a4e057b2c7": "[MainLayout] Failed to load author info",
|
||||
@@ -193,6 +201,7 @@
|
||||
"d373809ab86ba93b": "Copy",
|
||||
"d3b1da3088ddd334": "Model test failed",
|
||||
"d53d32f1a1211371": "Custom Headers JSON",
|
||||
"d6ce4f0f88178144": "Used only for Plugins, Skills, and MCP; does not change the account in the Cursor client",
|
||||
"d7889896c5b7732a": "Anthropic Extra Params JSON",
|
||||
"d7da2aabd35772ec": "e.g. 200000 (leave blank to use the default)",
|
||||
"d95e5cb6bdcee553": "Include Cache Creation",
|
||||
@@ -205,8 +214,11 @@
|
||||
"e01c5dae36cf8c35": "When enabled, the JSON object will override the OpenAI request body. Duplicate fields are determined by this field. OpenAI service_tier supports auto, default, flex, scale, priority.",
|
||||
"e14c41ef2b7253c9": "Total request tokens: {0}",
|
||||
"e406825e0a72d2c2": "Local Settings",
|
||||
"e4343921c928a856": "Login failed",
|
||||
"e53580f8031f13c0": "Complete login in the browser, then return to Cursor and reopen the plugin marketplace",
|
||||
"e552c2accdbf5178": "Add Model",
|
||||
"e6faccfddce722e8": "Cache read tokens: {0}",
|
||||
"e8a0a6053998ebfa": "Logged in",
|
||||
"eaffd48cd2ea9f1a": "e.g. https://api.anthropic.com",
|
||||
"eb1be07f2ca6e506": "Estimated based on Claude Opus 4.7 pricing.",
|
||||
"ec3b17a75db49e24": "{0} t/s | First token {1}",
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
"1af38868896cf53d": "ルーティングモードは local または upstream のみサポートします",
|
||||
"1baddde657dd2720": "現在のアウトバウンドリクエストはシステムプロキシを使用しています",
|
||||
"1bc77f5ab979f4c1": "モデル設定を追加",
|
||||
"1c631615c1d85c9e": "Cursor にログイン",
|
||||
"1e238093b79b3165": "空欄で 65536",
|
||||
"21296ab18ad9af25": "追加パラメータ JSON",
|
||||
"24343a2096988d42": "開けませんでした",
|
||||
@@ -46,10 +47,12 @@
|
||||
"37d23612f78a2e63": "今すぐ再起動して更新",
|
||||
"392d0dceb45998d3": "最高",
|
||||
"393df9bb13ea4900": "ヒット",
|
||||
"3ab8cc15939f3b5c": "ログアウト",
|
||||
"3af7e5489e61ea51": "更新中",
|
||||
"3bf8512aa520ed21": "ローカルサービスモード",
|
||||
"3c2a9f9901109e75": "{0} のタイプは OpenAI または Anthropic のみサポートします",
|
||||
"3d13868593ae4eeb": "表示言語",
|
||||
"3d52574ce1500561": "未接続",
|
||||
"3ea83f9f55062582": "公開日時: {0}",
|
||||
"3edda85621fd03b2": "件のモデルアダプター",
|
||||
"3fd47edce45b3603": "閉じる",
|
||||
@@ -84,6 +87,7 @@
|
||||
"66af574b8948fe83": "{0} の API キーは必須です",
|
||||
"6744b4c6a9aa0038": "無効化",
|
||||
"675109292da4eb36": "まだテストしていません",
|
||||
"688102a402ba015a": "ログインを待っています...",
|
||||
"699fe7ade5407687": "直結モード",
|
||||
"6a7b96f399e58138": "例: sk-xxxxxx",
|
||||
"6aa8f49cc992dfd7": "テスト",
|
||||
@@ -106,6 +110,7 @@
|
||||
"80296f4aa3f4543b": "キャッシュ読み書き",
|
||||
"81123c56d5d880d0": "API キー",
|
||||
"8139cb3dd11f5a67": "有効にすると、JSONオブジェクトが最終的なリクエストヘッダーを上書きします。同名のヘッダーはこの設定が優先され、値は文字列である必要があります。",
|
||||
"83be9cac28873059": "Cursor コントロールプレーンアカウント",
|
||||
"8672864e90417138": "最大",
|
||||
"86df7ec743047234": "サービス稼働中",
|
||||
"87ed126f7bd1121e": "ルーティングモード",
|
||||
@@ -174,9 +179,11 @@
|
||||
"bddd504af0c92fd0": "システムのPAC/自動プロキシが検出されました。現在のバージョンは直接接続として処理されます",
|
||||
"bef280f9eb392495": "会話ターン",
|
||||
"c228558cf257fc49": "削除に失敗しました",
|
||||
"c3d46b387eeadb23": "cursor-byok 内の Cursor アカウントからのみログアウトします。Cursor クライアントからはログアウトしません。続行しますか?",
|
||||
"c3e9c3c60020b8b7": "モードを選択",
|
||||
"c5af02060847d167": "Anthropic adaptive thinkingの思考強度。リクエストは一貫して新しいthinking.type=adaptiveを使用します。",
|
||||
"c69f5bce63b9f14c": "設定フォルダー",
|
||||
"c8a52b66651d294c": "ログアウトに失敗しました",
|
||||
"c8c14507b2d37395": "推論強度",
|
||||
"c98e118e0a43f078": "モデル",
|
||||
"c9dd59beefd7144f": "キャッシュ読み取り / (キャッシュ読み取り + 非キャッシュ入力)",
|
||||
@@ -184,6 +191,7 @@
|
||||
"ca1d1059408b3837": "異常ターン: {0}",
|
||||
"cd7ca5fb221e1c53": "{0}は空にできません",
|
||||
"ce46f23cea3bf3c5": "有効にすると、Cursor は公式サービスへ直接接続します。オンにしないでください",
|
||||
"cfa6c803eb3fc713": "ブラウザでのログインを待っています",
|
||||
"d0325067fed88e5a": "キャッシュヒット率 {0}",
|
||||
"d08fd4224abcd69d": "切替に失敗しました",
|
||||
"d1bde4a4e057b2c7": "[MainLayout] 作者情報の読み込みに失敗しました",
|
||||
@@ -193,6 +201,7 @@
|
||||
"d373809ab86ba93b": "コピー",
|
||||
"d3b1da3088ddd334": "モデルテストに失敗しました",
|
||||
"d53d32f1a1211371": "カスタムヘッダー JSON",
|
||||
"d6ce4f0f88178144": "プラグイン、Skills、MCP 専用です。Cursor クライアントの現在のアカウントは変更しません",
|
||||
"d7889896c5b7732a": "Anthropic 追加パラメータ JSON",
|
||||
"d7da2aabd35772ec": "例: 200000(空欄でデフォルト値)",
|
||||
"d95e5cb6bdcee553": "キャッシュ作成を含める",
|
||||
@@ -205,8 +214,11 @@
|
||||
"e01c5dae36cf8c35": "有効にすると、JSONオブジェクトがOpenAIのリクエストボディを上書きします。同名のフィールドはこの設定が優先されます。OpenAIのservice_tierはauto、default、flex、scale、priorityをサポートしています。",
|
||||
"e14c41ef2b7253c9": "総リクエスト Token: {0}",
|
||||
"e406825e0a72d2c2": "ローカル設定",
|
||||
"e4343921c928a856": "ログインに失敗しました",
|
||||
"e53580f8031f13c0": "ブラウザでログインを完了し、Cursor に戻ってプラグインマーケットを開き直してください",
|
||||
"e552c2accdbf5178": "モデルを追加",
|
||||
"e6faccfddce722e8": "キャッシュ読込 Token: {0}",
|
||||
"e8a0a6053998ebfa": "ログイン済み",
|
||||
"eaffd48cd2ea9f1a": "例: https://api.anthropic.com",
|
||||
"eb1be07f2ca6e506": "Claude Opus 4.7の価格に基づいて見積もられます。",
|
||||
"ec3b17a75db49e24": "{0} t/s | 初回 Token {1}",
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
"1af38868896cf53d": "Режим маршрутизации поддерживает только local или upstream",
|
||||
"1baddde657dd2720": "Исходящие запросы используют системный прокси",
|
||||
"1bc77f5ab979f4c1": "Добавить настройки модели",
|
||||
"1c631615c1d85c9e": "Войти в Cursor",
|
||||
"1e238093b79b3165": "Если оставить пустым, используется 65536",
|
||||
"21296ab18ad9af25": "Дополнительные параметры JSON",
|
||||
"24343a2096988d42": "Не удалось открыть",
|
||||
@@ -46,10 +47,12 @@
|
||||
"37d23612f78a2e63": "Перезапустить и обновить",
|
||||
"392d0dceb45998d3": "Очень высокая",
|
||||
"393df9bb13ea4900": "Попадание",
|
||||
"3ab8cc15939f3b5c": "Выйти",
|
||||
"3af7e5489e61ea51": "Обновление",
|
||||
"3bf8512aa520ed21": "Режим локального сервиса",
|
||||
"3c2a9f9901109e75": "Тип {0} поддерживает только OpenAI или Anthropic",
|
||||
"3d13868593ae4eeb": "Язык интерфейса",
|
||||
"3d52574ce1500561": "Не подключено",
|
||||
"3ea83f9f55062582": "Дата выпуска: {0}",
|
||||
"3edda85621fd03b2": "адаптеров моделей",
|
||||
"3fd47edce45b3603": "Закрыть",
|
||||
@@ -84,6 +87,7 @@
|
||||
"66af574b8948fe83": "Ключ API {0} не может быть пустым",
|
||||
"6744b4c6a9aa0038": "Выключено",
|
||||
"675109292da4eb36": "Еще не проверено",
|
||||
"688102a402ba015a": "Ожидание входа...",
|
||||
"699fe7ade5407687": "Прямой режим",
|
||||
"6a7b96f399e58138": "например, sk-xxxxxx",
|
||||
"6aa8f49cc992dfd7": "Проверить",
|
||||
@@ -106,6 +110,7 @@
|
||||
"80296f4aa3f4543b": "Чтение/запись кеша",
|
||||
"81123c56d5d880d0": "Ключ API",
|
||||
"8139cb3dd11f5a67": "Если включено, объект JSON переопределит итоговые заголовки запроса. При совпадении имен используются значения отсюда; все значения должны быть строками.",
|
||||
"83be9cac28873059": "Аккаунт управляющего уровня Cursor",
|
||||
"8672864e90417138": "Максимальная",
|
||||
"86df7ec743047234": "Сервис запущен",
|
||||
"87ed126f7bd1121e": "Режим маршрутизации",
|
||||
@@ -174,9 +179,11 @@
|
||||
"bddd504af0c92fd0": "Обнаружен системный PAC/автоматический прокси; в текущей версии используется прямое подключение",
|
||||
"bef280f9eb392495": "Ходы диалога",
|
||||
"c228558cf257fc49": "Не удалось удалить",
|
||||
"c3d46b387eeadb23": "Будет выполнен выход только из аккаунта Cursor в cursor-byok. В клиенте Cursor вы останетесь в системе. Продолжить?",
|
||||
"c3e9c3c60020b8b7": "Выберите режим",
|
||||
"c5af02060847d167": "Интенсивность для адаптивных рассуждений Anthropic. В запросах всегда используется новый режим thinking.type=adaptive.",
|
||||
"c69f5bce63b9f14c": "Папка настроек",
|
||||
"c8a52b66651d294c": "Не удалось выйти",
|
||||
"c8c14507b2d37395": "Интенсивность рассуждений",
|
||||
"c98e118e0a43f078": "Модель",
|
||||
"c9dd59beefd7144f": "Чтение кеша / (Чтение кеша + Ввод без кеша)",
|
||||
@@ -184,6 +191,7 @@
|
||||
"ca1d1059408b3837": "Ошибочных ходов: {0}",
|
||||
"cd7ca5fb221e1c53": "{0} не может быть пустым",
|
||||
"ce46f23cea3bf3c5": "Если включено, Cursor подключается напрямую к официальному сервису. Не включайте этот режим.",
|
||||
"cfa6c803eb3fc713": "Ожидание входа в браузере",
|
||||
"d0325067fed88e5a": "Доля попаданий в кеш: {0}",
|
||||
"d08fd4224abcd69d": "Не удалось переключить",
|
||||
"d1bde4a4e057b2c7": "[MainLayout] Не удалось загрузить сведения об авторе",
|
||||
@@ -193,6 +201,7 @@
|
||||
"d373809ab86ba93b": "Копировать",
|
||||
"d3b1da3088ddd334": "Проверка модели не пройдена",
|
||||
"d53d32f1a1211371": "Пользовательские заголовки JSON",
|
||||
"d6ce4f0f88178144": "Используется только для Plugins, Skills и MCP; текущий аккаунт клиента Cursor не изменяется",
|
||||
"d7889896c5b7732a": "Дополнительные параметры Anthropic JSON",
|
||||
"d7da2aabd35772ec": "например, 200000 (оставьте пустым для значения по умолчанию)",
|
||||
"d95e5cb6bdcee553": "Учитывать создание кеша",
|
||||
@@ -205,8 +214,11 @@
|
||||
"e01c5dae36cf8c35": "Если включено, объект JSON переопределит тело запроса OpenAI. При совпадении полей используются значения отсюда. OpenAI service_tier поддерживает auto, default, flex, scale и priority.",
|
||||
"e14c41ef2b7253c9": "Всего токенов запроса: {0}",
|
||||
"e406825e0a72d2c2": "Локальные настройки",
|
||||
"e4343921c928a856": "Не удалось войти",
|
||||
"e53580f8031f13c0": "Завершите вход в браузере, затем вернитесь в Cursor и снова откройте магазин плагинов",
|
||||
"e552c2accdbf5178": "Добавить модель",
|
||||
"e6faccfddce722e8": "Токены чтения из кеша: {0}",
|
||||
"e8a0a6053998ebfa": "Выполнен вход",
|
||||
"eaffd48cd2ea9f1a": "например, https://api.anthropic.com",
|
||||
"eb1be07f2ca6e506": "Расчет основан на тарифах Claude Opus 4.7.",
|
||||
"ec3b17a75db49e24": "{0} т/с | Первый токен {1}",
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
"1af38868896cf53d": "运行模式仅支持 local 或 upstream",
|
||||
"1baddde657dd2720": "当前出站请求使用系统代理",
|
||||
"1bc77f5ab979f4c1": "新增模型配置",
|
||||
"1c631615c1d85c9e": "登录 Cursor",
|
||||
"1e238093b79b3165": "留空时默认 65536",
|
||||
"21296ab18ad9af25": "额外参数 JSON",
|
||||
"24343a2096988d42": "打开失败",
|
||||
@@ -46,10 +47,12 @@
|
||||
"37d23612f78a2e63": "立即重启更新",
|
||||
"392d0dceb45998d3": "极高",
|
||||
"393df9bb13ea4900": "命中",
|
||||
"3ab8cc15939f3b5c": "退出登录",
|
||||
"3af7e5489e61ea51": "刷新中",
|
||||
"3bf8512aa520ed21": "本地服务模式",
|
||||
"3c2a9f9901109e75": "{0} 的类型仅支持 OpenAI 或 Anthropic",
|
||||
"3d13868593ae4eeb": "界面语言",
|
||||
"3d52574ce1500561": "未连接",
|
||||
"3ea83f9f55062582": "发布时间:{0}",
|
||||
"3edda85621fd03b2": "个模型适配器",
|
||||
"3fd47edce45b3603": "关闭",
|
||||
@@ -84,6 +87,7 @@
|
||||
"66af574b8948fe83": "{0} 的访问密钥不能为空",
|
||||
"6744b4c6a9aa0038": "已关闭",
|
||||
"675109292da4eb36": "尚未测试",
|
||||
"688102a402ba015a": "等待登录...",
|
||||
"699fe7ade5407687": "直连模式",
|
||||
"6a7b96f399e58138": "例如:sk-xxxxxx",
|
||||
"6aa8f49cc992dfd7": "测试",
|
||||
@@ -106,6 +110,7 @@
|
||||
"80296f4aa3f4543b": "缓存读写",
|
||||
"81123c56d5d880d0": "访问密钥",
|
||||
"8139cb3dd11f5a67": "开启后会把 JSON 对象覆盖到最终请求头。同名请求头以这里为准,值必须是字符串。",
|
||||
"83be9cac28873059": "Cursor 控制面账号",
|
||||
"8672864e90417138": "最高",
|
||||
"86df7ec743047234": "服务运行中",
|
||||
"87ed126f7bd1121e": "运行模式",
|
||||
@@ -174,9 +179,11 @@
|
||||
"bddd504af0c92fd0": "检测到系统 PAC/自动代理,当前版本按直连处理",
|
||||
"bef280f9eb392495": "对话轮次",
|
||||
"c228558cf257fc49": "删除失败",
|
||||
"c3d46b387eeadb23": "只会退出 cursor-byok 中的 Cursor 账号,不会退出 Cursor 客户端。是否继续?",
|
||||
"c3e9c3c60020b8b7": "选择模式",
|
||||
"c5af02060847d167": "Anthropic adaptive thinking 的思考强度。请求会固定使用新版 thinking.type=adaptive。",
|
||||
"c69f5bce63b9f14c": "设置文件夹",
|
||||
"c8a52b66651d294c": "退出登录失败",
|
||||
"c8c14507b2d37395": "推理强度",
|
||||
"c98e118e0a43f078": "模型",
|
||||
"c9dd59beefd7144f": "缓存读取 /(缓存读取 + 非缓存输入)",
|
||||
@@ -184,6 +191,7 @@
|
||||
"ca1d1059408b3837": "异常轮次:{0}",
|
||||
"cd7ca5fb221e1c53": "{0}不能为空",
|
||||
"ce46f23cea3bf3c5": "开启后,Cursor将直接接通官方,请勿开启",
|
||||
"cfa6c803eb3fc713": "等待浏览器登录",
|
||||
"d0325067fed88e5a": "缓存命中率 {0}",
|
||||
"d08fd4224abcd69d": "切换失败",
|
||||
"d1bde4a4e057b2c7": "[MainLayout] 加载作者信息失败",
|
||||
@@ -193,6 +201,7 @@
|
||||
"d373809ab86ba93b": "拷贝",
|
||||
"d3b1da3088ddd334": "模型测试失败",
|
||||
"d53d32f1a1211371": "自定义请求头 JSON",
|
||||
"d6ce4f0f88178144": "独立用于插件、Skills 和 MCP;不会改变 Cursor 客户端当前账号",
|
||||
"d7889896c5b7732a": "Anthropic 额外参数 JSON",
|
||||
"d7da2aabd35772ec": "例如:200000(留空用默认值)",
|
||||
"d95e5cb6bdcee553": "计入缓存创建",
|
||||
@@ -205,8 +214,11 @@
|
||||
"e01c5dae36cf8c35": "开启后会把 JSON 对象覆盖到 OpenAI 请求体。同名字段以这里为准。OpenAI service_tier 支持 auto、default、flex、scale、priority。",
|
||||
"e14c41ef2b7253c9": "总请求:{0}",
|
||||
"e406825e0a72d2c2": "本地配置",
|
||||
"e4343921c928a856": "登录失败",
|
||||
"e53580f8031f13c0": "请在浏览器完成登录,完成后返回 Cursor 重新打开插件市场",
|
||||
"e552c2accdbf5178": "新增模型",
|
||||
"e6faccfddce722e8": "缓存读取:{0}",
|
||||
"e8a0a6053998ebfa": "已经登录",
|
||||
"eaffd48cd2ea9f1a": "例如:https://api.anthropic.com",
|
||||
"eb1be07f2ca6e506": "按 Claude Opus 4.7 价格估算。",
|
||||
"ec3b17a75db49e24": "{0} t/s | 首字 {1}",
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
import {
|
||||
DisconnectCursorAccount,
|
||||
GetCursorAccountStatus,
|
||||
GetState,
|
||||
LoadUserConfig,
|
||||
SaveUserConfig,
|
||||
StartCursorAccountLogin,
|
||||
StartProxy,
|
||||
StopProxy,
|
||||
} from "@bindings/cursor/internal/bridge/proxyservice.js";
|
||||
@@ -62,6 +65,18 @@ export function saveUserConfig(payload) {
|
||||
return withApiLogging("SaveUserConfig", payload, () => SaveUserConfig(payload));
|
||||
}
|
||||
|
||||
export function getCursorAccountStatus() {
|
||||
return withApiLogging("GetCursorAccountStatus", undefined, () => GetCursorAccountStatus());
|
||||
}
|
||||
|
||||
export function startCursorAccountLogin() {
|
||||
return withApiLogging("StartCursorAccountLogin", undefined, () => StartCursorAccountLogin());
|
||||
}
|
||||
|
||||
export function disconnectCursorAccount() {
|
||||
return withApiLogging("DisconnectCursorAccount", undefined, () => DisconnectCursorAccount());
|
||||
}
|
||||
|
||||
export function getProxyState() {
|
||||
return withApiLogging("GetState", undefined, () => GetState());
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ import Button from "@/components/ui/Button.vue";
|
||||
import Card from "@/components/ui/Card.vue";
|
||||
import Switch from "@/components/ui/Switch.vue";
|
||||
import HomeMetricsCard from "@/components/HomeMetricsCard.vue";
|
||||
import CursorAccountCard from "@/components/CursorAccountCard.vue";
|
||||
import { useMessage } from "@/composables/useMessage";
|
||||
import { showModal } from "@/composables/useModal";
|
||||
import { getAdRuntime } from "@/services/clientApi";
|
||||
@@ -149,7 +150,7 @@ onBeforeUnmount(() => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="flex flex-col gap-4 p-4 pt-0 text-[#e5e5e5]">
|
||||
<div class="flex h-full min-h-0 flex-col gap-4 overflow-y-auto p-4 pt-0 text-[#e5e5e5]">
|
||||
<HomeMetricsCard
|
||||
:metrics="appState.homeMetrics"
|
||||
:loading="appState.homeMetricsLoading"
|
||||
@@ -194,6 +195,8 @@ onBeforeUnmount(() => {
|
||||
</div>
|
||||
</Card>
|
||||
|
||||
<CursorAccountCard />
|
||||
|
||||
<Card>
|
||||
<div class="flex items-center justify-between gap-4">
|
||||
<div>
|
||||
|
||||
Reference in New Issue
Block a user