refactoring with Gallic template system

This commit is contained in:
Olivier Lambert
2012-12-31 13:37:03 +01:00
parent 7a174aded6
commit 19b460f1e3
29 changed files with 1291 additions and 703 deletions

View File

@@ -1,2 +1,44 @@
<?php
require(__DIR__.'/../vendor/autoload.php');
/**
*
*/
/**
* Bootstraps and returns the application singleton.
*
* @return Application
*/
function _bootstrap()
{
static $application;
if (!isset($application))
{
// Variables definition.
$root_dir = defined('__DIR__')
? __DIR__
: dirname(__FILE__)
;
if (defined('APPLICATION_ENV'))
{
$app_env = APPLICATION_ENV;
}
elseif (($app_env = getenv('APPLICATION_ENV')) === false)
{
$app_env = 'development';
}
// Class autoloading.
require($root_dir.'/../vendor/autoload.php');
// Dependency injector.
$di = new DI;
// Finally, creates the inventory.
$application = $di->get('application');
}
return $application;
}
return _bootstrap();

60
src/lib/Application.php Normal file
View File

@@ -0,0 +1,60 @@
<?php
/**
* This file is a part of IoViz.
*
* IoViz is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* IoViz is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with IoViz. If not, see <http://www.gnu.org/licenses/>.
*
* @author Julien Fontanet <julien.fontanet@vates.fr>
* @license http://www.gnu.org/licenses/gpl-3.0-standalone.html GPLv3
*
* @package IoViz
*/
/**
*
*/
final class Application extends Base
{
/**
*
*/
function __construct(DI $di)
{
parent::__construct();
$this->_di = $di;
}
/**
*
*/
function getTemplate($template)
{
$template = $this->_di->get('template.manager')->build($template);
$template->filters += array(
'count' => 'count',
'json' => 'json_encode',
);
$template->functions += array(
'url' => array('TemplateUtils', 'url'),
);
return $template;
}
/**
* @var DI
*/
private $_di;
}

50
src/lib/Base.php Normal file
View File

@@ -0,0 +1,50 @@
<?php
/**
* This file is a part of IoViz.
*
* IoViz is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* IoViz is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with IoViz. If not, see <http://www.gnu.org/licenses/>.
*
* @author Julien Fontanet <julien.fontanet@vates.fr>
* @license http://www.gnu.org/licenses/gpl-3.0-standalone.html GPLv3
*
* @package IoViz
*/
/**
* Ultimate base class.
*/
abstract class Base
{
function __destruct()
{}
function __get($name)
{
trigger_error(
'no such readable property '.get_class($this).'->'.$name,
E_USER_ERROR
);
}
function __set($name, $value)
{
trigger_error(
'no such writable property '.get_class($this).'->'.$name,
E_USER_ERROR
);
}
protected function __construct()
{}
}

80
src/lib/DI.php Normal file
View File

@@ -0,0 +1,80 @@
<?php
/**
* This file is a part of IoViz.
*
* IoViz is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* IoViz is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with IoViz. If not, see <http://www.gnu.org/licenses/>.
*
* @author Julien Fontanet <julien.fontanet@vates.fr>
* @license http://www.gnu.org/licenses/gpl-3.0-standalone.html GPLv3
*
* @package IoViz
*/
/**
* Dependency injector.
*/
final class DI extends Base
{
function __construct()
{
parent::__construct();
}
function get($id)
{
if (isset($this->_entries[$id])
|| array_key_exists($id, $this->_entries))
{
return $this->_entries[$id];
}
$tmp = str_replace(array('_', '.'), array('', '_'), $id);
if (method_exists($this, '_get_'.$tmp))
{
return $this->{'_get_'.$tmp}();
}
if (method_exists($this, '_init_'.$tmp))
{
$value = $this->{'_init_'.$tmp}();
$this->set($id, $value);
return $value;
}
throw new Exception('no such entry: '.$id);
}
function set($id, $value)
{
$this->_entries[$id] = $value;
}
private $_entries = array();
////////////////////////////////////////œ
private function _init_application()
{
return new Application($this);
}
private function _init_template_manager()
{
return new Gallic_Template_Manager(
__DIR__.'/../templates',
0
);
}
}

42
src/lib/TemplateUtils.php Normal file
View File

@@ -0,0 +1,42 @@
<?php
/**
* This file is a part of IoViz.
*
* IoViz is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* IoViz is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with IoViz. If not, see <http://www.gnu.org/licenses/>.
*
* @author Julien Fontanet <julien.fontanet@vates.fr>
* @license http://www.gnu.org/licenses/gpl-3.0-standalone.html GPLv3
*
* @package IoViz
*/
/**
*
*/
final class TemplateUtils
{
static function url(Gallic_Template $tpl, array $parameters)
{
$url = $parameters['to'].'.php'; unset($parameters['to']);
if ($parameters)
{
$url .= '?'.http_build_query($parameters);
}
return $url;
}
private function __construct()
{}
}

131
src/templates/_base.html Normal file
View File

