feat: add image generation tool and WebUI mode

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Xubin Ren
2026-05-08 20:06:23 +08:00
committed by Xubin Ren
co-authored by Cursor
parent 3a2f47d720
commit e936ed48bd
45 changed files with 2979 additions and 89 deletions
@@ -16,12 +16,14 @@ interface SettingsViewProps {
onBackToChat: () => void;
onModelNameChange: (modelName: string | null) => void;
onLogout?: () => void;
onRestart?: () => void;
}
export function SettingsView({
onBackToChat,
onModelNameChange,
onLogout,
onRestart,
}: SettingsViewProps) {
const { token } = useClient();
const [settings, setSettings] = useState<SettingsPayload | null>(null);
@@ -119,6 +121,7 @@ export function SettingsView({
saving={saving}
onSave={save}
onLogout={onLogout}
onRestart={onRestart}
/>
) : null}
</main>
@@ -134,6 +137,7 @@ function SettingsSection({
saving,
onSave,
onLogout,
onRestart,
}: {
form: {
model: string;
@@ -148,6 +152,7 @@ function SettingsSection({
saving: boolean;
onSave: () => void;
onLogout?: () => void;
onRestart?: () => void;
}) {
const { t } = useTranslation();
return (
@@ -200,6 +205,19 @@ function SettingsSection({
</SettingsGroup>
</section>
{onRestart && (
<section>
<h2 className="mb-2 px-2 text-xs font-medium text-muted-foreground">{t("app.system.section")}</h2>
<SettingsGroup>
<SettingsRow title={t("app.system.restartHint")}>
<Button size="sm" variant="outline" onClick={onRestart}>
{t("app.system.restart")}
</Button>
</SettingsRow>
</SettingsGroup>
</section>
)}
{onLogout && (
<section>
<h2 className="mb-2 px-2 text-xs font-medium text-muted-foreground">{t("app.account.section")}</h2>