From 677dfdbc052d44d6f0c19e38172458c883560399 Mon Sep 17 00:00:00 2001 From: alejandrovarelasc Date: Mon, 13 May 2024 01:33:59 -0500 Subject: [PATCH] fix: Docs --- README.md | 2 +- .../database/mongo-alerts-database.ts | 15 -------------- .../database/mongo-alerts.database.ts | 17 +++++++++------- .../database/mongo-device-database.ts | 15 -------------- .../database/mongo-devices.database.ts | 20 ++++++++++--------- compute/client/src/pages/api/alerts/[id].ts | 2 +- .../client/src/pages/api/alerts/getAlerts.ts | 2 +- .../src/pages/api/alerts/getAmountAlerts.ts | 2 +- 8 files changed, 25 insertions(+), 50 deletions(-) delete mode 100644 compute/client/src/infrastructure/database/mongo-alerts-database.ts delete mode 100644 compute/client/src/infrastructure/database/mongo-device-database.ts diff --git a/README.md b/README.md index ad0ba07..2a94459 100644 --- a/README.md +++ b/README.md @@ -117,7 +117,7 @@ Desarrollar y validar un sistema tele-informático que permita automatizar el pr # kubectl create -f ./storage/mongo-operator.yaml --namespace apps # kubectl delete -f ./storage/mongo-operator.yaml --namespace apps # Using local mongo db - Move to storage folder - ./generate. + ./generate.sh ./configure.sh admin kubectl apply -f ./storage/mongo-ui.yaml --namespace apps # Creation of cisterns db and measurements colleciton from ui diff --git a/compute/client/src/infrastructure/database/mongo-alerts-database.ts b/compute/client/src/infrastructure/database/mongo-alerts-database.ts deleted file mode 100644 index ee33d73..0000000 --- a/compute/client/src/infrastructure/database/mongo-alerts-database.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Alert as AlertDomain } from "@/domain/model/Alert"; -import mongoose, { Model } from "mongoose"; -const { Schema, model } = mongoose; - -const AlertSchema = new Schema({ - _id: String, - hostname: String, - type: String, - value: Boolean, -}); - -const Alert: Model = - mongoose.models.Alert || model("Alert", AlertSchema); - -export default Alert; diff --git a/compute/client/src/infrastructure/database/mongo-alerts.database.ts b/compute/client/src/infrastructure/database/mongo-alerts.database.ts index 7419c14..ee33d73 100644 --- a/compute/client/src/infrastructure/database/mongo-alerts.database.ts +++ b/compute/client/src/infrastructure/database/mongo-alerts.database.ts @@ -1,12 +1,15 @@ -import { Alert as AlertDomain } from '@/domain/model/Alert' -import mongoose, { Model } from 'mongoose' -const { Schema, model } = mongoose +import { Alert as AlertDomain } from "@/domain/model/Alert"; +import mongoose, { Model } from "mongoose"; +const { Schema, model } = mongoose; const AlertSchema = new Schema({ + _id: String, + hostname: String, type: String, - description: String, -}) + value: Boolean, +}); -const Alert: Model = mongoose.models?.Alert|| model('Alert', AlertSchema) +const Alert: Model = + mongoose.models.Alert || model("Alert", AlertSchema); -export default Alert \ No newline at end of file +export default Alert; diff --git a/compute/client/src/infrastructure/database/mongo-device-database.ts b/compute/client/src/infrastructure/database/mongo-device-database.ts deleted file mode 100644 index a98698d..0000000 --- a/compute/client/src/infrastructure/database/mongo-device-database.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Device as DeviceDomain } from "@/domain/model/Device"; -import mongoose, { Model } from "mongoose"; -const { Schema, model } = mongoose; - -const DeviceSchema = new Schema({ - _id: String, - hostname: String, - ip: String, - status: Boolean, -}); - -const Device: Model = - mongoose.models.Device || model("Device", DeviceSchema); - -export default Device; diff --git a/compute/client/src/infrastructure/database/mongo-devices.database.ts b/compute/client/src/infrastructure/database/mongo-devices.database.ts index 291cd8e..a98698d 100644 --- a/compute/client/src/infrastructure/database/mongo-devices.database.ts +++ b/compute/client/src/infrastructure/database/mongo-devices.database.ts @@ -1,13 +1,15 @@ -import { Device as DeviceDomain } from '@/domain/model/Device' -import mongoose, { Model } from 'mongoose' -const { Schema, model } = mongoose +import { Device as DeviceDomain } from "@/domain/model/Device"; +import mongoose, { Model } from "mongoose"; +const { Schema, model } = mongoose; const DeviceSchema = new Schema({ - name: String, - type: String, - location: String, -}) + _id: String, + hostname: String, + ip: String, + status: Boolean, +}); -const Device: Model = mongoose.models?.Device|| model('Device', DeviceSchema) +const Device: Model = + mongoose.models.Device || model("Device", DeviceSchema); -export default Device \ No newline at end of file +export default Device; diff --git a/compute/client/src/pages/api/alerts/[id].ts b/compute/client/src/pages/api/alerts/[id].ts index 76015fa..88dd66a 100644 --- a/compute/client/src/pages/api/alerts/[id].ts +++ b/compute/client/src/pages/api/alerts/[id].ts @@ -1,6 +1,6 @@ import { NextApiRequest, NextApiResponse } from "next"; import { dbConnect } from "@/infrastructure/database/mongo-client.database"; -import Alert from "@/infrastructure/database/mongo-alerts-database"; +import Alert from "@/infrastructure/database/mongo-alerts.database"; import { Types } from "mongoose"; export default async function handler( diff --git a/compute/client/src/pages/api/alerts/getAlerts.ts b/compute/client/src/pages/api/alerts/getAlerts.ts index 985d57e..ca8a9a0 100644 --- a/compute/client/src/pages/api/alerts/getAlerts.ts +++ b/compute/client/src/pages/api/alerts/getAlerts.ts @@ -1,6 +1,6 @@ import { NextApiRequest, NextApiResponse } from "next"; import { dbConnect } from "@/infrastructure/database/mongo-client.database"; -import Alert from "@/infrastructure/database/mongo-alerts-database"; +import Alert from "@/infrastructure/database/mongo-alerts.database"; import { Alert as AlertType } from "@/domain/model/Alert"; export default async function handler( diff --git a/compute/client/src/pages/api/alerts/getAmountAlerts.ts b/compute/client/src/pages/api/alerts/getAmountAlerts.ts index 15387bd..ec03ba5 100644 --- a/compute/client/src/pages/api/alerts/getAmountAlerts.ts +++ b/compute/client/src/pages/api/alerts/getAmountAlerts.ts @@ -1,6 +1,6 @@ import { NextApiRequest, NextApiResponse } from "next"; import { dbConnect } from "@/infrastructure/database/mongo-client.database"; -import Alert from "@/infrastructure/database/mongo-alerts-database"; +import Alert from "@/infrastructure/database/mongo-alerts.database"; interface AlertsCount { _id: string;