mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-21 17:21:09 +01:00
feat: enhance internationalization and update AutoProbe interfaces
- Updated Chinese translation for 'AutoProbe' to include its native term. - Modified AutoProbe interfaces to improve data structure, including changes to page_data and the addition of new properties in AutoProbeTaskResult. - Enhanced SidebarItem component to conditionally display badge values based on item properties.
This commit is contained in:
@@ -43,7 +43,7 @@ const router: LRouter = {
|
||||
disclaimer: '免责声明',
|
||||
},
|
||||
},
|
||||
autoprobe: 'AutoProbe',
|
||||
autoprobe: '智探 (AutoProbe)',
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ export declare global {
|
||||
last_task?: AutoProbeTask;
|
||||
default_task_id?: string;
|
||||
page_pattern?: PagePattern;
|
||||
page_data?: PageDataRow;
|
||||
page_data?: PageData;
|
||||
}
|
||||
|
||||
type AutoProbeTaskStatus =
|
||||
@@ -63,13 +63,23 @@ export declare global {
|
||||
query?: string;
|
||||
status: AutoProbeTaskStatus;
|
||||
error?: string;
|
||||
html?: string;
|
||||
page_pattern?: PagePattern;
|
||||
page_data?: PageData;
|
||||
page_elements?: PageItemCoordinates[];
|
||||
provider_id?: string;
|
||||
model?: string;
|
||||
usage?: LLMResponseUsage;
|
||||
}
|
||||
|
||||
interface AutoProbeTaskResult {
|
||||
html?: string;
|
||||
screenshot_base64?: string;
|
||||
page_pattern?: PagePattern;
|
||||
page_data?: PageData;
|
||||
page_elements?: PageItemCoordinates[];
|
||||
}
|
||||
|
||||
type AutoProbeItemType = 'page_pattern' | 'list' | 'field' | 'pagination';
|
||||
|
||||
interface AutoProbeNavItem<T = any> extends NavItem<T> {
|
||||
@@ -99,9 +109,11 @@ export declare global {
|
||||
height: number;
|
||||
}
|
||||
|
||||
type PageElementType = 'list' | 'list-item' | 'field' | 'pagination';
|
||||
|
||||
interface PageItemCoordinates {
|
||||
id: string;
|
||||
name: string;
|
||||
type: PageElementType;
|
||||
coordinates: ElementCoordinates;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,11 @@ defineOptions({ name: 'ClSidebarItem' });
|
||||
<cl-menu-item-icon :item="item" size="normal" />
|
||||
<template #title>
|
||||
<span class="menu-item-title">
|
||||
<el-badge :value="item.badge" :type="item.badgeType" :offset="[12, 0]">
|
||||
<el-badge
|
||||
:value="item.badge ? t(item.badge) : ''"
|
||||
:type="item.badgeType"
|
||||
:offset="[12, 0]"
|
||||
>
|
||||
{{ t(item.title) }}
|
||||
</el-badge>
|
||||
</span>
|
||||
|
||||
@@ -134,7 +134,7 @@ export function getDefaultSidebarMenuItems(): MenuItem[] {
|
||||
path: '/autoprobes',
|
||||
title: 'router.menuItems.autoprobe',
|
||||
icon: getIconByRouteConcept('autoprobe'),
|
||||
badge: t('common.mode.preview'),
|
||||
badge: 'common.mode.preview',
|
||||
badgeType: 'primary',
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user