summaryrefslogtreecommitdiffstats
path: root/management-interface
diff options
context:
space:
mode:
authorNils Schwabe2014-05-09 19:05:13 +0200
committerNils Schwabe2014-05-09 19:05:13 +0200
commit32602049a8e4edc408a83380cebb1c838cdf4d1e (patch)
tree9512e35ccd31fb2220a547dbf38201b6cf5bf682 /management-interface
parentAdd the management webinterface (diff)
downloadmasterserver-32602049a8e4edc408a83380cebb1c838cdf4d1e.tar.gz
masterserver-32602049a8e4edc408a83380cebb1c838cdf4d1e.tar.xz
masterserver-32602049a8e4edc408a83380cebb1c838cdf4d1e.zip
Did some changes on webinterface
Diffstat (limited to 'management-interface')
-rw-r--r--management-interface/css/custom.css44
-rwxr-xr-xmanagement-interface/index.php37
-rw-r--r--management-interface/php/about.inc.php9
-rw-r--r--management-interface/php/functions.php22
-rw-r--r--management-interface/php/home.inc.php10
-rw-r--r--management-interface/php/login.inc.php14
-rw-r--r--management-interface/php/template.inc.php8
-rw-r--r--management-interface/php/user.inc.php9
8 files changed, 127 insertions, 26 deletions
diff --git a/management-interface/css/custom.css b/management-interface/css/custom.css
index 929aeef..7486fdc 100644
--- a/management-interface/css/custom.css
+++ b/management-interface/css/custom.css
@@ -1,3 +1,47 @@
+
+/* Fix for always scrollbars */
html {
overflow-y: scroll;
}
+
+/* Fix for login form */
+.form-signin {
+ max-width: 330px;
+ padding: 15px;
+ margin: 0 auto;
+}
+.form-adduser {
+ max-width: 600px;
+ padding: 10px;
+ margin: 0 auto;
+}
+.form-signin .form-signin-heading,
+.form-signin .checkbox {
+ margin-bottom: 10px;
+}
+.form-signin .checkbox {
+ font-weight: normal;
+}
+.form-signin .form-control,
+.form-adduser .form-control {
+ position: relative;
+ font-size: 16px;
+ height: auto;
+ padding: 10px;
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+}
+.form-control:focus {
+ z-index: 2;
+}
+.form-signin input[type="text"] {
+ margin-bottom: -1px;
+ border-bottom-left-radius: 0;
+ border-bottom-right-radius: 0;
+}
+.form-signin input[type="password"] {
+ margin-bottom: 10px;
+ border-top-left-radius: 0;
+ border-top-right-radius: 0;
+}
diff --git a/management-interface/index.php b/management-interface/index.php
index ea35e8c..dbd73ce 100755
--- a/management-interface/index.php
+++ b/management-interface/index.php
@@ -2,6 +2,9 @@
# include important scripts
require "./php/settings.php";
+require "./php/functions.php";
+
+$include = true;
?>
<!DOCTYPE html>
@@ -41,28 +44,16 @@ require "./php/settings.php";
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
- <a class="navbar-brand" href="#"><?php echo PAGENAME; ?></a>
+ <a class="navbar-brand" href="<?php echo $_SERVER["PHP_SELF"]; ?>?m=home"><?php echo PAGENAME; ?></a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
- <li class="active"><a href="#">Home</a></li>
- <li><a href="#about">About</a></li>
- <li><a href="#contact">Contact</a></li>
- <li class="dropdown">
- <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a>
- <ul class="dropdown-menu">
- <li><a href="#">Action</a></li>
- <li><a href="#">Another action</a></li>
- <li><a href="#">Something else here</a></li>
- <li class="divider"></li>
- <li class="dropdown-header">Nav header</li>
- <li><a href="#">Separated link</a></li>
- <li><a href="#">One more separated link</a></li>
- </ul>
- </li>
+ <li<?php echo ($_item=="home")?" class=\"active\"":""; ?>><a href="<?php echo $_SERVER["PHP_SELF"]; ?>?m=home">Home</a></li>
+ <li<?php echo ($_item=="user")?" class=\"active\"":""; ?>><a href="<?php echo $_SERVER["PHP_SELF"]; ?>?m=user">User</a></li>
+ <li<?php echo ($_item=="about")?" class=\"active\"":""; ?>><a href="<?php echo $_SERVER["PHP_SELF"]; ?>?m=about">About</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
- <li><a href="<?php echo $_SERVER["PHP_SELF"]; ?>?m=login">Login</a></li>
+ <li<?php echo ($_item=="login")?" class=\"active\"":""; ?>><a href="<?php echo $_SERVER["PHP_SELF"]; ?>?m=login">Login</a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
@@ -71,15 +62,9 @@ require "./php/settings.php";
<div class="container">
- <!-- Main component for a primary marketing message or call to action -->
- <div class="jumbotron">
- <h1>Navbar example</h1>
- <p>This example is a quick exercise to illustrate how the default, static and fixed to top navbar work. It includes the responsive CSS and HTML, so it also adapts to your viewport and device.</p>
- <p>To see the difference between static and fixed top navbars, just scroll.</p>
- <p>
- <a class="btn btn-lg btn-primary" href="../../components/#navbar" role="button">View navbar docs &raquo;</a>
- </p>
- </div>
+ <?php
+ include "./php/" . $_item . ".inc.php";
+ ?>
</div> <!-- /container -->
diff --git a/management-interface/php/about.inc.php b/management-interface/php/about.inc.php
new file mode 100644
index 0000000..57edd01
--- /dev/null
+++ b/management-interface/php/about.inc.php
@@ -0,0 +1,9 @@
+<?php
+if (!$include) die("404 - Permission denied.");
+?>
+
+<div class="jumbotron">
+<p>
+This website is the interface for the masterserver to do several things.
+</p>
+</div>
diff --git a/management-interface/php/functions.php b/management-interface/php/functions.php
new file mode 100644
index 0000000..f84c097
--- /dev/null
+++ b/management-interface/php/functions.php
@@ -0,0 +1,22 @@
+<?php
+
+# get the menu item
+switch ($_GET["m"]) {
+case "home":
+ $_item = "home";
+ break;
+case "login":
+ $_item = "login";
+ break;
+case "user":
+ $_item = "user";
+ break;
+case "about":
+ $_item = "about";
+ break;
+default:
+ $_item = "home";
+ break;
+}
+
+?>
diff --git a/management-interface/php/home.inc.php b/management-interface/php/home.inc.php
new file mode 100644
index 0000000..b003336
--- /dev/null
+++ b/management-interface/php/home.inc.php
@@ -0,0 +1,10 @@
+<?php
+if (!$include) die("404 / Permission denied.");
+?>
+
+<div class="jumbotron">
+<h1>Hello user!</h1>
+<p>
+Lorem ipsum dolor sit amet.
+</p>
+</div>
diff --git a/management-interface/php/login.inc.php b/management-interface/php/login.inc.php
new file mode 100644
index 0000000..9d92195
--- /dev/null
+++ b/management-interface/php/login.inc.php
@@ -0,0 +1,14 @@
+<?php
+if (!$include) die("404 - Permission denied.");
+?>
+
+<div class="jumbotron">
+ <div class="container">
+ <form class="form-signin" role="form">
+ <h2 class="form-signin-heading">Please login</h2>
+ <input type="text" class="form-control" placeholder="Username" name="user" required autofocus>
+ <input type="password" class="form-control" placeholder="Password" name="pass" required>
+ <button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
+ </form>
+ </div>
+</div>
diff --git a/management-interface/php/template.inc.php b/management-interface/php/template.inc.php
new file mode 100644
index 0000000..6c8bece
--- /dev/null
+++ b/management-interface/php/template.inc.php
@@ -0,0 +1,8 @@
+<?php
+if (!$include) die("404 - Permission denied.");
+?>
+
+<div class="jumbotron">
+<p>
+</p>
+</div>
diff --git a/management-interface/php/user.inc.php b/management-interface/php/user.inc.php
new file mode 100644
index 0000000..5361034
--- /dev/null
+++ b/management-interface/php/user.inc.php
@@ -0,0 +1,9 @@
+<?php
+if (!$include) die("404 - Permission denied.");
+?>
+
+<div class="jumbotron">
+<p>
+Current users:<br />
+</p>
+</div>