/** * Created by cmiles on 8/9/2017. */ var express = require('express'); var router = express.Router(); var fs = require('fs'); var template_render = require('../lib/render_template.js'); var authorize = require('../lib/authorize.js'); router.get('/', authorize.auth, function(req, res, next) { glass_settings_template = template_render.get_template("glass_alerts"); var json_file = require('jsonfile'); /* Read Config */ glass_config = json_file.readFileSync('config/glass_config.json'); /* Shared Network Alert Threshold (Critical) */ input = template_render.form_input('Shared Network Alert Threshold % (Critical)', ''); /* Shared Network Alert Threshold (Warning) */ input = input + template_render.form_input('Shared Network Alert Threshold % (Warning)', ''); /* Leases Per Minute Threshold */ input = input + template_render.form_input('Alert when Leases Per Minute Reaches Below this Number', ''); //
form_data = template_render.form_body("glass-alerts-form", input); glass_settings_template = template_render.set_template_variable(glass_settings_template, "c_content", form_data); /* Shared Network Alert Threshold (Critical) */ input = template_render.form_input('Slack Webhook URL ', ''); /* Shared Network Alert Threshold (Warning) */ input = input + template_render.form_input('Slack Channel ', ''); // form_data = template_render.form_body("glass-notifications-form", input); glass_settings_template = template_render.set_template_variable(glass_settings_template, "n_content", form_data); glass_settings_template = template_render.set_template_variable( glass_settings_template, "save_button", '' ); res.send(template_render.get_index_template(glass_settings_template, req.url)); }); module.exports = router;