-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
339e537
commit 677dfdb
Showing
8 changed files
with
25 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 0 additions & 15 deletions
15
compute/client/src/infrastructure/database/mongo-alerts-database.ts
This file was deleted.
Oops, something went wrong.
17 changes: 10 additions & 7 deletions
17
compute/client/src/infrastructure/database/mongo-alerts.database.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<AlertDomain>({ | ||
_id: String, | ||
hostname: String, | ||
type: String, | ||
description: String, | ||
}) | ||
value: Boolean, | ||
}); | ||
|
||
const Alert: Model<AlertDomain> = mongoose.models?.Alert|| model('Alert', AlertSchema) | ||
const Alert: Model<AlertDomain> = | ||
mongoose.models.Alert || model("Alert", AlertSchema); | ||
|
||
export default Alert | ||
export default Alert; |
15 changes: 0 additions & 15 deletions
15
compute/client/src/infrastructure/database/mongo-device-database.ts
This file was deleted.
Oops, something went wrong.
20 changes: 11 additions & 9 deletions
20
compute/client/src/infrastructure/database/mongo-devices.database.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<DeviceDomain>({ | ||
name: String, | ||
type: String, | ||
location: String, | ||
}) | ||
_id: String, | ||
hostname: String, | ||
ip: String, | ||
status: Boolean, | ||
}); | ||
|
||
const Device: Model<DeviceDomain> = mongoose.models?.Device|| model('Device', DeviceSchema) | ||
const Device: Model<DeviceDomain> = | ||
mongoose.models.Device || model("Device", DeviceSchema); | ||
|
||
export default Device | ||
export default Device; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters