mirror of
https://github.com/myvesta/vesta.git
synced 2025-03-12 04:35:23 -07:00
Merge branch 'master' of github.com:serghey-rodin/vesta
This commit is contained in:
commit
d5361b6f70
63
web/css/popup.css
Normal file
63
web/css/popup.css
Normal file
@ -0,0 +1,63 @@
|
||||
/* Styles for popups */
|
||||
.d-popup{
|
||||
position:absolute;
|
||||
top:100px;
|
||||
left:0;
|
||||
z-index:100;
|
||||
background-color:#ccc;
|
||||
background:url(../images/info-popup-bg-2.png) repeat;
|
||||
|
||||
width:250px;
|
||||
|
||||
border-radius: 10px;
|
||||
-moz-border-radius: 10px;
|
||||
-webkit-border-radius: 10px;
|
||||
}
|
||||
.d-popup-inner{
|
||||
padding:20px;
|
||||
}
|
||||
.d-popup .close{
|
||||
position:absolute;
|
||||
top:10px;
|
||||
right:10px;
|
||||
|
||||
display:block;
|
||||
width:13px;
|
||||
height:13px;
|
||||
background:url(../images/info-popup-sprite.png) no-repeat;
|
||||
cursor:pointer;
|
||||
}
|
||||
.d-popup span.close:hover{
|
||||
background-position:0 -13px;
|
||||
}
|
||||
.d-popup span.close:active{
|
||||
background-position:0 -26px;
|
||||
}
|
||||
|
||||
.d-popup-title{
|
||||
font-size:11px;
|
||||
text-transform:uppercase;
|
||||
text-align:center;
|
||||
color:#fffdd4;
|
||||
margin:0 0 9px;
|
||||
}
|
||||
.d-popup-items{
|
||||
font-size:12px;
|
||||
color:#fff;
|
||||
}
|
||||
.d-popup-items .item{
|
||||
margin:0 0 9px;
|
||||
}
|
||||
.d-popup-items a{
|
||||
color:#aaa;
|
||||
padding-right:5px;
|
||||
}
|
||||
.d-popup .prop-box{
|
||||
display:block;
|
||||
}
|
||||
.d-popup .prop-title{
|
||||
color:#bbb;
|
||||
}
|
||||
.d-popup .prop-value{
|
||||
color:#fff;
|
||||
}
|
BIN
web/images/Asteroid_Vesta.jpg
Normal file
BIN
web/images/Asteroid_Vesta.jpg
Normal file
Binary file not shown.
After ![]() (image error) Size: 193 KiB |
BIN
web/images/auth-plus.png
Normal file
BIN
web/images/auth-plus.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 252 B |
BIN
web/images/checkbox-1.png
Normal file
BIN
web/images/checkbox-1.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 536 B |
BIN
web/images/dotted.gif
Normal file
BIN
web/images/dotted.gif
Normal file
Binary file not shown.
After ![]() (image error) Size: 44 B |
BIN
web/images/form-group-collapsed.png
Normal file
BIN
web/images/form-group-collapsed.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 288 B |
BIN
web/images/form-group-expanded.png
Normal file
BIN
web/images/form-group-expanded.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 268 B |
BIN
web/images/info-popup-bg-2.png
Normal file
BIN
web/images/info-popup-bg-2.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 933 B |
BIN
web/images/info-popup-bg.png
Normal file
BIN
web/images/info-popup-bg.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 933 B |
BIN
web/images/info-popup-sprite.png
Normal file
BIN
web/images/info-popup-sprite.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 2.2 KiB |
BIN
web/images/stats-brace.png
Normal file
BIN
web/images/stats-brace.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 965 B |
@ -8,6 +8,7 @@
|
||||
|
||||
<link rel="stylesheet" media="all" type="text/css" href="css/reset2.css" />
|
||||
<link rel="stylesheet" media="all" type="text/css" href="css/main.css" />
|
||||
<link rel="stylesheet" media="all" type="text/css" href="css/popup.css" />
|
||||
|
||||
<!--[if lt IE 8]>
|
||||
<link rel="stylesheet" type="text/css" href="http://dl.dropbox.com/u/1750887/projects/vesta2/css/ie.css" />
|
||||
@ -52,7 +53,6 @@
|
||||
<h1 class="logo"><a href="#">Vesta panel <span> </span></a></h1>
|
||||
</div>
|
||||
<ul class="settings">
|
||||
|
||||
<li><a href="#">settings</a></li>
|
||||
<li><a href="#">exit</a></li>
|
||||
</ul>
|
||||
@ -64,11 +64,11 @@
|
||||
<dl class="users-nav-item">
|
||||
<dt class="section-title cc">
|
||||
<span class="to-section">Users</span>
|
||||
<i class="add-entry"> </i>
|
||||
<i class="add-entry do_action_new_entry"> </i>
|
||||
</dt>
|
||||
<dd class="section-contains">
|
||||
<span class="def">0 users</span>
|
||||
<span class="def">0 blocked</span>
|
||||
<span class="def"><span class="num-total">0</span> users</span>
|
||||
<span class="def"><span class="num-blocked">0</span> blocked</span>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
@ -80,12 +80,11 @@
|
||||
<dl class="users-nav-item">
|
||||
<dt class="section-title cc">
|
||||
<span class="to-section">Web Domain</span>
|
||||
<i class="add-entry"> </i>
|
||||
<i class="add-entry do_action_new_entry"> </i>
|
||||
</dt>
|
||||
<dd class="section-contains">
|
||||
<span class="def">0 users</span>
|
||||
<span class="def">0 blocked</span>
|
||||
<span class="def">3 waiting</span>
|
||||
<span class="def"><span class="num-total">0</span> web domains</span>
|
||||
<span class="def"><span class="num-blocked">0</span> blocked</span>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
@ -95,12 +94,10 @@
|
||||
<dl class="users-nav-item">
|
||||
<dt class="section-title cc">
|
||||
<span class="to-section">Mail</span>
|
||||
<i class="add-entry"> </i>
|
||||
<i class="add-entry do_action_new_entry"> </i>
|
||||
</dt>
|
||||
<dd class="section-contains">
|
||||
<span class="def">0 users</span>
|
||||
<span class="def">0 blocked</span>
|
||||
<span class="def">3 waiting</span>
|
||||
<span class="def"><span class="num-total">0</span> mails</span>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
@ -110,12 +107,11 @@
|
||||
<dl class="users-nav-item">
|
||||
<dt class="section-title cc">
|
||||
<span class="to-section">DB</span>
|
||||
<i class="add-entry"> </i>
|
||||
<i class="add-entry do_action_new_entry"> </i>
|
||||
</dt>
|
||||
<dd class="section-contains">
|
||||
<span class="def">0 users</span>
|
||||
<span class="def">0 blocked</span>
|
||||
<span class="def">3 waiting</span>
|
||||
<span class="def"><span class="num-total">0</span> databases</span>
|
||||
<span class="def"><span class="num-blocked">0</span> blocked</span>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
@ -125,7 +121,7 @@
|
||||
<dl class="users-nav-item">
|
||||
<dt class="section-title cc">
|
||||
<span class="to-section">DNS</span>
|
||||
<i class="add-entry"> </i>
|
||||
<i class="add-entry do_action_new_entry"> </i>
|
||||
</dt>
|
||||
<dd class="section-contains">
|
||||
<span class="def total_dns_records">0 total records</span>
|
||||
@ -138,12 +134,11 @@
|
||||
<dl class="users-nav-item">
|
||||
<dt class="section-title cc">
|
||||
<span class="to-section">IP</span>
|
||||
<i class="add-entry"> </i>
|
||||
<i class="add-entry do_action_new_entry"> </i>
|
||||
</dt>
|
||||
<dd class="section-contains">
|
||||
<span class="def">0 users</span>
|
||||
<span class="def">0 blocked</span>
|
||||
<span class="def">3 waiting</span>
|
||||
<span class="def"><span class="num-total">0</span> ip entries</span>
|
||||
<span class="def"><span class="num-blocked">0</span> blocked</span>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
@ -153,12 +148,11 @@
|
||||
<dl class="users-nav-item">
|
||||
<dt class="section-title cc">
|
||||
<span class="to-section">Cron</span>
|
||||
<i class="add-entry"> </i>
|
||||
<i class="add-entry do_action_new_entry"> </i>
|
||||
</dt>
|
||||
<dd class="section-contains">
|
||||
<span class="def">0 users</span>
|
||||
<span class="def">0 blocked</span>
|
||||
<span class="def">3 waiting</span>
|
||||
<span class="def"><span class="num-total">0</span> cron records</span>
|
||||
<span class="def"><span class="num-blocked">0</span> blocked</span>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
@ -190,7 +184,12 @@
|
||||
<div class="b-console-results"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="actions-toolbar" class="cc"><a class="add-domain do_action_new_entry" href="javascript:void(0)"><i class="icon do_action_new_entry"> </i>add new domain</a></div>
|
||||
<div id="actions-toolbar" class="cc">
|
||||
<a class="add-domain do_action_new_entry" href="javascript:void(0)">
|
||||
<i class="icon do_action_new_entry"> </i>
|
||||
add new entry
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
|
@ -15,6 +15,7 @@ App.Constants.DNS_FORM_ID = 'dns-form';
|
||||
App.Constants.USER_FORM_ID = 'user-form';
|
||||
App.Constants.WEB_DOMAIN_FORM_ID = 'web_domain-form';
|
||||
App.Constants.DB_FORM_ID = 'db-form';
|
||||
App.Constants.CRON_FORM_ID = 'cron-form';
|
||||
|
||||
App.Settings.ajax_url = 1;
|
||||
App.Settings.uri = location.href.replace('index.html', '');
|
||||
|
@ -135,6 +135,7 @@ App.Actions.cancel_form = function(evt, params) {
|
||||
$('#' + form_id).remove();
|
||||
}
|
||||
else {
|
||||
fb.warn(elm.find('.source').val());
|
||||
var options = App.Helpers.evalJSON(elm.find('.source').val());
|
||||
var entry_name = App.Env.world.toLowerCase() + '_entry';
|
||||
var tpl = App.HTML.Build[entry_name](options);
|
||||
|
@ -189,13 +189,15 @@ App.Ajax.request = function(jedi_method, data, callback)
|
||||
type: data.request_method || "POST",
|
||||
data: $.extend(data, {'jedi_method': jedi_method}),
|
||||
dataType: "text",
|
||||
async:true,
|
||||
async: true,
|
||||
success: function(reply)
|
||||
{
|
||||
timer.start();
|
||||
reply = reply.replace(/\\'/gi, '');
|
||||
reply = reply.replace(/\'/gi, '');
|
||||
//timer.start();
|
||||
callback && callback(jsonParse(reply));
|
||||
App.Helpers.afterAjax();
|
||||
timer.stop(jedi_method);
|
||||
//timer.stop(jedi_method);
|
||||
},
|
||||
error: function()
|
||||
{
|
||||
|
@ -70,13 +70,21 @@ App.Helpers.getFirstKey = function(obj)
|
||||
App.Helpers.updateInitial = function()
|
||||
{
|
||||
// TODO: need api method
|
||||
$.each(App.Env.initialParams, function(key) {
|
||||
var item = App.Env.initialParams[key];
|
||||
$.each(item, function (i, o) {
|
||||
if (i.indexOf('total_') != -1) {
|
||||
App.View.updateInitialInfo(i, o);
|
||||
$.each(App.Env.initialParams.totals, function(key) {
|
||||
var item = App.Env.initialParams.totals[key];
|
||||
var expr_id = '#'+key;
|
||||
if ('undefined' != typeof item.total) {
|
||||
var ref = $(expr_id).find('.num-total');
|
||||
if (ref.length > 0) {
|
||||
$(ref).html(item.total);
|
||||
}
|
||||
});
|
||||
}
|
||||
if ('undefined' != typeof item.blocked) {
|
||||
var ref = $(expr_id).find('.num-blocked');
|
||||
if (ref.length > 0) {
|
||||
$(ref).html(item.blocked);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -123,14 +131,17 @@ App.Helpers.getFirstValue = function(obj)
|
||||
return first;
|
||||
}
|
||||
|
||||
App.Helpers.evalJSON = function(string)
|
||||
App.Helpers.evalJSON = function(str)
|
||||
{
|
||||
return $.parseJSON(string);
|
||||
/*str = str.replace(/\\'/gi, '');
|
||||
str = str.replace(/\'/gi, '');
|
||||
fb.warn(str);*/
|
||||
return $.parseJSON(str);
|
||||
}
|
||||
|
||||
App.Helpers.toJSON = function(object)
|
||||
{
|
||||
return ($.toJSON(object).replace(/'/gi, ''));
|
||||
{
|
||||
return ($.toJSON(object).replace(/\\'/gi, ''));
|
||||
}
|
||||
|
||||
|
||||
|
@ -357,6 +357,38 @@ App.HTML.Build.cron_entry = function(o, key)
|
||||
|
||||
return tpl.finalize();
|
||||
}
|
||||
|
||||
|
||||
App.HTML.Build.cron_form = function(options, id)
|
||||
{try{
|
||||
if('undefined' == typeof App.Env.initialParams) {
|
||||
return alert('PLease wait a bit. Some background processes are not yet executed. Thank you for patience.');
|
||||
}
|
||||
var tpl = App.Templates.get('FORM', 'cron');
|
||||
tpl.set(':source', options);
|
||||
tpl.set(':id', id || '');
|
||||
options = App.Helpers.evalJSON(options) || {};
|
||||
if (App.Helpers.isEmpty(options)) {
|
||||
tpl.set(':title', 'New cron entry');
|
||||
tpl.set(':save_button', 'ADD');
|
||||
}
|
||||
else {
|
||||
tpl.set(':title', 'Edit cron entry');
|
||||
tpl.set(':save_button', 'SAVE');
|
||||
}
|
||||
|
||||
options = !App.Helpers.isEmpty(options) ? options : {DAY:'', MONTH: '', WDAY:'',HOUR:'',CMD:'',MIN:''};
|
||||
tpl = App.HTML.setTplKeys(tpl, options);
|
||||
|
||||
/*tpl.set(':id', id || '');
|
||||
tpl.set(':IP_ADDRESS', options.IP_ADDRESS || '');
|
||||
tpl.set(':NETMASK', options.NETMASK || '');
|
||||
tpl.set(':NAME', options.NAME || '');*/
|
||||
|
||||
//tpl = App.HTML.Build.ip_selects(tpl, options);
|
||||
}catch(e){fb.error(e);}
|
||||
return tpl.finalize();
|
||||
}
|
||||
|
||||
|
||||
App.HTML.Build.dns_records = function(records)
|
||||
|
@ -21,7 +21,7 @@ App.Model.WEB_DOMAIN.loadList = function()
|
||||
App.Model.MAIL.loadList = function()
|
||||
{
|
||||
//App.Ajax.request('MAIL.getList', {}, App.View.listItems);
|
||||
App.Ref.CONTENT.html('<center><h1 style="padding-top: 20px;font-size: 28px;">Under maintanance</h1></center>');
|
||||
App.Ref.CONTENT.html('<center><h1 style="padding-top: 20px; font-size: 28px; position: absolute; margin-left: 351px; color: white; text-shadow: 2px 1px 1px rgb(65, 124, 213);">Under maintanance</h1><img width="900px" src="http://dev.vestacp.com:8083/images/Asteroid_Vesta.jpg"></center>');
|
||||
}
|
||||
|
||||
App.Model.DB.loadList = function()
|
||||
|
@ -1,7 +1,7 @@
|
||||
App.Pages.init = function(){
|
||||
App.Ajax.request('MAIN.getInitial', {}, function(reply){
|
||||
App.Env.initialParams = reply.data;
|
||||
//App.Helpers.updateInitial();
|
||||
App.Helpers.updateInitial();
|
||||
});
|
||||
|
||||
App.Pages.prepareHTML();
|
||||
|
@ -44,7 +44,7 @@ App.Templates.html = {
|
||||
dns: {
|
||||
FORM: [
|
||||
'<div style="margin-top: 25px;" class="b-new-entry b-new-entry_dns" id="~!:id~!">\
|
||||
<input type="hidden" name="source" class="source" value=\'~!:source~!\'>\
|
||||
<input type="hidden" name="source" class="source" value=~!:source~!>\
|
||||
<input type="hidden" name="target" class="target" value=\'\'>\
|
||||
<div class="entry-header">~!:title~!</div>\
|
||||
<div class="errors">\
|
||||
@ -86,8 +86,8 @@ App.Templates.html = {
|
||||
],
|
||||
ENTRIES_WRAPPER: ['<div class="dns-list items-list">~!:content~!</div>'],
|
||||
ENTRY: ['<div class="row dns-details-row ~!:CHECKED~!">\
|
||||
<input type="hidden" name="source" class="source" value=\'~!:source~!\'>\
|
||||
<input type="hidden" class="target" name="target" value="" />\
|
||||
<input type="hidden" name="source" class="source" value=~!:source~! />\
|
||||
<input type="hidden" class="target" name="target" value=\'\' />\
|
||||
<div class="row-actions-box cc">\
|
||||
<div class="check-this check-control"></div>\
|
||||
<div class="row-operations">\
|
||||
@ -763,9 +763,66 @@ App.Templates.html = {
|
||||
</div>']
|
||||
},
|
||||
cron: {
|
||||
FORM: ['<div class="b-new-entry b-new-entry_cron" id="~!:id~!" >\
|
||||
<input type="hidden" name="source" class="source" value=\'~!:source~!\'>\
|
||||
<input type="hidden" name="target" class="target" value=\'\'>\
|
||||
<div class="entry-header">~!:title~!</div>\
|
||||
<div class="form-error">\
|
||||
<div class="error-box">\
|
||||
</div>\
|
||||
</div>\
|
||||
<div class="form-row form-row-line run-at-box cc">\
|
||||
<span class="row-header">run at:</span>\
|
||||
<div class="field-box cron-minute-box">\
|
||||
<label for="#" class="field-label">minute:<br>(0—59)</label>\
|
||||
<div class="field-box-inner cc">\
|
||||
<input type="text" value="~!:MIN~!" name="MIN" class="text-field">\
|
||||
</div>\
|
||||
</div>\
|
||||
<div class="field-box cron-hour-box">\
|
||||
<label for="#" class="field-label">hour:<br>(0—23)</label>\
|
||||
<div class="field-box-inner cc">\
|
||||
<input type="text" value="~!:HOUR~!" name="HOUR" class="text-field">\
|
||||
</div>\
|
||||
</div>\
|
||||
<div class="field-box cron-day-box">\
|
||||
<label for="#" class="field-label">day of Month:<br>(1—31)</label>\
|
||||
<div class="field-box-inner cc">\
|
||||
<input type="text" value="~!:DAY~!" name="DAY" class="text-field">\
|
||||
</div>\
|
||||
</div>\
|
||||
<div class="field-box cron-month-box">\
|
||||
<label for="#" class="field-label">Month:<br>(1—12)(Jan—Dec)</label>\
|
||||
<div class="field-box-inner cc">\
|
||||
<input type="text" value="~!:MONTH~!" name="MONTH" class="text-field">\
|
||||
</div>\
|
||||
</div>\
|
||||
<div class="field-box cron-week-box">\
|
||||
<label for="#" class="field-label">day of Week:<br>(1—7)(Sun—Sat)</label>\
|
||||
<div class="field-box-inner cc">\
|
||||
<input type="text" value="~!:WDAY~!" name="WDAY" class="text-field">\
|
||||
</div>\
|
||||
</div>\
|
||||
</div>\
|
||||
<div class="form-row cc">\
|
||||
<label for="#" class="field-label">command:</label>\
|
||||
<textarea class="textarea" name="CMD">~!:CMD~!</textarea>\
|
||||
</div>\
|
||||
<div class="form-row cc">\
|
||||
<label for="#" class="field-label">report to: <span class="remark">(devide by comma ",")</span></label>\
|
||||
<textarea class="textarea" name="REPORT_TO"></textarea>\
|
||||
</div>\
|
||||
<div class="form-row buttons-row cc">\
|
||||
<input type="submit" value="~!:save_button~!" class="add-entry-btn do_action_save_form">\
|
||||
<span class="cancel-btn do_action_cancel_form">Cancel</span>\
|
||||
<a target="_blank" href="http://vestacp.com/docs/cron/" class="help-btn">Help</a>\
|
||||
</div>\
|
||||
</div>'],
|
||||
ENTRIES_WRAPPER: ['<div class="db-list">~!:content~!</div>'],
|
||||
ENTRY: ['<div class="row first-row cron-details-row">\
|
||||
<div class="row-actions-box cc">\
|
||||
<input type="hidden" name="source" class="source" value=\'~!:source~!\'>\
|
||||
<input type="hidden" name="target" class="target" value=\'\'>\
|
||||
<div class="row-actions-box cc">\
|
||||
<div class="check-this check-control"></div>\
|
||||
<div class="row-operations">\
|
||||
~!:SUSPENDED_TPL~!\
|
||||
|
@ -26,7 +26,7 @@ App.Validate.form = function(world, elm)
|
||||
}
|
||||
else {
|
||||
|
||||
if ($(field).val().trim() == '') {
|
||||
if ($(field).val().trim() == '' || $(field).val().trim() == '-') {
|
||||
App.Env.FormError.push($(field).attr('name') + ' is required');
|
||||
form_valid = false;
|
||||
}
|
||||
|
@ -71,7 +71,8 @@ class MAIN extends AjaxHandler
|
||||
'IP' => $this->getIpParams($data_ip),
|
||||
'DNS' => $this->getDnsParams(),
|
||||
'DB' => $this->getDbParams($data_db),
|
||||
'USERS' => $this->getUsersParams($data_users)
|
||||
'USERS' => $this->getUsersParams($data_users),
|
||||
'totals' => $this->getTotals()
|
||||
);
|
||||
|
||||
return $this->reply(true, $reply);
|
||||
@ -81,6 +82,19 @@ class MAIN extends AjaxHandler
|
||||
//
|
||||
//
|
||||
|
||||
public function getTotals($data = array())
|
||||
{
|
||||
return array(
|
||||
'USER' => array('total' => 7, 'blocked' => 0),
|
||||
'WEB_DOMAIN' => array('total' => 4, 'blocked' => 0),
|
||||
'MAIL' => array('total' => 0),
|
||||
'DB' => array('total' => 4, 'blocked' => 0),
|
||||
'DNS' => array('total' => 4, 'blocked' => 0),
|
||||
'IP' => array('total' => 2, 'blocked' => 0),
|
||||
'CRON' => array('total' => 5, 'blocked' => 0)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* WEB DOMAIN initial params
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user