[Kimchi-devel] [PATCH v3] [Wok] Bug fix #144: The filter of of the user activity log shows loading forever
Lucio Correia
luciojhc at linux.vnet.ibm.com
Wed Dec 14 17:21:16 UTC 2016
Reviewed-By: Lucio Correia <luciojhc at linux.vnet.ibm.com>
On 14/12/2016 14:41, bianca at linux.vnet.ibm.com wrote:
> From: Bianca Carvalho <bianca at linux.vnet.ibm.com>
>
> User log data was storing null value to user field, changed the reqlogger.py
> and wok.user-log.js to make sure both get 'N/A' instead of null.
>
> Signed-off-by: Bianca Carvalho <bianca at linux.vnet.ibm.com>
> ---
> src/wok/reqlogger.py | 2 +-
> ui/js/wok.user-log.js | 4 ++++
> 2 files changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/src/wok/reqlogger.py b/src/wok/reqlogger.py
> index b51abf1..92e155d 100644
> --- a/src/wok/reqlogger.py
> +++ b/src/wok/reqlogger.py
> @@ -99,7 +99,7 @@ def log_request(code, params, exception, method, status, app=None, user=None,
> app = cherrypy.request.app.script_name
>
> if user is None:
> - user = cherrypy.session.get(USER_NAME, 'N/A')
> + user = cherrypy.session.get(USER_NAME, 'N/A') or 'N/A'
>
> if ip is None:
> ip = cherrypy.request.remote.ip
> diff --git a/ui/js/wok.user-log.js b/ui/js/wok.user-log.js
> index e49e428..fa4945f 100644
> --- a/ui/js/wok.user-log.js
> +++ b/ui/js/wok.user-log.js
> @@ -155,11 +155,15 @@ wok.initUserLogConfigGridData = function() {
> wok.getUserLogs(function(result) {
> $.each(result, function(index, log){
> var statusLabel = labelStyle(log.status);
> + var userLabel = labelStyle(log.user);
> if (statusLabel != null) {
> log.status = "<span class='" + statusLabel.labelColor + "'><i class='" + statusLabel.labelIcon + "' aria-hidden='true'></i> " + log.status + "</span> ";
> } else {
> log.status = "";
> }
> + if (userLabel == null) {
> + log.user = "N/A";
> + }
> })
> wok.loadBootgridData(wok.opts_user_log['gridId'], result);
> wok.showBootgridData(wok.opts_user_log);
>
--
Lucio Correia
Software Engineer
IBM LTC Brazil
More information about the Kimchi-devel
mailing list