From 0b92218c5b815abf9c9e7cb8168a1d2f01912eb8 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Thu, 17 Nov 2016 22:44:30 +0800 Subject: configs: Update logging message format * Also update the logging messages styles for the Web UI * Show a modal notification when the task finished. --- fg21sim/configs/00-general.conf.spec | 2 +- fg21sim/webui/static/js/console.js | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/fg21sim/configs/00-general.conf.spec b/fg21sim/configs/00-general.conf.spec index 0a84673..42900c1 100644 --- a/fg21sim/configs/00-general.conf.spec +++ b/fg21sim/configs/00-general.conf.spec @@ -108,7 +108,7 @@ OmegaM0 = float(default=0.27, min=0.0, max=1.0) level = option("DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL", default="INFO") # Set the format of displayed messages -format = string(default="%(asctime)s [%(levelname)s] %(name)s: %(message)s") +format = string(default="%(asctime)s [%(levelname)s] <%(name)s> %(message)s") # Set the date/time format in messages datefmt = string(default="%Y-%m-%dT%H:%M:%S") diff --git a/fg21sim/webui/static/js/console.js b/fg21sim/webui/static/js/console.js index 69b475a..6392b96 100644 --- a/fg21sim/webui/static/js/console.js +++ b/fg21sim/webui/static/js/console.js @@ -83,8 +83,9 @@ var appendLogMessage = function (msg) { var ele = $("

").addClass("code log log-" + level); ele.append($(log_icons[level])); ele.append($("").addClass("asctime").text(msg.asctime)); - ele.append($("").addClass("levelname").text(msg.levelname)); - ele.append($("").addClass("name").text(msg.name)); + ele.append($("").addClass("levelname") + .text("[" + msg.levelname + "]")); + ele.append($("").addClass("name").text("<" + msg.name + ">")); ele.append($("").addClass("message").text(msg.message)); ele.appendTo("#log-messages"); }; @@ -206,6 +207,11 @@ $(document).ready(function () { getServerTaskStatus(ajax_url) .done(function (response) { updateTaskStatus(response.status); + // Popup a modal notification + var modalData = {}; + modalData.icon = "check-circle"; + modalData.message = "Simulation task successfully finished."; + showModalConfigs(modalData); }); }); } else { -- cgit v1.2.2