mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-08-15 06:50:58 +00:00
fix(wizard): remove redundant Space CTA (#2416)
Co-authored-by: Chan <dadachann@users.noreply.github.com>
This commit is contained in:
@@ -16,7 +16,6 @@ import {
|
||||
|
||||
import { httpClient } from '@/app/infra/http/HttpClient';
|
||||
import {
|
||||
userInfo,
|
||||
systemInfo,
|
||||
bootstrapWorkspaceSession,
|
||||
initializeSystemInfo,
|
||||
@@ -490,24 +489,6 @@ export default function WizardPage() {
|
||||
t,
|
||||
]);
|
||||
|
||||
// ---- Space auth redirect ----
|
||||
|
||||
const handleSpaceAuth = useCallback(async () => {
|
||||
try {
|
||||
const callbackUrl = `${window.location.origin}/auth/space/callback`;
|
||||
const resp = await httpClient.getSpaceAuthorizeUrl(callbackUrl);
|
||||
window.location.href = resp.authorize_url;
|
||||
} catch (err) {
|
||||
console.error('Failed to get space authorize URL', err);
|
||||
toast.error(t('wizard.spaceAuthError'));
|
||||
}
|
||||
}, [t]);
|
||||
|
||||
// ---- Check if local account ----
|
||||
// Re-evaluated after remote data fetch (when userInfo is populated)
|
||||
const isLocalAccount =
|
||||
!isLoading && (!userInfo || userInfo.account_type === 'local');
|
||||
|
||||
// ---- Skip handler ----
|
||||
const [showSkipConfirm, setShowSkipConfirm] = useState(false);
|
||||
const [isSkipping, setIsSkipping] = useState(false);
|
||||
@@ -662,8 +643,6 @@ export default function WizardPage() {
|
||||
runnerOptions={runnerOptions}
|
||||
selected={selectedRunner}
|
||||
onSelect={handleSelectRunner}
|
||||
isLocalAccount={isLocalAccount}
|
||||
onSpaceAuth={handleSpaceAuth}
|
||||
runnerConfigItems={selectedRunnerConfigItems}
|
||||
runnerConfigValues={runnerConfig}
|
||||
onRunnerConfigChange={setRunnerConfig}
|
||||
@@ -1006,8 +985,6 @@ function StepAIEngine({
|
||||
runnerOptions,
|
||||
selected,
|
||||
onSelect,
|
||||
isLocalAccount,
|
||||
onSpaceAuth,
|
||||
runnerConfigItems,
|
||||
runnerConfigValues,
|
||||
onRunnerConfigChange,
|
||||
@@ -1015,8 +992,6 @@ function StepAIEngine({
|
||||
runnerOptions: { name: string; label: { en_US: string; zh_Hans: string } }[];
|
||||
selected: string | null;
|
||||
onSelect: (name: string) => void;
|
||||
isLocalAccount: boolean;
|
||||
onSpaceAuth: () => void;
|
||||
runnerConfigItems: IDynamicFormItemSchema[];
|
||||
runnerConfigValues: Record<string, unknown>;
|
||||
onRunnerConfigChange: (v: Record<string, unknown>) => void;
|
||||
@@ -1127,28 +1102,6 @@ function StepAIEngine({
|
||||
</Card>
|
||||
);
|
||||
})}
|
||||
|
||||
{/* Space promotion banner */}
|
||||
{selected === 'local-agent' && isLocalAccount && (
|
||||
<div className="animate-in fade-in slide-in-from-left-2 duration-300">
|
||||
<div className="relative rounded-lg p-[2px] bg-gradient-to-r from-purple-500 via-pink-500 to-orange-500">
|
||||
<div className="rounded-[calc(0.5rem-2px)] bg-background p-3 flex flex-col items-center gap-2 text-center">
|
||||
<Sparkles className="w-6 h-6 text-purple-500 shrink-0" />
|
||||
<p className="text-xs font-medium">
|
||||
{t('wizard.spaceBanner.message')}
|
||||
</p>
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
onClick={onSpaceAuth}
|
||||
className="w-full"
|
||||
>
|
||||
{t('wizard.spaceBanner.action')}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1807,7 +1807,6 @@ const enUS = {
|
||||
botCreateSuccess: 'Bot created successfully!',
|
||||
botSaveSuccess: 'Bot configuration saved and enabled!',
|
||||
createError: 'Failed to create resources',
|
||||
spaceAuthError: 'Failed to initiate Space authorization',
|
||||
skipSaveError: 'Failed to save skip status. Please try again.',
|
||||
completeSaveError: 'Failed to save completion status. Please try again.',
|
||||
step: {
|
||||
@@ -1836,11 +1835,6 @@ const enUS = {
|
||||
description:
|
||||
"Choose the AI engine that will power your bot's intelligence.",
|
||||
},
|
||||
spaceBanner: {
|
||||
message:
|
||||
'Connect to LangBot Space for free trial model credits and zero-config instant setup!',
|
||||
action: 'Authorize with Space',
|
||||
},
|
||||
config: {
|
||||
botInfo: 'Bot Information',
|
||||
botNamePlaceholder: 'Enter bot name',
|
||||
|
||||
@@ -1672,7 +1672,6 @@ const esES = {
|
||||
botCreateSuccess: '¡Bot creado correctamente!',
|
||||
botSaveSuccess: '¡Configuración del Bot guardada y activada!',
|
||||
createError: 'Error al crear los recursos',
|
||||
spaceAuthError: 'Error al iniciar la autorización de Space',
|
||||
skipSaveError:
|
||||
'Error al guardar el estado de omisión. Por favor, inténtalo de nuevo.',
|
||||
completeSaveError:
|
||||
@@ -1705,11 +1704,6 @@ const esES = {
|
||||
description:
|
||||
'Elige el motor de IA que impulsará la inteligencia de tu Bot.',
|
||||
},
|
||||
spaceBanner: {
|
||||
message:
|
||||
'¡Conéctate a LangBot Space para obtener créditos de prueba gratuitos y configuración instantánea sin esfuerzo!',
|
||||
action: 'Autorizar con Space',
|
||||
},
|
||||
config: {
|
||||
botInfo: 'Información del Bot',
|
||||
botNamePlaceholder: 'Introduce el nombre del Bot',
|
||||
|
||||
@@ -1722,7 +1722,6 @@ const jaJP = {
|
||||
botCreateSuccess: 'ボットが正常に作成されました!',
|
||||
botSaveSuccess: 'ボット設定が保存され、有効になりました!',
|
||||
createError: 'リソースの作成に失敗しました',
|
||||
spaceAuthError: 'Space 認証の開始に失敗しました',
|
||||
skipSaveError: 'スキップ状態の保存に失敗しました。もう一度お試しください。',
|
||||
completeSaveError: '完了状態の保存に失敗しました。もう一度お試しください。',
|
||||
step: {
|
||||
@@ -1753,11 +1752,6 @@ const jaJP = {
|
||||
description:
|
||||
'ボットのインテリジェンスを駆動するAIエンジンを選択してください。',
|
||||
},
|
||||
spaceBanner: {
|
||||
message:
|
||||
'LangBot Spaceに接続して、無料トライアルモデルクレジットとゼロ設定の即時セットアップを入手!',
|
||||
action: 'Spaceで認証',
|
||||
},
|
||||
config: {
|
||||
botInfo: 'ボット情報',
|
||||
botNamePlaceholder: 'ボット名を入力',
|
||||
|
||||
@@ -1645,7 +1645,6 @@ const ruRU = {
|
||||
botCreateSuccess: 'Бот успешно создан!',
|
||||
botSaveSuccess: 'Конфигурация бота сохранена и включена!',
|
||||
createError: 'Не удалось создать ресурсы',
|
||||
spaceAuthError: 'Не удалось инициировать авторизацию через Space',
|
||||
skipSaveError: 'Не удалось сохранить статус пропуска. Повторите попытку.',
|
||||
completeSaveError:
|
||||
'Не удалось сохранить статус завершения. Повторите попытку.',
|
||||
@@ -1675,11 +1674,6 @@ const ruRU = {
|
||||
description:
|
||||
'Выберите ИИ-движок, который будет управлять интеллектом вашего бота.',
|
||||
},
|
||||
spaceBanner: {
|
||||
message:
|
||||
'Подключитесь к LangBot Space для бесплатных пробных кредитов и мгновенной настройки!',
|
||||
action: 'Авторизация через Space',
|
||||
},
|
||||
config: {
|
||||
botInfo: 'Информация о боте',
|
||||
botNamePlaceholder: 'Введите имя бота',
|
||||
|
||||
@@ -1612,7 +1612,6 @@ const thTH = {
|
||||
botCreateSuccess: 'สร้าง Bot สำเร็จ!',
|
||||
botSaveSuccess: 'บันทึกและเปิดใช้งาน Bot สำเร็จ!',
|
||||
createError: 'ไม่สามารถสร้างทรัพยากรได้',
|
||||
spaceAuthError: 'ไม่สามารถเริ่มต้นการยืนยันสิทธิ์ Space ได้',
|
||||
skipSaveError: 'ไม่สามารถบันทึกสถานะการข้ามได้ กรุณาลองใหม่',
|
||||
completeSaveError: 'ไม่สามารถบันทึกสถานะการเสร็จสิ้นได้ กรุณาลองใหม่',
|
||||
step: {
|
||||
@@ -1640,11 +1639,6 @@ const thTH = {
|
||||
title: 'เลือกเครื่องมือ AI',
|
||||
description: 'เลือกเครื่องมือ AI ที่จะขับเคลื่อนความฉลาดของ Bot',
|
||||
},
|
||||
spaceBanner: {
|
||||
message:
|
||||
'เชื่อมต่อกับ LangBot Space เพื่อรับเครดิตทดลองใช้โมเดลฟรีและตั้งค่าทันทีโดยไม่ต้องกำหนดค่า!',
|
||||
action: 'ยืนยันสิทธิ์กับ Space',
|
||||
},
|
||||
config: {
|
||||
botInfo: 'ข้อมูล Bot',
|
||||
botNamePlaceholder: 'กรอกชื่อ Bot',
|
||||
|
||||
@@ -1638,7 +1638,6 @@ const viVN = {
|
||||
botCreateSuccess: 'Tạo Bot thành công!',
|
||||
botSaveSuccess: 'Cấu hình Bot đã lưu và bật!',
|
||||
createError: 'Tạo tài nguyên thất bại',
|
||||
spaceAuthError: 'Khởi tạo ủy quyền Space thất bại',
|
||||
skipSaveError: 'Lưu trạng thái bỏ qua thất bại. Vui lòng thử lại.',
|
||||
completeSaveError: 'Lưu trạng thái hoàn tất thất bại. Vui lòng thử lại.',
|
||||
step: {
|
||||
@@ -1666,11 +1665,6 @@ const viVN = {
|
||||
title: 'Chọn công cụ AI',
|
||||
description: 'Chọn công cụ AI sẽ cung cấp trí tuệ cho Bot của bạn.',
|
||||
},
|
||||
spaceBanner: {
|
||||
message:
|
||||
'Kết nối với LangBot Space để nhận tín dụng dùng thử mô hình miễn phí và thiết lập tức thì không cần cấu hình!',
|
||||
action: 'Ủy quyền với Space',
|
||||
},
|
||||
config: {
|
||||
botInfo: 'Thông tin Bot',
|
||||
botNamePlaceholder: 'Nhập tên Bot',
|
||||
|
||||
@@ -1730,7 +1730,6 @@ const zhHans = {
|
||||
botCreateSuccess: '机器人创建成功!',
|
||||
botSaveSuccess: '机器人配置已保存并启用!',
|
||||
createError: '创建资源失败',
|
||||
spaceAuthError: '无法发起 Space 授权',
|
||||
skipSaveError: '保存跳过状态失败,请重试。',
|
||||
completeSaveError: '保存完成状态失败,请重试。',
|
||||
step: {
|
||||
@@ -1756,10 +1755,6 @@ const zhHans = {
|
||||
title: '选择 AI 引擎',
|
||||
description: '选择驱动机器人智能的 AI 引擎。',
|
||||
},
|
||||
spaceBanner: {
|
||||
message: '接入 LangBot Space,获取免费试用模型额度,零配置极速开箱!',
|
||||
action: '前往授权登录',
|
||||
},
|
||||
config: {
|
||||
botInfo: '机器人信息',
|
||||
botNamePlaceholder: '请输入机器人名称',
|
||||
|
||||
@@ -1566,7 +1566,6 @@ const zhHant = {
|
||||
botCreateSuccess: '機器人建立成功!',
|
||||
botSaveSuccess: '機器人配置已儲存並啟用!',
|
||||
createError: '建立資源失敗',
|
||||
spaceAuthError: '無法發起 Space 授權',
|
||||
skipSaveError: '儲存跳過狀態失敗,請重試。',
|
||||
completeSaveError: '儲存完成狀態失敗,請重試。',
|
||||
step: {
|
||||
@@ -1592,10 +1591,6 @@ const zhHant = {
|
||||
title: '選擇 AI 引擎',
|
||||
description: '選擇驅動機器人智慧的 AI 引擎。',
|
||||
},
|
||||
spaceBanner: {
|
||||
message: '接入 LangBot Space,取得免費試用模型額度,零配置極速開箱!',
|
||||
action: '前往授權登入',
|
||||
},
|
||||
config: {
|
||||
botInfo: '機器人資訊',
|
||||
botNamePlaceholder: '請輸入機器人名稱',
|
||||
|
||||
Reference in New Issue
Block a user