From 3cb69228e88227f3c6c7f749bca337c3158e0b9c Mon Sep 17 00:00:00 2001
From: Adhidarma Hadiwinoto <gua@adhisimon.org>
Date: Wed, 6 Jan 2016 17:50:44 +0700
Subject: [PATCH] relayout with panel

---
 index.js                      | 9 +++++++++
 views/layout-with-topbar.html | 1 +
 2 files changed, 10 insertions(+)

diff --git a/index.js b/index.js
index f7d9994..f2d0d98 100644
--- a/index.js
+++ b/index.js
@@ -30,6 +30,14 @@ function matchedPasswordAndHash(password, hash) {
     return (hash == sha256sum.digest('hex'))
 }
 
+function renderDashboard(req, res) {
+    res.render('dashboard.html', {
+        gateway_name: config.globals.gateway_name,
+        title: 'Dashboard',
+        config: config,
+    });
+}
+
 function renderConfigIndex(req, res) {
     
     masked = ['config.expresso.password'];
@@ -277,6 +285,7 @@ function createServer() {
     });
     
     app.get('/', loggedIn, function(req, res) { res.redirect('/runtime-info'); });
+    app.get('/dashboard', loggedIn, renderDashboard);
     app.get('/config', loggedIn, renderConfigIndex);
     app.get('/login', renderLoginPage);
     app.post('/login', passport.authenticate('local', { successRedirect: '/', failureRedirect: '/login' }));
diff --git a/views/layout-with-topbar.html b/views/layout-with-topbar.html
index 1ac8b0f..04f7dc7 100644
--- a/views/layout-with-topbar.html
+++ b/views/layout-with-topbar.html
@@ -40,6 +40,7 @@
         <div id="navbar" class="collapse navbar-collapse">
           <ul class="nav navbar-nav">
             <li><a href="/">Home</a></li>
+            <li><a href="/dashboard">Dashboard</a></li>
             <li><a href="/config">Config</a></li>
             <li><a href="/runtime-info">Runtime</a></li>
             <li><a href="/logout">Logout</a></li>
-- 
1.9.0