mirror of
https://github.com/langbot-app/LangBot.git
synced 2025-11-25 11:29:39 +08:00
perf: linter error in pipeline page
This commit is contained in:
@@ -42,16 +42,16 @@ export default function PluginConfigPage() {
|
|||||||
.then((value) => {
|
.then((value) => {
|
||||||
let currentTime = new Date();
|
let currentTime = new Date();
|
||||||
const pipelineList = value.pipelines.map((pipeline) => {
|
const pipelineList = value.pipelines.map((pipeline) => {
|
||||||
let lastUpdatedTimeAgo = Math.floor((currentTime.getTime() - new Date(pipeline.updated_at).getTime()) / 1000 / 60 / 60 / 24);
|
let lastUpdatedTimeAgo = Math.floor((currentTime.getTime() - new Date(pipeline.updated_at ?? currentTime.getTime()).getTime()) / 1000 / 60 / 60 / 24);
|
||||||
|
|
||||||
let lastUpdatedTimeAgoText = lastUpdatedTimeAgo > 0 ? ` ${lastUpdatedTimeAgo} 天前` : '今天';
|
let lastUpdatedTimeAgoText = lastUpdatedTimeAgo > 0 ? ` ${lastUpdatedTimeAgo} 天前` : '今天';
|
||||||
|
|
||||||
return new PipelineCardVO({
|
return new PipelineCardVO({
|
||||||
lastUpdatedTimeAgo: lastUpdatedTimeAgoText,
|
lastUpdatedTimeAgo: lastUpdatedTimeAgoText,
|
||||||
description: pipeline.description,
|
description: pipeline.description,
|
||||||
id: pipeline.uuid,
|
id: pipeline.uuid ?? '',
|
||||||
name: pipeline.name,
|
name: pipeline.name,
|
||||||
isDefault: pipeline.is_default,
|
isDefault: pipeline.is_default ?? false,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
setPipelineList(pipelineList);
|
setPipelineList(pipelineList);
|
||||||
|
|||||||
Reference in New Issue
Block a user