@@ -0,0 +1,131 @@
{**
* This file is a part of Xen Orchestra.
*
* Xen Orchestra is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Xen Orchestra is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Xen Orchestra. If not, see <http://www.gnu.org/licenses/>.
*
* @author Olivier Lambert <olivier.lambert@vates.fr>
* @license http://www.gnu.org/licenses/agpl.html aGPL
*
* @package Xo-web
*}
{**
* This is the base template and should not be used directly.
*
* See “normal.html” and “wide.html”.
*}
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>{block title}Xen Orchestra{/block}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Web Interface for XCP">
<meta name="author" content="Olivier Lambert and Julien Fontanet">
{* We use Bootstrap CSS. *}
<link href="../deps/bootstrap/css/bootstrap.css" rel="stylesheet">
<link href="../deps/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
{* IE support. *}
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
{* This font is used for icons. *}
<link rel="stylesheet" href="../deps/font-awesome/css/font-awesome.css">
{* Our stylesheet and scripts. *}
<link rel="stylesheet" href="css/style.css">
<link rel="icon" href="img/favicon.ico" />
{* Children templates may used this block to add extra headers. *}
{block extra_html_headers}{/block}
</head>
<body style="padding-top: 60px">
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="index.php"><img src="img/bannerb.png"></a><a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></a>
<div class="nav-collapse collapse">
<ul class="nav">
<li class="divider-vertical"></li>
<li {if $pool}class="active"{/if}> <a href="pool.php"><i class="icon-cloud"></i> Pool</a>
</li>
<li {if $server}class="active"{/if}> <a href="servers.php"><i class="icon-cog"></i> Server</a>
</li>
<li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#"><i class="icon-bolt"></i> Vm <b class="caret"></b> </a>
<ul class="dropdown-menu">
<li><a href="#"><i class="icon-reorder"></i> List</a></li>
<li><a href="#"><i class="icon-plus"></i> Add new...</a></li>
<li><a href="#"><i class="icon-cog"></i> Manage</a></li>
<li><a href="#"><i class="icon-file"></i> Templates</a></li>
<li class="divider"></li>
<li><a href="#"><i class="icon-wrench"></i> Options...</a></li>
</ul>
</li>
<li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#"><i class="icon-hdd"></i> Storage <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#"><i class="icon-reorder"></i> List</a></li>
<li><a href="#"><i class="icon-plus"></i> Add new...</a></li>
<li><a href="#"><i class="icon-cog"></i> Manage</a></li>
<li class="divider"></li>
<li><a href="#"><i class="icon-wrench"></i> Options...</a></li>
</ul>
</li>
</ul>
<ul class="nav pull-right">
<li class="divider-vertical"></li>
<li {if $admin}class="active"{/if}><a rel="tooltip" data-original-title="Settings" href="admin.php"><i class="icon-wrench"></i></a></li>
<li><a id="msg" rel="tooltip" data-original-title="No unread notifications" href="#"><i class="icon-bell"></i></a></li>
<li class="dropdown">
<a class="dropdown-toggle" href="#" data-toggle="dropdown"><i class="icon-signin"></i> Log In <strong class="caret"></strong></a>
<div class="dropdown-menu" style="padding: 15px; padding-bottom: 0px;">
<!-- Login form here -->
<form>
<div class="input-prepend">
<span class="add-on"><i class="icon-user"></i></span>
<input class="span2" type="text" placeholder="User">
</div>
<div class="input-prepend">
<span class="add-on"><i class="icon-key"></i></span>
<input class="span2" type="password" placeholder="Password"></input><br/><br/>
</div>
<button type="submit" class="btn btn-info"><i class="icon-signin icon-small"></i> Log In</button>
</form>
</div>
</ul>
<form class="navbar-search pull-right" action="">
<input class="search-query" type="text" placeholder="Search">
</form>
</div><!--/.nav-collapse -->
</div>
</div>
</div>
</div>
<!-- end of navbar -->
{block body}{/block}
<!-- JS Placed at the end of the document so the pages load faster -->
<script src="../deps/js/jquery.js"></script>
<script src="../deps/bootstrap/js/bootstrap.js"></script>
<script type="text/javascript" src="js/xo.js"></script>
</body>
</html>

View File

@@ -0,0 +1,45 @@
{**
* This file is a part of Xen Orchestra.
*
* Xen Orchestra is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Xen Orchestra is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Xen Orchestra. If not, see <http://www.gnu.org/licenses/>.
*
* @author Olivier Lambert <olivier.lambert@vates.fr>
* @license http://www.gnu.org/licenses/agpl.html aGPL
*
* @package Xo-web
*}
{extends "/_base.html"}
{block title}Xen Orchestra - Admin{/block}
{block body}
<div class="row-fluid">
<div class="span2 offset1">
<ul class="nav nav-list well">
<li class="nav-header">Admin Panel</li>
<li {if $dashboard}class="active"{/if}><a href="admin.php">Dashboard</a></li>
<li class="nav-header">Security</li>
<li {if $users}class="active"{/if}><a href="users.php">Users</a></li>
<li {if $groups}class="active"{/if}><a href="groups.php">Groups</a></li>
<li {if $policies}class="active"{/if}><a href="policies.php">Policies</a></li>
<li class="nav-header">XCP settings</li>
<li {if $hosts}class="active"{/if}><a href="hosts.php">Hosts</a></li>
<li {if $apps}class="active"{/if}><a href="apps.php">Apps</a></li>
<li class="nav-header">Misc</li>
<li {if $events}class="active"{/if}><a href="events.php">XO Events</a></li>
</ul>
</div>
{block content}{/block}
{/block body}

View File

@@ -0,0 +1,31 @@
{**
* This file is a part of Xen Orchestra.
*
* Xen Orchestra is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Xen Orchestra is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Xen Orchestra. If not, see <http://www.gnu.org/licenses/>.
*
* @author Olivier Lambert <olivier.lambert@vates.fr>
* @license http://www.gnu.org/licenses/agpl.html aGPL
*
* @package Xo-web
*}
{extends "/admin/_base.html"}
{block content}
<div class="span8 well">
<h3 class="center">Apps</h3>
<p class="center">Here admin of apps</p>
</div>
{/block content}

View File

@@ -0,0 +1,31 @@
{**
* This file is a part of Xen Orchestra.
*
* Xen Orchestra is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Xen Orchestra is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Xen Orchestra. If not, see <http://www.gnu.org/licenses/>.
*
* @author Olivier Lambert <olivier.lambert@vates.fr>
* @license http://www.gnu.org/licenses/agpl.html aGPL
*
* @package Xo-web
*}
{extends "/admin/_base.html"}
{block content}
<div class="span8 well">
<h3 class="center">Events</h3>
<p class="center">Here admin of events</p>
</div>
{/block content}

View File

@@ -0,0 +1,31 @@
{**
* This file is a part of Xen Orchestra.
*
* Xen Orchestra is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Xen Orchestra is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Xen Orchestra. If not, see <http://www.gnu.org/licenses/>.
*
* @author Olivier Lambert <olivier.lambert@vates.fr>
* @license http://www.gnu.org/licenses/agpl.html aGPL
*
* @package Xo-web
*}
{extends "/admin/_base.html"}
{block content}
<div class="span8 well">
<h3 class="center">Groups</h3>
<p class="center">Here admin of groups</p>
</div>
{/block content}

View File

@@ -0,0 +1,39 @@
{**
* This file is a part of Xen Orchestra.
*
* Xen Orchestra is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Xen Orchestra is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Xen Orchestra. If not, see <http://www.gnu.org/licenses/>.
*
* @author Olivier Lambert <olivier.lambert@vates.fr>
* @license http://www.gnu.org/licenses/agpl.html aGPL
*
* @package Xo-web
*}
{extends "/admin/_base.html"}
{block content}
<div class="span8">
<div class="accordion-group"> <div class="accordion-heading"><a class="accordion-toggle" href="#item0" data-toggle="collapse"> Configured Hosts </a> </div>
<div id="item0" class="collapse in">
<div class="accordion-inner"> Cluster1 (single host)</div>
<div class="accordion-inner"> Cluster2 (single host)</div>
<div class="accordion-inner"> XenFr1 (pool master)</div>
</div></div>
<div class="accordion-group"> <div class="accordion-heading"> <a class="accordion-toggle" href="#item2" data-toggle="collapse"> Pool master failback </a> </div>
<div id="item2" class="collapse">
<div class="accordion-inner"> XenFr2 </div>
</div></div>
</div>
{/block content}

View File

