Skip to content

Commit 7fa0de5

Browse files
z275748353张龙彬LP-J
authored
fix bug ID with #98 (#1451)
* add dataflow * add dataflow * remove antv/x6/lib/registry package * Fix bugs * Fix bugs * add package * add package * add zhHantOps * 1.Adjust the image path for operator management 2.Add permission judgment on whether to display the menu in operator management * Operator Management: Modification of dataflow/operator/ interface * 1.Add the cancellation of execution for internationalization and status verification 2.If a user has no organization or no authorized operators, all public operators will be queried by default * 1.Add the cancellation of execution for internationalization and status verification 2.If a user has no organization or no authorized operators, all public operators will be queried by default * 1.Add the cancellation of execution for internationalization and status verification 2.If a user has no organization or no authorized operators, all public operators will be queried by default * Add newly developed operators, internationalize tools, and supplement the internationalization of statistics. * Add newly developed operators, internationalize tools, and supplement the internationalization of statistics. * 1.Add template deletion function 2.Celery node deletion (admin only, offline status) 3.Block the option of creating tool operators, set tools as default 4.Internationalization update * Fix the bug of dataflow with ID #36 * Fix the bug of dataflow with ID OpenCSGs/csghub-dataflow#31 * Fix the bug of dataflow with ID OpenCSGs/csghub-dataflow#43 * Fix the bug of dataflow with ID OpenCSGs/csghub-dataflow#34 * 1.Fixed the issue where modifying the custom template operator name does not take effect, and added an internationalized name subtitle. 1.Added internationalization to the description of the keyword filtering operator. * 1.Add horizontal and vertical alignment guides for operator task flow filling. 2.Select PDF for format conversion and add the Mineru Backend field. 3.Add model selection and corresponding internationalization to the MD-to-JSONL tool. 4.Implement internationalization for the existing auxiliary reminder words in operator configuration. * 1. When dealing with operator overlap, there may be duplicate connection issues 2. Add internationalization to the generate_code_qa_cir_mapper configuration item * Problem handling of model path display * 1.Add a field for "whether to generate a meta file" and corresponding internationalization support in format conversion. 2.Add a model selection list component. --------- Co-authored-by: 张龙彬 <[email protected]> Co-authored-by: Jilp <[email protected]>
1 parent ad0b788 commit 7fa0de5

File tree

6 files changed

+169
-2
lines changed

6 files changed

+169
-2
lines changed

frontend/src/components/dataflow_config/dataAcquisition/formatConversion/newFormatConversion.vue

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,19 @@
249249
</el-input>
250250
</el-form-item>
251251
</el-col>
252+
<el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
253+
<el-form-item prop="skip_meta" class="mt-[12px]">
254+
<template #label>
255+
<p class="text-gray-500 text-xs">
256+
{{ t("dataPipelines.skipMeta") }}
257+
</p>
258+
</template>
259+
<el-radio-group v-model="form.skip_meta">
260+
<el-radio :label="true">{{ t("dataPipelines.yes") }}</el-radio>
261+
<el-radio :label="false">{{ t("dataPipelines.no") }}</el-radio>
262+
</el-radio-group>
263+
</el-form-item>
264+
</el-col>
252265
</el-row>
253266
</el-form>
254267

