From 4706475eef3c7b8b5308954be0bacb05b03596e8 Mon Sep 17 00:00:00 2001 From: Malishev Dmitry Date: Mon, 9 Jan 2012 18:28:11 +0300 Subject: [PATCH 01/10] Log in as. Closes #10 --- web/js/user_templates.js | 1150 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 1150 insertions(+) create mode 100644 web/js/user_templates.js diff --git a/web/js/user_templates.js b/web/js/user_templates.js new file mode 100644 index 000000000..d4a853a07 --- /dev/null +++ b/web/js/user_templates.js @@ -0,0 +1,1150 @@ +alert('User templates loaded'); +App.Templates.html = { + help: { + DNS_form: ['

Some Things You Just Can\'t Explain

\ + A farmer was sitting in the neighborhood bar getting drunk. A man came in and asked the farmer, "Hey, why are you sitting here on this beautiful day, getting drunk?" The farmer shook his head and replied, "Some things you just can\'t explain."\ + "So what happened that\'s so horrible?" the man asked as he sat down next to the farmer.\ + "Well," the farmer said, "today I was sitting by my cow, milking her. Just as I got the bucket full, she lifted her left leg and kicked over the bucket."\ + "Okay," said the man, "but that\'s not so bad." "Some things you just can\'t explain," the farmer replied. "So what happened then?" the man asked. The farmer said, "I took her left leg and tied it to the post on the left."\ + "And then?"\ + "Well, I sat back down and continued to milk her. Just as I got the bucket full, she took her right leg and kicked over the bucket."\ + The man laughed and said, "Again?" The farmer replied, "Some things you just can\'t explain." "So, what did you do then?" the man asked.\ + "I took her right leg this time and tied it to the post on the right."\ + "And then?"\ + "Well, I sat back down and began milking her again. Just as I got the bucket full, the stupid cow knocked over the bucket with her tail."\ + "Hmmm," the man said and nodded his head. "Some things you just can\'t explain," the farmer said.\ + "So, what did you do?" the man asked.\ + "Well," the farmer said, "I didn\'t have anymore rope, so I took off my belt and tied her tail to the rafter. In that moment, my pants fell down and my wife walked in ... Some things you just can\'t explain."'] + }, + general: { + logged_as: ['
You (~!:YOU_ARE~!) are viewing ~!:USER~! interface. Exit it to return to your own.
'], + over_bar: [''], + loading: ['
\ +
\ +
'], + popup: ['\ + '], + inner_popup: ['
\ +
\ + ×\ +
~!:POPUP_TITLE~!
\ +
\ + ~!:CONTENT~!\ +
\ +
\ +
'], + select_option: [''], + error_elm: ['
~!:ERROR~!
'], + SUSPENDED_TPL_NOT_SUSPENDED : ['enabled'], + SUSPENDED_TPL_SUSPENDED : ['suspended'] + }, + popup: { + error: ['

Important: An Error Has Occured.


    Something went wrong and some of your actions can be not saved in system. Mostly, it happens when you have network connection errors.
,    However, please notify us about the situation. It would be helpfull if you will write us approximate time the error occured and last actions you were performing. You send your petition on this email: BLABLA,

Sorry for inconvinience. (We recommend you to reload the page)
'], + change_psw: [ + '
\ +
\ +
\ + \ + ~!:VERSION~!\ +
\ + ~!:PRODUCT_NAME~! \ +
\ +
\ +
\ + \ + \ +
\ +
\ + \ + \ + \ +
\ + \ + \ +
\ +
\ +  \ +
\ + \ +
\ +
\ +

\ +
\ +

For questions please contact ~!:EMAIL~!

\ +
© ~!:YEAR~! Vesta Control Panel
\ +
\ +
\ +
\ +
' + ], + login: ['
\ +
\ +
\ + \ + ~!:VERSION~!\ +
\ + ~!:PRODUCT_NAME~! \ +
\ +
\ +
\ + \ + \ +
\ +
\ + \ + \ +
\ + \ +
\ +
\ + \ + \ +
\ + \ +
\ +
\ +

forgot password?

\ +
\ +

For questions please contact ~!:EMAIL~!

