-
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.
feature/post overhaul cleanup (#141)
* a quick fix of sorts * updates to live video * lint fix 🧹 * tooltip fix? * update delete modal for processes * removing shrinkwraps + card view in processlist * shrinkwraps
- Loading branch information
Showing
132 changed files
with
6,337 additions
and
9,591 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,44 @@ | ||
module.exports = { | ||
"ignorePatterns": [ | ||
"command/frontend/js/lib/*", | ||
"command/dist/app.js", | ||
"node_modules" | ||
], | ||
"env": { | ||
"browser": true, | ||
"es2021": true, | ||
"node": true | ||
}, | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:react/recommended" | ||
], | ||
"parserOptions": { | ||
"ecmaFeatures": { | ||
"jsx": true | ||
}, | ||
"ecmaVersion": 13, | ||
"sourceType": "module" | ||
}, | ||
"plugins": [ | ||
"react" | ||
], | ||
"rules": { | ||
"indent": [ | ||
"error", | ||
"tab" | ||
], | ||
"linebreak-style": [ | ||
"error", | ||
"unix" | ||
], | ||
"quotes": [ | ||
"error", | ||
"double" | ||
], | ||
"semi": [ | ||
"error", | ||
"never" | ||
] | ||
} | ||
"ignorePatterns": [ | ||
"command/frontend/js/lib/*", | ||
"command/dist/app.js", | ||
"node_modules" | ||
], | ||
"env": { | ||
"browser": true, | ||
"es2021": true, | ||
"node": true | ||
}, | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:react/recommended" | ||
], | ||
"parserOptions": { | ||
"ecmaFeatures": { | ||
"jsx": true | ||
}, | ||
"ecmaVersion": 13, | ||
"sourceType": "module" | ||
}, | ||
"plugins": [ | ||
"react" | ||
], | ||
"rules": { | ||
"indent": [ | ||
"error", | ||
"tab" | ||
], | ||
"linebreak-style": [ | ||
"error", | ||
"unix" | ||
], | ||
"quotes": [ | ||
"error", | ||
"double" | ||
], | ||
"semi": [ | ||
"error", | ||
"never" | ||
] | ||
} | ||
} |
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,36 +1,36 @@ | ||
require("dotenv").config() | ||
const Pool = require('pg').Pool | ||
const Pool = require("pg").Pool | ||
const pool = new Pool({ | ||
user: process.env.database_USER, | ||
host: process.env.database_HOST, | ||
database: process.env.database_NAME, | ||
password: process.env.database_PASSWORD, | ||
port: process.env.database_PORT, | ||
user: process.env.database_USER, | ||
host: process.env.database_HOST, | ||
database: process.env.database_NAME, | ||
password: process.env.database_PASSWORD, | ||
port: process.env.database_PORT, | ||
}) | ||
|
||
const creationTasks = [ | ||
{ | ||
query: `CREATE TABLE frame_files(ID SERIAL PRIMARY KEY, timestamp TIMESTAMP, camera NUMERIC(10), name VARCHAR, size NUMERIC);`, | ||
description: "frame files table" | ||
}, | ||
{ | ||
query: `CREATE TABLE frame_deletes(ID SERIAL PRIMARY KEY, timestamp TIMESTAMP, camera NUMERIC(10), size NUMERIC, count NUMERIC);`, | ||
description: "frame deletions table" | ||
}, | ||
{ | ||
query: `CREATE TABLE auth(ID SERIAL PRIMARY KEY, username VARCHAR(10) UNIQUE, hash VARCHAR);`, | ||
description: "authorization table" | ||
} | ||
{ | ||
query: "CREATE TABLE frame_files(ID SERIAL PRIMARY KEY, timestamp TIMESTAMP, camera NUMERIC(10), name VARCHAR, size NUMERIC);", | ||
description: "frame files table" | ||
}, | ||
{ | ||
query: "CREATE TABLE frame_deletes(ID SERIAL PRIMARY KEY, timestamp TIMESTAMP, camera NUMERIC(10), size NUMERIC, count NUMERIC);", | ||
description: "frame deletions table" | ||
}, | ||
{ | ||
query: "CREATE TABLE auth(ID SERIAL PRIMARY KEY, username VARCHAR(10) UNIQUE, hash VARCHAR);", | ||
description: "authorization table" | ||
} | ||
] | ||
|
||
Promise.allSettled(creationTasks.map(({query}) => { | ||
return pool.query(query) | ||
return pool.query(query) | ||
})).then(values => { | ||
let issues = false | ||
values.forEach((value, index) => { | ||
const tableExists = value.status == "fulfilled" || (value.status == "rejected" && value.reason && value.reason.code == `42P07`) | ||
if(!tableExists) issues = true | ||
console.log(`${creationTasks[index].description} ${tableExists ? `✔️` : `❌`}`) | ||
}) | ||
process.exit(issues ? 1 : 0) | ||
let issues = false | ||
values.forEach((value, index) => { | ||
const tableExists = value.status == "fulfilled" || (value.status == "rejected" && value.reason && value.reason.code == "42P07") | ||
if(!tableExists) issues = true | ||
console.log(`${creationTasks[index].description} ${tableExists ? "✔️" : "❌"}`) | ||
}) | ||
process.exit(issues ? 1 : 0) | ||
}) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
module.exports = { | ||
default: { | ||
create: () => ({ | ||
post: (url, data, other) => { | ||
return new Promise(resolve => { | ||
resolve(data) | ||
}) | ||
} | ||
}) | ||
} | ||
default: { | ||
create: () => ({ | ||
post: (url, data, other) => { | ||
return new Promise(resolve => { | ||
resolve(data) | ||
}) | ||
} | ||
}) | ||
} | ||
} |
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,14 +1,14 @@ | ||
module.exports = { | ||
client: (name) => ({ | ||
emit: (event, ...args) => { | ||
if(event == "savePassword"){ | ||
args[1]() | ||
} | ||
else if(event == "verifyPassword"){ | ||
args[1](false) | ||
} | ||
}, | ||
on: () => {} | ||
}), | ||
server: () => {} | ||
client: (name) => ({ | ||
emit: (event, ...args) => { | ||
if(event == "savePassword"){ | ||
args[1]() | ||
} | ||
else if(event == "verifyPassword"){ | ||
args[1](false) | ||
} | ||
}, | ||
on: () => {} | ||
}), | ||
server: () => {} | ||
} |
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,20 +1,20 @@ | ||
const bcrypt = jest.requireActual("bcryptjs") | ||
const hashedMockedPassword = bcrypt.hashSync('mockedPassword', bcrypt.genSaltSync(10)) | ||
const hashedMockedPassword = bcrypt.hashSync("mockedPassword", bcrypt.genSaltSync(10)) | ||
|
||
const queryObject = { | ||
query: (str, callback) => callback(null, {rows: [{hash: hashedMockedPassword}]}) | ||
query: (str, callback) => callback(null, {rows: [{hash: hashedMockedPassword}]}) | ||
} | ||
const mockedPool = { | ||
connect: () => { | ||
return queryObject | ||
}, | ||
...queryObject, | ||
end: jest.fn(), | ||
on: jest.fn() | ||
connect: () => { | ||
return queryObject | ||
}, | ||
...queryObject, | ||
end: jest.fn(), | ||
on: jest.fn() | ||
} | ||
|
||
const pg = { | ||
Pool: jest.fn(() => mockedPool) | ||
Pool: jest.fn(() => mockedPool) | ||
} | ||
|
||
module.exports = pg |
Oops, something went wrong.