vizualization updates
This commit is contained in:
48
src/shared/model/vizualization/widgemodel.ts
Normal file
48
src/shared/model/vizualization/widgemodel.ts
Normal 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;
|
||||
Reference in New Issue
Block a user