@@ -0,0 +1,30 @@
{**
* This file is a part of Xen Orchestra.
*
* Xen Orchestra is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Xen Orchestra is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Xen Orchestra. If not, see <http://www.gnu.org/licenses/>.
*
* @author Olivier Lambert <olivier.lambert@vates.fr>
* @license http://www.gnu.org/licenses/agpl.html aGPL
*
* @package Xo-web
*}
{extends "/admin/_base.html"}
{block content}
<div class="span8 well">
<h3 class="center">Dashboard</h3>
<p class="center">Here some nice graphs and/or recap of XO</p>
</div>
{/block content}

View File

@@ -0,0 +1,31 @@
{**
* This file is a part of Xen Orchestra.
*
* Xen Orchestra is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Xen Orchestra is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Xen Orchestra. If not, see <http://www.gnu.org/licenses/>.
*
* @author Olivier Lambert <olivier.lambert@vates.fr>
* @license http://www.gnu.org/licenses/agpl.html aGPL
*
* @package Xo-web
*}
{extends "/admin/_base.html"}
{block content}
<div class="span8 well">
<h3 class="center">Policies</h3>
<p class="center">Here admin of policies</p>
</div>
{/block content}

View File

@@ -0,0 +1,31 @@
{**
* This file is a part of Xen Orchestra.
*
* Xen Orchestra is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Xen Orchestra is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Xen Orchestra. If not, see <http://www.gnu.org/licenses/>.
*
* @author Olivier Lambert <olivier.lambert@vates.fr>
* @license http://www.gnu.org/licenses/agpl.html aGPL
*
* @package Xo-web
*}
{extends "/admin/_base.html"}
{block content}
<div class="span8 well">
<h3 class="center">Users</h3>
<p class="center">Here admin of Users</p>
</div>
{/block content}

65
src/templates/index.html Normal file
View File

@@ -0,0 +1,65 @@
{**
* This file is a part of Xen Orchestra.
*
* Xen Orchestra is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Xen Orchestra is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Xen Orchestra. If not, see <http://www.gnu.org/licenses/>.
*
* @author Olivier Lambert <olivier.lambert@vates.fr>
* @license http://www.gnu.org/licenses/agpl.html aGPL
*
* @package Xo-web
*}
{extends "/_base.html"}
{block title}Xen Orchestra - Home{/block}
{block body}
<div class="row-fluid">
<div class="span10 offset1 hero-unit">
<h1 class="center">Welcome on XO!</h1>
<p class="center">It seems you don't have any connected host.<br/>Add an XCP host or a Pool master, and start to use the magic of Xen Orchestra.</p><br/>
<p class="center"><a class="btn btn-success btn-large"><i class="icon-plus"></i> Add server</a></p>
</div>
</div>
<div class="row-fluid">
<div class="span3 offset1 well">
<h2 class="center">Need help?</h2>
<p>If you don't know how to start, please read the README first. Then, if you have further questions, please read the FAQ on the project website.
</p><br/>
<p class="center"><a class="btn btn-info btn-large" data-toggle="modal" href="#infos" ><i class="icon-info-sign"></i> Readme</a></p>
</div>
<div class="span4 well">
<h2 class="center">About us</h2>
<p>We are the team behind XO, we are Vates! We create Open Source products and we offer commercial support for Xen and Xen Orchestra. This project is Open Source, everyone is welcome aboard!</p><br/>
<p class="center"><a class="btn btn-large" href="http://vates.fr"><i class="icon-circle-arrow-right"></i> Go on our website!</a></p>
</div>
<div class="span3 well">
<h2 class="center">Get involved!</h2>
<p>You want a specific feature in XO? Report a bug? Go to our project website, read the FAQ and get involved in the project!</p><br/>
<p class="center"><a class="btn btn-success btn-large" href="http://xen-orchestra.com"><i class="icon-beaker"></i> Project page</a></p>
</div>
</div>
<div class="modal hide fade" id="infos">
<div class="modal-header"> <a class="close" data-dismiss="modal">×</a>
<h3>Initial configuraton</h3>
</div>
<div class="modal-body">
<p>Please add an XCP server or a Pool master. For this, click on the "Let's go" button on the main screen. Otherwise, you can do the same thing by using the top menu ("Server" then "Add").</p>
</div>
<div class="modal-footer">
<a class="btn btn-info" data-dismiss="modal">Close</a>
</div>
</div>
{/block}

73
src/templates/pool.html Normal file
View File

@@ -0,0 +1,73 @@
{**
* This file is a part of Xen Orchestra.
*
* Xen Orchestra is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Xen Orchestra is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Xen Orchestra. If not, see <http://www.gnu.org/licenses/>.
*
* @author Olivier Lambert <olivier.lambert@vates.fr>
* @license http://www.gnu.org/licenses/agpl.html aGPL
*
* @package Xo-web
*}
{extends "/_base.html"}
{block title}Pool overview{/block}
{block body}
<div class="row-fluid">
<div class="span2 offset1">
<ul class="nav nav-list well">
<li class="nav-header">Pool Manager</li>
<li class="active"><a href="#">Overview</a></li>
<li class="nav-header">Management</li>
<li><a href="#">New pool</a></li>
<li><a href="#">Add server</a></li>
<li class="nav-header">Connected pools</li>
<li><a href="#"><i class="icon-cloud"></i> Dev Pool</a></li>
<li><a href="#"><i class="icon-cloud"></i> Prod Pool</a></li>
<li><a href="#"><i class="icon-cloud"></i> Test Pool</a></li>
<li class="nav-header">Misc</li>
<li><a href="#">Pool Events</a></li>
</ul>
</div>
<div class="span8">
<h2 class="center">Pool overview</h2>
<table class="table table-bordered table-hover table-striped">
<thead>
<tr>
<th>Name</th>
<th>Servers</th>
<th>Storage</th>
</tr>
</thead>
<tbody>
<tr>
<td>Dev Pool</td>
<td>Cluster1, Cluster2</td>
<td>NFS virtual disk storage</td>
</tr>
<tr>
<td>Prod Pool</td>
<td>Cluster3, Cluster4, Cluster5, Cluster6</td>
<td>NFS virtual disk storage</td>
</tr>
<tr>
<td>Test Pool</td>
<td>Cluster10, Cluster11</td>
<td>NFS virtual disk storage</td>
</tr>
</tbody>
</table>
</div>
{/block body}

145
src/templates/server.html Normal file
View File

