[Kimchi-devel] [PATCH v2 stable][Wok] Bug fix #144: The filter of of the user activity log shows loading forever
bianca at linux.vnet.ibm.com
bianca at linux.vnet.ibm.com
Wed Dec 14 16:48:20 UTC 2016
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 37190dc..49c9589 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);
--
2.9.3
More information about the Kimchi-devel
mailing list