feat(system):优化后端
1.新增后端测试 2.增加了后端的加密 3.增加了i18n(国际化)
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
import { Package, Wrench } from 'lucide-react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Package, Wrench, Loader2, Box } from 'lucide-react';
|
||||
import apiClient from '../../api/client';
|
||||
|
||||
export function ToolSettings() {
|
||||
const { t } = useTranslation();
|
||||
const [tools, setTools] = useState<string[]>([]);
|
||||
const [loading, setLoading] = useState(true);
|
||||
|
||||
@@ -25,23 +27,29 @@ export function ToolSettings() {
|
||||
<div>
|
||||
<div className="flex items-center gap-2 mb-1">
|
||||
<Wrench size={16} className="text-accent" />
|
||||
<h3 className="text-lg font-bold text-text-primary">Installed Tools</h3>
|
||||
<h3 className="text-lg font-bold text-text-primary">{t('plugin.toolManagement')}</h3>
|
||||
</div>
|
||||
<p className="text-sm text-text-muted">Manage agent tools and functions</p>
|
||||
<p className="text-sm text-text-muted">{t('plugin.toolDesc')}</p>
|
||||
</div>
|
||||
|
||||
<div className="bg-bg-card border border-border-primary rounded-2xl shadow-sm overflow-hidden">
|
||||
<div className="px-6 py-4 border-b border-border-primary flex justify-between items-center bg-bg-secondary">
|
||||
<div>
|
||||
<h4 className="text-sm font-bold text-text-primary">Available Tools</h4>
|
||||
<p className="text-[11px] text-text-muted">Installed tools for agents</p>
|
||||
<h4 className="text-sm font-bold text-text-primary">{t('plugin.availableTools')}</h4>
|
||||
<p className="text-[11px] text-text-muted">{t('plugin.toolSubDesc')}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div className="p-6">
|
||||
{loading ? (
|
||||
<div className="text-text-muted text-sm">Loading tools...</div>
|
||||
<div className="flex flex-col items-center justify-center py-12 text-text-muted">
|
||||
<Loader2 size={24} className="animate-spin mb-3" />
|
||||
<span className="text-sm">{t('common.loading')}</span>
|
||||
</div>
|
||||
) : tools.length === 0 ? (
|
||||
<div className="text-text-muted text-sm">No tools installed yet.</div>
|
||||
<div className="flex flex-col items-center justify-center py-12 text-text-muted">
|
||||
<Box size={32} className="mb-3 opacity-40" />
|
||||
<span className="text-sm">{t('plugin.noTools')}</span>
|
||||
</div>
|
||||
) : (
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-3">
|
||||
{tools.map((tool) => (
|
||||
|
||||
Reference in New Issue
Block a user