@@ -0,0 +1,145 @@
{**
* This file is a part of Xen Orchestra.
*
* Xen Orchestra is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Xen Orchestra is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Xen Orchestra. If not, see <http://www.gnu.org/licenses/>.
*
* @author Olivier Lambert <olivier.lambert@vates.fr>
* @license http://www.gnu.org/licenses/agpl.html aGPL
*
* @package Xo-web
*}
{extends "/_base.html"}
{block title}Server overview{/block}
{block body}
<div class="row-fluid">
<div class="span2 offset1">
<ul class="nav nav-list well">
<li class="nav-header">Server Manager</li>
<li class="active"><a href="#">Overview</a></li>
<li class="nav-header">Management</li>
<li><a href="#">Add server</a></li>
<li><a href="#">Connect</a></li>
<li><a href="#">Disconnect</a></li>
<li class="nav-header">Connected servers</li>
<li><a href="#"><i class="icon-cog"></i> Cluster1</a></li>
<li><a href="#"><i class="icon-cog"></i> Cluster2</a></li>
<li><a href="#"><i class="icon-cog"></i> Cluster3</a></li>
<li><a href="#"><i class="icon-cog"></i> Cluster4</a></li>
<li><a href="#"><i class="icon-cog"></i> Cluster5</a></li>
<li><a href="#"><i class="icon-cog"></i> Cluster6</a></li>
<li><a href="#"><i class="icon-cog"></i> Cluster7</a></li>
<li class="nav-header">Misc</li>
<li><a href="#">Server Events</a></li>
</ul>
</div>
<div class="span8">
<h3 class="center">Server overview</h3>
<table class="table table-bordered table-hover table-striped">
<caption>Dev Pool</caption>
<thead>
<tr>
<th>Name</th>
<th>Memory</th>
<th>Network (avg/max KBs)</th>
<th>Uptime</th>
</tr>
</thead>
<tbody>
<tr>
<td>Cluster1</td>
<td><div class="progress progress-info progress-small"><div class="bar" style="width: 40%;"></div></div></td>
<td>3/3</td>
<td>6 days</td>
</tr>
<tr>
<td>Cluster1</td>
<td><div class="progress progress-info progress-small"><div class="bar" style="width: 20%;"></div></div></td>
<td>3/3</td>
<td>6 days 2 hours 10 minutes</td>
</tr>
<tr>
<td>Cluster1</td>
<td><div class="progress progress-info progress-small"><div class="bar" style="width: 60%;"></div></div></td>
<td>3/3</td>
<td>6 days 2 hours 10 minutes</td>
</tr>
</tbody>
</table>
<table class="table table-bordered table-hover table-striped">
<caption>Test Pool</caption>
<thead>
<tr>
<th>Name</th>
<th>Memory</th>
<th>Network (avg/max KBs)</th>
<th>Uptime</th>
</tr>
</thead>
<tbody>
<tr>
<td>Cluster1</td>
<td><div class="progress progress-info progress-small"><div class="bar" style="width: 80%;"></div></div></td>
<td>3/3</td>
<td>6 days 2 hours 10 minutes</td>
</tr>
<tr>
<td>Cluster1</td>
<td><div class="progress progress-info progress-small"><div class="bar" style="width: 70%;"></div></div></td>
<td>3/3</td>
<td>6 days 2 hours 10 minutes</td>
</tr>
<tr>
<td>Cluster1</td>
<td><div class="progress progress-info progress-small"><div class="bar" style="width: 48%;"></div></div></td>
<td>3/3</td>
<td>6 days 2 hours 10 minutes</td>
</tr>
</tbody>
</table>
<table class="table table-bordered table-hover table-striped">
<caption>Prod Pool</caption>
<thead>
<tr>
<th>Name</th>
<th>Memory</th>
<th>Network (avg/max KBs)</th>
<th>Uptime</th>
</tr>
</thead>
<tbody>
<tr>
<td>Cluster1</td>
<td><div class="progress progress-info progress-small"><div class="bar" style="width: 50%;"></div></div></td>
<td>3/3</td>
<td>6 days 2 hours 10 minutes</td>
</tr>
<tr>
<td>Cluster1</td>
<td><div class="progress progress-info progress-small"><div class="bar" style="width: 35%;"></div></div></td>
<td>3/3</td>
<td>6 days 2 hours 10 minutes</td>
</tr>
<tr>
<td>Cluster1</td>
<td><div class="progress progress-info progress-small"><div class="bar" style="width: 25%;"></div></div></td>
<td>3/3</td>
<td>6 days 2 hours 10 minutes</td>
</tr>
</tbody>
</table>
</div>
{/block body}

28
src/www/admin.php Normal file
View File

@@ -0,0 +1,28 @@
<?php
/**
* This file is a part of Xen Orchestra.
*
* Xen Orchestra is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Xen Orchestra is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Xen Orchestra. If not, see <http://www.gnu.org/licenses/>.
*
* @author Olivier Lambert <olivier.lambert@vates.fr>
* @license http://www.gnu.org/licenses/agpl.html aGPL
*
* @package Xo-web
*/
$application = require(__DIR__.'/../bootstrap.php');
$application->getTemplate('/admin/index.html')->render(array(
'admin' => true,
'dashboard' => true,
));

View File

