mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
feat: Implement hard delete for LlmLog items older than 3 days when billing is enabled; refactor LlmLogsTable by removing unused fields and action buttons
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
import DatabaseService from "./DatabaseService";
|
||||
import Model from "../../Models/DatabaseModels/LlmLog";
|
||||
import { IsBillingEnabled } from "../EnvironmentConfig";
|
||||
|
||||
export class Service extends DatabaseService<Model> {
|
||||
public constructor() {
|
||||
super(Model);
|
||||
if (IsBillingEnabled) {
|
||||
this.hardDeleteItemsOlderThanInDays("createdAt", 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -36,23 +36,6 @@ const LlmLogsTable: FunctionComponent<LlmLogsTableProps> = (
|
||||
type: FieldType.Text,
|
||||
noValueMessage: "-",
|
||||
},
|
||||
{
|
||||
field: { llmType: true },
|
||||
title: "Type",
|
||||
type: FieldType.Text,
|
||||
noValueMessage: "-",
|
||||
},
|
||||
{
|
||||
field: { modelName: true },
|
||||
title: "Model",
|
||||
type: FieldType.Text,
|
||||
noValueMessage: "-",
|
||||
},
|
||||
{
|
||||
field: { isGlobalProvider: true },
|
||||
title: "Global",
|
||||
type: FieldType.Boolean,
|
||||
},
|
||||
{
|
||||
field: { feature: true },
|
||||
title: "Feature",
|
||||
@@ -164,8 +147,6 @@ const LlmLogsTable: FunctionComponent<LlmLogsTableProps> = (
|
||||
...(props.query || {}),
|
||||
}}
|
||||
selectMoreFields={{
|
||||
requestPrompt: true,
|
||||
responsePreview: true,
|
||||
statusMessage: true,
|
||||
}}
|
||||
cardProps={{
|
||||
@@ -183,32 +164,6 @@ const LlmLogsTable: FunctionComponent<LlmLogsTableProps> = (
|
||||
columns={defaultColumns}
|
||||
filters={defaultFilters}
|
||||
actionButtons={[
|
||||
{
|
||||
title: "View Request",
|
||||
buttonStyleType: ButtonStyleType.NORMAL,
|
||||
icon: IconProp.List,
|
||||
onClick: async (item: LlmLog, onCompleteAction: VoidFunction) => {
|
||||
setModalText(
|
||||
(item["requestPrompt"] as string) || "No request data",
|
||||
);
|
||||
setModalTitle("Request Prompt");
|
||||
setShowModal(true);
|
||||
onCompleteAction();
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "View Response",
|
||||
buttonStyleType: ButtonStyleType.NORMAL,
|
||||
icon: IconProp.File,
|
||||
onClick: async (item: LlmLog, onCompleteAction: VoidFunction) => {
|
||||
setModalText(
|
||||
(item["responsePreview"] as string) || "No response data",
|
||||
);
|
||||
setModalTitle("Response Preview");
|
||||
setShowModal(true);
|
||||
onCompleteAction();
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "View Error",
|
||||
buttonStyleType: ButtonStyleType.NORMAL,
|
||||
|
||||
Reference in New Issue
Block a user