Semi functional client webUI

- can update client info for sure
- Working on notifications now
This commit is contained in:
Logan Cusano
2023-07-22 03:27:39 -04:00
committed by logan
parent 167f87128e
commit abdb725964
12 changed files with 964 additions and 47 deletions

View File

@@ -15,7 +15,9 @@ router.get('/status', botController.getStatus);
*
* @param req The request sent from the master
* @param req.body.channelId The channel ID to join
* @param req.body.clientId The discord Client ID to use when connecting to the server
* @param req.body.presetName The name of the preset to start listening to
* @param req.body.NGThreshold [OPTIONAL] The noisegate threshold, this will default to 50
*/
router.post('/join', botController.joinServer);

View File

@@ -2,7 +2,7 @@
const express = require('express');
const router = express.Router();
// Controllers
const { requestCheckIn, getPresets, updatePreset, addNewPreset, removePreset, updateClient } = require("../controllers/clientController");
const { requestCheckIn, getPresets, updatePreset, addNewPreset, removePreset, updateClient, updateClientConfigWrapper } = require("../controllers/clientController");
/** GET Request a check in from the client
* Queue the client to check in with the server
@@ -11,16 +11,21 @@ const { requestCheckIn, getPresets, updatePreset, addNewPreset, removePreset, up
*/
router.get('/requestCheckIn', requestCheckIn);
/** GET Object of all known presets
* Query the client to get all the known presets
*/
router.put('/', );
/** GET Object of all known presets
* Query the client to get all the known presets
*/
router.get('/presets', getPresets);
/**
* PUT An update to the running client config (not radio config)
* @param {number} req.body.id The ID given to the node to update
* @param {string} req.body.name The name of the node
* @param {string} req.body.ip The IP the server can contact the node on
* @param {number} req.body.port The port the server can contact the node on
* @param {string} req.body.location The physical location of the node
*/
router.put('/', updateClientConfigWrapper);
/** POST Update to preset
*
* @param req The request sent from the master

View File

@@ -1,9 +1,11 @@
var express = require('express');
var router = express.Router();
const { getFullConfig } = require('../utilities/configHandler');
/* GET home page. */
router.get('/', function(req, res, next) {
res.render('index', { title: 'Express' });
router.get('/', async function(req, res, next) {
const clientConfig = await getFullConfig();
res.render('index', { 'node': clientConfig });
});
module.exports = router;