@@ -1,142 +1,27 @@
<?php
require(__DIR__.'/../../bootstrap.php');
/**
* This file is a part of Xen Orchestra.
*
* Xen Orchestra is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Xen Orchestra is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Xen Orchestra. If not, see <http://www.gnu.org/licenses/>.
*
* @author Olivier Lambert <olivier.lambert@vates.fr>
* @license http://www.gnu.org/licenses/agpl.html aGPL
*
* @package Xo-web
*/
$application = require(__DIR__.'/../bootstrap.php');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Xen Orchestra</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<!-- styles -->
<link href="../../deps/bootstrap/css/bootstrap.css" rel="stylesheet">
<style>
body {
padding-top: 60px; /* 60px to make the container go all the way to the bottom of the topbar */
}
</style>
<link href="../../deps/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link rel="stylesheet" href="../../deps/font-awesome/css/font-awesome.css">
<link rel="stylesheet" href="../css/style.css">
<link rel="icon" href="../img/favicon.ico" />
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="../index.php"><img src="../img/bannerb.png"></a><a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></a>
<div class="nav-collapse collapse">
<ul class="nav">
<li class="divider-vertical"></li>
<li> <a href="../pool.php"><i class="icon-cloud"></i> Pool</a>
</li>
<li> <a href="../servers.php"><i class="icon-cog"></i> Server</a>
</li>
<li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#"><i class="icon-bolt"></i> Vm <b class="caret"></b> </a>
<ul class="dropdown-menu">
<li><a href="#"><i class="icon-reorder"></i> List</a></li>
<li><a href="#"><i class="icon-plus"></i> Add new...</a></li>
<li><a href="#"><i class="icon-cog"></i> Manage</a></li>
<li><a href="#"><i class="icon-file"></i> Templates</a></li>
<li class="divider"></li>
<li><a href="#"><i class="icon-wrench"></i> Options...</a></li>
</ul>
</li>
<li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#"><i class="icon-hdd"></i> Storage <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#"><i class="icon-reorder"></i> List</a></li>
<li><a href="#"><i class="icon-plus"></i> Add new...</a></li>
<li><a href="#"><i class="icon-cog"></i> Manage</a></li>
<li class="divider"></li>
<li><a href="#"><i class="icon-wrench"></i> Options...</a></li>
</ul>
</li>
</ul>
<ul class="nav pull-right">
<li class="divider-vertical"></li>
<li><a rel="tooltip" data-original-title="Settings" href="admin/admin.php"><i class="icon-wrench"></i></a></li>
<li><a id="msg" rel="tooltip" data-original-title="No unread notifications" href="#"><i class="icon-bell"></i></a></li>
<li class="dropdown">
<a class="dropdown-toggle" href="#" data-toggle="dropdown"><i class="icon-signin"></i> Log In <strong class="caret"></strong></a>
<div class="dropdown-menu" style="padding: 15px; padding-bottom: 0px;">
<!-- Login form here -->
<form>
<div class="input-prepend">
<span class="add-on"><i class="icon-user"></i></span>
<input class="span2" type="text" placeholder="User">
</div>
<div class="input-prepend">
<span class="add-on"><i class="icon-key"></i></span>
<input class="span2" type="password" placeholder="Password"></input><br/><br/>
</div>
<button type="submit" class="btn btn-info"><i class="icon-signin icon-small"></i> Log In</button>
</form>
</div>
</ul>
<form class="navbar-search pull-right" action="">
<input class="search-query" type="text" placeholder="Search">
</form>
</div><!--/.nav-collapse -->
</div>
</div>
</div>
</div>
<!-- end of navbar -->
<div class="row-fluid">
<div class="span2 offset1">
<ul class="nav nav-list well">
<li class="nav-header">Admin Panel</li>
<li class="active"><a href="#">Dashboard</a></li>
<li class="nav-header">Security</li>
<li><a href="#">Users</a></li>
<li><a href="#">Groups</a></li>
<li><a href="#">Policies</a></li>
<li class="nav-header">XCP settings</li>
<li><a href="hosts.php">Hosts</a></li>
<li><a href="#">Applications</a></li>
<li class="nav-header">Misc</li>
<li><a href="#">XO Events</a></li>
</ul>
</div>
<div class="span8 well">
<h3 class="center">Dashboard</h3>
<p class="center">Here some nice graphs and/or recap of XO</p>
</div>
</div> <!-- /container -->
<footer class="footer" style="background-color:#c2c2c2">
</footer>
<!-- Le javascript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="../../deps/js/jquery.js"></script>
<script src="../../deps/bootstrap/js/bootstrap.js"></script>
<script src="../../deps/bootstrap/js/bootstrap.js"></script>
<!-- Tooltip -->
<script type="text/javascript">
$(function (){
$('a:first-child').tooltip({placement:'bottom'});
$('a').tooltip();
});
</script>
</body>
</html>
$application->getTemplate('/pages/admin.html')->render(array(
'server' => true,
));

28
src/www/apps.php Normal file
View File

@@ -0,0 +1,28 @@
<?php
/**
* This file is a part of Xen Orchestra.
*
* Xen Orchestra is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Xen Orchestra is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Xen Orchestra. If not, see <http://www.gnu.org/licenses/>.
*
* @author Olivier Lambert <olivier.lambert@vates.fr>
* @license http://www.gnu.org/licenses/agpl.html aGPL
*
* @package Xo-web
*/
$application = require(__DIR__.'/../bootstrap.php');
$application->getTemplate('/admin/apps.html')->render(array(
'admin' => true,
'apps' => true,
));

28
src/www/events.php Normal file
View File

@@ -0,0 +1,28 @@
<?php
/**
* This file is a part of Xen Orchestra.
*
* Xen Orchestra is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Xen Orchestra is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Xen Orchestra. If not, see <http://www.gnu.org/licenses/>.
*
* @author Olivier Lambert <olivier.lambert@vates.fr>
* @license http://www.gnu.org/licenses/agpl.html aGPL
*
* @package Xo-web
*/
$application = require(__DIR__.'/../bootstrap.php');
$application->getTemplate('/admin/events.html')->render(array(
'admin' => true,
'events' => true,
));

28
src/www/groups.php Normal file
View File

@@ -0,0 +1,28 @@
<?php
/**
* This file is a part of Xen Orchestra.
*
* Xen Orchestra is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Xen Orchestra is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Xen Orchestra. If not, see <http://www.gnu.org/licenses/>.
*
* @author Olivier Lambert <olivier.lambert@vates.fr>
* @license http://www.gnu.org/licenses/agpl.html aGPL
*
* @package Xo-web
*/
$application = require(__DIR__.'/../bootstrap.php');
$application->getTemplate('/admin/groups.html')->render(array(
'admin' => true,
'groups' => true,
));

28
src/www/hosts.php Normal file
View File

@@ -0,0 +1,28 @@
<?php
/**
* This file is a part of Xen Orchestra.
*
* Xen Orchestra is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Xen Orchestra is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Xen Orchestra. If not, see <http://www.gnu.org/licenses/>.
*
* @author Olivier Lambert <olivier.lambert@vates.fr>
* @license http://www.gnu.org/licenses/agpl.html aGPL
*
* @package Xo-web
*/
$application = require(__DIR__.'/../bootstrap.php');
$application->getTemplate('/admin/hosts.html')->render(array(
'admin' => true,
'hosts' => true,
));

View File