\ +
© ~!:YEAR~! Vesta Control Panel
\ +
\ +
\ +
\ +
'] + }, + dates: { + 'lock_plan_date' : [''], + 'save_forecasted_date' : [''] + }, + dns: { + FORM: [ + '
\ + \ + \ +
~!:title~!
\ + \ +
\ + \ + \ + \ +
\ +
\ + \ +
\ + \ +  \ +
\ +
\ +
\ + \ + ~!:TPL_DEFAULT_VALUE~!\ + \ + View template settings\ +
\ +
\ + \ + \ +
\ +
\ + \ + \ +
\ +
\ + \ + \ +
\ +
\ + \ + Cancel\ + Delete\ +
\ +
' + ], + ENTRIES_WRAPPER: ['
~!:content~!
'], + ENTRY: ['
\ + \ + \ +
\ +
\ +
\ + ~!:SUSPENDED_TPL~!\ +
\ +
\ +
\ +
~!:DATE~!
\ +
\ +
\ +
\ +
\ + ~!:DNS_DOMAIN~!\ +
\ +
Show records
\ +
\ +
\ +
\ + ~!:IP~!\ + \ + template:\ + \ + ~!:TPL~!\ + \ +
\ +
\ +
\ + \ + ttl:\ + ~!:TTL~!\ + \ + \ + soa:\ + ~!:SOA~!\ + \ +
\ +
\ +
'], + SUBFORM: ['
\ +
\ +
Hide records
\ +
\ +
\ +
\ + \ + ~!:SUBRECORDS~!\ +
\ + \ + Cancel\ + \ +
\ +
'], + SUBENTRY: ['
\ + \ +
\ + \ +
\ + \ +
in
\ +
\ +
\ +
\ + \ + \ + \ +
\ +
\ + \ + \ +
\ +
\ +
'] + }, + ip: { + FORM: ['\ +
\ + \ + \ +
~!:title~!
\ + \ +
\ + \ + \ +
\ +
\ + \ +
\ + \ +
\ +
\ +
\ + \ + \ + \ +
\ +
\ + \ + \ +
\ +
\ + \ + \ + \ +
\ +
\ + \ + \ +
\ +
\ + \ + \ +
\ +
\ + \ + Cancel\ + Delete\ +
\ +
\ + '], + DOT: ['.'], + ENTRY: ['\ +
\ + \ + \ +
\ +
\ +
\ + ~!:SUSPENDED_TPL~!\ +
\ +
\ +
\ +
~!:DATE~!
\ +
\ +
\ +
\ +
\ + ~!:IP_ADDRESS~!\ +
\ + \ + netmask:\ + ~!:NETMASK~!\ + \ + \ + interface:\ + ~!:INTERFACE~!\ + \ + \ + name:\ + ~!:NAME~!\ + \ +
\ +
\ + \ + owner:\ + ~!:OWNER~!\ + \ + \ + status:\ + ~!:STATUS~!\ + \ +
\ +
\ + \ + sys users:\ + ~!:U_SYS_USERS~!\ + \ + \ + web domains:\ + ~!:U_WEB_DOMAINS~!\ + \ +
\ +
\ +
\ + '], + ENTRIES_WRAPPER: ['
~!:content~!
'], + SUSPENDED_TPL_ENABLED : ['enabled\ + delete'], + SUSPENDED_TPL_DISABLED : ['suspended'] + }, + + + user: { + WEB_TPL_MINIMIZED: ['~!:WEB_TPL_MINI~!\ + \ + ~!:MORE_NUMBER~! more\ + '], + WEB_TPL: ['~!:NAME~!'], + NS_MINIMIZED: ['~!:NS_MINI~!\ + \ + ~!:MORE_NUMBER~! more\ + '], + NS_RECORD: ['~!:NAME~!'], + NS_INPUT: ['
\ + \ + \ + \ +
'], + PLUS_ONE_NS: ['
\ + \ +  \ + Add additional NS\ + \ +
'], + ENTRIES_WRAPPER: ['
~!:content~!
'], + FORM: ['
\ + \ + \ +
~!:title~!
\ + \ +
\ + \ + \ +
\ +
\ + \ + \ + Generate\ +
\ +
\ + \ + \ +
\ +
\ + \ + \ +
\ + \ +
\ + \ + \ +
\ +
\ + \ + \ +
\ +
\ + \ + \ +
\ +
\ + \ + \ +
\ +
\ + \ + \ +
\ +
\ + \ + \ +
\ + ~!:NS~!\ +
\ + \ + \ +
\ +
\ + \ + Cancel\ + Delete\ +
\ +
'], + ENTRY: ['
\ + \ + \ +
\ +
\ +
\ + ~!:SUSPENDED_TPL~!\ +
\ +
\ +
\ +
~!:DATE~!
\ +
\ +
\ +
\ +
\ +
\ + \ + ~!:LOGIN_NAME~!\ + \ + \ + \ + package:\ + ~!:PACKAGE~!\ + \ +
\ +
\ + \ + name:\ + ~!:FULLNAME~!\ + \ + \ + email:\ + \ + ~!:CONTACT~!\ + (reports ~!:REPORTS_ENABLED~!)\ + \ + \ +
\ +
\ + \ + \ +
\ +
stats
\ + \ +
\ + disk usage:\ +
\ +
\ +
\ + ~!:U_DISK_PERCENTAGE~!% (~!:U_DISK~! ~!:DISK_QUOTA_MEASURE~!)\ + \ + ~!:OVER_BAR~!\ +
\ +
\ +
~!:DISK_QUOTA~! ~!:DISK_QUOTA_MEASURE_2~!
\ +
\ +
\ +
\ + \ +
\ + bandwidth:\ +
\ +
\ +
\ + ~!:U_BANDWIDTH_PERCENTAGE~!% (~!:U_BANDWIDTH~! ~!:BANDWIDTH_MEASURE~!)\ + \ + ~!:OVER_BAR_2~!\ +
\ +
\ +
~!:BANDWIDTH~! ~!:BANDWIDTH_MEASURE_2~!
\ +
\ +
\ +
\ +
\ + \ + web ssl:\ + ~!:U_WEB_SSL~! (~!:WEB_SSL~!)\ + \ + \ + web alias:\ + ~!:WEB_ALIASES~! per domain\ + \ + \ + web templates:\ + \ + ~!:WEB_TPL~!\ + \ + \ + \ + databases:\ + ~!:U_DATABASES~! (~!:DATABASES~!)\ + \ + \ + shell:\ + ~!:SHELL~!\ + \ + \ + backups:\ + retention ~!:BACKUPS~!\ + \ +
\ +
\ + \ + mailboxes:\ + ~!:U_MAIL_BOXES~! (~!:MAIL_BOXES~!)\ + \ + \ + mail forwarders:\ + ~!:U_MAIL_FORWARDERS~! (~!:MAIL_FORWARDERS~!)\ + \ + \ + mail domains:\ + ~!:U_MAIL_DOMAINS~! (~!:MAIL_DOMAINS~!)\ + \ + \ + web domains:\ + ~!:U_WEB_DOMAINS~! (~!:WEB_DOMAINS~!)\ + \ + \ + dns domains:\ + ~!:U_DNS_DOMAINS~! (~!:DNS_DOMAINS~!)\ + \ + \ + ns list:\ + \ + ~!:NS~!\ + \ +
\ +
\ +
'] + }, + web_domain: { + FORM: ['
\ + \ + \ +
~!:title~!
\ + \ +
\ + \ + \ +
\ +
\ + \ +
\ + \ +
\ +
\ +
\ + \ + \ +
\ +
\ + \ + \ +
\ + \ +
\ + \ + \ +
\ + \ +
\ + \ + Cancel\ + Delete\ +
\ +
'], + ENTRIES_WRAPPER: ['
~!:content~!
'], + ENTRY: ['
\ + \ + \ +
\ +
\ +
\ + ~!:SUSPENDED_TPL~!\ +
\ +
\ +
\ +
~!:DATE~!
\ +
\ +
\ +
\ + ~!:DOMAIN~!\ + Alias:\ + ~!:ALIAS~!\ +
\ +
\ +
\ + ~!:IP~!\ + \ + template:\ + ~!:TPL~!\ + \ +
\ +
\ +
stats
\ + \ +
\ + disk usage:\ +
\ +
\ +
\ + ~!:U_DISK_PERCENTAGE~!% (~!:U_DISK~! ~!:DISK_QUOTA_MEASURE~!)\ + \ + ~!:OVER_BAR~!\ +
\ +
\ +
~!:DISK_QUOTA~! ~!:DISK_QUOTA_MEASURE_2~!
\ +
\ +
\ +
\ + \ +
\ + bandwidth:\ +
\ +
\ +
\ + ~!:U_BANDWIDTH_PERCENTAGE~!% (~!:U_BANDWIDTH~! ~!:BANDWIDTH_MEASURE~!)\ + \ + ~!:OVER_BAR_2~!\ +
\ +
\ +
~!:BANDWIDTH~! ~!:BANDWIDTH_MEASURE_2~!
\ +
\ +
\ +
\ +
\ + \ + php:\ + ~!:PHP~!\ + \ + \ + cgi:\ + ~!:CGI~!\ + \ + \ + elog:\ + ~!:ELOG~!\ + \ + \ + stats:\ + ~!:STAT~!\ + \ + ~!:STATS_AUTH~!\ + \ + \ +
\ +
\ + \ + ssl:\ + ~!:SSL~!\ + \ + \ + nginx:\ + ~!:NGINX~!\ + extension list\ + \ +
\ +
\ +
'] + }, + db: { + USER_ITEMS_WRAPPER: ['
~!:CONTENT~!
'], + USER_ITEM: ['\ + ~!:NAME~!\ + \ + change password'], + DIVIDER: ['
\ + \ + \ + ~!:TYPE~!\ + \ + \ +
'], + ENTRIES_WRAPPER: ['
~!:content~!
'], + FORM: ['
\ + \ + \ +
~!:title~!
\ + \ +
\ + \ + \ +
\ +
\ + \ + \ +
\ +
\ +
\ + \ + \ +
\ +
\ + \ + \ + Generate\ +
\ +
\ + \ +
\ + \ + \ +
\ +
\ + \ + Cancel\ + Delete\ +
\ +
'], + ENTRY: ['
\ + \ + \ +
\ +
\ +
\ + ~!:SUSPENDED_TPL~!\ +
\ +
\ +
\ +
\ + \ + ~!:OWNER~!\ + \ +
\ +
~!:DATE~!
\ +
\ +
\ +
\ +
\ + ~!:DB~!\ +
\ +
\ + \ +
\ + backup\ + \ +
\ +
\ +
\ + ~!:U_DISK~! Mb\ +
\ + \ +
\ +
\ +
~!:DISK~! ~!:DISK_MEASURE~!
\ +
\ +
\ +
\ +
\ +
'] + }, + cron: { + FORM: ['
\ + \ + \ +
~!:title~!
\ + \ +
\ + Schedule Time:\ +
\ + \ +
\ + \ +
\ +
\ +
\ + \ +
\ + \ +
\ +
\ +
\ + \ +
\ + \ +
\ +
\ +
\ + \ +
\ + \ +
\ +
\ +
\ + \ +
\ + \ +
\ +
\ +
\ +
\ + \ + \ +
\ + \ +
\ + \ + \ +
\ +
\ + \ + Cancel\ + Delete\ +
\ +
'], + ENTRIES_WRAPPER: ['
~!:content~!
'], + ENTRY: ['
\ + \ + \ +
\ +
\ +
\ + ~!:SUSPENDED_TPL~!\ +
\ +
\ +
\ +
~!:DATE~!
\ +
\ +
\ +
\ + \ + min\ + ~!:MIN~!\ + \ + \ + hour\ + ~!:HOUR~!\ + \ + \ + day of Month\ + ~!:DAY~!\ + \ + \ + Month\ + ~!:MONTH~!\ + \ + \ + day of Week\ + ~!:WDAY~!\ + \ +
\ +
\ + ~!:CMD~!\ +
\ + \ +
\ +
'] + }, + backup: { + WRAPPER: ['
~!:CONTENT~!
'], + ENTRY: ['
\ + \ +
\ +
\ +
\ + \ + owner:\ + ~!:OWNER~!\ + \ +
\ +
\ +
\ +
\ + \ + \ + ~!:CREATED_AT~!\ + ~!:CREATED_AT_TIME~!\ + \ + ~!:CREATED_AT_WDAY~!\ + \ + \ + Generation time:\ + ~!:GENERATION_TIME~!\ + \ +
\ +
\ + \ + ~!:SIZE~!\ + \ + download\ +
\ + \ +
\ +
'] + }, + stats: { + WRAPPER: ['
~!:CONTENT~!
'], + ENTRY: ['
\ +

