Skip to content

Commit

Permalink
now supporting secrets in admin port
Browse files Browse the repository at this point in the history
  • Loading branch information
wfelipe committed Oct 22, 2010
1 parent ec3b596 commit a0c6370
Show file tree
Hide file tree
Showing 4 changed files with 158 additions and 72 deletions.
83 changes: 53 additions & 30 deletions lang/wp-varnish-pt_BR.po
Expand Up @@ -5,7 +5,8 @@ msgstr ""
"POT-Creation-Date: 2010-08-04 17:15-0300\n" "POT-Creation-Date: 2010-08-04 17:15-0300\n"
"PO-Revision-Date: 2010-10-20 23:30-0300\n" "PO-Revision-Date: 2010-10-20 23:30-0300\n"
"Last-Translator: Wilson Felipe <wfelipe@gmail.com>\n" "Last-Translator: Wilson Felipe <wfelipe@gmail.com>\n"
"Language-Team: Hugo Cisneiros <hugo.cisneiros@gmail.com>, Wilson Felipe <wfelipe@gmail.com>\n" "Language-Team: Hugo Cisneiros <hugo.cisneiros@gmail.com>, Wilson Felipe "
"<wfelipe@gmail.com>\n"
"Language: \n" "Language: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
Expand All @@ -17,83 +18,105 @@ msgstr ""
"X-Poedit-SourceCharset: utf-8\n" "X-Poedit-SourceCharset: utf-8\n"
"X-Poedit-SearchPath-0: wp-varnish\n" "X-Poedit-SearchPath-0: wp-varnish\n"


#: ../wp-varnish.php:145 #: ../wp-varnish.php:152
msgid "WP-Varnish Configuration" msgid "WP-Varnish Configuration"
msgstr "Configuração do WP-Varnish" msgstr "Configuração do WP-Varnish"


#: ../wp-varnish.php:190 #: ../wp-varnish.php:202
msgid "Settings Saved!" msgid "Settings Saved!"
msgstr "Configurações Salvas!" msgstr "Configurações Salvas!"


#: ../wp-varnish.php:192 #: ../wp-varnish.php:204
msgid "You do not have the privileges." msgid "You do not have the privileges."
msgstr "Você não tem os privilégios necessários." msgstr "Você não tem os privilégios necessários."


#: ../wp-varnish.php:203 #: ../wp-varnish.php:215
msgid "WordPress Varnish Administration" msgid "WordPress Varnish Administration"
msgstr "Administração do Varnish no WordPress" msgstr "Administração do Varnish no WordPress"


#: ../wp-varnish.php:204 #: ../wp-varnish.php:216
msgid "IP address and port configuration" msgid "IP address and port configuration"
msgstr "Configuração de Endereços IP e Portas" msgstr "Configuração de Endereços IP e Portas"


#: ../wp-varnish.php:210 #: ../wp-varnish.php:222
msgid "These values can't be edited since there's a global configuration located in <em>wp-config.php</em>. If you want to change these settings, please update the file or contact the administrator." msgid ""
msgstr "Estes valores não podem ser editados, pois existe uma configuração global localizada no <em>wp-config.php</em>. Se você deseja mudar estas configurações, por favor atualize o arquivo ou entre em contato com o administrador." "These values can't be edited since there's a global configuration located in "
"<em>wp-config.php</em>. If you want to change these settings, please update "
"the file or contact the administrator."
msgstr ""
"Estes valores não podem ser editados, pois existe uma configuração global "
"localizada no <em>wp-config.php</em>. Se você deseja mudar estas "
"configurações, por favor atualize o arquivo ou entre em contato com o "
"administrador."


#: ../wp-varnish.php:213 #: ../wp-varnish.php:225
msgid "Current configuration:" msgid "Current configuration:"
msgstr "Configuração atual:" msgstr "Configuração atual:"


#: ../wp-varnish.php:217 #: ../wp-varnish.php:229
msgid "Server: " msgid "Server: "
msgstr "Servidor: " msgstr "Servidor: "


#: ../wp-varnish.php:217 #: ../wp-varnish.php:229
msgid "Port: " msgid "Port: "
msgstr "Porta: " msgstr "Porta: "


#: ../wp-varnish.php:227 #: ../wp-varnish.php:239
msgid "Varnish Administration IP Address" msgid "Varnish Administration IP Address"
msgstr "Endereço IP de Administração do Varnish" msgstr "Endereço IP de Administração do Varnish"


#: ../wp-varnish.php:228 #: ../wp-varnish.php:240
msgid "Varnish Administration Port" msgid "Varnish Administration Port"
msgstr "Porta de Administração do Varnish" msgstr "Porta de Administração do Varnish"


#: ../wp-varnish.php:246 #: ../wp-varnish.php:241
msgid "Varnish Secret"
msgstr "Varnish Secret"

#: ../wp-varnish.php:260
msgid "Add one more server" msgid "Add one more server"
msgstr "Adicionar mais um servidor" msgstr "Adicionar mais um servidor"


#: ../wp-varnish.php:252 #: ../wp-varnish.php:266
msgid "Timeout" msgid "Timeout"
msgstr "Timeout" msgstr "Timeout"


#: ../wp-varnish.php:252 #: ../wp-varnish.php:266
msgid "seconds" msgid "seconds"
msgstr "segundos" msgstr "segundos"


#: ../wp-varnish.php:254 #: ../wp-varnish.php:268
msgid "Use admin port instead of PURGE method." msgid "Use admin port instead of PURGE method."
msgstr "Usar porta de administração ao invés do método PURGE." msgstr "Usar porta de administração ao invés do método PURGE."


#: ../wp-varnish.php:256 #: ../wp-varnish.php:270
msgid "Also purge all page navigation (experimental, use carefully, it will include a bit more load on varnish servers.)" msgid ""
msgstr "Também limpar o cache de toda navegação de páginas (experimental, use com cuidado, irá colocar um pouco de carga a mais nos servidores varnish.)" "Also purge all page navigation (experimental, use carefully, it will include "
"a bit more load on varnish servers.)"
msgstr ""
"Também limpar o cache de toda navegação de páginas (experimental, use com "
"cuidado, irá colocar um pouco de carga a mais nos servidores varnish.)"


#: ../wp-varnish.php:258 #: ../wp-varnish.php:272
msgid "Also purge all comment navigation (experimental, use carefully, it will include a bit more load on varnish servers.)" msgid ""
msgstr "Também limpar o cache de toda navegação de comentários (experimental, use com cuidado, irá colocar um pouco de carga a mais nos servidores varnish.)" "Also purge all comment navigation (experimental, use carefully, it will "
"include a bit more load on varnish servers.)"
msgstr ""
"Também limpar o cache de toda navegação de comentários (experimental, use "
"com cuidado, irá colocar um pouco de carga a mais nos servidores varnish.)"


#: ../wp-varnish.php:260 #: ../wp-varnish.php:274
msgid "Save Changes" msgid "Save Changes"
msgstr "Salvar Mudanças" msgstr "Salvar Mudanças"


#: ../wp-varnish.php:262 #: ../wp-varnish.php:276
msgid "Purge All Blog Cache" msgid "Purge All Blog Cache"
msgstr "Limpar Todo Cache do Blog" msgstr "Limpar Todo Cache do Blog"


#: ../wp-varnish.php:262 #: ../wp-varnish.php:276
msgid "Use only if necessary, and carefully as this will include a bit more load on varnish servers." msgid ""
msgstr "Use apenas se necessário, e com cuidado pois irá colocar um pouco de carga a mais nos servidores varnish." "Use only if necessary, and carefully as this will include a bit more load on "

"varnish servers."
msgstr ""
"Use apenas se necessário, e com cuidado pois irá colocar um pouco de carga a "
"mais nos servidores varnish."
65 changes: 40 additions & 25 deletions lang/wp-varnish.pot
Expand Up @@ -5,90 +5,105 @@ msgstr ""
"POT-Creation-Date: 2010-08-04 17:15-0300\n" "POT-Creation-Date: 2010-08-04 17:15-0300\n"
"PO-Revision-Date: 2010-10-20 23:33-0200\n" "PO-Revision-Date: 2010-10-20 23:33-0200\n"
"Last-Translator: Wilson Felipe <wfelipe@gmail.com>\n" "Last-Translator: Wilson Felipe <wfelipe@gmail.com>\n"
"Language-Team: Hugo Cisneiros <hugo.cisneiros@gmail.com>, Wilson Felipe <wfelipe@gmail.com>\n" "Language-Team: Hugo Cisneiros <hugo.cisneiros@gmail.com>, Wilson Felipe "
"<wfelipe@gmail.com>\n"
"Language: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Poedit-KeywordsList: __;_;gettext;gettext_noop\n" "X-Poedit-KeywordsList: __;_;gettext;gettext_noop\n"
"X-Poedit-Basepath: .\n" "X-Poedit-Basepath: .\n"
"X-Poedit-SearchPath-0: ..\n" "X-Poedit-SearchPath-0: ..\n"


#: ../wp-varnish.php:145 #: ../wp-varnish.php:152
msgid "WP-Varnish Configuration" msgid "WP-Varnish Configuration"
msgstr "" msgstr ""


#: ../wp-varnish.php:190 #: ../wp-varnish.php:202
msgid "Settings Saved!" msgid "Settings Saved!"
msgstr "" msgstr ""


#: ../wp-varnish.php:192 #: ../wp-varnish.php:204
msgid "You do not have the privileges." msgid "You do not have the privileges."
msgstr "" msgstr ""


#: ../wp-varnish.php:203 #: ../wp-varnish.php:215
msgid "WordPress Varnish Administration" msgid "WordPress Varnish Administration"
msgstr "" msgstr ""


#: ../wp-varnish.php:204 #: ../wp-varnish.php:216
msgid "IP address and port configuration" msgid "IP address and port configuration"
msgstr "" msgstr ""


#: ../wp-varnish.php:210 #: ../wp-varnish.php:222
msgid "These values can't be edited since there's a global configuration located in <em>wp-config.php</em>. If you want to change these settings, please update the file or contact the administrator." msgid ""
"These values can't be edited since there's a global configuration located in "
"<em>wp-config.php</em>. If you want to change these settings, please update "
"the file or contact the administrator."
msgstr "" msgstr ""


#: ../wp-varnish.php:213 #: ../wp-varnish.php:225
msgid "Current configuration:" msgid "Current configuration:"
msgstr "" msgstr ""


#: ../wp-varnish.php:217 #: ../wp-varnish.php:229
msgid "Server: " msgid "Server: "
msgstr "" msgstr ""


#: ../wp-varnish.php:217 #: ../wp-varnish.php:229
msgid "Port: " msgid "Port: "
msgstr "" msgstr ""


#: ../wp-varnish.php:227 #: ../wp-varnish.php:239
msgid "Varnish Administration IP Address" msgid "Varnish Administration IP Address"
msgstr "" msgstr ""


#: ../wp-varnish.php:228 #: ../wp-varnish.php:240
msgid "Varnish Administration Port" msgid "Varnish Administration Port"
msgstr "" msgstr ""


#: ../wp-varnish.php:246 #: ../wp-varnish.php:241
msgid "Varnish Secret"
msgstr ""

#: ../wp-varnish.php:260
msgid "Add one more server" msgid "Add one more server"
msgstr "" msgstr ""


#: ../wp-varnish.php:252 #: ../wp-varnish.php:266
msgid "Timeout" msgid "Timeout"
msgstr "" msgstr ""


#: ../wp-varnish.php:252 #: ../wp-varnish.php:266
msgid "seconds" msgid "seconds"
msgstr "" msgstr ""


#: ../wp-varnish.php:254 #: ../wp-varnish.php:268
msgid "Use admin port instead of PURGE method." msgid "Use admin port instead of PURGE method."
msgstr "" msgstr ""