@@ -1,158 +1,27 @@
<?php
require(__DIR__.'/../bootstrap.php');
/**
* This file is a part of Xen Orchestra.
*
* Xen Orchestra is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Xen Orchestra is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Xen Orchestra. If not, see <http://www.gnu.org/licenses/>.
*
* @author Olivier Lambert <olivier.lambert@vates.fr>
* @license http://www.gnu.org/licenses/agpl.html aGPL
*
* @package Xo-web
*/
$application = require(__DIR__.'/../bootstrap.php');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Xen Orchestra</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<!-- styles -->
<link href="../deps/bootstrap/css/bootstrap.css" rel="stylesheet">
<style>
body {
padding-top: 60px; /* 60px to make the container go all the way to the bottom of the topbar */
}
</style>
<link href="../deps/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link rel="stylesheet" href="../deps/font-awesome/css/font-awesome.css">
<link rel="stylesheet" href="css/style.css">
<link rel="icon" href="img/favicon.ico" />
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="index.php"><img src="img/bannerb.png"></a><a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></a>
<div class="nav-collapse collapse">
<ul class="nav">
<li class="divider-vertical"></li>
<li class="dropdown"> <a href="pool.php"><i class="icon-cloud"></i> Pool</a>
</li>
<li class="dropdown"> <a href="servers.php"><i class="icon-cog"></i> Server</a>
</li>
<li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#"><i class="icon-bolt"></i> Vm <b class="caret"></b> </a>
<ul class="dropdown-menu">
<li><a href="#"><i class="icon-reorder"></i> List</a></li>
<li><a href="#"><i class="icon-plus"></i> Add new...</a></li>
<li><a href="#"><i class="icon-cog"></i> Manage</a></li>
<li><a href="#"><i class="icon-file"></i> Templates</a></li>
<li class="divider"></li>
<li><a href="#"><i class="icon-wrench"></i> Options...</a></li>
</ul>
</li>
<li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#"><i class="icon-hdd"></i> Storage <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#"><i class="icon-reorder"></i> List</a></li>
<li><a href="#"><i class="icon-plus"></i> Add new...</a></li>
<li><a href="#"><i class="icon-cog"></i> Manage</a></li>
<li class="divider"></li>
<li><a href="#"><i class="icon-wrench"></i> Options...</a></li>
</ul>
</li>
</ul>
<ul class="nav pull-right">
<li class="divider-vertical"></li>
<li><a rel="tooltip" data-original-title="Settings" href="admin/admin.php"><i class="icon-wrench"></i></a></li>
<li><a id="msg" rel="tooltip" data-original-title="No unread notifications" href="#"><i class="icon-bell"></i></a></li>
<li class="dropdown">
<a class="dropdown-toggle" href="#" data-toggle="dropdown"><i class="icon-signin"></i> Log In <strong class="caret"></strong></a>
<div class="dropdown-menu" style="padding: 15px; padding-bottom: 0px;">
<!-- Login form here -->
<form>
<div class="input-prepend">
<span class="add-on"><i class="icon-user"></i></span>
<input class="span2" type="text" placeholder="User">
</div>
<div class="input-prepend">
<span class="add-on"><i class="icon-key"></i></span>
<input class="span2" type="password" placeholder="Password"></input><br/><br/>
</div>
<button type="submit" class="btn btn-info"><i class="icon-signin icon-small"></i> Log In</button>
</form>
</div>
</ul>
<form class="navbar-search pull-right" action="">
<input class="search-query" type="text" placeholder="Search">
</form>
</div><!--/.nav-collapse -->
</div>
</div>
</div>
</div>
<!-- end of navbar -->
<div class="row-fluid">
<div class="span10 offset1 hero-unit">
<h1 class="center">Welcome on XO!</h1>
<p class="center">It seems you don't have any connected host.<br/>Add an XCP host or a Pool master, and start to use the magic of Xen Orchestra.</p><br/>
<p class="center"><a class="btn btn-success btn-large"><i class="icon-plus"></i> Add server</a></p>
</div>
</div>
<div class="row-fluid">
<div class="span3 offset1 well">
<h2 class="center">Need help?</h2>
<p>If you don't know how to start, please read the README first. Then, if you have further questions, please read the FAQ on the project website.
</p><br/>
<p class="center"><a class="btn btn-info btn-large" data-toggle="modal" href="#infos" ><i class="icon-info-sign"></i> Readme</a></p>
</div>
<div class="span4 well">
<h2 class="center">About us</h2>
<p>We are the team behind XO, we are Vates! We create Open Source products and we offer commercial support for Xen and Xen Orchestra. This project is Open Source, everyone is welcome aboard!</p><br/>
<p class="center"><a class="btn btn-large" href="http://vates.fr"><i class="icon-circle-arrow-right"></i> Go on our website!</a></p>
</div>
<div class="span3 well">
<h2 class="center">Get involved!</h2>
<p>You want a specific feature in XO? Report a bug? Go to our project website, read the FAQ and get involved in the project!</p><br/>
<p class="center"><a class="btn btn-success btn-large" href="http://xen-orchestra.com"><i class="icon-beaker"></i> Project page</a></p>
</div>
</div>
<div class="modal hide fade" id="infos">
<div class="modal-header"> <a class="close" data-dismiss="modal">×</a>
<h3>Initial configuraton</h3>
</div>
<div class="modal-body">
<p>Please add an XCP server or a Pool master. For this, click on the "Let's go" button on the main screen. Otherwise, you can do the same thing by using the top menu ("Server" then "Add").</p>
</div>
<div class="modal-footer">
<a class="btn btn-info" data-dismiss="modal">Close</a>
</div>
</div>
<!-- JS Placed at the end of the document so the pages load faster -->
<script src="../deps/js/jquery.js"></script>
<script src="../deps/bootstrap/js/bootstrap.js"></script>
<!-- Tooltip -->
<script type="text/javascript">
$(function (){
$('a:first-child').tooltip({placement:'bottom'});
$('a').tooltip();
});
</script>
<!-- TODO Blink when notification -->
<script type="text/javascript">
function blink(selector){
$(selector).fadeOut('slow', function(){
$(this).fadeIn('slow', function(){
blink(this);
});
});
}
blink('#msg');
</script>
</body>
</html>
$application->getTemplate('/pages/index.html')->render(array(
'index' => true,
));

37
src/www/js/xo.js Normal file
View File

@@ -0,0 +1,37 @@
/**
* This file is a part of Xen Orchestra.
*
* Xen Orchestra is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Xen Orchestra is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Xen Orchestra. If not, see <http://www.gnu.org/licenses/>.
*
* @author Olivier Lambert <olivier.lambert@vates.fr>
* @license http://www.gnu.org/licenses/agpl.html aGPL
*
* @package Xo-web
*/
$(function (){
$('a:first-child').tooltip({placement:'bottom'});
$('a').tooltip();
});
/** Blink Bell
* TODO: blink only when notifications
*/
function blink(selector){
$(selector).fadeOut('slow', function(){
$(this).fadeIn('slow', function(){
blink(this);
});
});
}
blink('#msg');

28
src/www/policies.php Normal file
View File

@@ -0,0 +1,28 @@
<?php
/**
* This file is a part of Xen Orchestra.
*
* Xen Orchestra is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Xen Orchestra is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Xen Orchestra. If not, see <http://www.gnu.org/licenses/>.
*
* @author Olivier Lambert <olivier.lambert@vates.fr>
* @license http://www.gnu.org/licenses/agpl.html aGPL
*
* @package Xo-web
*/
$application = require(__DIR__.'/../bootstrap.php');
$application->getTemplate('/admin/policies.html')->render(array(
'admin' => true,
'policies' => true,
));

View File

