mirror of
https://wget.la/https://github.com/leookun/cursor-byok
synced 2026-08-18 03:57:06 +08:00
feat(cursor): add contributor profile link and improve UI for Cursor account card
- Integrated a tooltip with a button to open the contributor's GitHub profile in the CursorAccountCard component. - Updated the layout of the account card for better visual organization. - Removed routing mode options from the configuration view and adjusted related translations in multiple languages. - Cleaned up unused routing mode logic in the app state management.
This commit is contained in:
@@ -1,10 +1,8 @@
|
||||
<script setup>
|
||||
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";
|
||||
import {
|
||||
@@ -12,7 +10,6 @@ import {
|
||||
appViewState,
|
||||
openConfigWindow,
|
||||
openModelConfigWindow,
|
||||
saveRoutingMode,
|
||||
syncHomeMetrics,
|
||||
syncServiceState,
|
||||
toUserError,
|
||||
@@ -21,8 +18,6 @@ import {
|
||||
import { Events } from "@wailsio/runtime";
|
||||
import { computed, onBeforeUnmount, onMounted, ref } from "vue";
|
||||
|
||||
const directModeEnabled = computed(() => appState.routingMode === "upstream");
|
||||
const message = useMessage();
|
||||
const AD_UPDATED_EVENT = "ad:updated";
|
||||
const OPEN_AD_EVENT = "cursor:open-ad";
|
||||
|
||||
@@ -128,15 +123,6 @@ async function handleOpenModelConfig() {
|
||||
}
|
||||
}
|
||||
|
||||
async function handleDirectModeChange(enabled) {
|
||||
const result = await saveRoutingMode(enabled ? "upstream" : "local");
|
||||
if (!result.ok) {
|
||||
await showActionError("切换失败", result.error);
|
||||
return;
|
||||
}
|
||||
message.success(enabled ? "已切换到直连 Cursor 模式" : "已切换到本地服务模式");
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
unsubscribeAdUpdated = Events.On(AD_UPDATED_EVENT, handleAdUpdated);
|
||||
void syncAdRuntimeQuietly();
|
||||
@@ -181,17 +167,6 @@ onBeforeUnmount(() => {
|
||||
class="rounded-[8px] border border-[#4b1d1d] bg-[#2a1313] px-3 py-2 text-sm text-[#fca5a5]">
|
||||
{{ appState.serviceLastError }}
|
||||
</div>
|
||||
|
||||
<Switch
|
||||
label="直连模式"
|
||||
description="开启后,Cursor将直接接通官方,请勿开启"
|
||||
enabled-text="当前为直连模式"
|
||||
disabled-text="当前为本地服务模式"
|
||||
:enabled="directModeEnabled"
|
||||
:busy="appState.configSaving"
|
||||
:disabled="appState.configSaving"
|
||||
@change="handleDirectModeChange"
|
||||
/>
|
||||
</div>
|
||||
</Card>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user