This commit is contained in:
User Web
2018-12-06 01:21:33 +03:00
parent bf4f18776e
commit 05379d0aa9
4 changed files with 34 additions and 10 deletions

View File

@@ -5,6 +5,7 @@ class ClonOS
{ {
public $server_name=''; public $server_name='';
public $workdir=''; public $workdir='';
public $realpath='';
public $realpath_php=''; public $realpath_php='';
public $realpath_public=''; public $realpath_public='';
public $realpath_page=''; public $realpath_page='';
@@ -89,6 +90,9 @@ class ClonOS
$this->workdir=getenv('WORKDIR'); $this->workdir=getenv('WORKDIR');
# // /usr/jails # // /usr/jails
$this->realpath=$_REALPATH.'/';
# /usr/home/web/cp/clonos/
$this->realpath_php=$_REALPATH.'/php/'; $this->realpath_php=$_REALPATH.'/php/';
# /usr/home/web/cp/clonos/php/ # /usr/home/web/cp/clonos/php/

View File

@@ -965,7 +965,7 @@ td.error {
.tasklog { .tasklog {
width:60%; width:60%;
max-width:60%; max-width:60%;
margin-left:-30% !important; /*margin-left:-30% !important;*/
left:50%; left:50%;
} }
.tasklog .window-content { .tasklog .window-content {
@@ -1614,3 +1614,14 @@ body.overview div.smoothie-chart-tooltip {
width:260px; width:260px;
padding-left:10px !important; padding-left:10px !important;
} }
.copys {
position:absolute;
bottom:0;
left:22px;
background-color:rgba(255,255,255,0.7);
}
#jailslist td:nth-child(1), #jailslist td:nth-child(2) {
cursor:pointer;
}

View File

@@ -149,6 +149,7 @@ if(isset($_languages))foreach($_languages as $lng=>$lngname)
<div class="spinner"></div> <div class="spinner"></div>
<div class="online icon-online" id="net-stat" onclick="ws_debug();"></div> <div class="online icon-online" id="net-stat" onclick="ws_debug();"></div>
<div class="copys">&nbsp;ver.: <?php echo file_get_contents($clonos->realpath.'version'); ?>&nbsp;</div>
</body> </body>
</html> </html>
<?php //print_r($clonos->userGetInfo()); ?> <?php //print_r($clonos->userGetInfo()); ?>

View File

@@ -1700,8 +1700,11 @@ var clonos={
var tblid=$(tbl).attr('id'); var tblid=$(tbl).attr('id');
if(tblid=='jailslist'){ if(tblid=='jailslist'){
if(td==$(tr).children()[0] || td==$(tr).children()[1])
{
var e=$(tr).parents('div.main');if(e){$(e).toggleClass('asplit');} var e=$(tr).parents('div.main');if(e){$(e).toggleClass('asplit');}
this.openedJailSummary=trid; this.openedJailSummary=trid;
}
} }
var opt='jail'; var opt='jail';
@@ -3110,9 +3113,12 @@ if(tblid=='jailslist'){
if(res!=null) if(res!=null)
{ {
var name=res[1]; var name=res[1];
if($.isEmptyObject(graphs.list[name]))
{
var g=new graph(name,width,height,gr,tooltip1,tooltip2); var g=new graph(name,width,height,gr,tooltip1,tooltip2);
g.create(); g.create();
} }
}
}, },
createGraphById:function(id) createGraphById:function(id)
@@ -3128,6 +3134,8 @@ if(tblid=='jailslist'){
} }
/* --- GRAPH START --- */ /* --- GRAPH START --- */
socket=null;
graphs={ graphs={
list:{}, list:{},
@@ -3144,12 +3152,12 @@ graphs={
wsconnect:function() wsconnect:function()
{ {
console.log('Поступила команда на подсоединение по ws'); console.log('Поступила команда на подсоединение по ws');
if(!this.socket || this.socket.readyState==this.socket.CLOSED) if(!socket || socket.readyState==socket.CLOSED)
{ {
console.log('Соединяемся по сокету'); console.log('Соединяемся по сокету');
this.client_id=this.name; this.client_id=this.name;
this.socket = new WebSocket("ws://"+_server_name+":8024/graph"+location.pathname+"client-"+Math.random()); socket = new WebSocket("ws://"+_server_name+":8024/graph"+location.pathname+"client-"+Math.random());
$(this.socket).on('open',$.proxy(this.wsopen,this)) $(socket).on('open',$.proxy(this.wsopen,this))
.on('close',$.proxy(this.wsclose,this)) .on('close',$.proxy(this.wsclose,this))
.on('error',$.proxy(this.wserror,this)) .on('error',$.proxy(this.wserror,this))
.on('message',$.proxy(this.wsmessage,this)); .on('message',$.proxy(this.wsmessage,this));
@@ -3166,11 +3174,11 @@ graphs={
var msg='Соединение с сервером разорвано аварийно! Перезагрузите страницу!'; var msg='Соединение с сервером разорвано аварийно! Перезагрузите страницу!';
} }
if(this.socket.readyState==this.socket.CLOSED) if(socket.readyState==socket.CLOSED)
{ {
this.connected=false; this.connected=false;
console.log('Соединение закрыто по неизвестной причине...'); console.log('Соединение закрыто по неизвестной причине...');
this.socket=null; socket=null;
setTimeout($.proxy(this.wsconnect,this),5000); setTimeout($.proxy(this.wsconnect,this),5000);
} }
console.log('Произошло событие «close», нужно проверить что с соединением.'); console.log('Произошло событие «close», нужно проверить что с соединением.');