@@ -1,169 +1,27 @@
<?php
require(__DIR__.'/../bootstrap.php');
/**
* This file is a part of Xen Orchestra.
*
* Xen Orchestra is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Xen Orchestra is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Xen Orchestra. If not, see <http://www.gnu.org/licenses/>.
*
* @author Olivier Lambert <olivier.lambert@vates.fr>
* @license http://www.gnu.org/licenses/agpl.html aGPL
*
* @package Xo-web
*/
$application = require(__DIR__.'/../bootstrap.php');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Xen Orchestra</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<!-- styles -->
<link href="../deps/bootstrap/css/bootstrap.css" rel="stylesheet">
<style>
body {
padding-top: 60px; /* 60px to make the container go all the way to the bottom of the topbar */
}
</style>
<link href="../deps/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link rel="stylesheet" href="../deps/font-awesome/css/font-awesome.css">
<link rel="stylesheet" href="css/style.css">
<link rel="icon" href="img/favicon.ico" />
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="index.php"><img src="img/bannerb.png"></a><a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></a>
<div class="nav-collapse collapse">
<ul class="nav">
<li class="divider-vertical"></li>
<li class="active"> <a href="pool.php"><i class="icon-cloud"></i> Pool</a>
</li>
<li> <a href="servers.php"><i class="icon-cog"></i> Server</a>
</li>
<li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#"><i class="icon-bolt"></i> Vm <b class="caret"></b> </a>
<ul class="dropdown-menu">
<li><a href="#"><i class="icon-reorder"></i> List</a></li>
<li><a href="#"><i class="icon-plus"></i> Add new...</a></li>
<li><a href="#"><i class="icon-cog"></i> Manage</a></li>
<li><a href="#"><i class="icon-file"></i> Templates</a></li>
<li class="divider"></li>
<li><a href="#"><i class="icon-wrench"></i> Options...</a></li>
</ul>
</li>
<li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#"><i class="icon-hdd"></i> Storage <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#"><i class="icon-reorder"></i> List</a></li>
<li><a href="#"><i class="icon-plus"></i> Add new...</a></li>
<li><a href="#"><i class="icon-cog"></i> Manage</a></li>
<li class="divider"></li>
<li><a href="#"><i class="icon-wrench"></i> Options...</a></li>
</ul>
</li>
</ul>
<ul class="nav pull-right">
<li class="divider-vertical"></li>
<li><a rel="tooltip" data-original-title="Settings" href="admin/admin.php"><i class="icon-wrench"></i></a></li>
<li><a id="msg" rel="tooltip" data-original-title="No unread notifications" href="#"><i class="icon-bell"></i></a></li>
<li class="dropdown">
<a class="dropdown-toggle" href="#" data-toggle="dropdown"><i class="icon-signin"></i> Log In <strong class="caret"></strong></a>
<div class="dropdown-menu" style="padding: 15px; padding-bottom: 0px;">
<!-- Login form here -->
<form>
<div class="input-prepend">
<span class="add-on"><i class="icon-user"></i></span>
<input class="span2" type="text" placeholder="User">
</div>
<div class="input-prepend">
<span class="add-on"><i class="icon-key"></i></span>
<input class="span2" type="password" placeholder="Password"></input><br/><br/>
</div>
<button type="submit" class="btn btn-info"><i class="icon-signin icon-small"></i> Log In</button>
</form>
</div>
</ul>
<form class="navbar-search pull-right" action="">
<input class="search-query" type="text" placeholder="Search">
</form>
</div><!--/.nav-collapse -->
</div>
</div>
</div>
</div>
<!-- end of navbar -->
<div class="row-fluid">
<div class="span2 offset1">
<ul class="nav nav-list well">
<li class="nav-header">Pool Manager</li>
<li class="active"><a href="#">Overview</a></li>
<li class="nav-header">Management</li>
<li><a href="#">New pool</a></li>
<li><a href="#">Add server</a></li>
<li class="nav-header">Connected pools</li>
<li><a href="#"><i class="icon-cloud"></i> Dev Pool</a></li>
<li><a href="#"><i class="icon-cloud"></i> Prod Pool</a></li>
<li><a href="#"><i class="icon-cloud"></i> Test Pool</a></li>
<li class="nav-header">Misc</li>
<li><a href="#">Pool Events</a></li>
</ul>
</div>
<div class="span8">
<h2 class="center">Pool overview</h2>
<table class="table table-bordered table-hover table-striped">
<thead>
<tr>
<th>Name</th>
<th>Servers</th>
<th>Storage</th>
</tr>
</thead>
<tbody>
<tr>
<td>Dev Pool</td>
<td>Cluster1, Cluster2</td>
<td>NFS virtual disk storage</td>
</tr>
<tr>
<td>Prod Pool</td>
<td>Cluster3, Cluster4, Cluster5, Cluster6</td>
<td>NFS virtual disk storage</td>
</tr>
<tr>
<td>Test Pool</td>
<td>Cluster10, Cluster11</td>
<td>NFS virtual disk storage</td>
</tr>
</tbody>
</table>
</div>
<!-- JS Placed at the end of the document so the pages load faster -->
<script src="../deps/js/jquery.js"></script>
<script src="../deps/bootstrap/js/bootstrap.js"></script>
<!-- Tooltip -->
<script type="text/javascript">
$(function (){
$('a:first-child').tooltip({placement:'bottom'});
$('a').tooltip();
});
</script>
<!-- TODO Blink when notification -->
<script type="text/javascript">
function blink(selector){
$(selector).fadeOut('slow', function(){
$(this).fadeIn('slow', function(){
blink(this);
});
});
}
blink('#msg');
</script>
</body>
</html>
$application->getTemplate('/pool.html')->render(array(
'pool' => true,
));

View File

