add english translation

This commit is contained in:
olevole
2017-02-07 12:26:10 +03:00
parent ddff7b3ba5
commit e3b714ade9
65 changed files with 3807 additions and 56 deletions

View File

@@ -7,6 +7,7 @@ class ClonOS
public $realpath_php='';
public $realpath_public='';
public $realpath_page='';
public $uri_chunks=array();
public $json_name='';
public $language='en';
public $language_file_loaded=false;
@@ -17,7 +18,7 @@ class ClonOS
private $_db=null;
private $_client_ip='';
private $_dialogs=array();
private $_cmd_array=array('jcreate','jstart','jstop','jrestart','jedit','jremove','jexport','jimport','jclone','madd','sstart','sstop','projremove','bcreate','bstart','bstop','brestart','bremove','vm_obtain','removesrc','srcup','removebase','world','repo');
private $_cmd_array=array('jcreate','jstart','jstop','jrestart','jedit','jremove','jexport','jimport','jclone','madd','sstart','sstop','projremove','bcreate','bstart','bstop','brestart','bremove','bclone','vm_obtain','removesrc','srcup','removebase','world','repo');
/*
public $projectId=0;
@@ -72,7 +73,7 @@ class ClonOS
}
}
function __construct($_REALPATH) # /usr/home/web/cp/clonos
function __construct($_REALPATH,$uri='') # /usr/home/web/cp/clonos
{
$this->_post=($_SERVER['REQUEST_METHOD']=='POST');
$this->_vars=$_POST;
@@ -87,6 +88,14 @@ class ClonOS
$this->realpath_public=$_REALPATH.'/public/';
# /usr/home/web/cp/clonos/public/
/*
if(!empty($uri))
{
$str=str_replace('/index.php','',$uri);
$this->uri_chunks=explode('/',$str);
}
*/
$translate_filename=$this->realpath_public.'/lang/'.$this->language.'.php';
$translate_filename_alt=$this->realpath_public.'/lang/en.php';
if(file_exists($translate_filename)) $t_filename=$translate_filename; else $t_filename=$translate_filename_alt;
@@ -109,6 +118,7 @@ class ClonOS
include('config.php');
include('db.php');
include('forms.php');
include('menu.php');
$this->_db_tasks=new Db('base','cbsdtaskd');
@@ -138,6 +148,9 @@ class ClonOS
case 'jailAdd':
echo json_encode($this->jailAdd());
return;break;
case 'jailClone':
echo json_encode($this->jailClone());
return;break;
case 'jailEdit':
echo json_encode($this->jailEdit());
return;break;
@@ -156,6 +169,10 @@ class ClonOS
case 'bhyveObtain':
echo json_encode($this->bhyveObtain());
return;break;
case 'bhyveClone':
echo json_encode($this->bhyveClone());
return;break;
case 'authkeyAdd':
echo json_encode($this->authkeyAdd());
@@ -456,6 +473,7 @@ class ClonOS
'bstop'=>'Stopping',
'brestart'=>'Restarting',
'bremove'=>'Removing',
'bclone'=>'Cloning',
'vm_obtain'=>'Creating',
'removesrc'=>'Removing',
'srcup'=>'Updating',
@@ -547,6 +565,7 @@ class ClonOS
$stat_array['bstop']=&$stat_array['jstop'];
$stat_array['brestart']=&$stat_array['jrestart'];
$stat_array['bremove']=&$stat_array['jremove'];
$stat_array['bclone']=&$stat_array['jclone'];
$stat_array['removesrc']=&$stat_array['jremove'];
$stat_array['removebase']=&$stat_array['jremove'];
@@ -638,7 +657,12 @@ class ClonOS
switch($task['operation'])
{
case 'jclone':
//$obj[$key]['new_ip']=$this->getJailIpOnJcloneEnd($key);
$res=$this->getJailInfo($obj[$key]['jail_id']);
if(isset($res['html'])) $obj[$key]['new_html']=$res['html'];
break;
case 'bclone':
$res=$this->getBhyveInfo($obj[$key]['jail_id']);
if(isset($res['html'])) $obj[$key]['new_html']=$res['html'];
break;
case 'repo':
$res=$this->fillRepoTr($obj[$key]['jail_id'],true,false);
@@ -658,6 +682,89 @@ class ClonOS
return $obj;
}
function jailClone()
{
$form=$this->_vars['form_data'];
$res=$this->cbsd_cmd('task owner=cbsdwebsys mode=new /usr/local/bin/cbsd jclone checkstate=0 old='.$form['oldJail'].' new='.$form['jname'].' host_hostname='.$form['host_hostname'].' ip4_addr='.$form['ip4_addr']);
$err='Jail is not create!';
$taskId=-1;
if($res['retval']==0)
{
$err='Jail was created!';
$taskId=$res['message'];
}else{
$err=$res['error'];
}
$html='';
$hres=$this->getTableChunk('jailslist','tbody');
if($hres!==false)
{
$html_tpl=$hres[1];
$vars=array(
'nth-num'=>'nth0', // исправить на актуальные данные!
'node'=>'local', // исправить на актуальные данные!
'ip4_addr'=>str_replace(',',',<wbr />',$form['ip4_addr']),
'jname'=>$form['jname'],
'jstatus'=>$this->translate('Cloning'),
'icon'=>'spin6 animate-spin',
'desktop'=>'s-on',
'maintenance'=>' maintenance',
'protected'=>'icon-cancel',
'protitle'=>$this->translate('Delete'),
'vnc_title'=>$this->translate('Open VNC'),
'reboot_title'=>$this->translate('Restart jail'),
);
foreach($vars as $var=>$val)
$html_tpl=str_replace('#'.$var.'#',$val,$html_tpl);
$html=$html_tpl;
}
return array('errorMessage'=>$err,'jail_id'=>$form['jname'],'taskId'=>$taskId,'mode'=>$this->mode,'html'=>$html);
}
function getJailInfo($jname)
{
$html='';
$db=new Db('base','local');
if($db!==false)
{
$jail=$db->selectAssoc("SELECT jname,ip4_addr,status,protected FROM jails WHERE jname='{$jname}'");
$hres=$this->getTableChunk('jailslist','tbody');
if($hres!==false)
{
$html_tpl=$hres[1];
// $status=$jail['status'];
$vars=array(
'nth-num'=>'nth0',
'node'=>'local',
'ip4_addr'=>str_replace(',',',<wbr />',$jail['ip4_addr']),
'jname'=>$jail['jname'],
'jstatus'=>$this->translate('Cloned'),
'icon'=>'spin6 animate-spin',
'desktop'=>' s-off',
'maintenance'=>' maintenance',
'protected'=>($jail['protected']==1)?'icon-lock':'icon-cancel',
'protitle'=>($jail['protected']==1)?' title="'.$this->translate('Protected jail').'"':' title="'.$this->translate('Delete').'"',
'vnc_title'=>$this->translate('Open VNC'),
'reboot_title'=>$this->translate('Restart jail'),
);
foreach($vars as $var=>$val)
$html_tpl=str_replace('#'.$var.'#',$val,$html_tpl);
$html.=$html_tpl;
}
}
$html=preg_replace('#<tr[^>]*>#','',$html);
$html=str_replace(array('</tr>',"\n","\r","\t"),'',$html);
return array('html'=>$html);
}
function jailAdd()
{
$form=$this->_vars['form_data'];
@@ -753,11 +860,26 @@ class ClonOS
$form=$this->_vars['form_data'];
if(!isset($form['jail_id'])) return array('error'=>true,'error_message'=>'Bad jail id!');
$err=false;
$db=new Db('base','local');
if($db!==false)
{
$query="SELECT jname,host_hostname,ip4_addr,allow_mount,interface,mount_ports,astart,vnet FROM jails WHERE jname='{$form['jail_id']}';";
$res['vars']=$db->selectAssoc($query);
}else{
$err=true;
}
if(empty($res['vars']))
{
$err=true;
}
if($err)
{
$res['error']=true;
$res['error_message']=$this->translate('Jail '.$form['jail_id'].' is not present.');
$res['jail_id']=$form['jail_id'];
$res['reload']=true;
return $res;
}
$res['error']=false;
@@ -812,19 +934,123 @@ class ClonOS
return $res;
}
function bhyveClone()
{
$form=$this->_vars['form_data'];
$res=$this->cbsd_cmd('task owner=cbsdwebsys mode=new /usr/local/bin/cbsd bclone checkstate=0 old='.$form['oldBhyve'].' new='.$form['vm_name']);
$err='Bhyve is not create!';
$taskId=-1;
if($res['retval']==0)
{
$err='Bhyve was created!';
$taskId=$res['message'];
}else{
$err=$res['error'];
}
$html='';
$hres=$this->getTableChunk('bhyveslist','tbody');
if($hres!==false)
{
$html_tpl=$hres[1];
$vars=array(
'nth-num'=>'nth0', // исправить на актуальные данные!
'node'=>'local', // исправить на актуальные данные!
'jname'=>$form['vm_name'],
'vm_ram'=>$form['vm_ram'],
'vm_cpus'=>$form['vm_cpus'],
'vm_os_type'=>$form['vm_os_type'],
'jstatus'=>$this->translate('Cloning'),
'icon'=>'spin6 animate-spin',
'desktop'=>'s-on',
'maintenance'=>' maintenance',
'protected'=>'icon-cancel',
'protitle'=>$this->translate('Delete'),
'vnc_title'=>$this->translate('Open VNC'),
'reboot_title'=>$this->translate('Restart VM'),
);
foreach($vars as $var=>$val)
$html_tpl=str_replace('#'.$var.'#',$val,$html_tpl);
$html=$html_tpl;
}
return array('errorMessage'=>$err,'vm_name'=>$form['vm_name'],'jail_id'=>$form['vm_name'],'taskId'=>$taskId,'mode'=>$this->mode,'html'=>$html);
}
function getBhyveInfo($jname)
{
$statuses=array('Not Launched','Launched','unknown-1','Maintenance','unknown-3','unknown-4','unknown-5','unknown-6');
$html='';
$db=new Db('base','local');
if($db!==false)
{
$bhyve=$db->selectAssoc("SELECT jname,vm_ram,vm_cpus,vm_os_type,hidden FROM bhyve WHERE jname='{$jname}'");
$hres=$this->getTableChunk('bhyveslist','tbody');
if($hres!==false)
{
$html_tpl=$hres[1];
$status=$this->check_vmonline($bhyve['jname']);
$vars=array(
'jname'=>$bhyve['jname'],
'nth-num'=>'nth0',
'desktop'=>'',
'maintenance'=>'',
'node'=>'local',
'vm_name'=>'',
'vm_ram'=>$this->fileSizeConvert($bhyve['vm_ram']),
'vm_cpus'=>$bhyve['vm_cpus'],
'vm_os_type'=>$bhyve['vm_os_type'],
'vm_status'=>$this->translate($statuses[$status]),
'desktop'=>($status==0)?' s-off':' s-on',
'icon'=>($status==0)?'play':'stop',
'protected'=>'icon-cancel',
'protitle'=>' title="'.$this->translate('Delete').'"',
'vnc_title'=>$this->translate('Open VNC'),
'reboot_title'=>$this->translate('Restart bhyve'),
);
foreach($vars as $var=>$val)
$html_tpl=str_replace('#'.$var.'#',$val,$html_tpl);
$html.=$html_tpl;
}
}
$html=preg_replace('#<tr[^>]*>#','',$html);
$html=str_replace(array('</tr>',"\n","\r","\t"),'',$html);
return array('html'=>$html);
}
function bhyveEditVars()
{
$form=$this->_vars['form_data'];
if(!isset($form['jail_id'])) return array('error'=>true,'error_message'=>'Bad jail id!');
$err=false;
$db=new Db('base','local');
if($db!==false)
{
$query="SELECT b.jname as vm_name,vm_cpus,vm_ram,vm_vnc_port as vnc_port,interface FROM bhyve as b inner join jails as j on b.jname=j.jname and b.jname='{$form['jail_id']}';";
//$query="SELECT jname as vm_name,vm_cpus,vm_ram,vm_vnc_port as vnc_port FROM bhyve WHERE jname='{$form['jail_id']}';";
$query="SELECT b.jname as vm_name,vm_cpus,vm_ram,vm_vnc_port,bhyve_vnc_tcp_bind,interface FROM bhyve as b inner join jails as j on b.jname=j.jname and b.jname='{$form['jail_id']}';";
$res['vars']=$db->selectAssoc($query);
$res['vars']['vm_ram']=$this->fileSizeConvert($res['vars']['vm_ram']);
}else{
$err=true;
}
if(empty($res['vars']))
{
$err=true;
}
if($err)
{
$res['error']=true;
$res['error_message']=$this->translate('Jail '.$form['jail_id'].' is not present.');
$res['jail_id']=$form['jail_id'];
$res['reload']=true;
return $res;
}
$res['error']=false;
@@ -847,7 +1073,7 @@ class ClonOS
$ram=str_ireplace('gb','g',$ram);
$form['vm_ram']=$ram;
$arr=array('vm_cpus','vm_ram','vnc_port','interface');
$arr=array('vm_cpus','vm_ram','bhyve_vnc_tcp_bind','vm_vnc_port','interface');
foreach($arr as $a)
{
if(isset($form[$a]))
@@ -896,6 +1122,8 @@ class ClonOS
'vm_efi'=>'uefi',
'vm_os_profile'=>$os_items['profile'],
'vm_guestfs'=>'',
'bhyve_vnc_tcp_bind'=>$form['bhyve_vnc_tcp_bind'],
'vm_vnc_port'=>$form['vm_vnc_port'],
);
/* create vm */

View File

@@ -3,6 +3,7 @@ class Db
{
private $_pdo=null;
private $_workdir='';
private $_filename='';
public $error=false;
public $error_message='';
@@ -10,6 +11,11 @@ class Db
$place = base (это базовый набор баз данных: local, nodes и т.д.)
$place = file (указываем конкретную базу данных по полному пути)
*/
function __destruct()
{
//if($this->_pdo) $this->_pdo->close();
}
function __construct($place='base',$database='')
{
$this->_workdir=getenv('WORKDIR'); // /usr/jails/
@@ -21,6 +27,12 @@ class Db
$connect='sqlite:'.$file_name;
}elseif($place=='file'){
}elseif($place=='helper'){
$file_name=$this->_workdir.'/formfile/'.$database.".sqlite";
$connect='sqlite:'.$file_name;
}elseif($place=='helpers'){
//$file_name=$this->_workdir.'/formfile/'.$database['jname'].'/helpers/'.$database.".sqlite";
//$connect='sqlite:'.$file_name;
}
/*
$databases=array(
@@ -69,13 +81,15 @@ class Db
}
*/
if(!file_exists($file_name))
if(!isset($file_name) || empty($file_name) || !file_exists($file_name))
{
$this->error=true;
$this->error_message='DB file not found!';
return false;
}
$this->_filename=$file_name;
if(!empty($connect))
{
try
@@ -97,6 +111,11 @@ class Db
return $this->_workdir;
}
function getFileName()
{
return $this->_filename;
}
function select($query)
{
if($quer=$this->_pdo->query($query))

View File

@@ -1,6 +1,4 @@
<?php
include_once($_REALPATH.'/db.php');
class Forms
{
private $name='';
@@ -15,6 +13,7 @@ class Forms
function generate()
{
if($this->db->error) return;
$query="select * from forms order by group_id asc, order_id asc";
$fields=$this->db->select($query);
//echo '<pre>';print_r($fields);

View File

@@ -43,7 +43,7 @@ class Menu
$this->html='<ul class="menu">'.PHP_EOL;
$qstr=trim($_SERVER['REQUEST_URI'],DIRECTORY_SEPARATOR);
$qstr=trim($_SERVER['REQUEST_URI'],'/');
$this->path=$qstr; //$_MENU_PATH
if(!empty($menu_config))foreach($menu_config as $key=>$val)
{

View File

@@ -428,6 +428,13 @@ thead td:first-child, td:first-child {
.tsimple tr.sel td {
background-color:#fefec0;
}
.tsimple td.vmiddle {
vertical-align:middle;
}
.tsimple tr.helper:hover {
background-color:#fcfccc;
cursor:pointer;
}
.wordwreck {
word-wrap:break-word;
}
@@ -622,6 +629,9 @@ dialog.new .new,
dialog.edit .edit {
display:inline-block;
}
dialog.new p.new {
display:block;
}
.dialog-close:before {
font-family:"clonos";
content:'\e820';
@@ -955,4 +965,48 @@ span.top-button::before {
.noty_bar {
box-shadow:3px 3px 3px rgba(0,0,0,.5);
}
/* PROGRESS LOADER START */
.spinner {
display:none;
width: 60px;
height: 60px;
background-color:#337ab7;
position:absolute;
top:50%;
left:50%;
-webkit-animation: sk-rotateplane 1.2s infinite ease-in-out;
animation: sk-rotateplane 1.2s infinite ease-in-out;
}
@-webkit-keyframes sk-rotateplane {
0% { -webkit-transform: perspective(120px) }
50% { -webkit-transform: perspective(120px) rotateY(180deg) }
100% { -webkit-transform: perspective(120px) rotateY(180deg) rotateX(180deg) }
}
@keyframes sk-rotateplane {
0% {
transform: perspective(120px) rotateX(0deg) rotateY(0deg);
-webkit-transform: perspective(120px) rotateX(0deg) rotateY(0deg)
} 50% {
transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg);
-webkit-transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg)
} 100% {
transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg);
-webkit-transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg);
}
}
/* PROGRESS LOADER END */
.warning {
background-color:#fff0f0;
padding:4px;
border:1px solid #d7a0a0;
}
strong {
font-weight:bold;
}

View File

@@ -0,0 +1,23 @@
<script type="text/javascript">
err_messages={
'vm_name':'<?php echo $this->translate("Can not be empty. Name must begin with a letter / a-z / and not have any special symbols: -,.=%");?>',
};
</script>
<dialog id="bhyve-clone" class="window-box new">
<h1>
<span class="new"><?php echo $this->translate('Clone Virtual Machine');?></span>
</h1>
<h2><?php echo $this->translate('Cloned Virtual Machine Settings');?></h2>
<form class="win" method="post" id="bhyveCloneSettings" onsubmit="return false;">
<div class="window-content">
<p>
<span class="field-name"><?php echo $this->translate('Virtual Machine name');?>:</span>
<input type="text" name="vm_name" value="" pattern="[^0-9]{1}[a-zA-Z0-9]{1,}" required="required" class="edit-disable" />
</p>
</div>
</form>
<div class="buttons">
<input type="button" value="<?php echo $this->translate('Clone');?>" class="new button ok-but" />
<input type="button" value="<?php echo $this->translate('Cancel');?>" class="button red cancel-but" />
</div>
</dialog>

View File

@@ -35,9 +35,14 @@ err_messages={
<span class="field-name"><?php echo $this->translate('VM RAM');?>:</span>
<input type="text" name="vm_ram" value="" pattern="^[0-9]+\s*(g|G|gb|GB|mb|MB|m|M)$" placeholder="1g" required="required" />
</p>
<p>
<span class="field-name"><?php echo $this->translate('VNC IP address');?>:</span>
<input type="radio" name="bhyve_vnc_tcp_bind" value="127.0.0.1" id="vncip0" checked="checked" class="inline"><label for="vncip0">127.0.0.1</label></radio>
<input type="radio" name="bhyve_vnc_tcp_bind" value="0.0.0.0" id="vncip1" class="inline"><label for="vncip1">0.0.0.0</label></radio>
</p>
<p>
<span class="field-name"><?php echo $this->translate('VNC PORT');?>:</span>
<input type="text" name="vnc_port" value="" placeholder="0" />
<input type="text" name="vm_vnc_port" value="" placeholder="0" maxlength="5" />
</p>
<!-- <p>
<span class="field-name"><?php echo $this->translate('CD-ROM ISO');?>:</span>
@@ -58,4 +63,3 @@ err_messages={
<input type="button" value="<?php echo $this->translate('Cancel');?>" class="button red cancel-but" />
</div>
</dialog>
<?php

View File

@@ -0,0 +1,36 @@
<script type="text/javascript">
err_messages={
'jname':'<?php echo $this->translate("Can not be empty. Name must begin with a letter / a-z / and not have any special symbols: -,.=%");?>',
'hostname':'<?php echo $this->translate("This field can not be empty");?>',
'ip':'<?php echo $this->translate("Write correct ip address, e.g: 10.0.0.2");?>',
};
</script>
<dialog id="jail-clone" class="window-box new">
<h1>
<span class="new"><?php echo $this->translate('Clone jail');?></span>
</h1>
<h2><?php echo $this->translate('Cloned Jail Settings');?></h2>
<form class="win" method="post" id="jailCloneSettings" onsubmit="return false;">
<div class="window-content">
<p class="warning" style="width:400px;">
<?php echo $this->translate('@clone_warning@'); ?>
</p>
<p>
<span class="field-name"><?php echo $this->translate('Jail name');?>:</span>
<input type="text" name="jname" value="" pattern="[^0-9]{1}[a-zA-Z0-9]{2,}" required="required" class="edit-disable" />
</p>
<p>
<span class="field-name"><?php echo $this->translate('Hostname');?> (FQDN):</span>
<input type="text" name="host_hostname" value="" required="required" />
</p>
<p>
<span class="field-name"><?php echo $this->translate('IP address');?>:</span>
<input type="text" name="ip4_addr" value="DHCP" pattern="^DHCP$|^(?:[0-9]{1,3}\.){3}[0-9]{1,3}(\/[\d]{1,3})?$" required="required" />
</p>
</div>
</form>
<div class="buttons">
<input type="button" value="<?php echo $this->translate('Clone');?>" class="new button ok-but" />
<input type="button" value="<?php echo $this->translate('Cancel');?>" class="button red cancel-but" />
</div>
</dialog>

View File

@@ -5,5 +5,6 @@
<li class="icon-docs" id="jddm-clone"> <?php echo $this->translate('clone');?></li>
<li class="icon-gift" id="jddm-export"> <?php echo $this->translate('export');?></li>
<li class="icon-cubes" id="jddm-helpers"> <?php echo $this->translate('helpers');?></li>
<li class="icon-edit" id="jddm-rename"> <?php echo $this->translate('rename');?></li>
</ul>
</div>

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 277 KiB

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill-opacity="1" color-rendering="auto" color-interpolation="auto" stroke="black" text-rendering="auto" stroke-linecap="square" width="330" stroke-miterlimit="10" stroke-opacity="1" shape-rendering="auto" fill="black" stroke-dasharray="none" font-weight="normal" stroke-width="1" height="156" font-family="'Dialog'" font-style="normal" stroke-linejoin="miter" font-size="12px" stroke-dashoffset="0" image-rendering="auto">
<!--Generated by ySVG 2.5-->
<defs id="genericDefs"/>
<g>
<defs id="defs1">
<linearGradient x1="580" gradientUnits="userSpaceOnUse" x2="780" y1="217.5" y2="217.5" id="linearGradient1" spreadMethod="reflect">
<stop stop-opacity="1" stop-color="rgb(255,204,0)" offset="0%"/>
<stop stop-opacity="1" stop-color="rgb(255,153,0)" offset="100%"/>
</linearGradient>
<clipPath clipPathUnits="userSpaceOnUse" id="clipPath1">
<path d="M0 0 L330 0 L330 156 L0 156 L0 0 Z"/>
</clipPath>
<clipPath clipPathUnits="userSpaceOnUse" id="clipPath2">
<path d="M465 202 L795 202 L795 358 L465 358 L465 202 Z"/>
</clipPath>
</defs>
<g fill="white" text-rendering="geometricPrecision" shape-rendering="geometricPrecision" transform="translate(-465,-202)" stroke="white">
<rect x="465" width="330" height="156" y="202" clip-path="url(#clipPath2)" stroke="none"/>
</g>
<g fill="url(#linearGradient1)" text-rendering="geometricPrecision" shape-rendering="geometricPrecision" transform="matrix(1,0,0,1,-465,-202)" stroke="url(#linearGradient1)">
<rect x="480" width="300" height="125" y="217.5" clip-path="url(#clipPath2)" stroke="none"/>
</g>
<g text-rendering="geometricPrecision" stroke-miterlimit="1.45" shape-rendering="geometricPrecision" font-family="sans-serif" transform="matrix(1,0,0,1,-465,-202)" stroke-linecap="butt">
<text x="606.4189" xml:space="preserve" y="284.1562" clip-path="url(#clipPath2)" stroke="none">No data</text>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 50 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 30 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 94 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 36 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 125 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 15 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 112 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 12 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 24 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 242 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 85 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 75 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 23 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><g fill="#008cdb"><path d="M188.318 424.399c0-11.935 9.674-21.609 21.617-21.609 11.926 0 21.6 9.675 21.6 21.609 0 11.927-9.674 21.601-21.6 21.601-11.943 0-21.617-9.674-21.617-21.601zM280.465 424.399c0-11.935 9.664-21.609 21.6-21.609 11.945 0 21.609 9.675 21.609 21.609 0 11.927-9.664 21.601-21.609 21.601-11.936 0-21.6-9.674-21.6-21.601z"/><path d="M418.986 66h-55.871c-19.428 0-26.246 6.029-31.984 10.587-30.264 24.092-63.666 73.34-75.131 90.968-11.475-17.628-44.867-66.876-75.141-90.968C175.123 72.029 168.305 66 148.885 66H93.006c-25.422 0-41.305 20.332-41.305 79.432v218.592c0 40.035 13.975 76.896 33.678 76.896h70.529c30.361 0-26.043-92.138-26.043-187.46v-21.91-1.454-3.964c0-31.142 6.703-60.03 22.877-47.022 55.277 44.478 52.732 177.298 81.02 177.298h44.476c28.277 0 25.742-132.82 81.02-177.298 16.174-13.008 22.877 15.881 22.877 47.022v27.328c0 95.322-56.404 187.46-26.051 187.46h70.527c19.713 0 33.688-36.86 33.688-76.896V145.432c0-59.1-15.881-79.432-41.313-79.432z"/></g></svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 829 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 829 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
public/images/logo/php.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

View File

@@ -1,12 +1,17 @@
<?php
$_REALPATH=realpath('../');
$uri=trim($_SERVER['REQUEST_URI'],'/');
include($_REALPATH.'/php/clonos.php');
$clonos=new ClonOS($_REALPATH);
$clonos=new ClonOS($_REALPATH,$uri);
$lang=$clonos->getLang();
$uri=trim($_SERVER['REQUEST_URI'],DIRECTORY_SEPARATOR);
$root=trim($_SERVER['DOCUMENT_ROOT'],DIRECTORY_SEPARATOR);
$_ds=DIRECTORY_SEPARATOR;
/*
$chunks=$clonos->uri_chunks;
if(!empty($chunks) && count($chunks)>1) $uri=$chunks[0];
*/
$file_path=$_ds.$root.$_ds.'pages'.$_ds.$uri.$_ds;
$file_name=$file_path.$lang.'.index.php';
$json_name=$file_path.'a.json.php';
@@ -78,6 +83,6 @@ if(isset($_languages))foreach($_languages as $lng=>$lngname)
</ul>
</div></header>
<div class="spinner"></div>
</body>
</html>

View File

@@ -3,6 +3,7 @@ var clonos={
tmp_jail_info:{},
manual_close_menu:false,
lastX:0,
oldHash:'',
start:function()
{
@@ -14,17 +15,38 @@ var clonos={
var rx=new RegExp(/([^\/]+)/g);
if(res=hash.match(rx))
{
/*
for(r in res)
{
var r1=res[r].split('-');
if(r1.length==2) args[args.length]={'var':r1[0],'val':r1[1]};
}
this.route(args);
*/
this.route(res);
}
},
route:function(args)
{
if(typeof args=='undefined') return;
this.onHashChange();
},
onHashChange:function(event)
{
var hash=location.hash;
if(hash=='')
{
$('#tab2').hide();
$('#tab1').show();
}else{
$('#tab1').hide();
$('#tab2').show();
}
this.loadData('getJsonPage',$.proxy(this.onLoadData,this));
},
addEvents:function()
{
$(window).on('hashchange',$.proxy(this.onHashChange,this));
$('#lng-sel').on('change',function(){document.cookie="lang="+$(this).val()+";path=/;";location.reload();});
$('#content').on('click',$.proxy(this.bodyClick,this));
$('.closer').on('click',$.proxy(this.closerClick,this));
@@ -109,12 +131,6 @@ var clonos={
return phrase;
},
route:function(args)
{
if(typeof args=='undefined') return;
//alert(args.length);
},
getTrIdsForCheck:function(table_id)
{
var ids=[];
@@ -265,7 +281,21 @@ var clonos={
}
}
}else{
if($('form#jailSettings').length>0)
if(id=='jail-clone')
{
var inp=$('form#jailCloneSettings input[name="jname"]');
var jid=$(inp).val();
if(this.isJnameExists('jailslist',jid))
{
inp.get(0).setCustomValidity(this.translate('This name is already exists!'));
inp.get(0).reportValidity();
return;
}
var posts=$('form#jailCloneSettings').serializeArray();
posts.push({'name':'oldJail','value':this.clonedOldName});
this.loadData('jailClone',$.proxy(this.onJailAdd,this),posts);
}
if(id=='jail-settings')
{
var jid=$('form#jailSettings input[name="jname"]').val();
this.trids=this.getTrIdsForCheck('jailslist'); // !!!
@@ -280,7 +310,7 @@ var clonos={
}
var pass1=$('form#jailSettings input[name="user_pw_root"]').val();
var pass2=$('form#jailSettings input[name="user_pw_root_1"]').val();
if(pass1!='' || pass2!='' && pass1!=pass2)
if(pass1!=pass2)
{
var inp=$('form#jailSettings input[name="user_pw_root"]').get(0);
inp.setCustomValidity(this.translate('Passwords must match!'));
@@ -307,6 +337,14 @@ var clonos={
inp.reportValidity();
return;
}
var port=$('form#bhyveSettings input[name="vm_vnc_port"]').val();
if(port!=0 && (port<1025 || port >65534))
{
var inp=$('form#bhyveSettings input[name="vm_vnc_port"]').get(0);
inp.setCustomValidity(this.translate('VNC Port must be in interval: 0,1025—65534!'));
inp.reportValidity();
return;
}
}
this.tmp_jail_info[jid]={};
this.tmp_jail_info[jid]['runasap']=0; // исправить на реальные данные!
@@ -323,6 +361,26 @@ var clonos={
var posts=$('form#bhyveObtSettings').serializeArray();
this.loadData('bhyveObtain',$.proxy(this.onJailAdd,this),posts);
}
if(id=='bhyve-clone')
{
var inp=$('form#bhyveCloneSettings input[name="vm_name"]');
var jid=$(inp).val();
if(this.isJnameExists('bhyveslist',jid))
{
inp.get(0).setCustomValidity(this.translate('This name is already exists!'));
inp.get(0).reportValidity();
return;
}
var vm_ram=$('#bhyveslist tr#'+this.clonedOldName+' .vm_ram').html();
var vm_cpus=$('#bhyveslist tr#'+this.clonedOldName+' .vm_cpus').html();
var vm_os_type=$('#bhyveslist tr#'+this.clonedOldName+' .vm_os_type').html();
var posts=$('form#bhyveCloneSettings').serializeArray();
posts.push({'name':'oldBhyve','value':this.clonedOldName});
posts.push({'name':'vm_ram','value':vm_ram});
posts.push({'name':'vm_cpus','value':vm_cpus});
posts.push({'name':'vm_os_type','value':vm_os_type});
this.loadData('bhyveClone',$.proxy(this.onJailAdd,this),posts);
}
if(id=='authkey')
{
var posts=$('form#authkeySettings').serializeArray();
@@ -347,7 +405,7 @@ var clonos={
var posts=$('form#repoSettings').serializeArray();
this.loadData('repoCompile',$.proxy(this.onJailAdd,this),posts);
}
}
},
fillFormDataOnChange:function(data)
@@ -366,6 +424,11 @@ var clonos={
}
}
},
isJnameExists:function(table,jname)
{
var trs=$('#'+table+' #'+jname);
return trs.length>0;
},
onJailAdd:function(data)
{
try{
@@ -387,6 +450,14 @@ var clonos={
var table='jailslist';
var operation='jcreate';
break;
case 'jailClone':
var table='jailslist';
var operation='jclone';
break;
case 'bhyveClone':
var table='bhyveslist';
var operation='bclone';
break;
case 'bhyveAdd':
var table='bhyveslist';
var operation='bcreate';
@@ -434,7 +505,7 @@ var clonos={
}
if(mode=='update')
{
var tr=trn; //$('tr#'+this.dotEscape(data.jail_id));
var tr=trn;
$(tr).addClass('busy');
$('.ops .icon-cnt span',tr).addClass('icon-spin6 animate-spin');
$('.jstatus',tr).html(data.txt_status);
@@ -571,10 +642,11 @@ var clonos={
$('dialog#jail-settings input[name="host_hostname"]').val(data.freejname+'.my.domain');
},
loadData:function(mode,return_func,arr)
loadData:function(mode,return_func,arr,spinner)
{
if(spinner!==false) $('.spinner').show();
var path='/json.php';
var posts={'mode':mode,'path':location.pathname};
var posts={'mode':mode,'path':location.pathname,'hash':window.location.hash};
//if(typeof this.helper!='undefined') posts['helper']=this.helper;
if(typeof arr=='object')
{
@@ -583,7 +655,7 @@ var clonos={
posts['form_data'][arr[n]['name']]=arr[n]['value'];
}
$.post(path,posts,
$.proxy(function(data){return_func(data);},this)
$.proxy(function(data){return_func(data);$('.spinner').hide();},this)
);
},
@@ -659,6 +731,14 @@ var clonos={
}
},
fillTab:function(data)
{
if(typeof data.html!='undefined')
{
$('#tab2').html(data.html);
}
},
enableWait:function(id,empty)
{
if(typeof empty=='undefined') empty=false;
@@ -871,7 +951,7 @@ var clonos={
}
var vars=JSON.stringify(this.tasks);
this.context.loadData('getTasksStatus',$.proxy(this.update,this),[{'name':'jsonObj','value':vars}]);
this.context.loadData('getTasksStatus',$.proxy(this.update,this),[{'name':'jsonObj','value':vars}],false);
},
update:function(data)
@@ -971,12 +1051,19 @@ var clonos={
case 'jcreate':
case 'bcreate':
case 'vm_obtain':
case 'jclone':
case 'bclone':
var disp='s-off';
if(typeof this.tmp_jail_info[id]!='undefined')
{
var runasap=this.tmp_jail_info[id]['runasap'];
if(runasap==1) disp='s-on';
}
if(task.new_html!='undefined')
{
$('#'+this.dotEscape(id)).html(task.new_html);
}
$('#'+id).removeClass('s-off').removeClass('s-on')
$('#'+id).addClass(disp).removeClass('busy').removeClass('maintenance');
this.enablePlay(id);
@@ -1026,7 +1113,7 @@ var clonos={
case 'jimport':
this.enablePlay(id);
break;
case 'jclone':
/* case 'jclone':
var num=this.getJailNumById(id);
var j=this.jailsList[num];
if(typeof j.task_status!='undefined')
@@ -1043,6 +1130,7 @@ var clonos={
}
this.currentPage='jails';
break;
*/
/*
case 'modremove':
case 'modinstall':
@@ -1237,7 +1325,7 @@ var clonos={
this.DDMenuSelect(elid);
return;break;
case 'jddm-clone':
alert('Клонируем! :)');
this.DDMenuSelect(elid);
return;break;
case 'jddm-export':
alert('Экспортируем! :)');
@@ -1351,6 +1439,11 @@ var clonos={
}
}
if(tblid=='instanceslist')
{
location.hash='#'+trid;
return;
}
/* if(target.tagName=='SPAN')
{
@@ -1522,21 +1615,63 @@ var clonos={
if(!dt)return;
var id=dt.id;
var table_id=dt.table_id;
var preloadVars=false;
switch(table_id)
{
case 'jailslist':
var dialog='jail-settings';
var mode='jailEditVars';
switch(elid)
{
case 'jddm-edit':
var dialog='jail-settings';
var mode='jailEditVars';
preloadVars=true;
break;
case 'jddm-clone':
var dialog='jail-clone';
var mode='jailClone';
this.clonedOldName=dt.id;
$('dialog#jail-clone input[name="jname"]').val(dt.id+'clone');
if($(dt.tr).hasClass('s-on'))
{
$('dialog#jail-clone .warning').show();
}else{
$('dialog#jail-clone .warning').hide();
}
break;
}
break;
case 'bhyveslist':
var dialog='bhyve-new';
var mode='bhyveEditVars';
switch(elid)
{
case 'jddm-edit':
var dialog='bhyve-new';
var mode='bhyveEditVars';
preloadVars=true;
break;
case 'jddm-clone':
var dialog='bhyve-clone';
var mode='bhyveClone';
this.clonedOldName=dt.id;
$('dialog#bhyve-clone input[name="vm_name"]').val(dt.id+'clone');
if($(dt.tr).hasClass('s-on'))
{
$('dialog#bhyve-clone .warning').show();
}else{
$('dialog#bhyve-clone .warning').hide();
}
break;
}
break;
}
this.DDMenuClose();
var posts=[{'name':'jail_id','value':id},{'name':'dialog','value':dialog},{'name':'elid','value':elid}];
this.loadData(mode,$.proxy(this.onDDMenuLoad,this),posts);
if(preloadVars)
{
var posts=[{'name':'jail_id','value':id},{'name':'dialog','value':dialog},{'name':'elid','value':elid}];
this.loadData(mode,$.proxy(this.onDDMenuLoad,this),posts);
}else{
this.dialogShow1(dialog);
}
},
onDDMenuLoad:function(data)
{
@@ -1549,6 +1684,11 @@ var clonos={
if(data.error)
{
this.notify(data.error_message,'error');
if(typeof data.reload!='undefined')
{
if(data.reload)
this.loadData('getJsonPage',$.proxy(this.onLoadData,this));
}
return;
}
}

View File

@@ -1,3 +1,50 @@
clonos.lang={
"Error": "Error",
"No data, add something": "No data, add something",
"available on the jail is not running": "available when jail is not running",
"Log is empty": "Log is empty",
"Exported jails": "Exported jails",
"Download": "Download",
"Jail is created": "Jail is created",
"Jail already launched": "Jail already launched",
"Jail already stopped": "Jail already stopped",
"Export not available on launched jail": "Export not available on launched jail",
"This field cannot be left blank": "This field cannot be left blank",
"You need to select one or more jails for clone": "You need to select one or more jails for clone",
"You want to restart selected jail! Are you sure?":"You want to restart selected jail! Are you sure?",
"You want to restart selected virtual machine! Are you sure?":"You want to restart selected virtual machine! Are you sure?",
"You want to delete selected jail! Are you sure?":"You want to delete selected jail! Are you sure?",
"You want to delete selected virtual machine! Are you sure?":"You want to delete selected virtual machine! Are you sure?",
"You want to delete selected authkey! Are you sure?":"You want to delete selected authkey! Are you sure?",
"Not running":"Not running",
"Not Launched":"Not Launched",
"Launched":"Launched",
"Stopping":"Stopping",
"Stopped":"Stopped",
"Removing":"Removing",
"Removed":"Removed",
"Creating":"Creating",
"Created":"Created",
"Starting":"Starting",
"Exporting":"Exporting",
"Cloning":"Cloning",
"Cloned":"Cloned",
"Restarting":"Restarting",
"Restarted":"Restarted",
"Update":"Update",
"Updating":"Updating",
"Updated":"Updated",
"Delete":"Delete",
"Save":"Save",
//"Create jail":"Создание контейнера",
//"Edit jail":"Редактирование параметров контейнера",
"end":"end",
"This name is already exists!":"This name is already exists!",
"Passwords must match!":"Passwords must match!",
}

View File

@@ -1,5 +1,129 @@
<?php
$lang=array(
'Settings'=>'Settings',
'Profile'=>'Profile',
'Support'=>'Support',
'Overview'=>'Overview',
'Summary Overview'=>'Summary Overview',
'Jails containers'=>'Jail containers',
'Jails containers control panel'=>'Jail containers control panel',
'Template for jail'=>'Template for jail',
'Helpers and wizard for containers'=>'Helpers and wizard for containers',
'Helpers of jails'=>'Helpers of jails',
'Virtual machine control panel'=>'Virtual machine control panel',
'Bhyve VMs'=>'Bhyve VMs',
'Virtual machine control panel'=>'Virtual machine control panel',
'Nodes'=>'Nodes',
'Nodes control panel'=>'Nodes control panel',
'Virtual Private Network'=>'Virtual Private Network',
'Manage for virtual private networks'=>'Manage for virtual private networks',
'Authkeys'=>'Authkeys',
'Manage for SSH auth key'=>'Manage for SSH auth key',
'Storage Media'=>'Storage Media',
'Virtual Media Manager'=>'Virtual Media Manager',
'Repository'=>'Repository',
'Remote repository'=>'Remote repository',
'FreeBSD Bases'=>'FreeBSD Bases',
'FreeBSD bases manager'=>'Управление базами FreeBSD',
'FreeBSD Sources'=>'FreeBSD Sources',
'FreeBSD sources manager'=>'FreeBSD sources manager',
'Jail Marketplace'=>'Jail Marketplace',
'Public remote containers marketplace'=>'Public remote containers marketplace',
'Bhyve Marketplace'=>'Bhyve Marketplace',
'Public remote virtual machine marketplace'=>'Public remote virtual machine marketplace',
'TaskLog'=>'TaskLog',
'System task log'=>'System task log',
'File not found'=>'File not found',
'Not Launched'=>'Not Launched',
'Starting'=>'Starting',
'Launched'=>'Launched',
'Creating'=>'Creating',
'Created'=>'Created',
'Stopping'=>'Stopping',
'Stopped'=>'Stopped',
'Removing'=>'Removing',
'Exporting'=>'Exporting',
'Cloning'=>'Cloning',
'Cloned'=>'Cloned',
'Restarting'=>'Restarting',
'Restarted'=>'Restarted',
'Maintenance'=>'Maintenance',
'Create jail'=>'Create jail',
'Edit jail'=>'Edit jail',
'Jail Settings'=>'Jail Settings',
'Jail name'=>'Jail name',
'Hostname'=>'Hostname',
'available on the jail is not running'=>'available on the jail is not running',
'IP address'=>'IP address',
'Root password'=>'Root password (optional)',
'Root password (again)'=>'Root password (again)',
'Description'=>'Description',
'Net Interface'=>'Net Interface',
'Parameters'=>'Parameters',
'Autostart'=>'Autostart',
'Autostart jail at system startup'=>'Autostart jail at system startup',
'Base writable'=>'Base writable',
'Virtual network stack (VIMAGE)'=>'Virtual network stack (VIMAGE)',
'Mount'=>'Mount',
'Enabled services'=>'Enabled services',
'Create'=>'Create',
'Cancel'=>'Cancel',
'Save'=>'Save',
'Delete'=>'Delete',
'Protected jail'=>'Protected jai',
'Open VNC'=>'Open VNC',
'Restart jail'=>'Restart jail',
'Restart bhyve'=>'Restart VM',
//err_messages
'Can not be empty. Name must begin with a letter / a-z / and not have any special symbols: -,.=%'=>'Can not be empty. Name must begin with a letter / a-z / and not have any special symbols: -,.=%',
'This field can not be empty'=>'This field can not be empty',
'Write correct ip address, e.g: 10.0.0.2'=>'Write correct ip address, e.g: 10.0.0.2',
'Password can not be less than 3 symbols'=>'Password can not be less than 3 symbols',
'Please retype password correctly'=>'Please retype password correctly',
'edit'=>'edit',
'clone'=>'clone',
'export'=>'export',
'helpers'=>'helpers',
'rename'=>'rename',
'default is'=>'default is',
'Create Virtual Machine'=>'Create Virtual Machine',
'Create Virtual Machine from Library'=>'Obtain Virtual Machine from Library',
'Virtual Machine Settings'=>'Virtual Machine Settings',
'Virtual Machine name'=>'Virtual Machine name',
'VM OS profile'=>'VM OS profile',
'Authkey'=>'Authkey',
'VM CPUs'=>'vCPU core',
'VM RAM'=>'RAM',
'VM Image size'=>'Image disk size',
'VNC PORT'=>'VNC port ( 0 - is auto )',
'VM Password'=>'Root password',
'Create Authkey'=>'Create Authkey',
'Authkey name'=>'Authkey name',
'Authkey'=>'Authkey',
'Open'=>'Open',
'Close'=>'Close',
'Get'=>'Get',
'Update'=>'Update',
'Updating'=>'Updating',
'Version'=>'Version',
'Version number'=>'Version number (e.g:: 11.1, 12)',
'Source'=>'Source',
'@clone_warning@'=>'<strong>ATTENTION!</strong> Cloning of the running container can lead to data inconsistency in clones (eg environment with active database). Stop the container for safe cloning or continue, if you are confident in the security operation!',
//''=>'',
);

View File

@@ -93,6 +93,7 @@ $lang=array(
'clone'=>'клонировать',
'export'=>'экспортировать',
'helpers'=>'хэлперы',
'rename'=>'переименовать',
'default is'=>'по-умолчанию',
@@ -123,5 +124,7 @@ $lang=array(
'Source'=>'Источник',
'@clone_warning@'=>'<strong>ВНИМАНИЕ!</strong> Клонирование запущенного контейнера может привести к неконсистентным данным клона (например окружение с активной базой данных). Остановите контейнер для безопасного клонирования или продолжайте, если вы уверены в безопасности операции!',
//''=>'',
);

View File

@@ -0,0 +1,19 @@
<?php
$clonos->useDialogs(array(
'authkey',
));
?>
<h1>List of authorization keys</h1>
<p>
<span class="top-button icon-plus id:authkey">Add new authkey</span>
</p>
<table class="tsimple" id="authkeyslist" width="100%">
<thead>
<td class="wdt-200 keyname">Name of key</td>
<td class="txtleft">Authkey body</td>
<td class="wdt-80">Action</td>
</thead>
<tbody></tbody>
</table>

View File

@@ -0,0 +1,28 @@
<?php
$clonos->useDialogs(array(
'bases',
'bases-repo',
));
?>
<h1>FreeBSD bases:</h1>
<p><span class="top-button icon-edit id:basescompile">Build for source code</span>
<span class="top-button icon-gift id:getrepo">Fetch from repository</span></p>
<table class="tsimple" id="baseslist" width="100%">
<thead>
<tr>
<th>Node name</th>
<th>Name</th>
<th class="wdt-80">Platform</th>
<th class="wdt-80">Arch</th>
<th class="wdt-80">TargetArch</th>
<th colspan="2" class="wdt-120">Ver</th>
<th class="wdt-80">Elf</th>
<th class="wdt-90">Action</th>
<th colspan="2" class="wdt-50">Action</th>
<th class="wdt-90">&nbsp;</th>
</tr>
</thead>
<tbody></tbody>
</table>

View File

@@ -4,7 +4,7 @@
<td class="txtleft">#jname#</td>
<td class="txtleft vm_ram">#vm_ram#</td>
<td class="vm_cpus">#vm_cpus#</td>
<td>#vm_os_type#</td>
<td class="vm_os_type">#vm_os_type#</td>
<td class="jstatus">#vm_status#</td>
<td class="ops" width="5"><span class="icon-cnt"><span class="icon-#icon#"></span></span></td>
<td width="5" class="op-settings"><span class="icon-cog"></span></td>

View File

@@ -1,19 +1,29 @@
<?php
$clonos->useDialogs(array(
$clonos->useDialogs(array(
'vnc-bhyve',
// 'jail-settings',
// 'jail-settings-config-menu',
'bhyve-new',
'bhyve-obtain',
'bhyve-clone',
'jail-settings-config-menu',
));
?>
<h1>Bhyve VMs</h1>
<p>
<span class="top-button icon-plus id:bhyve-new">New VMs from ISO</span>
<span class="top-button icon-plus id:bhyve-obtain">Obtain VMs</span>
<span class="top-button icon-plus id:bhyve-new">Create from ISO</span>
<span class="top-button icon-plus id:bhyve-obtain">Obtain from lib</span>
</p>
<table class="tsimple" id="bhyveslist" width="100%">
<thead>
<th class="wdt-120">Node name</th>
<th class="txtleft">VM</th>
<th class="txtleft wdt-70">RAM</th>
<th class="wdt-30">CPU</th>
<th class="wdt-100">OS type</th>
<th class="wdt-120">Status</th>
<th colspan="4" class="wdt-100">Action</th>
<th class="wdt-30">VNC</th>
</thead>
<tbody></tbody>
</table>

View File

@@ -3,6 +3,7 @@ $clonos->useDialogs(array(
'vnc-bhyve',
'bhyve-new',
'bhyve-obtain',
'bhyve-clone',
'jail-settings-config-menu',
));
?>

View File

@@ -0,0 +1,76 @@
<?php
if(!empty($this->_vars['hash']))
{
include('helpers.php');
return;
}
$sys_helpers=array(
'network','cbsd','bhyvenet','general','zfsinstall','userspw','sudo','natcfg','jconstruct',
);
$html='';
$arr=array();
$res=$this->cbsd_cmd('forms header=0');
if($res['retval']==0)
{
$empty_logo='/images/logo/empty.png';
$lst=explode("\n",$res['message']);
$n=0;
if(!empty($lst)) foreach($lst as $item)
{
if(!in_array($item,$sys_helpers))
{
$description='';
$db=new Db('helper',$item);
if($db!==false)
{
if($db->error)
{
$file_name=$db->getFileName();
if(!file_exists($file_name))
{
$res=$this->cbsd_cmd('forms module='.$item.' inter=0');
if($res['retval']==0)
{
$db=new Db('helper',$item);
}
}
}
if($db!==false && !$db->error) $res=$db->selectAssoc("select longdesc from system limit 1");
if(isset($res['longdesc'])) $description=$res['longdesc']; else $description=$this->translate('no data').'&hellip; ('.$file_name.')';
}
$hres=$this->getTableChunk('instances','tbody');
if($hres!==false)
{
$html_tpl=$hres[1];
$logo_file='images/logo/'.$item.'.png';
$logo=file_exists($this->realpath_public.$logo_file)?'/'.$logo_file:$empty_logo;
$vars=array(
'nth-num'=>'nth0',
'logo'=>$logo,
'name'=>$item,
'description'=>$description,
'opentitle'=>$this->translate('Open'),
);
foreach($vars as $var=>$val)
$html_tpl=str_replace('#'.$var.'#',$val,$html_tpl);
$html.=$html_tpl;
}
}
}
}
$html=str_replace(array('\n','\r','\t'),'',$html);
echo json_encode(array(
'tbody'=>$html,
'error'=>false,
'func'=>'fillTable',
'id'=>'instanceslist',
));

View File

@@ -0,0 +1,14 @@
<?php
$hash=preg_replace('/^#/','',$this->_vars['hash']);
$form=new Forms('php','local');
$res=$form->generate();
$html=$res['html'];
echo json_encode(array('html'=>$html,'func'=>'fillTab'));

View File

@@ -0,0 +1,7 @@
<tbody>
<tr class="#nth-num# helper" id="#name#">
<td class="txtleft"><img src="#logo#" width="150" /></td>
<td class="txtleft name vmiddle">#name#</td>
<td class="txtleft description vmiddle">#description#</td>
</tr>
</tbody>

View File

@@ -0,0 +1,23 @@
<?php
$clonos->useDialogs(array(
));
?>
<div id="tab1">
<h1>Шаблоны окружений:</h1>
<!-- p><span class="top-button icon-plus id:jail-settings">Создать контейнер</span></p-->
<table class="tsimple" id="instanceslist" width="100%">
<thead>
<tr>
<th class="txtleft wdt-150">Логотип</th>
<th class="txtleft wdt-100">Название</th>
<th>Описание</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<div id="tab2"></div>

View File

@@ -3,6 +3,7 @@ $clonos->useDialogs(array(
'vnc',
'jail-settings',
'jail-settings-config-menu',
'jail-clone',
));
?>
<h1>Jail containers:</h1>
@@ -11,12 +12,14 @@ $clonos->useDialogs(array(
<table class="tsimple" id="jailslist" width="100%">
<thead>
<th>Node</th>
<th class="txtleft">Jail name</th>
<th class="txtleft">IP Address</th>
<th>Status</th>
<th colspan="4">Action</th>
<th>VNC</th>
<tr>
<th class="wdt-200 elastic">Node name</th>
<th class="txtleft">Jail</th>
<th class="txtleft wdt-200">IP-address</th>
<th class="wdt-120">Status</th>
<th colspan="4" class="wdt-100">Action</th>
<th class="wdt-30">VNC</th>
</tr>
</thead>
<tbody></tbody>
</table>

View File

@@ -3,6 +3,7 @@ $clonos->useDialogs(array(
'vnc',
'jail-settings',
'jail-settings-config-menu',
'jail-clone',
));
?>
<h1>Контейнеры:</h1>

View File

@@ -0,0 +1,21 @@
<?php
$section_name='media';
$clonos->useDialogs(array(
$section_name,
));
?>
<h1>Subnet list</h1>
<p>
<span class="top-button icon-plus id:<?php echo $section_name;?>">Add ISO</span>
</p>
<table class="tsimple" id="<?php echo $section_name;?>slist" width="100%">
<thead>
<td class="wdt-200 keyname">Storage name</td>
<td class="txtleft">Path</td>
<td class="wdt-80">Action</td>
</thead>
<tbody></tbody>
</table>

View File

@@ -51,6 +51,6 @@ if($res_array['average']>0)
$res_array['average']=$this->GhzConvert($res_array['average']/($res_array['num-nodes']?:1));
}
$res_array['sum-ram']=$this->fileSizeConvert($res_array['sum-ram']*1024);
$res_array['sum-ram']=$this->fileSizeConvert($res_array['sum-ram']*1024*1024,1024,true);
echo json_encode($res_array);

View File

@@ -23,7 +23,7 @@
<p>It is an open source and free product which powered by other project (major importance list):</p>
<ul>
<li><a href="https://www.bsdstore.ru/" target="_blank">CBSD Project</a> FreeBSD OS virtual environment management framework</li>
<li><a href="https://www.freebsd.org/" target="_blank">FreeBSD Project</a> FreeBSD is an advanced computer operating system</li>
<li><a href="https://www.freebsd.org/" target="_blank">FreeBSD Project</a> FreeBSD is a free and open source Unix-like operating system descended from Research Unix created in <a href="https://en.wikipedia.org/wiki/Berkeley_Software_Distribution">University of California, Berkeley, U.S.</a></li>
<li><a href="https://puppet.com/" target="_blank">Puppet</a> Puppet is an open-source configuration management tool.</li>
<li>and many other..</li>
</ul>

View File

@@ -23,7 +23,7 @@
<p>Это открытый и свободный проект, использующий в своей работе такие проекты, как (наиболее значимые):</p>
<ul>
<li><a href="https://www.bsdstore.ru/" target="_blank">CBSD Project</a> Фреймворк для управления виртуальными окружениями FreeBSD ОС</li>
<li><a href="https://www.freebsd.org/" target="_blank">FreeBSD Project</a> свободная Unix-подобная операционная система, потомок AT&T Unix по линии BSD, созданной в университете Беркли</li>
<li><a href="https://www.freebsd.org/" target="_blank">FreeBSD Project</a> свободная Unix-подобная операционная система, потомок AT&T Unix по линии BSD, созданной в <a href="https://en.wikipedia.org/wiki/Berkeley_Software_Distribution">Калифорнийском университете Беркли, США</a></li>
<li><a href="https://puppet.com/" target="_blank">Puppet</a> Система управления конфигурациями</li>
<li>и много остального..</li>
</ul>

View File

@@ -0,0 +1,24 @@
<?php
$clonos->useDialogs(array(
'src-get',
// 'jail-settings',
// 'jail-settings-config-menu',
));
?>
<h1>FreeBSD source codes:</h1>
<p><span class="top-button icon-docs id:srcget">Get version</span></p>
<table class="tsimple" id="srcslist" width="100%">
<thead>
<tr>
<th>Node name</th>
<th colspan="2" class="wdt-150">Ver</th>
<th class="wdt-100">Rev</th>
<th class="wdt-150">Update date</th>
<th colspan="3" class="wdt-100">Action</th>
<th class="wdt-120">Status</th>
</tr>
</thead>
<tbody></tbody>
</table>

View File

@@ -0,0 +1,22 @@
<?php
$clonos->useDialogs(array(
'tasklog',
));
?>
<h1>Task logs</h1>
<p><span class="top-button icon-trash-empty id:flushlog">Flush log</span></p>
<table class="tsimple" id="taskloglist" width="100%">
<thead><tr>
<th class="wdt-50 keyname">Task ID</th>
<th class="wdt-80">Log file</th>
<th class="txtleft">CMD</th>
<th class="wdt-130">Start time</th>
<th class="wdt-130">End time</th>
<th class="wdt-50">Status</th>
<th class="wdt-50">Error code</th>
<th class="wdt-50">Log size</th>
</tr></thead>
<tbody></tbody>
</table>

View File

@@ -0,0 +1,19 @@
<?php
$clonos->useDialogs(array(
'vpnet',
));
?>
<h1>Subnet list</h1>
<p>
<span class="top-button icon-plus id:vpnet">Add subnet</span>
</p>
<table class="tsimple" id="vpnetslist" width="100%">
<thead><tr>
<th class="wdt-200 keyname">Name of subnet</th>
<th class="txtleft">Subnet</th>
<th class="wdt-80">Action</th>
</tr></thead>
<tbody></tbody>
</table>

View File

@@ -67,7 +67,7 @@ jprofile="default";
swapsize="";
#vm_iso_path="Windows-10-x64"; # must be merged from CBSD profiles
vm_guestfs="#vm_guestfs#";
vm_vnc_port="0";
vm_vnc_port="#vm_vnc_port#";
#bhyve_generate_acpi="1"; # must be merged from CBSD profiles
#bhyve_wire_memory="0"; # must be merged from CBSD profiles
@@ -79,5 +79,5 @@ vm_vnc_port="0";
cd_vnc_wait="1";
bhyve_vnc_resolution="1024x768";
bhyve_vnc_tcp_bind="127.0.0.1";
bhyve_vnc_tcp_bind="#bhyve_vnc_tcp_bind#";