~!:HEADER~!

\ +
\ + \ +
\ +
'], + SUBMENU: ['today\ + week\ + month\ + year
'] + } +} + + +// Internals +var Tpl = App.Templates; +var Templator = function() +{ + var init = function() { + fb.info('Templator work'); + Templator.splitThemAll(); + Templator.freezeTplIndexes(); + }; + + /** + * Split the tpl strings into arrays + */ + Templator.splitThemAll = function() + { + fb.info('splitting tpls'); + $.each(App.Templates.html, function(o) { + var tpls = App.Templates.html[o]; + $.each(tpls, function(t) { + tpls[t] = tpls[t][0].split('~!'); + }); + }); + }, + + /** + * Iterates tpls + */ + Templator.freezeTplIndexes = function() + { + fb.info('freezing tpl keys'); + $.each(App.Templates.html, Templator.cacheTplIndexes); + }, + + /** + * Grab the tpl group key and process it + */ + Templator.cacheTplIndexes = function(key) + { + var tpls = App.Templates.html[key]; + $.each(tpls, function(o) { + var tpl = tpls[o]; + Templator.catchIndex(key, o, tpl); + }); + }, + + /** + * Set the indexes + */ + Templator.catchIndex = function(key, ref_key, tpl) + { + 'undefined' == typeof App.Templates._indexes[key] ? App.Templates._indexes[key] = {} : false; + 'undefined' == typeof App.Templates._indexes[key][ref_key] ? App.Templates._indexes[key][ref_key] = {} : false; + $(tpl).each(function(index, o) { + if(':' == o.charAt(0)){ + App.Templates._indexes[key][ref_key][o.toString()] = index; + } + }); + } + + /** + * Get concrete templates + */ + init(); + return Templator; +}; +Templator.getTemplate = function(ns, key) +{ + return [ + App.Templates._indexes[ns][key], + App.Templates.html[ns][key].slice(0) + ]; +} +// init templator +Tpl.Templator = Templator(); +Tpl.get = function(key, group) +{ + return Tpl.Templator.getTemplate(group, key); +} From 2a6e6ab6885fbec42307d857dd7c52b4b91448e8 Mon Sep 17 00:00:00 2001 From: Malishev Dmitry Date: Mon, 9 Jan 2012 18:41:56 +0300 Subject: [PATCH 02/10] Delete button removed from "new" forms. Closes #26 --- web/js/html.js | 12 +++++ web/js/templates.js | 124 ++++++++++++++++++++++++-------------------- 2 files changed, 79 insertions(+), 57 deletions(-) diff --git a/web/js/html.js b/web/js/html.js index b09e49460..042cfdd58 100644 --- a/web/js/html.js +++ b/web/js/html.js @@ -29,9 +29,11 @@ App.HTML.Build.dns_form = function (options, id) { if (App.Helpers.isEmpty(options)) { tpl.set(':title', 'New dns domain'); tpl.set(':save_button', 'ADD'); + tpl.set(':DELETE_ACTION', ''); } else { tpl.set(':title', 'Edit dns domain'); tpl.set(':save_button', 'SAVE'); + tpl.set(':DELETE_ACTION', App.Templates.get('DELETE_ACTION', 'general').finalize()); } tpl.set(':id', id || ''); tpl.set(':DNS_DOMAIN', options.DNS_DOMAIN || ''); @@ -55,9 +57,11 @@ App.HTML.Build.ip_form = function (options, id) { if (App.Helpers.isEmpty(options)) { tpl.set(':title', 'New ip address'); tpl.set(':save_button', 'ADD'); + tpl.set(':DELETE_ACTION', ''); } else { tpl.set(':title', 'Edit ip address'); tpl.set(':save_button', 'SAVE'); + tpl.set(':DELETE_ACTION', App.Templates.get('DELETE_ACTION', 'general').finalize()); } tpl.set(':id', id || ''); tpl.set(':IP_ADDRESS', options.IP_ADDRESS || ''); @@ -84,9 +88,11 @@ App.HTML.Build.user_form = function (options, id) { if (App.Helpers.isEmpty(options)) { tpl.set(':title', 'New user'); tpl.set(':save_button', 'ADD'); + tpl.set(':DELETE_ACTION', ''); } else { tpl.set(':title', 'Edit user'); tpl.set(':save_button', 'SAVE'); + tpl.set(':DELETE_ACTION', App.Templates.get('DELETE_ACTION', 'general').finalize()); } options = !App.Helpers.isEmpty(options) ? options : App.Empty.USER; if (in_edit == true) { @@ -135,9 +141,11 @@ App.HTML.Build.web_domain_form = function (options, id) { if (App.Helpers.isEmpty(options)) { tpl.set(':title', 'New WEB domain'); tpl.set(':save_button', 'ADD'); + tpl.set(':DELETE_ACTION', ''); } else { tpl.set(':title', 'Edit WEB domain'); tpl.set(':save_button', 'SAVE'); + tpl.set(':DELETE_ACTION', App.Templates.get('DELETE_ACTION', 'general').finalize()); } options = !App.Helpers.isEmpty(options) ? options : App.Empty.WEB_DOMAIN; if (in_edit == true) { @@ -180,9 +188,11 @@ App.HTML.Build.db_form = function (options, id) { if (App.Helpers.isEmpty(options)) { tpl.set(':title', 'New database'); tpl.set(':save_button', 'ADD'); + tpl.set(':DELETE_ACTION', ''); } else { tpl.set(':title', 'Edit database "' + options.DB + '"'); tpl.set(':save_button', 'SAVE'); + tpl.set(':DELETE_ACTION', App.Templates.get('DELETE_ACTION', 'general').finalize()); } options = !App.Helpers.isEmpty(options) ? options : App.Empty.DB; if (in_edit == true) { @@ -206,9 +216,11 @@ App.HTML.Build.cron_form = function (options, id) { if (App.Helpers.isEmpty(options)) { tpl.set(':title', 'New cron job'); tpl.set(':save_button', 'ADD'); + tpl.set(':DELETE_ACTION', ''); } else { tpl.set(':title', 'Edit cron job'); tpl.set(':save_button', 'SAVE'); + tpl.set(':DELETE_ACTION', App.Templates.get('DELETE_ACTION', 'general').finalize()); } options = !App.Helpers.isEmpty(options) ? options : { DAY: '', diff --git a/web/js/templates.js b/web/js/templates.js index bbe42a133..625b1e7aa 100644 --- a/web/js/templates.js +++ b/web/js/templates.js @@ -35,7 +35,8 @@ App.Templates.html = { select_option: [''], error_elm: ['
~!:ERROR~!
'], SUSPENDED_TPL_NOT_SUSPENDED : ['enabled'], - SUSPENDED_TPL_SUSPENDED : ['suspended'] + SUSPENDED_TPL_SUSPENDED : ['suspended'], + DELETE_ACTION: ['Delete'] }, popup: { error: ['