@@ -1,241 +1,27 @@
<?php
require(__DIR__.'/../bootstrap.php');
/**
* This file is a part of Xen Orchestra.
*
* Xen Orchestra is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Xen Orchestra is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Xen Orchestra. If not, see <http://www.gnu.org/licenses/>.
*
* @author Olivier Lambert <olivier.lambert@vates.fr>
* @license http://www.gnu.org/licenses/agpl.html aGPL
*
* @package Xo-web
*/
$application = require(__DIR__.'/../bootstrap.php');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Xen Orchestra</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<!-- styles -->
<link href="../deps/bootstrap/css/bootstrap.css" rel="stylesheet">
<style>
body {
padding-top: 60px; /* 60px to make the container go all the way to the bottom of the topbar */
}
</style>
<link href="../deps/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link rel="stylesheet" href="../deps/font-awesome/css/font-awesome.css">
<link rel="stylesheet" href="css/style.css">
<link rel="icon" href="img/favicon.ico" />
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="index.php"><img src="img/bannerb.png"></a><a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></a>
<div class="nav-collapse collapse">
<ul class="nav">
<li class="divider-vertical"></li>
<li> <a href="pool.php"><i class="icon-cloud"></i> Pool</a>
</li>
<li class="active"> <a href="servers.php"><i class="icon-cog"></i> Server</a>
</li>
<li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#"><i class="icon-bolt"></i> Vm <b class="caret"></b> </a>
<ul class="dropdown-menu">
<li><a href="#"><i class="icon-reorder"></i> List</a></li>
<li><a href="#"><i class="icon-plus"></i> Add new...</a></li>
<li><a href="#"><i class="icon-cog"></i> Manage</a></li>
<li><a href="#"><i class="icon-file"></i> Templates</a></li>
<li class="divider"></li>
<li><a href="#"><i class="icon-wrench"></i> Options...</a></li>
</ul>
</li>
<li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#"><i class="icon-hdd"></i> Storage <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#"><i class="icon-reorder"></i> List</a></li>
<li><a href="#"><i class="icon-plus"></i> Add new...</a></li>
<li><a href="#"><i class="icon-cog"></i> Manage</a></li>
<li class="divider"></li>
<li><a href="#"><i class="icon-wrench"></i> Options...</a></li>
</ul>
</li>
</ul>
<ul class="nav pull-right">
<li class="divider-vertical"></li>
<li><a rel="tooltip" data-original-title="Settings" href="admin/admin.php"><i class="icon-wrench"></i></a></li>
<li><a id="msg" rel="tooltip" data-original-title="No unread notifications" href="#"><i class="icon-bell"></i></a></li>
<li class="dropdown">
<a class="dropdown-toggle" href="#" data-toggle="dropdown"><i class="icon-signin"></i> Log In <strong class="caret"></strong></a>
<div class="dropdown-menu" style="padding: 15px; padding-bottom: 0px;">
<!-- Login form here -->
<form>
<div class="input-prepend">
<span class="add-on"><i class="icon-user"></i></span>
<input class="span2" type="text" placeholder="User">
</div>
<div class="input-prepend">
<span class="add-on"><i class="icon-key"></i></span>
<input class="span2" type="password" placeholder="Password"></input><br/><br/>
</div>
<button type="submit" class="btn btn-info"><i class="icon-signin icon-small"></i> Log In</button>
</form>
</div>
</ul>
<form class="navbar-search pull-right" action="">
<input class="search-query" type="text" placeholder="Search">
</form>
</div><!--/.nav-collapse -->
</div>
</div>
</div>
</div>
<!-- end of navbar -->
<div class="row-fluid">
<div class="span2 offset1">
<ul class="nav nav-list well">
<li class="nav-header">Server Manager</li>
<li class="active"><a href="#">Overview</a></li>
<li class="nav-header">Management</li>
<li><a href="#">Add server</a></li>
<li><a href="#">Connect</a></li>
<li><a href="#">Disconnect</a></li>
<li class="nav-header">Connected servers</li>
<li><a href="#"><i class="icon-cog"></i> Cluster1</a></li>
<li><a href="#"><i class="icon-cog"></i> Cluster2</a></li>
<li><a href="#"><i class="icon-cog"></i> Cluster3</a></li>
<li><a href="#"><i class="icon-cog"></i> Cluster4</a></li>
<li><a href="#"><i class="icon-cog"></i> Cluster5</a></li>
<li><a href="#"><i class="icon-cog"></i> Cluster6</a></li>
<li><a href="#"><i class="icon-cog"></i> Cluster7</a></li>
<li class="nav-header">Misc</li>
<li><a href="#">Server Events</a></li>
</ul>
</div>
<div class="span8">
<h3 class="center">Server overview</h3>
<table class="table table-bordered table-hover table-striped">
<caption>Dev Pool</caption>
<thead>
<tr>
<th>Name</th>
<th>Memory</th>
<th>Network (avg/max KBs)</th>
<th>Uptime</th>
</tr>
</thead>
<tbody>
<tr>
<td>Cluster1</td>
<td><div class="progress progress-info progress-small"><div class="bar" style="width: 40%;"></div></div></td>
<td>3/3</td>
<td>6 days</td>
</tr>
<tr>
<td>Cluster1</td>
<td><div class="progress progress-info progress-small"><div class="bar" style="width: 20%;"></div></div></td>
<td>3/3</td>
<td>6 days 2 hours 10 minutes</td>
</tr>
<tr>
<td>Cluster1</td>
<td><div class="progress progress-info progress-small"><div class="bar" style="width: 60%;"></div></div></td>
<td>3/3</td>
<td>6 days 2 hours 10 minutes</td>
</tr>
</tbody>
</table>
<table class="table table-bordered table-hover table-striped">
<caption>Test Pool</caption>
<thead>
<tr>
<th>Name</th>
<th>Memory</th>
<th>Network (avg/max KBs)</th>
<th>Uptime</th>
</tr>
</thead>
<tbody>
<tr>
<td>Cluster1</td>
<td><div class="progress progress-info progress-small"><div class="bar" style="width: 80%;"></div></div></td>
<td>3/3</td>
<td>6 days 2 hours 10 minutes</td>
</tr>
<tr>
<td>Cluster1</td>
<td><div class="progress progress-info progress-small"><div class="bar" style="width: 70%;"></div></div></td>
<td>3/3</td>
<td>6 days 2 hours 10 minutes</td>
</tr>
<tr>
<td>Cluster1</td>
<td><div class="progress progress-info progress-small"><div class="bar" style="width: 48%;"></div></div></td>
<td>3/3</td>
<td>6 days 2 hours 10 minutes</td>
</tr>
</tbody>
</table>
<table class="table table-bordered table-hover table-striped">
<caption>Prod Pool</caption>
<thead>
<tr>
<th>Name</th>
<th>Memory</th>
<th>Network (avg/max KBs)</th>
<th>Uptime</th>
</tr>
</thead>
<tbody>
<tr>
<td>Cluster1</td>
<td><div class="progress progress-info progress-small"><div class="bar" style="width: 50%;"></div></div></td>
<td>3/3</td>
<td>6 days 2 hours 10 minutes</td>
</tr>
<tr>
<td>Cluster1</td>
<td><div class="progress progress-info progress-small"><div class="bar" style="width: 35%;"></div></div></td>
<td>3/3</td>
<td>6 days 2 hours 10 minutes</td>
</tr>
<tr>
<td>Cluster1</td>
<td><div class="progress progress-info progress-small"><div class="bar" style="width: 25%;"></div></div></td>
<td>3/3</td>
<td>6 days 2 hours 10 minutes</td>
</tr>
</tbody>
</table>
</div>
<!-- JS Placed at the end of the document so the pages load faster -->
<script src="../deps/js/jquery.js"></script>
<script src="../deps/bootstrap/js/bootstrap.js"></script>
<!-- Tooltip -->
<script type="text/javascript">
$(function (){
$('a:first-child').tooltip({placement:'bottom'});
$('a').tooltip();
});
</script>
<!-- TODO Blink when notification -->
<script type="text/javascript">
function blink(selector){
$(selector).fadeOut('slow', function(){
$(this).fadeIn('slow', function(){
blink(this);
});
});
}
blink('#msg');
</script>
</body>
</html>
$application->getTemplate('/server.html')->render(array(
'server' => true,
));

28
src/www/users.php Normal file
View File

@@ -0,0 +1,28 @@
<?php
/**
* This file is a part of Xen Orchestra.
*
* Xen Orchestra is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Xen Orchestra is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Xen Orchestra. If not, see <http://www.gnu.org/licenses/>.
*
* @author Olivier Lambert <olivier.lambert@vates.fr>
* @license http://www.gnu.org/licenses/agpl.html aGPL
*
* @package Xo-web
*/
$application = require(__DIR__.'/../bootstrap.php');
$application->getTemplate('/admin/users.html')->render(array(
'admin' => true,
'users' => true,
));