@@ -285,6 +298,7 @@ const formLoading = ref(false);
285298
const userStore = useUserStore();
286299
// 表单
287300
const form = ref({
301+
skip_meta: true,
288302
// from_format_types: null,
289303
// to_data_type: null,
290304
});
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
<template>
2+
<div :class="[
3+
`${repoType}-card`,
4+
repoType === 'model' ? 'bg-gradient-to-r from-[#fafefe] to-white' : '',
5+
repoType === 'dataset' ? 'bg-gradient-to-r from-[#fbfaff] to-white' : '',
6+
repoType === 'code' ? 'bg-gradient-to-r from-[#F9FAFA] to-white' : ''
7+
]"
8+
class="flex flex-col justify-between focus:outline focus:outline-4 focus:outline-gray-200 hover:shadow-md p-4 gap-1 md:w-full border border-gray-200 rounded-md flex-grow xl:basis-full min-w-[250px] xl:max-w-full h-fit cursor-pointer"
9+
:style="isCollection ? 'width:100%' : ''"
10+
>
11+
<div class="flex items-center justify-between mb-1 gap-2 w-full">
12+
<SvgIcon v-if="repoType === 'model'" name="models" width="18" height="18" />
13+
<SvgIcon v-if="repoType === 'dataset'" name="datasets" width="18" height="18" />
14+
<SvgIcon v-if="repoType === 'code'" name="codes" width="18" height="18" />
15+
<SvgIcon v-if="repoType === 'space'" name="spaces" width="18" height="18" />
16+
<div :class="`${repoType}-path`"
17+
class="text-sm font-medium text-gray-700 text-ellipsis overflow-hidden whitespace-nowrap w-full flex items-center gap-2"
18+
>
19+
<div :class="showNewTag ? 'max-w-[80%] overflow-hidden text-ellipsis' : 'w-full'">{{ getComputed.path }}</div>
20+
<div v-if="showNewTag">
21+
<el-tooltip :content="$t(`${repoType}s.newTips`)" placement="top">
22+
<NewTag />
23+
</el-tooltip>
24+
</div>
25+
</div>
26+
<RepoItemSyncIcon
27+
:source="repo.source"
28+
:syncStatus="repo.sync_status"
29+
:httpCloneUrl="repo.repository && repo.repository.http_clone_url"
30+
/>
31+
</div>
32+
33+
<p v-if="getComputed.showDescription"
34+
class="w-full min-h-[18px] leading-[18px] mb-1.5 text-gray-500 text-sm font-normal overflow-hidden text-ellipsis line-clamp-1 text-left"
35+
:class="isCollection ? 'hidden' : ''"
36+
>
37+
{{ repo.description || '\u00A0' }}
38+
</p>
39+
40+
<div class="flex flex-nowrap overflow-hidden text-ellipsis items-center gap-2 text-xs text-gray-500">
41+
<span v-if="getComputed.taskTag"
42+
class="w-fit xl:max-w-full overflow-hidden text-ellipsis whitespace-nowrap flex items-center gap-1"
43+
>
44+
<img v-if="getComputed.taskTagIconPath && taskTagIconExists" :src="getComputed.taskTagIconPath" class="w-3 h-3 text-gray-500 filter-gray" alt="" />
45+
{{ getComputed.taskTag }}
46+
</span>
47+
48+
<span v-if="getComputed.taskTag">
49+
<SvgIcon name="vertical_divider" />
50+
</span>
51+
52+
<div class="overflow-hidden text-ellipsis whitespace-nowrap flex gap-1 items-center">
53+
<SvgIcon name="clock" />
54+
{{$t('all.lastTime')}}:{{ repo.updated_at.substring(0, 10) }}
55+
</div>
56+
57+
<template v-if="getComputed.visibility">
58+
<span> <SvgIcon name="vertical_divider" /> </span>
59+
<span class="visibility-label">{{ getComputed.visibility }}</span>
60+
</template>
61+
62+
<span> <SvgIcon name="vertical_divider" /> </span>
63+
64+
<span class="whitespace-nowrap flex gap-1 items-center">
65+
<SvgIcon name="download2" />
66+
{{ repo.downloads }}
67+
</span>
68+
</div>
69+
</div>
70+
</template>
71+
72+
<script setup>
73+
import RepoItemSyncIcon from '../../shared/RepoItemSyncIcon.vue';
74+
import { computed, ref, watch } from 'vue'
75+
import { useI18n } from 'vue-i18n'
76+
import NewTag from '../../shared/NewTag.vue'
77+
import { isWithinTwoWeeks } from '../../../packs/datetimeUtils'
78+
79+
const props = defineProps({
80+
repo: Object,
81+
repoType: String,
82+
isCollection: Boolean,
83+
cardType: {
84+
type: String,
85+
default: 'index'
86+
}
87+
})
88+
const { t, locale } = useI18n()
89+
const taskTagIconExists = ref(false)
90+
const showNewTag = computed(() => {
91+
return ((props.repoType === 'model' || props.repoType === 'dataset')) && (isWithinTwoWeeks(props.repo.created_at) || isWithinTwoWeeks(props.repo.updated_at));
92+
});
93+
94+
const getComputed = computed(() => {
95+
const path = props.repo.path
96+
97+
const visibility = props.repo.private ? t('all.private') : ''
98+
const showDescription = props.cardType === 'index' || !!props.repo.description?.trim()
99+
100+
const taskTagObj = (props.repo.tags || []).find(tag => tag.category === "task")
101+
let taskTag = null
102+
if (taskTagObj) {
103+
if (locale.value === 'en') {
104+
taskTag = taskTagObj["name"].replace(/-/g, ' ')
105+
} else {
106+
taskTag = taskTagObj["show_name"]
107+
}
108+
109+
// 获取标签对应的图标路径,图标文件名与标签名完全一致
110+
const taskTagIconPath = taskTagObj.name ? `/images/tags/${taskTagObj.name}.svg` : null
111+
return { path, visibility, taskTag, showDescription, taskTagIconPath }
112+
}
113+
114+
return { path, visibility, taskTag: null, showDescription, taskTagIconPath: null }
115+
116+
})
117+
118+
// 检查图标是否存在的函数
119+
const checkIconExists = (iconPath) => {
120+
if (!iconPath) {
121+
taskTagIconExists.value = false
122+
return
123+
}
124+
125+
const img = new Image()
126+
img.onload = () => {
127+
taskTagIconExists.value = true
128+
}
129+
img.onerror = () => {
130+
taskTagIconExists.value = false
131+
}
132+
img.src = iconPath
133+
}
134+
135+
watch(() => getComputed.value.taskTagIconPath, (newIconPath) => {
136+
checkIconExists(newIconPath)
137+
}, { immediate: true }) // immediate: true to run on initial load
138+
</script>
139+
140+
<style scoped>
141+
.filter-gray {
142+
filter: invert(56%) sepia(11%) saturate(207%) hue-rotate(176deg) brightness(93%) contrast(84%);
143+
}
144+
</style>