Important: An Error Has Occured.


    Something went wrong and some of your actions can be not saved in system. Mostly, it happens when you have network connection errors.
,    However, please notify us about the situation. It would be helpfull if you will write us approximate time the error occured and last actions you were performing. You send your petition on this email: BLABLA,

Sorry for inconvinience. (We recommend you to reload the page)
'], @@ -158,7 +159,7 @@ App.Templates.html = {
\ \ Cancel\ - Delete\ + ~!:DELETE_ACTION~!\
\ ' ], @@ -292,7 +293,7 @@ App.Templates.html = {
\ \ Cancel\ - Delete\ + ~!:DELETE_ACTION~!\
\ \ '], @@ -319,14 +320,14 @@ App.Templates.html = { netmask:\ ~!:NETMASK~!\ \ - \ - interface:\ - ~!:INTERFACE~!\ - \ \ name:\ ~!:NAME~!\ \ + \ + interface:\ + ~!:INTERFACE~!\ + \ \
\ \ @@ -340,7 +341,7 @@ App.Templates.html = {
\
\ \ - sys users:\ + users:\ ~!:U_SYS_USERS~!\ \ \ @@ -446,7 +447,7 @@ App.Templates.html = {
\ \ Cancel\ - Delete\ + ~!:DELETE_ACTION~!\
\
'], ENTRY: ['
\ @@ -469,19 +470,13 @@ App.Templates.html = { ~!:LOGIN_NAME~!\ \ \ - \ - package:\ - ~!:PACKAGE~!\ - \ -
\ + \ + ~!:FULLNAME~!\ + \ \
\ \ - \ - name:\ - ~!:FULLNAME~!\ - \ \ email:\ \ @@ -489,6 +484,10 @@ App.Templates.html = { (reports ~!:REPORTS_ENABLED~!)\ \ \ + \ + package:\ + ~!:PACKAGE~!\ + \
\ \ \ @@ -526,6 +525,10 @@ App.Templates.html = { \ \
\ + \ + web domains:\ + ~!:U_WEB_DOMAINS~! (~!:WEB_DOMAINS~!)\ + \ \ web ssl:\ ~!:U_WEB_SSL~! (~!:WEB_SSL~!)\ @@ -544,6 +547,37 @@ App.Templates.html = { databases:\ ~!:U_DATABASES~! (~!:DATABASES~!)\ \ + \ + Dedicated IP\'s:\ + ~!:IP_OWNED~!\ + \ + \ + cron jobs:\ + ~!:U_CRON_JOBS~!\ + \ +
\ +
\ + \ + mail domains:\ + ~!:U_MAIL_DOMAINS~! (~!:MAIL_DOMAINS~!)\ + \ + \ + mail accounts:\ + ~!:MAIL_BOXES~! per domain\ + \ + \ + mail forwarders:\ + ~!:MAIL_FORWARDERS~! per domain\ + \ + \ + dns domains:\ + ~!:U_DNS_DOMAINS~! (~!:DNS_DOMAINS~!)\ + \ + \ + name servers:\ + \ + ~!:NS~!\ + \ \ shell:\ ~!:SHELL~!\ @@ -551,35 +585,7 @@ App.Templates.html = { \ backups:\ retention ~!:BACKUPS~!\ - \ -
\ -
\ - \ - mailboxes:\ - ~!:U_MAIL_BOXES~! (~!:MAIL_BOXES~!)\ - \ - \ - mail forwarders:\ - ~!:U_MAIL_FORWARDERS~! (~!:MAIL_FORWARDERS~!)\ - \ - \ - mail domains:\ - ~!:U_MAIL_DOMAINS~! (~!:MAIL_DOMAINS~!)\ - \ - \ - web domains:\ - ~!:U_WEB_DOMAINS~! (~!:WEB_DOMAINS~!)\ - \ - \ - dns domains:\ - ~!:U_DNS_DOMAINS~! (~!:DNS_DOMAINS~!)\ - \ - \ - ns list:\ - \ - ~!:NS~!\ - \ -
\ + \ \ \ '] }, @@ -653,23 +659,28 @@ App.Templates.html = { Generate\ \ \ - \ + \
\ \ \
\ +
\ + \ + ...\ + \ +
\
\ \ ...\ \
\
\ - \ - ...\ - \ + \ + ...\ + \
\ \ \ @@ -702,7 +713,7 @@ App.Templates.html = {
\ \ Cancel\ - Delete\ + ~!:DELETE_ACTION~!\
\ '], ENTRIES_WRAPPER: ['
~!:content~!
'], @@ -721,7 +732,6 @@ App.Templates.html = {
\
\ ~!:DOMAIN~!\ - Alias:\ ~!:ALIAS~!\
\
\ @@ -829,7 +839,7 @@ App.Templates.html = {
\
\
\ - \ + \ \
\
\ @@ -849,7 +859,7 @@ App.Templates.html = {
\ \ Cancel\ - Delete\ + ~!:DELETE_ACTION~!\
\
'], ENTRY: ['
\ @@ -959,7 +969,7 @@ App.Templates.html = {
\ \ Cancel\ - Delete\ + ~!:DELETE_ACTION~!\
\
'], ENTRIES_WRAPPER: ['
~!:content~!
'], From 401c7851ea44b0f74dec36d1489a142a4f9fa506 Mon Sep 17 00:00:00 2001 From: Malishev Dmitry Date: Mon, 9 Jan 2012 18:51:55 +0300 Subject: [PATCH 03/10] Number of cron jobs. Closes #24 --- web/vesta/api/USER.class.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/web/vesta/api/USER.class.php b/web/vesta/api/USER.class.php index 9aade6f39..6be4cf190 100644 --- a/web/vesta/api/USER.class.php +++ b/web/vesta/api/USER.class.php @@ -19,6 +19,11 @@ class USER extends AjaxHandler */ public function getListExecute(Request $request) { + if(!VestaSession::getUserRole()){ + return self::getUserExecute($request); + } + + $reply = array(); $result = Vesta::execute(Vesta::V_LIST_SYS_USERS, array(Config::get('response_type'))); @@ -58,7 +63,9 @@ class USER extends AjaxHandler "U_MAIL_DOMAINS" => $details['U_MAIL_DOMAINS'], "DATE" => $details['DATE'], "U_MAIL_FORWARDERS" => '0', - "U_MAIL_BOXES" => '0' + "U_MAIL_BOXES" => '0', + "U_CRON_JOBS" => $details['U_CRON_JOBS'], + "IP_OWNED" => $details['IP_OWNED'] ); $reply[$user] = array_merge($user_details, $nses); // $reply[$user] = $user_details; @@ -107,6 +114,8 @@ class USER extends AjaxHandler "U_DNS_DOMAINS" => $details['U_DNS_DOMAINS'], "U_DATABASES" => $details['U_DATABASES'], "U_MAIL_DOMAINS" => $details['U_MAIL_DOMAINS'], + "U_CRON_JOBS" => 'todo', + "IP_OWNED" => $details['IP_OWNED'], "DATE" => $details['DATE'] ); $reply[$user] = $user_details; From c8c8e9043537465327ebe8a160d74c8ad550579c Mon Sep 17 00:00:00 2001 From: Malishev Dmitry Date: Tue, 10 Jan 2012 12:22:32 +0300 Subject: [PATCH 04/10] NS = Name Server. Closes #20 --- web/js/actions.js | 10 +++++----- web/js/html.js | 2 +- web/js/templates.js | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/web/js/actions.js b/web/js/actions.js index 4a9627839..88a8cecd7 100644 --- a/web/js/actions.js +++ b/web/js/actions.js @@ -561,7 +561,7 @@ App.Actions.add_form_ns = function(evt) var tpl = App.Templates.get('NS_INPUT', 'user'); tpl.set(':NAME', ''); - tpl.set(':NS_LABEL', 'NS'); + tpl.set(':NS_LABEL', 'Name Server'); var ref = $(elm).hasClass('form-row') ? elm : $(elm).parents('.form-row'); $(ref).before(tpl.finalize()); @@ -571,7 +571,7 @@ App.Actions.add_form_ns = function(evt) $(form).find('.ns-entry').each(function(i, o) { - $(o).find('label').text('NS #' + (i + 1)); + $(o).find('label').text('Name Server #' + (i + 1)); $(o).find('input').attr('name', 'NS' + (i + 1)); }); } @@ -587,7 +587,7 @@ App.Actions.delete_ns = function(evt) form = elm.parents('.form:first'); var total_nses = $(form).find('.ns-entry').length; if (total_nses == App.Settings.NS_MIN) { - return App.Helpers.alert('Minimum number of NS is ' + App.Settings.NS_MIN); + return App.Helpers.alert('Minimum number of Name Servers is ' + App.Settings.NS_MIN); } var form = elm.parents('.form:first'); @@ -596,7 +596,7 @@ App.Actions.delete_ns = function(evt) $(form).find('.ns-entry').each(function(i, o) { - $(o).find('label').text('NS #' + (i + 1)); + $(o).find('label').text('Name Server #' + (i + 1)); $(o).find('input').attr('name', 'NS' + (i + 1)); }); } @@ -604,7 +604,7 @@ App.Actions.delete_ns = function(evt) App.Actions.view_full_ns_list = function(evt) { var elm = $(evt.target); - App.Helpers.openInnerPopup(elm, $(elm).parents('.prop-box').find('.ns-full-list:first').html(), 'NS list'); + App.Helpers.openInnerPopup(elm, $(elm).parents('.prop-box').find('.ns-full-list:first').html(), 'Name Server list'); } App.Actions.view_template_info = function(evt) diff --git a/web/js/html.js b/web/js/html.js index 042cfdd58..94aba7bbe 100644 --- a/web/js/html.js +++ b/web/js/html.js @@ -101,7 +101,7 @@ App.HTML.Build.user_form = function (options, id) { $([3, 4, 5, 6, 7, 8]).each(function (i, index) { if (options['NS' + index].trim() != '') { var tpl_ns = App.Templates.get('NS_INPUT', 'user'); - tpl_ns.set(':NS_LABEL', 'NS #' + (index)); + tpl_ns.set(':NS_LABEL', 'Name Server #' + (index)); tpl_ns.set(':NAME', options['NS' + index]); ns[ns.length++] = tpl_ns.finalize(); } diff --git a/web/js/templates.js b/web/js/templates.js index 625b1e7aa..cfcc70395 100644 --- a/web/js/templates.js +++ b/web/js/templates.js @@ -378,7 +378,7 @@ App.Templates.html = { PLUS_ONE_NS: [''], ENTRIES_WRAPPER: ['
~!:content~!
'], @@ -432,11 +432,11 @@ App.Templates.html = { \
\
\ - \ + \ \
\
\ - \ + \ \
\ ~!:NS~!\ From f2c1e0ed5e7eb8c3d1edb78f0160fec968d947ef Mon Sep 17 00:00:00 2001 From: Malishev Dmitry Date: Tue, 10 Jan 2012 12:34:14 +0300 Subject: [PATCH 05/10] Tab switching "x records" message is resetting from now on. Added "do nothing" for batch operations. Closes #15 --- web/index.html | 6 +++++- web/js/actions.js | 10 ++++++++++ web/js/pages.js | 12 ++++++++++-- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/web/index.html b/web/index.html index 8bcb52b02..febb71277 100644 --- a/web/index.html +++ b/web/index.html @@ -217,7 +217,7 @@
- All + None
@@ -226,6 +226,10 @@