From ee90df1f3de07217c5140ee13405d63448269589 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 2 Sep 2017 06:24:21 -0500 Subject: [PATCH] DHCP Config Backups - add modals to core code --- .gitignore | 2 ++ public/assets/js/glass-core.js | 11 +++++++++++ public/templates/dhcp_config.html | 1 + public/templates/index.html | 19 ++++++++++++++++++- routes/dhcp_config_save.js | 25 ++++++++++++++++++++++--- 5 files changed, 54 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index d347231..048fc7c 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,8 @@ pids *.seed *.pid.lock +config_backups + # Directory for instrumented libs generated by jscoverage/JSCover lib-cov diff --git a/public/assets/js/glass-core.js b/public/assets/js/glass-core.js index 85b6a57..bb9cc78 100644 --- a/public/assets/js/glass-core.js +++ b/public/assets/js/glass-core.js @@ -2,6 +2,17 @@ * Created by cmiles on 8/9/2017. */ +function modal (title, content, buttons) { + $('#modal-title').html(title); + $('#modal-body').html(content); + + // + if(buttons != '') { + $('#modal-buttons').html(buttons); + } + $('#mdModal').modal('show'); +} + function get_form_query_string(form_id){ query_string = ""; $('#' + form_id).find('input, select, textarea').each(function (key) { diff --git a/public/templates/dhcp_config.html b/public/templates/dhcp_config.html index a0fa88e..4654656 100644 --- a/public/templates/dhcp_config.html +++ b/public/templates/dhcp_config.html @@ -33,3 +33,4 @@ + diff --git a/public/templates/index.html b/public/templates/index.html index 973418b..1dd9eb9 100644 --- a/public/templates/index.html +++ b/public/templates/index.html @@ -134,6 +134,24 @@ + + +
@@ -182,7 +200,6 @@ -
' + output + ''); + output = output.replace(". ", "
"); + output = output.replace("line", "

line"); + output = output.replace("Configuration file errors encountered", "

Configuration file errors encountered"); + + res.send(''); - + output = output.replace("\n", "
"); + res.send( + '