feat: update dynamic status model badge activation
This commit is contained in:
parent
1317694bcc
commit
072273b260
|
|
@ -0,0 +1,2 @@
|
|||
-- AlterTable
|
||||
ALTER TABLE "Model" ADD COLUMN "isActive" BOOLEAN NOT NULL DEFAULT false;
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
-- AlterTable
|
||||
ALTER TABLE "Model" ALTER COLUMN "isActive" SET DEFAULT true;
|
||||
|
|
@ -180,11 +180,11 @@ model Model {
|
|||
id Int @id @default(autoincrement())
|
||||
modelName String
|
||||
description String?
|
||||
|
||||
accuracy Float
|
||||
macroF1 Float
|
||||
f1Negative Float
|
||||
f1Neutral Float
|
||||
isActive Boolean @default(true)
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ async function main() {
|
|||
macroF1: 0.56,
|
||||
f1Negative: 0.61,
|
||||
f1Neutral: 0.16,
|
||||
isActive: false,
|
||||
},
|
||||
{
|
||||
modelName: "Model XGBoost (Tuned)",
|
||||
|
|
@ -21,6 +22,7 @@ async function main() {
|
|||
macroF1: 0.58,
|
||||
f1Negative: 0.65,
|
||||
f1Neutral: 0.17,
|
||||
isActive: false,
|
||||
},
|
||||
{
|
||||
modelName: "Model XGBoost (Optimized)",
|
||||
|
|
@ -30,6 +32,7 @@ async function main() {
|
|||
macroF1: 0.61,
|
||||
f1Negative: 0.65,
|
||||
f1Neutral: 0.27,
|
||||
isActive: true,
|
||||
},
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ export const getClassificationReport = async () => {
|
|||
macroF1: true,
|
||||
f1Negative: true,
|
||||
f1Neutral: true,
|
||||
isActive: true,
|
||||
},
|
||||
orderBy: {
|
||||
createdAt: "asc",
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ export default function AnalysisClient() {
|
|||
register,
|
||||
handleSubmit,
|
||||
onSubmit,
|
||||
setValue,
|
||||
errors,
|
||||
isValid,
|
||||
loading,
|
||||
|
|
@ -43,7 +42,6 @@ export default function AnalysisClient() {
|
|||
|
||||
<div className="flex flex-col gap-4">
|
||||
<div className="flex w-full gap-4">
|
||||
{/* Field Profesi */}
|
||||
<div className="w-1/2">
|
||||
<label className="block mb-1 text-sm font-medium text-gray-700">
|
||||
Pilih Profesi
|
||||
|
|
@ -60,7 +58,11 @@ export default function AnalysisClient() {
|
|||
</SelectTrigger>
|
||||
<SelectContent className="bg-card" position="popper">
|
||||
{professionItems.map((item) => (
|
||||
<SelectItem key={item.value} value={item.value} className="focus:bg-primary focus:text-card">
|
||||
<SelectItem
|
||||
key={item.value}
|
||||
value={item.value}
|
||||
className="focus:bg-primary focus:text-card"
|
||||
>
|
||||
<div className="flex gap-2 items-center">
|
||||
<item.icon className="h-4 w-4" />
|
||||
<span>{item.label}</span>
|
||||
|
|
|
|||
|
|
@ -54,9 +54,9 @@ export function ModelInfo({ data }: { data: ModelDB[] }) {
|
|||
|
||||
<Badge
|
||||
variant="secondary"
|
||||
className="bg-sentiment-positive-light text-sentiment-positive"
|
||||
className={`bg-sentiment-positive-light text-sentiment-positive ${currentModel.isActive ? "bg-sentiment-positive-light text-sentiment-positive" : "bg-primary/10 text-primary"}`}
|
||||
>
|
||||
Active
|
||||
{currentModel.isActive === true ? "Active" : "Inactive"}
|
||||
</Badge>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ export interface ModelDB {
|
|||
macroF1: number;
|
||||
f1Negative: number;
|
||||
f1Neutral: number;
|
||||
isActive: boolean;
|
||||
}
|
||||
|
||||
export interface ProfileClientProps {
|
||||
|
|
|
|||
Loading…
Reference in New Issue