Merge branch 'develop'
This commit is contained in:
73
build/schema/mysql.sql
Normal file
73
build/schema/mysql.sql
Normal file
@@ -0,0 +1,73 @@
|
||||
-- phpMyAdmin SQL Dump
|
||||
-- version 3.1.4
|
||||
-- http://www.phpmyadmin.net
|
||||
--
|
||||
-- Host: localhost:3306
|
||||
-- Generation Time: Dec 16, 2011 at 01:27 AM
|
||||
-- Server version: 5.1.53
|
||||
-- PHP Version: 5.3.6-pl1-gentoo
|
||||
|
||||
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
|
||||
|
||||
--
|
||||
-- Database: `status-board`
|
||||
--
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `settings`
|
||||
--
|
||||
-- Creation: Sep 24, 2010 at 07:22 PM
|
||||
-- Last update: Dec 04, 2011 at 01:19 PM
|
||||
-- Last check: Aug 20, 2011 at 10:32 PM
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `settings`;
|
||||
CREATE TABLE IF NOT EXISTS `settings` (
|
||||
`name` varchar(255) NOT NULL,
|
||||
`value` text NOT NULL,
|
||||
`type` enum('bool','int','float','string','array(string)','hash') DEFAULT 'string',
|
||||
PRIMARY KEY (`name`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `settings`
|
||||
--
|
||||
|
||||
INSERT INTO `settings` (`name`, `value`, `type`) VALUES
|
||||
('debug.display_exceptions', '1', 'bool'),
|
||||
('cache.base_dir', '/dev/shm/status-board/', 'string'),
|
||||
('logging.plugins', 'Database\nFlatFile', 'array(string)'),
|
||||
('logging.Database', 'webui', 'array(string)'),
|
||||
('logging.Database.webui.table', 'log', 'string'),
|
||||
('logging.Database.webui.severity', 'debug\ninfo\nwarning\ndebug', 'array(string)'),
|
||||
('logging.Database.webui.category', 'webui\ndefault', 'array(string)'),
|
||||
('logging.FlatFile', 'tmp', 'array(string)'),
|
||||
('logging.FlatFile.tmp.filename', '/tmp/status-board.log', 'string'),
|
||||
('logging.FlatFile.tmp.format', '%timestamp% %hostname%:%pid% %progname%:%file%[%line%] %message%', 'string'),
|
||||
('logging.FlatFile.tmp.severity', 'debug\ninfo\nwarning\nerror', 'array(string)'),
|
||||
('logging.FlatFile.tmp.category', 'webui\ndefault', 'array(string)'),
|
||||
('templates.tmp_path', '/var/tmp/status-board/', 'string');
|
||||
|
||||
--
|
||||
-- Table structure for table `log`
|
||||
--
|
||||
-- Creation: Aug 20, 2011 at 10:32 PM
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `log`;
|
||||
CREATE TABLE IF NOT EXISTS `log` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`level` varchar(32) NOT NULL,
|
||||
`category` varchar(32) NOT NULL,
|
||||
`ctime` int(11) NOT NULL,
|
||||
`pid` int(11) NOT NULL,
|
||||
`hostname` varchar(32) NOT NULL,
|
||||
`progname` varchar(64) NOT NULL,
|
||||
`file` text NOT NULL,
|
||||
`line` int(11) NOT NULL,
|
||||
`message` text NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;
|
||||
|
||||
4
private/.gitignore
vendored
Normal file
4
private/.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
# configuration files
|
||||
config.php
|
||||
dbconfig.conf
|
||||
settings.txt
|
||||
92
private/config.php.dist
Normal file
92
private/config.php.dist
Normal file
@@ -0,0 +1,92 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Sihnon Framework Library path
|
||||
*
|
||||
* Specifies the absolute or relative path to the Sihnon Framework library directory, relative to the webui root directory.
|
||||
* Path must end with a trailing slash.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
define('SihnonFramework_Lib', '/usr/lib/sihnon-php-lib/source/lib/');
|
||||
|
||||
/**
|
||||
* Sihnon Library path
|
||||
*
|
||||
* Specifies the absolute or relative path to the Sihnon library directory, relative to the webui root directory.
|
||||
* Path must end with a trailing slash.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
define('Sihnon_Lib', '/usr/lib/status-board/source/lib/');
|
||||
|
||||
/**
|
||||
* StatusBoard Library path
|
||||
*
|
||||
* Specifies the absolute or relative path to the StatusBoard library directory, relative to the webui root directory.
|
||||
* Path must end with a trailing slash.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
define('StatusBoard_Lib', '/usr/lib/status-board/source/lib/');
|
||||
|
||||
/**
|
||||
* Sihnon Database Support
|
||||
*
|
||||
* Specifies whether or not to include database support in the Framework
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
define('Sihnon_DatabaseSupport', true);
|
||||
|
||||
/**
|
||||
* Sihnon Database Configuration
|
||||
*
|
||||
* Specifies the absolute or relative path to the Sihnon database configuration file, required when Database support is enabled.
|
||||
* This is a standard ini type file, containing the config required to connect to the database.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
define('Sihnon_DBConfig', '/etc/status-board/dbconfig.conf');
|
||||
|
||||
/**
|
||||
* Sihnon Config Plugin
|
||||
*
|
||||
* Specifies the plugin to use for configuration value storage.
|
||||
* Options include:
|
||||
* - Database (Requires Database Support to be enabled, and the Sihnon_ConfigTable option set)
|
||||
* - FlatFile (Requires the Sihnon_ConfigFile option set)
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
define('Sihnon_ConfigPlugin', 'Database');
|
||||
|
||||
/**
|
||||
* Sihnon Config Table
|
||||
*
|
||||
* Specifies the name of the database table thats used for storing configuration values
|
||||
* when the Database Config Plugin is used.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
define('Sihnon_ConfigTable', 'settings');
|
||||
|
||||
/**
|
||||
* Sihnon Config File
|
||||
*
|
||||
* Specifies the name of the file used to store configuration values when the FlatFile Config Plugin is used
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
define('Sihnon_ConfigFile', '/etc/status-board/settings.txt');
|
||||
|
||||
/**
|
||||
* Sihnon Development Mode
|
||||
*
|
||||
* Specifies whether or not the Framework should operate in debug mode
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
define('Sihnon_Dev', false);
|
||||
|
||||
?>
|
||||
5
private/dbconfig.conf.dist
Normal file
5
private/dbconfig.conf.dist
Normal file
@@ -0,0 +1,5 @@
|
||||
hostname = localhost
|
||||
username = status-board
|
||||
password = changeme
|
||||
dbname = status-board
|
||||
|
||||
16
private/htaccess.dist
Normal file
16
private/htaccess.dist
Normal file
@@ -0,0 +1,16 @@
|
||||
SetEnv STATUSBOARD_CONFIG /etc/status-board/config.php
|
||||
|
||||
<IfModule mod_rewrite.c>
|
||||
|
||||
RewriteEngine on
|
||||
RewriteBase /
|
||||
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteRule ^(ajax/.*)$ a.php?l=$1 [L]
|
||||
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteRule ^(.*)$ index.php?l=$1
|
||||
|
||||
</IfModule>
|
||||
1
public/.gitignore
vendored
Normal file
1
public/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.htaccess
|
||||
16
public/_inc.php
Normal file
16
public/_inc.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
if (isset($_SERVER['STATUSBOARD_CONFIG']) &&
|
||||
file_exists($_SERVER['STATUSBOARD_CONFIG']) &&
|
||||
is_readable($_SERVER['STATUSBOARD_CONFIG'])) {
|
||||
require_once($_SERVER['STATUSBOARD_CONFIG']);
|
||||
} else {
|
||||
require_once '/etc/status-board/config.php';
|
||||
}
|
||||
|
||||
require_once SihnonFramework_Lib . 'SihnonFramework/Main.class.php';
|
||||
|
||||
SihnonFramework_Main::registerAutoloadClasses('SihnonFramework', SihnonFramework_Lib,
|
||||
'StatusBoard', StatusBoard_Lib);
|
||||
|
||||
?>
|
||||
0
public/images/.gitignore
vendored
Normal file
0
public/images/.gitignore
vendored
Normal file
21
public/index.php
Normal file
21
public/index.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
define('StatusBoard_File', 'index');
|
||||
|
||||
require '_inc.php';
|
||||
|
||||
try {
|
||||
$main = StatusBoard_Main::instance();
|
||||
StatusBoard_LogEntry::setLocalProgname('webui');
|
||||
$smarty = $main->smarty();
|
||||
|
||||
$page = new StatusBoard_Page($smarty, $main->request());
|
||||
if ($page->evaluate()) {
|
||||
$smarty->display('index.tpl');
|
||||
}
|
||||
|
||||
} catch (StatusBoard_Exception $e) {
|
||||
die("Uncaught Exception: " . $e->getMessage());
|
||||
}
|
||||
|
||||
?>
|
||||
5
public/scripts/main.js
Normal file
5
public/scripts/main.js
Normal file
@@ -0,0 +1,5 @@
|
||||
/**
|
||||
* StatusBoard main script file
|
||||
*
|
||||
*
|
||||
*/
|
||||
92
public/styles/normal.css
Normal file
92
public/styles/normal.css
Normal file
@@ -0,0 +1,92 @@
|
||||
/**
|
||||
* StatusBoard normal stylesheet
|
||||
*
|
||||
*/
|
||||
|
||||
@CHARSET "UTF-8";
|
||||
|
||||
body {
|
||||
margin: 0em;
|
||||
padding: 0em;
|
||||
font-family: verdana, helvetica, sans-serif;
|
||||
}
|
||||
|
||||
a {
|
||||
color: gray;
|
||||
}
|
||||
|
||||
label {
|
||||
margin-left: 1em;
|
||||
margin-right: 1em;
|
||||
}
|
||||
|
||||
#container {
|
||||
width: 75%;
|
||||
min-width: 75em;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
#banner {
|
||||
margin: 0em;
|
||||
padding: 0em;
|
||||
}
|
||||
|
||||
#banner h1 {
|
||||
padding: 0.5em;
|
||||
}
|
||||
|
||||
#navigation {
|
||||
margin-top: 0em;
|
||||
margin-bottom: 1em;
|
||||
padding: 0.2em;
|
||||
}
|
||||
|
||||
#navigation ul {
|
||||
margin: 0em;
|
||||
padding: 0em 5em;;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
#navigation li {
|
||||
margin: 1em;
|
||||
padding: 0em;
|
||||
display: inline;
|
||||
}
|
||||
|
||||
#page-container {
|
||||
margin: 0em;
|
||||
padding: 0em;
|
||||
}
|
||||
|
||||
#sidebar {
|
||||
float: left;
|
||||
width: 20em;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
#page {
|
||||
margin-left: 21em;
|
||||
margin-bottom: 1em;
|
||||
padding: 0.5em;
|
||||
}
|
||||
|
||||
#footer {
|
||||
clear: both;
|
||||
padding: 2em;
|
||||
font-size: smaller;
|
||||
font-style: italic;
|
||||
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
#errors {
|
||||
background: peachpuff;
|
||||
color: darkred;
|
||||
margin: 1em;
|
||||
}
|
||||
|
||||
#messages {
|
||||
background: lightcyan;
|
||||
color: darkblue;
|
||||
margin: 1em;
|
||||
}
|
||||
65
source/lib/StatusBoard/Main.class.php
Normal file
65
source/lib/StatusBoard/Main.class.php
Normal file
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
require 'smarty/Smarty.class.php';
|
||||
|
||||
class StatusBoard_Main extends SihnonFramework_Main {
|
||||
|
||||
const TEMPLATE_DIR = '../source/webui/templates/';
|
||||
|
||||
protected static $instance;
|
||||
|
||||
protected $smarty;
|
||||
protected $request;
|
||||
|
||||
protected function __construct() {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
protected function init() {
|
||||
parent::init();
|
||||
|
||||
$request_string = isset($_GET['l']) ? $_GET['l'] : '';
|
||||
|
||||
$this->request = new StatusBoard_RequestParser($request_string, self::TEMPLATE_DIR);
|
||||
|
||||
switch (StatusBoard_File) {
|
||||
case 'ajax':
|
||||
case 'index': {
|
||||
$smarty_tmp = $this->config->get('templates.tmp_path');
|
||||
$this->smarty = new Smarty();
|
||||
$this->smarty->template_dir = static::makeAbsolutePath(self::TEMPLATE_DIR);
|
||||
$this->smarty->compile_dir = static::makeAbsolutePath($smarty_tmp . '/templates');
|
||||
$this->smarty->cache_dir = static::makeAbsolutePath($smarty_tmp . '/cache');
|
||||
$this->smarty->config_dir = static::makeAbsolutePath($smarty_tmp . '/config');
|
||||
$this->smarty->plugins_dir[]= static::makeAbsolutePath('../source/webui/smarty/plugins');
|
||||
|
||||
$this->smarty->registerPlugin('modifier', 'formatDuration', array('StatusBoard_Main', 'formatDuration'));
|
||||
$this->smarty->registerPlugin('modifier', 'formatFilesize', array('StatusBoard_Main', 'formatFilesize'));
|
||||
|
||||
$this->smarty->assign('version', '0.1.0');
|
||||
$this->smarty->assign('messages', array());
|
||||
|
||||
$this->smarty->assign('base_uri', $this->base_uri);
|
||||
$this->smarty->assign('base_url', static::absoluteUrl(''));
|
||||
|
||||
} break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public function smarty() {
|
||||
return $this->smarty;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return StatusBoard_RequestParser
|
||||
*/
|
||||
public function request() {
|
||||
return $this->request;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
1
source/webui/templates/admin.tpl
Normal file
1
source/webui/templates/admin.tpl
Normal file
@@ -0,0 +1 @@
|
||||
TODO
|
||||
6
source/webui/templates/errors/404.tpl
Normal file
6
source/webui/templates/errors/404.tpl
Normal file
@@ -0,0 +1,6 @@
|
||||
<h2>The requested page could not be found</h2>
|
||||
<p>
|
||||
The file you requested ({$requested_page}) could not be found.
|
||||
If you typed in the address manually, check that you have spelled it correctly,
|
||||
or if you followed a link, let us know and we'll look into it.
|
||||
</p>
|
||||
46
source/webui/templates/errors/unhandled-exception.tpl
Normal file
46
source/webui/templates/errors/unhandled-exception.tpl
Normal file
@@ -0,0 +1,46 @@
|
||||
<h2>An unhandled error has occurred</h2>
|
||||
<p>
|
||||
There was a problem trying to complete the requested action. Please try again and if the problem persists, let us know.
|
||||
</p>
|
||||
|
||||
{if $display_exceptions}
|
||||
<p>
|
||||
An unhandled exception was caught during the page template processing. The full details are shown below:
|
||||
</p>
|
||||
<table class="exception-details">
|
||||
<colgroup id="header">
|
||||
<col />
|
||||
</colgroup>
|
||||
<colgroup>
|
||||
<col />
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Exception</th>
|
||||
<td>{$exception_type}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>File</th>
|
||||
<td>{$exception->getFile()}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Line</th>
|
||||
<td>{$exception->getLine()}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Message</th>
|
||||
<td>{$exception->getMessage()}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Stack Trace</th>
|
||||
<td><pre>{$exception->getTrace()|print_r}</pre></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<p>
|
||||
<em>Note:</em> Exception details should not be displayed on production systems.
|
||||
Disable the <a href="{$base_uri}admin/settings/key/debug.show_exceptions/"><code>debug.show_exceptions</code></a>
|
||||
setting to omit the exception details from this page.
|
||||
</p>
|
||||
{/if}
|
||||
1
source/webui/templates/home.tpl
Normal file
1
source/webui/templates/home.tpl
Normal file
@@ -0,0 +1 @@
|
||||
TODO
|
||||
60
source/webui/templates/index.tpl
Normal file
60
source/webui/templates/index.tpl
Normal file
@@ -0,0 +1,60 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Status Board</title>
|
||||
<script lang="javascript">
|
||||
</script>
|
||||
<link rel="stylesheet" type="text/css" href="{$base_uri}styles/normal.css" />
|
||||
|
||||
<script type="text/javascript">
|
||||
var base_uri = "{$base_uri|escape:'quote'}";
|
||||
var base_url = "{$base_url|escape:'quote'}";
|
||||
</script>
|
||||
|
||||
<link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/smoothness/jquery-ui.css" rel="Stylesheet" />
|
||||
<link type="text/css" href="{$base_uri}styles/3rdparty/jquery.asmselect.css" rel="Stylesheet" />
|
||||
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script>
|
||||
<script type="text/javascript" src="{$base_uri}scripts/main.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="banner">
|
||||
<h1>StatusBoard</h1>
|
||||
</div>
|
||||
|
||||
<div id="navigation">
|
||||
{include file="navigation.tpl"}
|
||||
</div>
|
||||
|
||||
<div id="page-container">
|
||||
|
||||
<div id="sidebar">
|
||||
{include file="sidebar.tpl"}
|
||||
</div>
|
||||
|
||||
<div id="page">
|
||||
|
||||
{if $messages}
|
||||
<div id="messages">
|
||||
{foreach from=$messages item=message}
|
||||
{$message}
|
||||
{/foreach}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{$page_content}
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Powered by StatusBoard {$version}. Written by Ben Roberts and Nathan Booth.
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
4
source/webui/templates/navigation.tpl
Normal file
4
source/webui/templates/navigation.tpl
Normal file
@@ -0,0 +1,4 @@
|
||||
<ul>
|
||||
<li><a href="{$base_uri}home/" title="Home">Home</a></li>
|
||||
<li><a href="{$base_uri}admin/" title="Admin">Admin</a></li>
|
||||
</ul>
|
||||
6
source/webui/templates/sidebar.tpl
Normal file
6
source/webui/templates/sidebar.tpl
Normal file
@@ -0,0 +1,6 @@
|
||||
<div id="services">
|
||||
<h2>Services</h2>
|
||||
<ul>
|
||||
<li>TODO</li>
|
||||
</ul>
|
||||
</div>
|
||||
Reference in New Issue
Block a user