From 197512b75c22abfdf235689a1e26099cecc02b7e Mon Sep 17 00:00:00 2001 From: Yan Pujante Date: Sun, 28 Jul 2013 15:01:15 -1000 Subject: [PATCH] #222: fixed issue when role is USER - workaround for grails bug http://jira.grails.org/browse/GRAILS-10293 --- .../grails-app/conf/UrlMappings.groovy | 2 +- .../grails-app/views/agents/commands.gsp | 42 +++++++++---------- .../grails-app/views/commands/list.gsp | 30 +++++-------- 3 files changed, 32 insertions(+), 42 deletions(-) diff --git a/console/org.linkedin.glu.console-webapp/grails-app/conf/UrlMappings.groovy b/console/org.linkedin.glu.console-webapp/grails-app/conf/UrlMappings.groovy index a9be22fb..75347f94 100644 --- a/console/org.linkedin.glu.console-webapp/grails-app/conf/UrlMappings.groovy +++ b/console/org.linkedin.glu.console-webapp/grails-app/conf/UrlMappings.groovy @@ -25,7 +25,7 @@ class UrlMappings public static final String MODULE = "org.linkedin.glu.console.conf.UrlMappings" public static final Logger log = LoggerFactory.getLogger(MODULE); - private static def role = { path -> + private static Closure role = { path -> def userRole = ConsoleConfig.getInstance().console.security.roles."${path}" if(!userRole) { diff --git a/console/org.linkedin.glu.console-webapp/grails-app/views/agents/commands.gsp b/console/org.linkedin.glu.console-webapp/grails-app/views/agents/commands.gsp index b8a2bb9e..b6fc1bc8 100644 --- a/console/org.linkedin.glu.console-webapp/grails-app/views/agents/commands.gsp +++ b/console/org.linkedin.glu.console-webapp/grails-app/views/agents/commands.gsp @@ -34,7 +34,6 @@ - function shouldRefresh() { return document.getElementById('autoRefresh').checked; @@ -43,7 +42,7 @@ function autoRefresh() { if(shouldRefresh()) { - setTimeout('refresh()', ${params.refreshRate ?: '2000'}); + setTimeout('refreshHistory()', ${params.refreshRate ?: '2000'}); show('#autoRefreshSpinner'); showHide(); } @@ -52,18 +51,21 @@ function autoRefresh() hide('#autoRefreshSpinner'); } } +function refreshHistory() +{ + ${g.remoteFunction(controller: 'commands', action: 'renderHistory', params: [agentId: params.id, offset: offset, max: max], update:[success: 'asyncDetailsHistory', failure: 'asyncErrorHistory'], onComplete: 'autoRefresh();')} +} +function refreshCommand() +{ + + ${g.remoteFunction(controller: 'commands', action: 'renderCommand', id: params.commandId, update:[success: 'asyncDetailsCommand', failure: 'asyncErrorCommand'])} + +} function refresh() { - if(shouldRefresh()) - { - ${g.remoteFunction(controller: 'commands', action: 'renderHistory', params: [agentId: params.id, offset: offset, max: max], update:[success: 'asyncDetails', failure: 'asyncError'], onComplete: 'autoRefresh();')} - } - else - { - hide('#autoRefreshSpinner'); - } + refreshCommand(); + refreshHistory(); } - function showHide() { @@ -97,23 +99,21 @@ function showHide() -
+
+
+
+
-

Auto Refresh: - Spinner +

Auto Refresh: + Spinner | ${filter.value}:

- -
-
-
- - - +
+
\ No newline at end of file diff --git a/console/org.linkedin.glu.console-webapp/grails-app/views/commands/list.gsp b/console/org.linkedin.glu.console-webapp/grails-app/views/commands/list.gsp index cacaeb2f..c74af0e6 100644 --- a/console/org.linkedin.glu.console-webapp/grails-app/views/commands/list.gsp +++ b/console/org.linkedin.glu.console-webapp/grails-app/views/commands/list.gsp @@ -39,7 +39,6 @@ - function shouldRefresh() { return document.getElementById('autoRefresh').checked; @@ -48,7 +47,7 @@ function autoRefresh() { if(shouldRefresh()) { - setTimeout('refresh()', ${params.refreshRate ?: '2000'}); + setTimeout('refreshHistory()', ${params.refreshRate ?: '2000'}); show('#autoRefreshSpinner'); showHide(); } @@ -57,18 +56,14 @@ function autoRefresh() hide('#autoRefreshSpinner'); } } +function refreshHistory() +{ + ${g.remoteFunction(controller: 'commands', action: 'renderHistory', params: [offset: offset, max: max], update:[success: 'asyncDetailsHistory', failure: 'asyncErrorHistory'], onComplete: 'autoRefresh();')} +} function refresh() { - if(shouldRefresh()) - { - ${g.remoteFunction(controller: 'commands', action: 'renderHistory', params: [offset: offset, max: max], update:[success: 'asyncDetails', failure: 'asyncError'], onComplete: 'autoRefresh();')} - } - else - { - hide('#autoRefreshSpinner'); - } + refreshHistory(); } - function showHide() { @@ -87,19 +82,14 @@ function showHide()
-

Auto Refresh: - Spinner +

Auto Refresh: + Spinner | ${filter.value}:

- -
-
-
- - - +
+
\ No newline at end of file