Refactor host schema to simplify deviceInfo structure
All checks were successful
farmcontrol/farmcontrol-ws/pipeline/head This commit looks good
All checks were successful
farmcontrol/farmcontrol-ws/pipeline/head This commit looks good
- Removed unused fields from the deviceInfo schema, including uptime, memory, and network properties, to streamline the schema. - Updated the deviceInfo reference in the host schema for improved clarity and consistency.
This commit is contained in:
parent
9416a94a23
commit
7b84114588
@ -10,20 +10,12 @@ const deviceInfoSchema = new mongoose.Schema(
|
||||
release: { type: String },
|
||||
arch: { type: String },
|
||||
hostname: { type: String },
|
||||
uptime: { type: Number },
|
||||
},
|
||||
cpu: {
|
||||
cores: { type: Number },
|
||||
model: { type: String },
|
||||
speedMHz: { type: Number },
|
||||
},
|
||||
memory: {
|
||||
totalGB: { type: String }, // stored as string from .toFixed(2), could also use Number
|
||||
freeGB: { type: String },
|
||||
},
|
||||
network: {
|
||||
type: mongoose.Schema.Types.Mixed, // since it's an object with dynamic interface names
|
||||
},
|
||||
user: {
|
||||
uid: { type: Number },
|
||||
gid: { type: Number },
|
||||
@ -33,8 +25,6 @@ const deviceInfoSchema = new mongoose.Schema(
|
||||
},
|
||||
process: {
|
||||
nodeVersion: { type: String },
|
||||
pid: { type: Number },
|
||||
cwd: { type: String },
|
||||
execPath: { type: String },
|
||||
},
|
||||
},
|
||||
@ -55,7 +45,7 @@ const hostSchema = new mongoose.Schema(
|
||||
active: { required: true, type: Boolean, default: true },
|
||||
connectedAt: { required: false, type: Date },
|
||||
authCode: { type: { required: false, type: String } },
|
||||
deviceInfo: { deviceInfoSchema },
|
||||
deviceInfo: deviceInfoSchema,
|
||||
otp: { type: { required: false, type: String } },
|
||||
otpExpiresAt: { required: false, type: Date },
|
||||
files: [{ type: mongoose.Schema.Types.ObjectId, ref: 'file' }],
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user