frontend/src/components/dataflow_config/newTask/index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@
683683
modelValidating ? 'cursor-not-allowed opacity-60' : 'cursor-pointer'
684684
]"
685685
>
686-
<repo-item
686+
<ModelSelectItem
687687
:repo="model"
688688
repo-type="model"
689689
/>
@@ -723,7 +723,7 @@
723723
import Sortable from 'sortablejs'
724724
import { useI18n } from 'vue-i18n'
725725
import { Search } from '@element-plus/icons-vue'
726-
import RepoItem from '../../shared/RepoItem.vue'
726+
import ModelSelectItem from './ModelSelectItem.vue'
727727
import CsgPagination from '../../shared/CsgPagination.vue'
728728
729729
const userStore = useUserStore()

frontend/src/locales/en_js/datapipelines.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ export const dataPipelines = {
1313
"sourceFormat": "Source Format",
1414
"targetFormat": "Target Format",
1515
"dataFlowBranch": "Data Flow Branch",
16+
"skipMeta": "Generate Meta File",
17+
"yes": "Yes",
18+
"no": "No",
1619
"startExecution": "Start Execution",
1720
"searchTaskName": "Search Task Name",
1821
"confirmTermination": "Confirm Termination",

frontend/src/locales/zh_hant_js/datapipelines.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ export const dataPipelines = {
1313
"sourceFormat": "來源格式",
1414
"targetFormat": "目標格式",
1515
"dataFlowBranch": "資料流向分支",
16+
"skipMeta": "是否生成Meta文件",
17+
"yes": "是",
18+
"no": "否",
1619
"startExecution": "開始執行",
1720
"searchTaskName": "搜尋任務名稱",
1821
"confirmTermination": "確認終止",

frontend/src/locales/zh_js/datapipelines.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ export const dataPipelines = {
1313
"sourceFormat": "源格式",
1414
"targetFormat": "目标格式",
1515
"dataFlowBranch": "数据流向分支",
16+
"skipMeta": "是否生成Meta文件",
17+
"yes": "是",
18+
"no": "否",
1619
"startExecution": "开始执行",
1720
"searchTaskName": "搜索任务名称",
1821
"confirmTermination": "确认终止",

0 commit comments

Comments
 (0)