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

View File

@@ -965,7 +965,7 @@ td.error {
.tasklog {
width:60%;
max-width:60%;
margin-left:-30% !important;
/*margin-left:-30% !important;*/
left:50%;
}
.tasklog .window-content {
@@ -1614,3 +1614,14 @@ body.overview div.smoothie-chart-tooltip {
width:260px;
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="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>
</html>
<?php //print_r($clonos->userGetInfo()); ?>

View File

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