Skip to content

armgit / jan

Public Imported from GitHub
0

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.

fix: fix missing translation

Vanalitef60d4709329e
diff --git a/web-app/src/containers/ChannelCard.tsx b/web-app/src/containers/ChannelCard.tsx
index 9e45b4fa9..6762b1be2 100644
--- a/web-app/src/containers/ChannelCard.tsx
+++ b/web-app/src/containers/ChannelCard.tsx
@@ -1,4 +1,3 @@
-import { useState } from 'react'
import { useTranslation } from '@/i18n/react-i18next-compat'
import { Button } from '@/components/ui/button'
import {
@@ -7,10 +6,6 @@ import {
IconBrandDiscord,
IconSettings,
IconTrash,
- IconChevronDown,
- IconChevronUp,
- IconMessage,
- IconClock,
} from '@tabler/icons-react'
export type ChannelType = 'telegram' | 'whatsapp' | 'discord'
@@ -46,19 +41,11 @@ export interface DiscordConfig {
// Union type for all channel configs
export type ChannelConfig = TelegramConfig | WhatsAppConfig | DiscordConfig
-interface MessagePreview {
- id: string
- sender: string
- content: string
- timestamp: Date
-}
-
interface ChannelCardProps {
type: ChannelType
config: ChannelConfig | null
onSettings: () => void
onDisconnect: () => void
- recentMessages?: MessagePreview[]
}
export function ChannelCard({
@@ -66,10 +53,8 @@ export function ChannelCard({
config,
onSettings,
onDisconnect,
- recentMessages = [],
}: ChannelCardProps) {
const { t } = useTranslation()
- const [isExpanded, setIsExpanded] = useState(false)
const isConnected = config?.connected ?? false
@@ -116,32 +101,6 @@ export function ChannelCard({
}
}
- const getConnectedUsers = (): number => {
- if (!config || !isConnected) return 0
-
- switch (type) {
- case 'telegram':
- return (config as TelegramConfig).paired_users
- case 'whatsapp':
- return (config as WhatsAppConfig).contacts_count
- case 'discord':
- return (config as DiscordConfig).guilds_count
- default:
- return 0
- }
- }
-
- const formatTimeAgo = (date: Date): string => {
- const minutes = Math.floor((Date.now() - date.getTime()) / 60000)
- if (minutes < 1) return t('settings:remoteAccess.justNow')
- if (minutes === 1) return `1 ${t('settings:remoteAccess.minuteAgo')}`
- if (minutes < 60)
- return `${minutes} ${t('settings:remoteAccess.minutesAgo')}`
- const hours = Math.floor(minutes / 60)
- if (hours === 1) return `1 ${t('settings:remoteAccess.hourAgo')}`
- return `${hours} ${t('settings:remoteAccess.hoursAgo')}`
- }
-
return (
<div
className={`border rounded-lg overflow-hidden transition-all ${
@@ -183,29 +142,6 @@ export function ChannelCard({
</div>
<div className="flex items-center gap-2">
- {isConnected && (
- <div className="flex items-center gap-1 text-sm text-muted-foreground mr-2">
- <IconMessage size={14} />
- <span>
- {getConnectedUsers()}{' '}
- {t('settings:remoteAccess.users', { count: getConnectedUsers() })}
- </span>
- </div>
- )}
- {recentMessages.length > 0 && (
- <Button
- variant="ghost"
- size="sm"
- onClick={() => setIsExpanded(!isExpanded)}
- className="gap-1"
- >
- {isExpanded ? (
- <IconChevronUp size={16} />
- ) : (
- <IconChevronDown size={16} />
- )}
- </Button>
- )}
<Button variant="outline" size="sm" onClick={onSettings}>
<IconSettings size={16} className="mr-1" />
{t('settings:remoteAccess.settings')}
@@ -218,38 +154,6 @@ export function ChannelCard({
</div>
</div>
- {/* Expanded Message History */}
- {isExpanded && recentMessages.length > 0 && (
- <div className="border-t border-border/40 p-4 bg-background/50">
- <h4 className="text-sm font-medium text-foreground mb-3">
- {t('settings:remoteAccess.recentMessages')}
- </h4>
- <div className="space-y-2">
- {recentMessages.map((message) => (
- <div
- key={message.id}
- className="flex items-start gap-3 p-2 rounded hover:bg-secondary/50 transition-colors"
- >
- <div className="flex-1 min-w-0">
- <div className="flex items-center gap-2">
- <span className="text-sm font-medium text-foreground">
- {message.sender}
- </span>
- <span className="text-xs text-muted-foreground flex items-center gap-1">
- <IconClock size={12} />
- {formatTimeAgo(message.timestamp)}
- </span>
- </div>
- <p className="text-sm text-muted-foreground truncate">
- {message.content}
- </p>
- </div>
- </div>
- ))}
- </div>
- </div>
- )}
-
{/* Not Connected State */}
{!isConnected && (
<div className="border-t border-border/40 px-4 py-3 bg-muted/30">
diff --git a/web-app/src/locales/cs/settings.json b/web-app/src/locales/cs/settings.json
index 4bf943130..46bd9fa7b 100644
--- a/web-app/src/locales/cs/settings.json
+++ b/web-app/src/locales/cs/settings.json
@@ -317,6 +317,8 @@
"running": "Běží",
"stopped": "Zastaveno",
"urlCopied": "URL zkopírována do schránky",
+ "backendInstallSuccess": "OpenClaw úspěšně nainstalován!",
+ "backendInstallError": "Instalace selhala. Zkontrolujte prosím instalaci Node.js.",
"activeChannels": "Aktivní kanály",
"connectedUsers": "Připojení uživatelé",
"port": "Port",
diff --git a/web-app/src/locales/de-DE/settings.json b/web-app/src/locales/de-DE/settings.json
index cc40c6456..aa8ee9b33 100644
--- a/web-app/src/locales/de-DE/settings.json
+++ b/web-app/src/locales/de-DE/settings.json
@@ -285,6 +285,8 @@
"running": "Läuft",
"stopped": "Gestoppt",
"urlCopied": "URL in Zwischenablage kopiert",
+ "backendInstallSuccess": "OpenClaw erfolgreich installiert!",
+ "backendInstallError": "Installation fehlgeschlagen. Bitte überprüfen Sie Ihre Node.js-Installation.",
"activeChannels": "Aktive Kanäle",
"connectedUsers": "Verbundene Benutzer",
"port": "Port",
diff --git a/web-app/src/locales/en/settings.json b/web-app/src/locales/en/settings.json
index 9fc0209c8..933039c17 100644
--- a/web-app/src/locales/en/settings.json
+++ b/web-app/src/locales/en/settings.json
@@ -329,6 +329,8 @@
"running": "Remote Access is now running",
"stopped": "Remote Access has been stopped",
"urlCopied": "Link copied to clipboard",
+ "backendInstallSuccess": "OpenClaw installed successfully!",
+ "backendInstallError": "Installation failed. Please check your Node.js installation.",
"activeChannels": "Active Channels",
"connectedUsers": "Connected Users",
"port": "Port",
diff --git a/web-app/src/locales/fr/settings.json b/web-app/src/locales/fr/settings.json
index 600fd9384..f87a929d2 100644
--- a/web-app/src/locales/fr/settings.json
+++ b/web-app/src/locales/fr/settings.json
@@ -323,6 +323,8 @@
"running": "En cours",
"stopped": "Arrêté",
"urlCopied": "URL copiée dans le presse-papiers",
+ "backendInstallSuccess": "OpenClaw installé avec succès !",
+ "backendInstallError": "Échec de l'installation. Veuillez vérifier votre installation Node.js.",
"activeChannels": "Canaux actifs",
"connectedUsers": "Utilisateurs connectés",
"port": "Port",
diff --git a/web-app/src/locales/id/settings.json b/web-app/src/locales/id/settings.json
index 521c9e673..9ed326dc7 100644
--- a/web-app/src/locales/id/settings.json
+++ b/web-app/src/locales/id/settings.json
@@ -285,6 +285,8 @@
"running": "Berjalan",
"stopped": "Berhenti",
"urlCopied": "URL disalin ke clipboard",
+ "backendInstallSuccess": "OpenClaw berhasil dipasang!",
+ "backendInstallError": "Instalasi gagal. Silakan periksa instalasi Node.js Anda.",
"activeChannels": "Channel Aktif",
"connectedUsers": "Pengguna Terhubung",
"port": "Port",
diff --git a/web-app/src/locales/ja/settings.json b/web-app/src/locales/ja/settings.json
index bba3b5638..27b9ed2a4 100644
--- a/web-app/src/locales/ja/settings.json
+++ b/web-app/src/locales/ja/settings.json
@@ -282,6 +282,8 @@
"running": "実行中",
"stopped": "停止",
"urlCopied": "URLをクリップボードにコピーしました",
+ "backendInstallSuccess": "OpenClawが正常にインストールされました!",
+ "backendInstallError": "インストールに失敗しました。Node.jsのインストールを確認してください。",
"activeChannels": "アクティブチャンネル",
"connectedUsers": "接続ユーザー",
"port": "ポート",
diff --git a/web-app/src/locales/pl/settings.json b/web-app/src/locales/pl/settings.json
index 185fd5039..ab6ee51f6 100644
--- a/web-app/src/locales/pl/settings.json
+++ b/web-app/src/locales/pl/settings.json
@@ -285,6 +285,8 @@
"running": "Uruchomiony",
"stopped": "Zatrzymany",
"urlCopied": "URL skopiowany do schowka",
+ "backendInstallSuccess": "OpenClaw został pomyślnie zainstalowany!",
+ "backendInstallError": "Instalacja nie powiodła się. Sprawdź instalację Node.js.",
"activeChannels": "Aktywne kanały",
"connectedUsers": "Połączeni użytkownicy",
"port": "Port",
diff --git a/web-app/src/locales/pt-BR/settings.json b/web-app/src/locales/pt-BR/settings.json
index 7be48b0c4..8ff503306 100644
--- a/web-app/src/locales/pt-BR/settings.json
+++ b/web-app/src/locales/pt-BR/settings.json
@@ -317,6 +317,8 @@
"running": "Executando",
"stopped": "Parado",
"urlCopied": "URL copiada para a área de transferência",
+ "backendInstallSuccess": "OpenClaw instalado com sucesso!",
+ "backendInstallError": "Falha na instalação. Verifique sua instalação do Node.js.",
"activeChannels": "Canais Ativos",
"connectedUsers": "Usuários Conectados",
"port": "Porta",
diff --git a/web-app/src/locales/ru/settings.json b/web-app/src/locales/ru/settings.json
index a241855eb..102c5a5ac 100644
--- a/web-app/src/locales/ru/settings.json
+++ b/web-app/src/locales/ru/settings.json
@@ -325,6 +325,8 @@
"running": "Запущено",
"stopped": "Остановлено",
"urlCopied": "URL скопирован в буфер обмена",
+ "backendInstallSuccess": "OpenClaw успешно установлен!",
+ "backendInstallError": "Установка не удалась. Проверьте установку Node.js.",
"activeChannels": "Активные каналы",
"connectedUsers": "Подключённые пользователи",
"port": "Порт",
diff --git a/web-app/src/locales/vn/settings.json b/web-app/src/locales/vn/settings.json
index 249604eec..fc7da5333 100644
--- a/web-app/src/locales/vn/settings.json
+++ b/web-app/src/locales/vn/settings.json
@@ -285,6 +285,8 @@
"running": "Đang chạy",
"stopped": "Đã dừng",
"urlCopied": "URL đã được sao chép vào clipboard",
+ "backendInstallSuccess": "OpenClaw đã được cài đặt thành công!",
+ "backendInstallError": "Cài đặt thất bại. Vui lòng kiểm tra cài đặt Node.js của bạn.",
"activeChannels": "Kênh hoạt động",
"connectedUsers": "Người dùng đã kết nối",
"port": "Cổng",
diff --git a/web-app/src/locales/zh-CN/settings.json b/web-app/src/locales/zh-CN/settings.json
index 59708d5fb..111b6df77 100644
--- a/web-app/src/locales/zh-CN/settings.json
+++ b/web-app/src/locales/zh-CN/settings.json
@@ -285,6 +285,8 @@
"running": "运行中",
"stopped": "已停止",
"urlCopied": "URL已复制到剪贴板",
+ "backendInstallSuccess": "OpenClaw安装成功!",
+ "backendInstallError": "安装失败。请检查您的Node.js安装。",
"activeChannels": "活跃频道",
"connectedUsers": "已连接用户",
"port": "端口",
diff --git a/web-app/src/locales/zh-TW/settings.json b/web-app/src/locales/zh-TW/settings.json
index d09885684..dd3ccadb1 100644
--- a/web-app/src/locales/zh-TW/settings.json
+++ b/web-app/src/locales/zh-TW/settings.json
@@ -285,6 +285,8 @@
"running": "執行中",
"stopped": "已停止",
"urlCopied": "URL已複製到剪貼簿",
+ "backendInstallSuccess": "OpenClaw安裝成功!",
+ "backendInstallError": "安裝失敗。請檢查您的Node.js安裝。",
"activeChannels": "活躍頻道",
"connectedUsers": "已連線使用者",
"port": "連接埠",
diff --git a/web-app/src/routes/settings/remote-access.tsx b/web-app/src/routes/settings/remote-access.tsx
index 254b0f580..ef0546d94 100644
--- a/web-app/src/routes/settings/remote-access.tsx
+++ b/web-app/src/routes/settings/remote-access.tsx
@@ -18,18 +18,12 @@ import { invoke } from '@tauri-apps/api/core'
import { toast } from 'sonner'
import { setOpenClawRunningState } from '@/utils/openclaw'
import {
- IconBrandTelegram,
- IconBrandWhatsapp,
- IconBrandDiscord,
IconPlugConnected,
IconLink,
- IconSettings,
IconLoader2,
IconPlayerPlay,
IconPlayerStop,
IconPlus,
- IconNetwork,
- IconShield,
IconCopy,
IconExternalLink,
} from '@tabler/icons-react'
@@ -64,14 +58,6 @@ interface TelegramConfig {
paired_users: number
}
-// Mock recent messages for display (would come from actual OpenClaw in future)
-interface RecentMessage {
- id: string
- channel: 'telegram' | 'whatsapp' | 'discord'
- sender: string
- content: string
- timestamp: Date
-}
const OPENCLAW_PORT = 18789
@@ -155,26 +141,10 @@ function RemoteAccess() {
const [isSecurityDialogOpen, setIsSecurityDialogOpen] = useState(false)
const [isTunnelDialogOpen, setIsTunnelDialogOpen] = useState(false)
const [tunnelStatus, setTunnelStatus] = useState<TunnelProvidersStatus | null>(null)
- const [securityStatus, setSecurityStatus] = useState<SecurityStatus | null>(null)
+ const [, setSecurityStatus] = useState<SecurityStatus | null>(null)
const [telegramConfig, setTelegramConfig] = useState<TelegramConfig | null>(null)
const [whatsappConfig, setWhatsAppConfig] = useState<WhatsAppConfig | null>(null)
const [discordConfig, setDiscordConfig] = useState<DiscordConfig | null>(null)
- const [recentMessages] = useState<RecentMessage[]>([
- {
- id: '1',
- channel: 'telegram',
- sender: '@john_doe',
- content: "What's the weather like today?",
- timestamp: new Date(Date.now() - 2 * 60 * 1000),
- },
- {
- id: '2',
- channel: 'whatsapp',
- sender: '+1234567890',
- content: 'Remind me to call mom',
- timestamp: new Date(Date.now() - 5 * 60 * 1000),
- },
- ])
// Fetch status on mount
const fetchStatus = useCallback(async () => {
@@ -316,19 +286,6 @@ function RemoteAccess() {
}
}
- // Get display name for auth mode
- const getAuthModeName = (mode: 'token' | 'password' | 'none'): string => {
- switch (mode) {
- case 'token':
- return t('settings:remoteAccess.tokenAuth')
- case 'password':
- return t('settings:remoteAccess.passwordAuth')
- case 'none':
- default:
- return t('settings:remoteAccess.noAuth')
- }
- }
-
const handleStart = async () => {
try {
setIsStarting(true)
@@ -372,6 +329,8 @@ function RemoteAccess() {
setIsInstalling(true)
const result = await invoke<InstallResult>('openclaw_install')
if (result.success) {
+ // Install now auto-configures and starts the Gateway
+ setOpenClawRunningState(true)
toast.success(t('settings:remoteAccess.backendInstallSuccess'))
await fetchStatus()
} else {
@@ -385,29 +344,6 @@ function RemoteAccess() {
}
}
- const formatTimeAgo = (date: Date): string => {
- const minutes = Math.floor((Date.now() - date.getTime()) / 60000)
- if (minutes < 1) return 'just now'
- if (minutes === 1) return '1 min ago'
- if (minutes < 60) return `${minutes} min ago`
- const hours = Math.floor(minutes / 60)
- if (hours === 1) return '1 hour ago'
- return `${hours} hours ago`
- }
-
- const getChannelIcon = (channel: string) => {
- switch (channel) {
- case 'telegram':
- return <IconBrandTelegram size={16} className="text-blue-500" />
- case 'whatsapp':
- return <IconBrandWhatsapp size={16} className="text-green-500" />
- case 'discord':
- return <IconBrandDiscord size={16} className="text-indigo-500" />
- default:
- return null
- }
- }
-
const getChannelName = (channel: string): string => {
switch (channel) {
case 'telegram':
@@ -465,11 +401,6 @@ function RemoteAccess() {
}
}
- // Get messages filtered by channel
- const getChannelMessages = (channel: string): RecentMessage[] => {
- return recentMessages.filter((msg) => msg.channel === channel)
- }
-
// Get connected channels list
const getConnectedChannels = (): ChannelType[] => {
const channels: ChannelType[] = []
@@ -641,36 +572,18 @@ function RemoteAccess() {
config={convertTelegramConfig(telegramConfig)}
onSettings={() => handleChannelSettings('telegram')}
onDisconnect={() => handleDisconnectChannel('telegram')}
- recentMessages={getChannelMessages('telegram').map((msg) => ({
- id: msg.id,
- sender: msg.sender,
- content: msg.content,
- timestamp: msg.timestamp,
- }))}
/>
<ChannelCard
type="whatsapp"
config={convertWhatsAppConfig(whatsappConfig)}
onSettings={() => handleChannelSettings('whatsapp')}
onDisconnect={() => handleDisconnectChannel('whatsapp')}
- recentMessages={getChannelMessages('whatsapp').map((msg) => ({
- id: msg.id,
- sender: msg.sender,
- content: msg.content,
- timestamp: msg.timestamp,
- }))}
/>
<ChannelCard
type="discord"
config={convertDiscordConfig(discordConfig)}
onSettings={() => handleChannelSettings('discord')}
onDisconnect={() => handleDisconnectChannel('discord')}
- recentMessages={getChannelMessages('discord').map((msg) => ({
- id: msg.id,
- sender: msg.sender,
- content: msg.content,
- timestamp: msg.timestamp,
- }))}
/>
</div>
@@ -686,37 +599,6 @@ function RemoteAccess() {
/>
</Card>
- {/* Recent Messages Card */}
- <Card title={t('settings:remoteAccess.recentMessages')}>
- {recentMessages.length > 0 ? (
- <div className="space-y-3">
- {recentMessages.map((message) => (
- <div
- key={message.id}
- className="border-b border-border/40 pb-3 last:border-0 last:pb-0"
- >
- <div className="flex items-center gap-2 mb-1">
- {getChannelIcon(message.channel)}
- <span className="text-foreground font-medium">
- {getChannelName(message.channel)} {message.sender}
- </span>
- <span className="text-muted-foreground text-xs">
- ({formatTimeAgo(message.timestamp)})
- </span>
- </div>
- <p className="text-muted-foreground text-sm">
- {message.content}
- </p>
- </div>
- ))}
- </div>
- ) : (
- <p className="text-muted-foreground">
- {t('settings:remoteAccess.noRecentMessages')}
- </p>
- )}
- </Card>
-
{/* Active Tunnel Status Card */}
{tunnelStatus?.active_tunnel && (
<Card title={t('settings:remoteAccess.activeTunnel')}>
@@ -766,91 +648,6 @@ function RemoteAccess() {
</Card>
)}
- {/* Settings Card */}
- <Card title={t('settings:remoteAccess.settings')}>
- <CardItem
- title={t('settings:remoteAccess.modelForRemote')}
- actions={
- <select className="bg-secondary text-foreground text-sm rounded px-2 py-1 border border-input">
- <option>Llama 3.2 3B</option>
- <option>Llama 3.1 8B</option>
- <option>Custom...</option>
- </select>
- }
- />
- <CardItem
- title={t('settings:remoteAccess.remoteMethod')}
- actions={
- <div className="flex items-center gap-2">
- <span className="text-foreground text-sm">
- {getTunnelProviderName(tunnelStatus?.active_provider ?? 'none')}
- </span>
- <Button
- variant="outline"
- size="sm"
- onClick={() => setIsTunnelDialogOpen(true)}
- >
- <IconNetwork className="mr-2 h-4 w-4" />
- {t('settings:remoteAccess.configure')}
- </Button>
- </div>
- }
- />
- <CardItem
- title={t('settings:remoteAccess.accessPolicy')}
- actions={
- <div className="flex items-center gap-2">
- <span className="text-foreground text-sm">
- {securityStatus
- ? getAuthModeName(securityStatus.auth_mode)
- : t('settings:remoteAccess.loading')}
- </span>
- <Button
- variant="outline"
- size="sm"
- onClick={() => setIsSecurityDialogOpen(true)}
- >
- <IconShield className="mr-2 h-4 w-4" />
- {t('settings:remoteAccess.security')}
- </Button>
- </div>
- }
- />
- {securityStatus && (
- <CardItem
- title={t('settings:remoteAccess.approvedDevices')}
- actions={
- <span className="text-foreground">
- {securityStatus.approved_device_count}
- </span>
- }
- />
- )}
- {tunnelStatus?.active_provider === 'tailscale' && (
- <CardItem
- title={t('settings:remoteAccess.tailscaleSettings')}
- actions={
- <Button
- variant="outline"
- size="sm"
- onClick={() => setIsTailscaleDialogOpen(true)}
- >
- <IconSettings className="mr-2 h-4 w-4" />
- {t('settings:remoteAccess.configureTailscale')}
- </Button>
- }
- />
- )}
- <CardItem
- title={t('settings:remoteAccess.advancedSettings')}
- actions={
- <Button variant="outline" size="sm">
- <IconSettings className="mr-2 h-4 w-4" />
- {t('settings:remoteAccess.advancedSettings')}
- </Button>
- }
- />
- </Card>
</div>
</div>
</div>