From de9f0cc3df1f1c29a3ba836a6ff433a7391842ad Mon Sep 17 00:00:00 2001 From: Ivan Maslov Date: Mon, 15 Feb 2021 12:08:24 +0300 Subject: [PATCH] # ORC WEB - Add freeze logs textarea button - tested! --- Sources/pyOpenRPA/Orchestrator/Web/Index.js | 23 ++++++++++++++++++- .../pyOpenRPA/Orchestrator/Web/Index.xhtml | 2 ++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/Sources/pyOpenRPA/Orchestrator/Web/Index.js b/Sources/pyOpenRPA/Orchestrator/Web/Index.js index 518ef37c..5af28fa7 100644 --- a/Sources/pyOpenRPA/Orchestrator/Web/Index.js +++ b/Sources/pyOpenRPA/Orchestrator/Web/Index.js @@ -548,6 +548,26 @@ $(document).ready(function() { /// v1.2.0 pyOpenRPA ServerLogs mGlobal.pyOpenRPA.ServerLogList = null mGlobal.pyOpenRPA.ServerLogListHashStr = "" + mGlobal.pyOpenRPA.ServerLogListDoRenderBool = true + ///Turn OFF rendering + mGlobal.pyOpenRPA.ServerLogListDoRenderFalse = function() { + ///Set unfreeze button + $("a.mGlobal-pyOpenRPA-ServerLogListDoRender").html("Unfreeze textarea") + $("a.mGlobal-pyOpenRPA-ServerLogListDoRender").attr("onclick","mGlobal.pyOpenRPA.ServerLogListDoRenderTrue()") + $("textarea.mGlobal-pyOpenRPA-ServerLogList").css("background-color","#b9e2e8") + mGlobal.pyOpenRPA.ServerLogListDoRenderBool = false + } + ///Turn ON rendering + mGlobal.pyOpenRPA.ServerLogListDoRenderTrue = function() { + mGlobal.pyOpenRPA.ServerLogListDoRenderBool = true + ///Render last data + mGlobal.pyOpenRPA.ServerLogListRefreshDef_TechnicalRender() + ///Set unfreeze button + $("a.mGlobal-pyOpenRPA-ServerLogListDoRender").html("Freeze textarea") + $("a.mGlobal-pyOpenRPA-ServerLogListDoRender").attr("onclick","mGlobal.pyOpenRPA.ServerLogListDoRenderFalse()") + $("textarea.mGlobal-pyOpenRPA-ServerLogList").css("background-color","") + + } mGlobal.pyOpenRPA.ServerLogListScrollBottomDef = function() { var lTA = $("textarea.mGlobal-pyOpenRPA-ServerLogList")[0]; lTA.scrollTop = lTA.scrollHeight; @@ -555,7 +575,7 @@ $(document).ready(function() { mGlobal.pyOpenRPA.ServerLogListRefreshDef_TechnicalRender = function() { lResponseJSON = mGlobal.pyOpenRPA.ServerLogList - if (lResponseJSON!= null) { + if (lResponseJSON!= null && mGlobal.pyOpenRPA.ServerLogListDoRenderBool==true) { lText = lResponseJSON.join("\n") /// Code for the processing the text $("textarea.mGlobal-pyOpenRPA-ServerLogList")[0].value= lText ///Прогрузить новую таблицу mGlobal.pyOpenRPA.ServerLogListScrollBottomDef() //Scroll to the bottom @@ -869,5 +889,6 @@ $(document).ready(function() { mGlobal.pyOpenRPA.ServerJSInitDef() // Recieve JS from server (if exist) and then call anothe url ServerData mGlobal.pyOpenRPA.ServerDataRefreshDef() // Init the refresh data def from server side mGlobal.pyOpenRPA.ServerLogListRefreshDef() // Init the refresh data def from the log window + mGlobal.pyOpenRPA.ServerLogListDoRenderTrue() // Init button to freeze/unfreeze textare with logs }); \ No newline at end of file diff --git a/Sources/pyOpenRPA/Orchestrator/Web/Index.xhtml b/Sources/pyOpenRPA/Orchestrator/Web/Index.xhtml index ac92dc76..74e4976d 100644 --- a/Sources/pyOpenRPA/Orchestrator/Web/Index.xhtml +++ b/Sources/pyOpenRPA/Orchestrator/Web/Index.xhtml @@ -286,9 +286,11 @@ Logs + + Freeze textarea