Commit d28977e3 authored by RemyD's avatar RemyD

3.0.1

parent 2a599f8d
......@@ -7,7 +7,7 @@
* Used for insert ONLY
*/
$_SESSION['$_SITE_SOURCE']='http://git.csti.ch/ispconfig-modules/hosted-vps/tags';
$_SESSION['$_SITE_SOURCE']='https://git.csti.ch/ispconfig-modules/hosted-vps';
global $media ;
$media='<img src="/hosted/medias/';
......@@ -49,15 +49,15 @@ class cstiConfig { /* CSTI Config Class, used for tracking version, Init and upd
# Table tracking and setup
private $_TableSetupData="(id, AppVersion, AppRevision, AppSubversion, AppDevVersion, CreateDate, sys_userid, sys_groupid, sys_perm_user, sys_perm_group, sys_perm_other,username,password,server,loglevel) VALUES (1, 1, 0, 0, now(), 0, 0, 'ruid', 'r', '', '','username','','',1);";
private $_TableSetupUpdate="INSERT INTO hosted_Setup (id, AppVersion, AppRevision, AppSubversion, AppDevVersion, CreateDate, sys_userid, sys_groupid,
sys_perm_user, sys_perm_group, sys_perm_other) VALUES (5,3,0,0, 0, now(), 0,0, 'ruid', 'r', '');";
sys_perm_user, sys_perm_group, sys_perm_other) VALUES (7,3,0,1, 0, now() , 0,0, 'ruid', 'r', '');";
function __construct(){
$this->_site_url=$_SESSION['$_SITE_SOURCE'];
$this->_site_url=$_SESSION['$_SITE_SOURCE'] . "/tags";
}
public function getHeaders() {
stream_context_set_default(
array(
'http' => array(
'https' => array(
'method' => 'GET'
)
)
......@@ -70,12 +70,12 @@ class cstiConfig { /* CSTI Config Class, used for tracking version, Init and upd
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $this->_site_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (compatible;Get Latest Version:: IspConfig/EXCHANGE)');
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (compatible;Get Latest Version:: IspConfig/Hosted)');
$reponse = curl_exec ($ch);
curl_close($ch);
$find ='<i class="fa fa-tag"></i>';
$find ='<div class="tags">';
$notice = strstr($reponse, $find, true );
$pos =strlen($notice) +26;
$pos =strlen($notice) +225;
$this->version=(substr($reponse,$pos,1));
$this->revision=(substr($reponse,$pos +2,1));
......
......@@ -25,8 +25,8 @@ $liste["item"][] = array( 'field' => "task_status",
'prefix' => "%",
'suffix' => "%",
'width' => "",
'value' => array("success" => "<div id=\"ir-Yes\" class=\"swap\"><span>Yes</span></div>",
"error" => "<div class=\"swap\" id=\"ir-No\"><span>No</span></div>" ));
'value' => array("success" => '<img src="hosted/medias/ok.png" Alt="OK">',
"error" => '<img src="hosted/medias/Failed.png" Alt="Failed" ">' ));
$liste["item"][] = array( 'field' => "task_description",
'datatype' => "VARCHAR",
'formtype' => "TEXT",
......
......@@ -28,8 +28,8 @@ $liste["item"][] = array( 'field' => "status_pwr",
'prefix' => "",
'suffix' => "",
'width' => "",
'value' => array(1 => "<div id=\"ir-Yes\" class=\"swap\"><span>Yes</span></div>",
0 => "<div class=\"swap\" id=\"ir-No\"><span>No</span></div>" )
'value' => array(1 => "<img src=\"hosted/medias/ok.png\" Alt=\"OK\">",
0 => "<img src=\"hosted/medias/Failed.png\" Alt=\"Failed"\">" )
);
$liste["item"][] = array( 'field' => "status_vmw",
'datatype' => "INTEGER",
......@@ -38,8 +38,8 @@ $liste["item"][] = array( 'field' => "status_vmw",
'prefix' => "",
'suffix' => "",
'width' => "",
'value' => array('3' => "<div id=\"ir-Yes\" class=\"swap\"><span>OK</span></div>",
'1' => "<div class=\"swap\" id=\"ir-No\"><span>Failed</span></div>" )
'value' => array(3 => "<img src=\"hosted/medias/ok.png\" Alt=\"OK\">",
0 => "<img src=\"hosted/medias/Failed.png\" Alt=\"Failed"\">" )
);
?>
\ No newline at end of file
......@@ -26,9 +26,11 @@ $liste["item"][] = array( 'field' => "status_pwr",
'prefix' => "",
'suffix' => "",
'width' => "",
'value' => array(1 => "<div id=\"ir-Yes\" class=\"swap\"><span>Yes</span></div>",
0 => "<div class=\"swap\" id=\"ir-No\"><span>No</span></div>" )
);
'value' => array(
'1' => '<img src="hosted/medias/ok.png" Alt="OK" >' ,
'0' => '<img src="hosted/medias/Failed.png" Alt="Failed" > '
)
);
$liste["item"][] = array( 'field' => "status_vmw",
'datatype' => "INTEGER",
'formtype' => "SELECT",
......@@ -36,9 +38,8 @@ $liste["item"][] = array( 'field' => "status_vmw",
'prefix' => "",
'suffix' => "",
'width' => "",
'value' => array('3' => "<div id=\"ir-Yes\" class=\"swap\"><span>OK</span></div>",
'1' => "<div class=\"swap\" id=\"ir-No\"><span>Failed</span></div>" )
);
'value' => array('3' => '<img src="hosted/medias/ok.png" Alt="OK" >' ,
'1' => '<img src="hosted/medias/Failed.png" Alt="Failed" >' ));
/* DB Others Fileds */
$liste["item"][] = array( 'field' => "client_id",
'datatype' => "INTEGER",
......
medias/linuxGuest-49.png

4.5 KB | W: | H:

medias/linuxGuest-49.png

1.98 KB | W: | H:

medias/linuxGuest-49.png
medias/linuxGuest-49.png
medias/linuxGuest-49.png
medias/linuxGuest-49.png
  • 2-up
  • Swipe
  • Onion skin
medias/med.jpg

5.41 KB | W: | H:

medias/med.jpg

1.5 KB | W: | H:

medias/med.jpg
medias/med.jpg
medias/med.jpg
medias/med.jpg
  • 2-up
  • Swipe
  • Onion skin
medias/ok.png

3.37 KB | W: | H:

medias/ok.png

2.29 KB | W: | H:

medias/ok.png
medias/ok.png
medias/ok.png
medias/ok.png
  • 2-up
  • Swipe
  • Onion skin
medias/windowsGuest-49.png

5.97 KB | W: | H:

medias/windowsGuest-49.png

3 KB | W: | H:

medias/windowsGuest-49.png
medias/windowsGuest-49.png
medias/windowsGuest-49.png
medias/windowsGuest-49.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -26,7 +26,7 @@
<td class="tbl_col_status_pwr"><a href="#" data-load-content="hosted/vps_details.php?id={tmpl_var name='id'}">{tmpl_var name="status_pwr"}</a></td>
<td class="tbl_col_status_vmw"><a href="#" data-load-content="hosted/vps_details.php?id={tmpl_var name='id'}">{tmpl_var name="status_vmw"}</a></td>
<td class="tbl_col_buttons">
<a href="#" data-load-content="hosted/events_list.php?vmid={tmpl_var name='vmid'}"><div id="ir-Int"></div></a>
<a href="#" data-load-content="hosted/events_list.php?vmid={tmpl_var name='vmid'}"><img src="hosted/medias/Question.png" alt="Events"></a>
</td>
</tr>
</tmpl_loop>
......
......@@ -22,31 +22,32 @@ $sub = ($v->subversion);
$_SESSION['MOD_HOSTED_SUBVERSION']=$dbVer['AppSubversion'];
$_SESSION['MOD_HOSTED_DEV_LEVEL']= $dbVer['AppDevVersion'];
$OnLineVer = $ver .'.'. $rev .'.'.$sub;
$thisver =$_SESSION['MOD_HOSTED_VERSION'].'.'.$_SESSION['MOD_HOSTED_REVISION'].'.'.$_SESSION['MOD_HOSTED_SUBVERSION'].'-'.$_SESSION['MOD_HOSTED_DEV_LEVEL'];
$message='<br><br><h3> Version:';
$bad='<font color="RED">You need to update to the latest version (';
$ok='<font color="GREEN">You use the latest version (Online:';
// value 0 Not installed , 1 Need Update , 2 Need minor Update , 3 Uptodate
$update=0;
if ($_SESSION['MOD_HOSTED_VERSION']==0) {
// not installed
$update=0;
$message = "Not installed.";
} else {
// installed
$update=1;
if ($rev <= $_SESSION['MOD_HOSTED_REVISION'])
{
if ($sub <= $_SESSION['MOD_HOSTED_SUBVERSION']) {
$message.= $ok.$ver.'.'.$rev.'.'.$sub.' - '.$thisver ;
$update=3;
if ($ver = $_SESSION['MOD_HOSTED_VERSION']) {
// Version OK
if ($rev == $_SESSION['MOD_HOSTED_REVISION'] ) {
// revision OK
if ($sub == $_SESSION['MOD_HOSTED_SUBVERSION']) {
$message.= $ok.$ver.'.'.$rev.'.'.$sub.' - '.$thisver ;
} else {
$message.= $bad. $OnLineVer .'#'.$thisver . " Subversion$sub";
}
} else {
$message.= $bad.$ver.'.'.$rev.'.'.$sub.'#'.$thisver;
$update=2;
$message.= $bad. $OnLineVer .'#'.$thisver . " Revision$rev";
}
} else {
$update=1;
$message.= $bad.$ver.'.'.$rev.'.'.$sub.'#'.$thisver;
// version not OK
$message.= $bad. $OnLineVer .'#'.$thisver . " Version $ver";
}
}
......
......@@ -46,13 +46,13 @@ class page_action extends tform_actions {
if (isset($vm->runtime->powerState)) {
if ($vm->runtime->powerState =='poweredOff') {
$toDB=0;
$power="Abort-49.png";
$power="Abort.png";
} elseif ($vm->runtime->powerState =='poweredOn') {
$toDB=1;
$power="OK-49.png";
$power="ok.png";
} else {
$toDB=5;
$power="Warning-49.png";
$power="Warning.png";
}
$app->tpl->setVar('power_img',$media. $power.$height.'>');
unset($power);
......@@ -69,15 +69,15 @@ class page_action extends tform_actions {
break;
case "toolsNotRunning":
$toDB=1;
$power="Failed-49.png";
$power="Failed.png";
break;
case "toolsOld":
$toDB=2;
$power="Warning-49.png";
$power="Warning.png";
break;
case "toolsOk":
$toDB=3;
$power="OK-49.png";
$power="ok.png";
break ;
}
$app->tpl->setVar('status_img',$media. $power.$height.'>');
......@@ -100,17 +100,17 @@ class page_action extends tform_actions {
// Hard Disk Checks $vm->guest->disk
$tablehdd='<table class="list" colspan="3">';
$tablehdd.='<thead><tr><th >Name</th><th >Capacity</th><th >FreeSpace</th></tr></thead><tbody>';
$tablehdd='<table class="table" colspan="5">';
$tablehdd.='<thead><tr><th></th><th >Name</th><th >Capacity</th><th >FreeSpace</th><th></th></tr></thead><tbody>';
if (is_array($vm->guest->disk)) {
foreach ($vm->guest->disk as $value) {
$tablehdd.='<tr class="'.$thisclass.'"><td >'.$value->diskPath. '</td><td >'.(int)($value->capacity/1024/1024/1024).'</td><td >'.(int)($value->freeSpace/1024/1024/1024).'</td></tr>';
$tablehdd.='<tr class="'.$thisclass.'"><td class="tbl_row_uneven" ></td><td >'.$value->diskPath. '</td><td >'.(int)($value->capacity/1024/1024/1024).'</td><td >'.(int)($value->freeSpace/1024/1024/1024).'</td><td class="tbl_row_uneven"></td></tr>';
$capa +=$value->capacity;
$freeSpace += $value->freeSpace;
if ($thisclass ==$class1) { $thisclass=$class2;} else {$thisclass=$class1;}
}
} else {
$tablehdd.='<tr class="'.$thisclass.'"><td >'.$vm->guest->disk->diskPath. '</td><td >'.(int)($vm->guest->disk->capacity/1024/1024/1024).'</td><td >'.(int)($vm->guest->disk->freeSpace/1024/1024/1024).'</td></tr>';
$tablehdd.='<tr class="'.$thisclass.'"><td class="tbl_row_uneven"></td><td >'.$vm->guest->disk->diskPath. '</td><td >'.(int)($vm->guest->disk->capacity/1024/1024/1024).'</td><td >'.(int)($vm->guest->disk->freeSpace/1024/1024/1024).'</td><td class="tbl_row_uneven"></td></tr>';
$capa =$vm->guest->disk->capacity;
$freeSpace = $vm->guest->disk->freeSpace;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment