summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdatabase.php4
-rw-r--r--js/locks.js33
-rw-r--r--lang/english.php1
-rw-r--r--lang/portuguese-br.php1
-rw-r--r--lang/portuguese-pt.php1
-rw-r--r--lang/recoded/english.php1
-rw-r--r--lang/recoded/portuguese-br.php1
-rw-r--r--lang/recoded/portuguese-pt.php1
-rw-r--r--themes/default/global.css2
9 files changed, 39 insertions, 6 deletions
diff --git a/database.php b/database.php
index 283b4d3f..14c78fe6 100755
--- a/database.php
+++ b/database.php
@@ -609,7 +609,7 @@
/* normal flow */
if ($action == 'locks') {
- $scripts = "<script src=\"libraries/js/jquery.js\" type=\"text/javascript\"></script>";
+ $scripts = "<script src=\"libraries/js/jquery.js\" type=\"text/javascript\"></script>\n";
$scripts .= "<script src=\"js/locks.js\" type=\"text/javascript\"></script>";
$refreshTime = $conf['ajax_refresh'] * 1000;
@@ -619,7 +619,9 @@
$scripts .= "ajax_time_refresh: {$refreshTime},\n";
$scripts .= "str_start: {text:'{$lang['strstart']}',icon: '". $misc->icon('Execute') ."'},\n";
$scripts .= "str_stop: {text:'{$lang['strstop']}',icon: '". $misc->icon('Stop') ."'},\n";
+ $scripts .= "load_icon: '". $misc->icon('Loading') ."',\n";
$scripts .= "server:'{$misc->href}',\n";
+ $scripts .= "errmsg: '". str_replace("'", "\'", $lang['strconnectionfail']) ."',\n";
$scripts .= "};\n";
$scripts .= "</script>\n";
}
diff --git a/js/locks.js b/js/locks.js
index 81310e64..e069f1e9 100644
--- a/js/locks.js
+++ b/js/locks.js
@@ -1,20 +1,33 @@
$(document).ready(function() {
- var timeid = null;
+ var timeid = query = null;
var controlLink = $('#control');
+ var errmsg = $('<p class="errmsg">'+Database.errmsg+'</p>')
+ .insertBefore(controlLink)
+ .hide();
+ var loading = $('<img class="loading" alt="[loading]" src="'+ Database.load_icon +'" />')
+ .insertAfter(controlLink)
+ .hide();
function refreshLocksTable() {
if (Database.ajax_time_refresh > 0) {
- $.ajax({
+ loading.show();
+ query = $.ajax({
type: 'GET',
dataType: 'html',
url: 'database.php?action=refresh_locks&' + Database.server,
- timeout: Database.ajax_timeout - 100,
cache: false,
contentType: 'application/x-www-form-urlencoded',
success: function(html) {
$('#locks_block').html(html);
timeid = window.setTimeout(refreshLocksTable, Database.ajax_time_refresh)
+ },
+ error: function() {
+ controlLink.click();
+ errmsg.show();
+ },
+ complete: function () {
+ loading.hide();
}
});
}
@@ -22,17 +35,29 @@ $(document).ready(function() {
controlLink.toggle(
function() {
+ $(errmsg).hide();
timeid = window.setTimeout(refreshLocksTable, Database.ajax_time_refresh);
controlLink.html('<img src="'+ Database.str_stop.icon +'" alt="" />&nbsp;'
- + Database.str_stop.text);
+ + Database.str_stop.text + '&nbsp;&nbsp;&nbsp;'
+ );
},
function() {
+ $(errmsg).hide();
+ $(loading).hide();
window.clearInterval(timeid);
+ query.abort();
controlLink.html('<img src="'+ Database.str_start.icon +'" alt="" />&nbsp;'
+ Database.str_start.text
);
}
);
+ /* preload images */
+ $('#control img').hide()
+ .attr('src', Database.str_start.icon)
+ .attr('src', Database.str_stop.icon)
+ .show();
+
+ /* start refreshing */
controlLink.click();
});
diff --git a/lang/english.php b/lang/english.php
index 3526ffcf..cab69712 100644
--- a/lang/english.php
+++ b/lang/english.php
@@ -197,6 +197,7 @@
$lang['strnoserversupplied'] = 'No server supplied!';
$lang['strbadpgdumppath'] = 'Export error: Failed to execute pg_dump (given path in your conf/config.inc.php : %s). Please, fix this path in your configuration and relog.';
$lang['strbadpgdumpallpath'] = 'Export error: Failed to execute pg_dumpall (given path in your conf/config.inc.php : %s). Please, fix this path in your configuration and relog.';
+ $lang['strconnectionfail'] = 'Can not connect to server.';
// Tables
$lang['strtable'] = 'Table';
diff --git a/lang/portuguese-br.php b/lang/portuguese-br.php
index cff37c6f..d32fe3b1 100644
--- a/lang/portuguese-br.php
+++ b/lang/portuguese-br.php
@@ -183,6 +183,7 @@
$lang['strcannotdumponwindows'] = 'O dumping de uma tabela complexa e um nome de esquema não é suportado no Windows.';
$lang['strinvalidserverparam'] = 'Tentativa de conectar com um parâmetro de servidor inválido, possivelmente alguém está tentando hackear o seu sistema.';
$lang['strnoserversupplied'] = 'Nenhum servidor informado!';
+ $lang['strconnectionfail'] = 'A conexão falhou.';
// Tables
$lang['strtable'] = 'Tabela';
diff --git a/lang/portuguese-pt.php b/lang/portuguese-pt.php
index e9dd5a22..de997c94 100644
--- a/lang/portuguese-pt.php
+++ b/lang/portuguese-pt.php
@@ -107,6 +107,7 @@ $lang['strsqlerror'] = 'Erro de SQL:';
$lang['strinstatement'] = 'Indicação de entrada :';
$lang['strinvalidparam'] = 'Parâmetros de script inválidos.';
$lang['strnodata'] = 'Não foram encontradas linhas.';
+$lang['strconnectionfail'] = 'A conexão falhou.';
// Tables
$lang['strtable'] = 'Tabela';
diff --git a/lang/recoded/english.php b/lang/recoded/english.php
index a4a58455..ae278781 100644
--- a/lang/recoded/english.php
+++ b/lang/recoded/english.php
@@ -197,6 +197,7 @@
$lang['strnoserversupplied'] = 'No server supplied!';
$lang['strbadpgdumppath'] = 'Export error: Failed to execute pg_dump (given path in your conf/config.inc.php : %s). Please, fix this path in your configuration and relog.';
$lang['strbadpgdumpallpath'] = 'Export error: Failed to execute pg_dumpall (given path in your conf/config.inc.php : %s). Please, fix this path in your configuration and relog.';
+ $lang['strconnectionfail'] = 'Can not connect to &#195;&#169;&#195;&#168;&#195;&#167;&#195;&#160; server.';
// Tables
$lang['strtable'] = 'Table';
diff --git a/lang/recoded/portuguese-br.php b/lang/recoded/portuguese-br.php
index 4f6d2b7d..70d0569f 100644
--- a/lang/recoded/portuguese-br.php
+++ b/lang/recoded/portuguese-br.php
@@ -183,6 +183,7 @@
$lang['strcannotdumponwindows'] = 'O dumping de uma tabela complexa e um nome de esquema n&#227;o &#233; suportado no Windows.';
$lang['strinvalidserverparam'] = 'Tentativa de conectar com um par&#226;metro de servidor inv&#225;lido, possivelmente algu&#233;m est&#225; tentando hackear o seu sistema.';
$lang['strnoserversupplied'] = 'Nenhum servidor informado!';
+ $lang['strconnectionfail'] = 'A conex&#227;o falhou.';
// Tables
$lang['strtable'] = 'Tabela';
diff --git a/lang/recoded/portuguese-pt.php b/lang/recoded/portuguese-pt.php
index 31229a83..f8f1c4b6 100644
--- a/lang/recoded/portuguese-pt.php
+++ b/lang/recoded/portuguese-pt.php
@@ -107,6 +107,7 @@ $lang['strsqlerror'] = 'Erro de SQL:';
$lang['strinstatement'] = 'Indica&#231;&#227;o de entrada :';
$lang['strinvalidparam'] = 'Par&#226;metros de script inv&#225;lidos.';
$lang['strnodata'] = 'N&#227;o foram encontradas linhas.';
+$lang['strconnectionfail'] = 'A conex&#227;o falhou.';
// Tables
$lang['strtable'] = 'Tabela';
diff --git a/themes/default/global.css b/themes/default/global.css
index 69462256..e039ed9d 100644
--- a/themes/default/global.css
+++ b/themes/default/global.css
@@ -445,7 +445,7 @@ pre.error
display:block;
color:#000;
}
-#fklist td a.fkval {
+#fklist td a.fkval, p.errmsg {
color:red;
}
.normal_field {