vizualization updates

This commit is contained in:
2025-03-28 12:45:59 +05:30
parent b117c8705c
commit dc5d7c2ebf
59 changed files with 1977 additions and 92 deletions

View File

@@ -0,0 +1,48 @@
import mongoose, { Schema, Document, model } from "mongoose";
import MainModel from "../../connect/mongoose.ts";
export interface widget extends Document {
widgetName: string;
widgetside: string;
widgetID: string;
widgetOrder: string;
elementType: string;
elementColor: string;
fontFamily: string;
fontStyle: string;
fontWeight: string;
isArchive: boolean;
panelID: mongoose.Types.ObjectId;
Data: {
measurement: Record<string, any>;
duration: string;
};
}
const widgetSchema: Schema = new Schema(
{
widgetName: { type: String },
widgetside: { type: String },
widgetID: { type: String },
widgetOrder: { type: String },
elementType: { type: String },
elementColor: { type: String },
fontFamily: { type: String },
fontStyle: { type: String },
Data: {
measurements: {
type: Object,
default: {},
},
duration: { type: String, default: "1hr" },
},
fontWeight: { type: String },
isArchive: { type: Boolean, default: false },
panelID: { type: mongoose.Schema.Types.ObjectId, ref: "Panel" },
},
{ timestamps: true }
);
const widgetModel = (db: any) => {
return MainModel(db, "Widget", widgetSchema, "Widget");
};
export default widgetModel;