#: ../wp-varnish.php:256 #: ../wp-varnish.php:270
msgid "Also purge all page navigation (experimental, use carefully, it will include a bit more load on varnish servers.)" msgid ""
"Also purge all page navigation (experimental, use carefully, it will include "
"a bit more load on varnish servers.)"
msgstr "" msgstr ""


#: ../wp-varnish.php:258 #: ../wp-varnish.php:272
msgid "Also purge all comment navigation (experimental, use carefully, it will include a bit more load on varnish servers.)" msgid ""
"Also purge all comment navigation (experimental, use carefully, it will "
"include a bit more load on varnish servers.)"
msgstr "" msgstr ""


#: ../wp-varnish.php:260 #: ../wp-varnish.php:274
msgid "Save Changes" msgid "Save Changes"
msgstr "" msgstr ""


#: ../wp-varnish.php:262 #: ../wp-varnish.php:276
msgid "Purge All Blog Cache" msgid "Purge All Blog Cache"
msgstr "" msgstr ""


#: ../wp-varnish.php:262 #: ../wp-varnish.php:276
msgid "Use only if necessary, and carefully as this will include a bit more load on varnish servers." msgid ""
"Use only if necessary, and carefully as this will include a bit more load on "
"varnish servers."
msgstr "" msgstr ""
18 changes: 14 additions & 4 deletions wp-varnish.js
Expand Up @@ -2,13 +2,15 @@
// so we need a base // so we need a base
var rowCount = 0; var rowCount = 0;


function createRow(tableID, id, addr, port) { function createRow(tableID, id, addr, port, secret) {
var row = document.createElement ('tr'); var row = document.createElement ('tr');
var td1 = document.createElement ('td'); var td1 = document.createElement ('td');
var td2 = document.createElement ('td'); var td2 = document.createElement ('td');
var td3 = document.createElement ('td'); var td3 = document.createElement ('td');
var td4 = document.createElement ('td');
var wpv_addr = document.createElement ('input'); var wpv_addr = document.createElement ('input');
var wpv_port = document.createElement ('input'); var wpv_port = document.createElement ('input');
var wpv_secret = document.createElement ('input');
var dRow = document.createElement ('input'); var dRow = document.createElement ('input');


wpv_addr.className = "regular-text"; wpv_addr.className = "regular-text";
Expand All @@ -23,6 +25,12 @@ function createRow(tableID, id, addr, port) {
wpv_port.name = "wpvarnish_port[]"; wpv_port.name = "wpvarnish_port[]";
wpv_port.value = port || ""; wpv_port.value = port || "";


wpv_secret.className = "regular-text";
wpv_secret.type = "text";
wpv_secret.id = id;
wpv_secret.name = "wpvarnish_secret[]";
wpv_secret.value = secret || "";

dRow.className = ""; dRow.className = "";
dRow.type = "button"; dRow.type = "button";
dRow.name = "deleteRow"; dRow.name = "deleteRow";
Expand All @@ -32,19 +40,21 @@ function createRow(tableID, id, addr, port) {


td1.appendChild (wpv_addr); td1.appendChild (wpv_addr);
td2.appendChild (wpv_port); td2.appendChild (wpv_port);
td3.appendChild (dRow); td3.appendChild (wpv_secret);
td4.appendChild (dRow);
row.appendChild (td1); row.appendChild (td1);
row.appendChild (td2); row.appendChild (td2);
row.appendChild (td3); row.appendChild (td3);
row.appendChild (td4);


return row; return row;
} }


function addRow(tableID, id, addr, port) { function addRow(tableID, id, addr, port, secret) {
var tbody = document.getElementById(tableID).getElementsByTagName ('tbody')[0]; var tbody = document.getElementById(tableID).getElementsByTagName ('tbody')[0];


rowCount++; rowCount++;
var row = createRow(tableID, id, addr, port); var row = createRow(tableID, id, addr, port, secret);


tbody.appendChild (row); tbody.appendChild (row);
} }
Expand Down

0 comments on commit a0c6370

Please sign in to comment.