chore: remove Vercel sync feature (UI, admin API, entrypoint)
Drop the Vercel Sync admin page and its backend (internal/httpapi/admin/vercel, webui/src/features/vercel), unregister its routes, remove the nav item and locale keys, and delete the Vercel Go entrypoint api/index.go. Deployment is docker-image only. The inert internal stream-prepare plumbing (chat/vercel_stream.go and the __stream_prepare branches) is left in place; it never executes without the Vercel Node bridge and removing it would touch concurrency-sensitive lease code in the core streaming handlers.
This commit is contained in:
@@ -1,20 +0,0 @@
|
||||
package handler
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"sync"
|
||||
|
||||
"ds2api/app"
|
||||
)
|
||||
|
||||
var (
|
||||
once sync.Once
|
||||
h http.Handler
|
||||
)
|
||||
|
||||
func Handler(w http.ResponseWriter, r *http.Request) {
|
||||
once.Do(func() {
|
||||
h = app.NewHandler()
|
||||
})
|
||||
h.ServeHTTP(w, r)
|
||||
}
|
||||
@@ -13,7 +13,6 @@ import (
|
||||
adminrawsamples "ds2api/internal/httpapi/admin/rawsamples"
|
||||
adminsettings "ds2api/internal/httpapi/admin/settings"
|
||||
adminshared "ds2api/internal/httpapi/admin/shared"
|
||||
adminvercel "ds2api/internal/httpapi/admin/vercel"
|
||||
adminversion "ds2api/internal/httpapi/admin/version"
|
||||
)
|
||||
|
||||
@@ -33,7 +32,6 @@ func RegisterRoutes(r chi.Router, h *Handler) {
|
||||
settingsHandler := &adminsettings.Handler{Store: deps.Store, Pool: deps.Pool, DS: deps.DS, OpenAI: deps.OpenAI, ChatHistory: deps.ChatHistory}
|
||||
proxiesHandler := &adminproxies.Handler{Store: deps.Store, Pool: deps.Pool, DS: deps.DS, OpenAI: deps.OpenAI, ChatHistory: deps.ChatHistory}
|
||||
rawSamplesHandler := &adminrawsamples.Handler{Store: deps.Store, Pool: deps.Pool, DS: deps.DS, OpenAI: deps.OpenAI, ChatHistory: deps.ChatHistory}
|
||||
vercelHandler := &adminvercel.Handler{Store: deps.Store, Pool: deps.Pool, DS: deps.DS, OpenAI: deps.OpenAI, ChatHistory: deps.ChatHistory}
|
||||
historyHandler := &adminhistory.Handler{Store: deps.Store, Pool: deps.Pool, DS: deps.DS, OpenAI: deps.OpenAI, ChatHistory: deps.ChatHistory}
|
||||
devCaptureHandler := &admindevcapture.Handler{Store: deps.Store, Pool: deps.Pool, DS: deps.DS, OpenAI: deps.OpenAI, ChatHistory: deps.ChatHistory}
|
||||
versionHandler := &adminversion.Handler{Store: deps.Store, Pool: deps.Pool, DS: deps.DS, OpenAI: deps.OpenAI, ChatHistory: deps.ChatHistory}
|
||||
@@ -47,7 +45,6 @@ func RegisterRoutes(r chi.Router, h *Handler) {
|
||||
adminproxies.RegisterRoutes(pr, proxiesHandler)
|
||||
adminaccounts.RegisterRoutes(pr, accountsHandler)
|
||||
adminrawsamples.RegisterRoutes(pr, rawSamplesHandler)
|
||||
adminvercel.RegisterRoutes(pr, vercelHandler)
|
||||
admindevcapture.RegisterRoutes(pr, devCaptureHandler)
|
||||
adminhistory.RegisterRoutes(pr, historyHandler)
|
||||
adminversion.RegisterRoutes(pr, versionHandler)
|
||||
|
||||
@@ -3,7 +3,6 @@ import { useLocation, useNavigate } from 'react-router-dom'
|
||||
import {
|
||||
LayoutDashboard,
|
||||
Upload,
|
||||
Cloud,
|
||||
Settings as SettingsIcon,
|
||||
LogOut,
|
||||
Menu,
|
||||
@@ -19,7 +18,6 @@ import AccountManagerContainer from '../features/account/AccountManagerContainer
|
||||
import ApiTesterContainer from '../features/apiTester/ApiTesterContainer'
|
||||
import ChatHistoryContainer from '../features/chatHistory/ChatHistoryContainer'
|
||||
import BatchImport from '../components/BatchImport'
|
||||
import VercelSyncContainer from '../features/vercel/VercelSyncContainer'
|
||||
import SettingsContainer from '../features/settings/SettingsContainer'
|
||||
import ProxyManagerContainer from '../features/proxy/ProxyManagerContainer'
|
||||
import LanguageToggle from '../components/LanguageToggle'
|
||||
@@ -37,7 +35,6 @@ export default function DashboardShell({ token, onLogout, config, fetchConfig, s
|
||||
{ id: 'test', label: t('nav.test.label'), icon: Server, description: t('nav.test.desc') },
|
||||
{ id: 'history', label: t('nav.history.label'), icon: History, description: t('nav.history.desc') },
|
||||
{ id: 'import', label: t('nav.import.label'), icon: Upload, description: t('nav.import.desc') },
|
||||
{ id: 'vercel', label: t('nav.vercel.label'), icon: Cloud, description: t('nav.vercel.desc') },
|
||||
{ id: 'settings', label: t('nav.settings.label'), icon: SettingsIcon, description: t('nav.settings.desc') },
|
||||
]
|
||||
|
||||
@@ -105,8 +102,6 @@ export default function DashboardShell({ token, onLogout, config, fetchConfig, s
|
||||
return <ChatHistoryContainer onMessage={showMessage} authFetch={authFetch} />
|
||||
case 'import':
|
||||
return <BatchImport onRefresh={fetchConfig} onMessage={showMessage} authFetch={authFetch} />
|
||||
case 'vercel':
|
||||
return <VercelSyncContainer onMessage={showMessage} authFetch={authFetch} isVercel={isVercel} config={config} />
|
||||
case 'settings':
|
||||
return <SettingsContainer onRefresh={fetchConfig} onMessage={showMessage} authFetch={authFetch} onForceLogout={onForceLogout} isVercel={isVercel} />
|
||||
default:
|
||||
|
||||
@@ -25,10 +25,6 @@
|
||||
"label": "Batch Import",
|
||||
"desc": "Bulk import account configuration"
|
||||
},
|
||||
"vercel": {
|
||||
"label": "Vercel Sync",
|
||||
"desc": "Sync configuration to Vercel"
|
||||
},
|
||||
"settings": {
|
||||
"label": "Settings",
|
||||
"desc": "Edit runtime and security settings online"
|
||||
@@ -448,41 +444,5 @@
|
||||
"adminPortal": "DS2API admin portal",
|
||||
"signInFailed": "Sign-in failed.",
|
||||
"networkError": "Network error: {error}"
|
||||
},
|
||||
"vercel": {
|
||||
"tokenRequired": "Vercel access token is required.",
|
||||
"projectRequired": "Project ID is required.",
|
||||
"syncFailed": "Sync failed.",
|
||||
"networkError": "Network error.",
|
||||
"title": "Vercel Deployment",
|
||||
"description": "Sync the current keys and accounts directly to Vercel environment variables.",
|
||||
"tokenLabel": "Vercel Access Token",
|
||||
"getToken": "Get token",
|
||||
"tokenPlaceholderPreconfig": "Using preconfigured token",
|
||||
"tokenPlaceholder": "Enter Vercel access token",
|
||||
"projectIdLabel": "Project ID",
|
||||
"projectIdHint": "Find it in Project Settings → General.",
|
||||
"teamIdLabel": "Team ID",
|
||||
"optional": "optional",
|
||||
"syncing": "Syncing...",
|
||||
"syncRedeploy": "Sync & redeploy",
|
||||
"redeployHint": "This triggers a Vercel redeploy and usually takes 30–60 seconds.",
|
||||
"syncSucceeded": "Sync succeeded",
|
||||
"syncFailedLabel": "Sync failed",
|
||||
"openDeployment": "Open deployment",
|
||||
"statusSynced": "Synced",
|
||||
"statusNotSynced": "Not synced",
|
||||
"statusNeverSynced": "Never synced",
|
||||
"lastSyncTime": "Last sync: {time}",
|
||||
"draftDiffers": "Frontend draft differs from env config. Click Sync & redeploy.",
|
||||
"pollPaused": "Status polling paused after {count} failures.",
|
||||
"manualRefresh": "Refresh manually",
|
||||
"howItWorks": "How it works",
|
||||
"steps": {
|
||||
"one": "The current configuration (keys and accounts) is exported as JSON.",
|
||||
"two": "The JSON is Base64-encoded for safe formatting.",
|
||||
"three": "Update the env var in Vercel:",
|
||||
"four": "Trigger a redeploy to apply the updated environment variables."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,10 +25,6 @@
|
||||
"label": "Массовый импорт",
|
||||
"desc": "Массовый импорт конфигурации аккаунтов"
|
||||
},
|
||||
"vercel": {
|
||||
"label": "Синхронизация Vercel",
|
||||
"desc": "Синхронизация конфигурации в Vercel"
|
||||
},
|
||||
"settings": {
|
||||
"label": "Настройки",
|
||||
"desc": "Онлайн-редактирование настроек среды выполнения и безопасности"
|
||||
@@ -448,41 +444,5 @@
|
||||
"adminPortal": "Портал администратора DS2API",
|
||||
"signInFailed": "Не удалось войти.",
|
||||
"networkError": "Ошибка сети: {error}"
|
||||
},
|
||||
"vercel": {
|
||||
"tokenRequired": "Требуется токен доступа Vercel.",
|
||||
"projectRequired": "Требуется ID проекта.",
|
||||
"syncFailed": "Синхронизация не выполнена.",
|
||||
"networkError": "Ошибка сети.",
|
||||
"title": "Развёртывание Vercel",
|
||||
"description": "Синхронизируйте текущие ключи и аккаунты напрямую в переменные окружения Vercel.",
|
||||
"tokenLabel": "Токен доступа Vercel",
|
||||
"getToken": "Получить токен",
|
||||
"tokenPlaceholderPreconfig": "Используется предварительно заданный токен",
|
||||
"tokenPlaceholder": "Введите токен доступа Vercel",
|
||||
"projectIdLabel": "ID проекта",
|
||||
"projectIdHint": "Найдите его в Project Settings → General.",
|
||||
"teamIdLabel": "ID команды",
|
||||
"optional": "необязательно",
|
||||
"syncing": "Синхронизация...",
|
||||
"syncRedeploy": "Синхронизировать и переразвернуть",
|
||||
"redeployHint": "Это запускает переразвёртывание Vercel и обычно занимает 30–60 секунд.",
|
||||
"syncSucceeded": "Синхронизация успешна",
|
||||
"syncFailedLabel": "Синхронизация не выполнена",
|
||||
"openDeployment": "Открыть развёртывание",
|
||||
"statusSynced": "Синхронизировано",
|
||||
"statusNotSynced": "Не синхронизировано",
|
||||
"statusNeverSynced": "Никогда не синхронизировалось",
|
||||
"lastSyncTime": "Последняя синхронизация: {time}",
|
||||
"draftDiffers": "Черновик фронтенда отличается от конфигурации env. Нажмите «Синхронизировать и переразвернуть».",
|
||||
"pollPaused": "Опрос статуса приостановлен после {count} сбоев.",
|
||||
"manualRefresh": "Обновить вручную",
|
||||
"howItWorks": "Как это работает",
|
||||
"steps": {
|
||||
"one": "Текущая конфигурация (ключи и аккаунты) экспортируется как JSON.",
|
||||
"two": "JSON кодируется в Base64 для безопасного форматирования.",
|
||||
"three": "Обновите переменную окружения в Vercel:",
|
||||
"four": "Запустите переразвёртывание, чтобы применить обновлённые переменные окружения."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user