First draft for VM integration.

** ONLY PERFORMS MOCKUP **
This commit is contained in:
François Serman 2013-04-12 21:52:27 +00:00
parent ec8ccc9982
commit 943d091944
4 changed files with 64 additions and 0 deletions

3
.gitattributes vendored
View File

@ -341,6 +341,7 @@ bureau/admin/styles/style-hw.css -text
bureau/admin/styles/style.css -text
bureau/admin/tempovars.php -text
bureau/admin/trash_dateselect.php -text
bureau/admin/vm.php -text
bureau/admin/webmail-redirect.php -text
bureau/class/config.php -text
bureau/class/config_nochk.php -text
@ -360,6 +361,7 @@ bureau/class/m_ftp.php -text
bureau/class/m_hooks.php -text
bureau/class/m_hta.php -text
bureau/class/m_log.php -text
bureau/class/m_lxc.php -text
bureau/class/m_mail.php -text
bureau/class/m_mem.php -text
bureau/class/m_menu.php -text
@ -370,6 +372,7 @@ bureau/class/m_trash.php -text
bureau/class/mime.php -text
bureau/class/reset_stats_conf.php -text
bureau/class/variables.php -text
bureau/class/vm.php -text
bureau/index.php -text
bureau/locales/Makefile -text
bureau/locales/README -text

32
bureau/admin/vm.php Normal file
View File

@ -0,0 +1,32 @@
<?php
require_once("../class/config.php");
include_once("head.php");
echo '<h1>youpi gestion des VM</h1>';
$fields = array (
"action" => array ("request", "string", FALSE),
"login" => array ("request", "string", FALSE),
"pass" => array("request", "string", FALSE),
"uid" => array("request", "integer", FALSE),
);
getFields($fields);
if (in_array($action, array('start', 'stop', 'monit')))
{
call_user_func(array($lxc, $action));
}
?>
<h1>Dev only</h1>
<form method="post">
<p>Action: <select name="action"><option value="monit">Monitoring</option><option value="start">Start</option><option value="stop">Stop</option></select></p>
<p>Login: <input type="text" name="login" /></p>
<p>Pass (hash): <input type="text" name="pass" /></p>
<p>Uid: <input type="text" name="uid" /></p>
<p><input type="submit" name="tester" /></p>
</form>

24
bureau/class/m_lxc.php Normal file
View File

@ -0,0 +1,24 @@
<?php
include_once(dirname(__FILE__) . '/vm.php');
# include('vm.php'); // This one fails ...
class m_lxc implements vm
{
public function start()
{
echo "lxc::start";
}
public function monit()
{
echo "1 / 5 used";
}
public function stop()
{
echo "lxc::stop";
}
}

5
bureau/class/vm.php Normal file
View File

@ -0,0 +1,5 @@
<?php
interface vm {
public function start();
public function stop();
}