Fix wifidevices update
This commit is contained in:
parent
f6029ae134
commit
db7090ab5d
4
server/package-lock.json
generated
4
server/package-lock.json
generated
|
@ -9,7 +9,7 @@
|
|||
"version": "3.3.9",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@prisma/client": "^4.2.1",
|
||||
"@prisma/client": "^4.7.1",
|
||||
"activedirectory2": "^2.1.0",
|
||||
"apollo-server": "^2.19.0",
|
||||
"apollo-server-plugin-response-cache": "^0.5.6",
|
||||
|
@ -37,7 +37,7 @@
|
|||
"@babel/plugin-proposal-object-rest-spread": "^7.16.0",
|
||||
"@babel/preset-env": "^7.16.0",
|
||||
"nodemon": "^2.0.15",
|
||||
"prisma": "^4.2.1"
|
||||
"prisma": "^4.7.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@ampproject/remapping": {
|
||||
|
|
|
@ -37,10 +37,10 @@
|
|||
"@babel/plugin-proposal-object-rest-spread": "^7.16.0",
|
||||
"@babel/preset-env": "^7.16.0",
|
||||
"nodemon": "^2.0.15",
|
||||
"prisma": "^4.2.1"
|
||||
"prisma": "^4.7.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@prisma/client": "^4.2.1",
|
||||
"@prisma/client": "^4.7.1",
|
||||
"activedirectory2": "^2.1.0",
|
||||
"apollo-server": "^2.19.0",
|
||||
"apollo-server-plugin-response-cache": "^0.5.6",
|
||||
|
|
|
@ -103,11 +103,13 @@ async function updateDB(onlineDevices) {
|
|||
where: { mac: device.mac },
|
||||
create: {
|
||||
...device,
|
||||
network: {
|
||||
network: network.id
|
||||
? {
|
||||
connect: {
|
||||
id: network.id
|
||||
}
|
||||
},
|
||||
}
|
||||
: undefined,
|
||||
hostname,
|
||||
firstSeen: device.firstSeen || new Date(),
|
||||
user,
|
||||
|
@ -119,10 +121,14 @@ async function updateDB(onlineDevices) {
|
|||
},
|
||||
update: {
|
||||
...device,
|
||||
network: {
|
||||
network: network.id
|
||||
? {
|
||||
connect: {
|
||||
id: network.id
|
||||
}
|
||||
}
|
||||
: {
|
||||
disconnect: true
|
||||
},
|
||||
hostname,
|
||||
user,
|
||||
|
|
|
@ -63,6 +63,9 @@ const typeDefs = gql`
|
|||
|
||||
"One Access Point"
|
||||
accessPoint(id: ID!): AccessPoint! @auth(roles: ["superAdmin"])
|
||||
|
||||
"All Subnets"
|
||||
subnets: [SubnetInfo!]! @auth(roles: ["superAdmin"])
|
||||
}
|
||||
|
||||
type Mutation {
|
||||
|
@ -363,6 +366,15 @@ const typeDefs = gql`
|
|||
sumUsage: String
|
||||
}
|
||||
|
||||
"A Subnet stats"
|
||||
type SubnetStats {
|
||||
id: ID!
|
||||
timestamp: String
|
||||
clients: Int
|
||||
avgUsage: Int
|
||||
sumUsage: Int
|
||||
}
|
||||
|
||||
"A WiFi Device Search result"
|
||||
type WifiDevicesResult {
|
||||
data: [WifiDevice!]!
|
||||
|
@ -388,6 +400,7 @@ const typeDefs = gql`
|
|||
subnetMaskLength: String!
|
||||
numHosts: String!
|
||||
length: String!
|
||||
stats: SubnetStats!
|
||||
}
|
||||
|
||||
input LoginInput {
|
||||
|
|
Loading…
Reference in New Issue
Block a user