From b98bf6d1cac909287f08b453abfba6cde0f074ac Mon Sep 17 00:00:00 2001 From: yshepilov Date: Thu, 21 May 2020 16:58:04 +0200 Subject: [PATCH] #145 added possibility to run multiple instances of the same script --- web-src/src/assets/css/index.css | 5 - web-src/src/common/components/AppLayout.vue | 69 ++-- web-src/src/common/utils/common.js | 8 + web-src/src/main-app/MainApp.vue | 2 +- .../components/history/AppHistoryHeader.vue | 21 +- .../scripts/ExecutionInstanceTabs.vue | 225 +++++++++++++ .../components/scripts/MainAppContent.vue | 3 +- .../components/scripts/ScriptHeader.vue | 34 +- .../scripts/script-parameters-view.vue | 4 +- .../components/scripts/script-view.vue | 13 +- web-src/src/main-app/index.js | 6 + web-src/src/main-app/store/index.js | 10 +- .../main-app/store/scriptExecutionManager.js | 104 ++++-- .../tests/unit/common/utils/common_test.js | 38 ++- .../unit/history/execution-details_test.js | 3 +- .../scripts/ExecutionInstanceTabs_test.js | 310 ++++++++++++++++++ .../scripts/ScriptLoadingText_test.js | 3 - .../store/scriptExecutionManager_test.js | 248 ++++++++++++++ web-src/tests/unit/test_utils.js | 2 + 19 files changed, 1019 insertions(+), 89 deletions(-) create mode 100644 web-src/src/main-app/components/scripts/ExecutionInstanceTabs.vue create mode 100644 web-src/tests/unit/main-app/components/scripts/ExecutionInstanceTabs_test.js create mode 100644 web-src/tests/unit/main-app/store/scriptExecutionManager_test.js diff --git a/web-src/src/assets/css/index.css b/web-src/src/assets/css/index.css index 0f254863..da2b1fc9 100644 --- a/web-src/src/assets/css/index.css +++ b/web-src/src/assets/css/index.css @@ -156,8 +156,3 @@ input[type=checkbox]:not(.browser-default) + span { #login-google_oauth-button[disabled] { color: #B0B0B0; } - -.main-content-header { - background: url('../titleBackground_small.jpg') no-repeat; - background-size: cover; -} \ No newline at end of file diff --git a/web-src/src/common/components/AppLayout.vue b/web-src/src/common/components/AppLayout.vue index 7ae6545e..2e36a1c7 100644 --- a/web-src/src/common/components/AppLayout.vue +++ b/web-src/src/common/components/AppLayout.vue @@ -133,6 +133,8 @@ display: flex; flex-direction: column; + + width: 100vw; } .app-menu-button { @@ -141,7 +143,6 @@ float: left; position: relative; z-index: 1; - margin-right: 8px; margin-top: 12px; text-align: center; } @@ -155,36 +156,20 @@ line-height: 1; } - @media (max-width: 992px) { - .app-sidebar { - position: absolute; - height: 100vh; - z-index: 999; - transition: transform 0.3s; - } - - .app-sidebar.collapsed { - -webkit-transform: translateX(-105%); - transform: translateX(-105%); - } - - .sidenav-overlay { - opacity: 1; - display: block; - background-color: rgba(0, 0, 0, 0.4); - } - - .app-menu-button { - display: block; - } - } - .content-header { flex: 0 0 auto; + overflow: hidden; + width: 100%; + z-index: 1; + padding-left: 24px; + border-bottom: 1px solid #C8C8C8; position: relative; + + background: url('../../assets/titleBackground_small.jpg') no-repeat; + background-size: cover; } .content-header.drop-shadow { @@ -199,9 +184,43 @@ margin: 0; bottom: 0; position: absolute; + left: 0; } .content-panel { flex: 1 1 0; } + + @media (max-width: 992px) { + .content-header { + padding-left: 0; + } + + .app-sidebar { + position: absolute; + height: 100vh; + z-index: 999; + transition: transform 0.3s; + } + + .app-sidebar.collapsed { + -webkit-transform: translateX(-105%); + transform: translateX(-105%); + } + + .sidenav-overlay { + opacity: 1; + display: block; + background-color: rgba(0, 0, 0, 0.4); + position: absolute; + z-index: 500; + width: 100%; + height: 100%; + } + + .app-menu-button { + display: block; + margin-right: 12px; + } + } \ No newline at end of file diff --git a/web-src/src/common/utils/common.js b/web-src/src/common/utils/common.js index 00dccf15..0f0a856e 100644 --- a/web-src/src/common/utils/common.js +++ b/web-src/src/common/utils/common.js @@ -658,4 +658,12 @@ export function randomInt(start, end) { const random = Math.random() * (end - start); return Math.floor(random) + start +} + +export function trimTextNodes(el) { + for (let node of el.childNodes) { + if (node.nodeType === Node.TEXT_NODE) { + node.data = node.data.trim(); + } + } } \ No newline at end of file diff --git a/web-src/src/main-app/MainApp.vue b/web-src/src/main-app/MainApp.vue index ec611e9a..2d480f81 100644 --- a/web-src/src/main-app/MainApp.vue +++ b/web-src/src/main-app/MainApp.vue @@ -61,7 +61,7 @@ } - \ No newline at end of file diff --git a/web-src/src/main-app/components/scripts/ExecutionInstanceTabs.vue b/web-src/src/main-app/components/scripts/ExecutionInstanceTabs.vue new file mode 100644 index 00000000..5acec72e --- /dev/null +++ b/web-src/src/main-app/components/scripts/ExecutionInstanceTabs.vue @@ -0,0 +1,225 @@ + + + + + \ No newline at end of file diff --git a/web-src/src/main-app/components/scripts/MainAppContent.vue b/web-src/src/main-app/components/scripts/MainAppContent.vue index a014b26d..c3fb9c64 100644 --- a/web-src/src/main-app/components/scripts/MainAppContent.vue +++ b/web-src/src/main-app/components/scripts/MainAppContent.vue @@ -58,7 +58,7 @@ height: 100%; background: white; - padding-bottom: 12px; + padding: 16px 24px 12px; display: flex; flex-direction: column; @@ -77,7 +77,6 @@ } .error-panel { - margin-left: 17px; color: #F44336; margin-top: 17px; } diff --git a/web-src/src/main-app/components/scripts/ScriptHeader.vue b/web-src/src/main-app/components/scripts/ScriptHeader.vue index b1b1e62a..89fa14ac 100644 --- a/web-src/src/main-app/components/scripts/ScriptHeader.vue +++ b/web-src/src/main-app/components/scripts/ScriptHeader.vue @@ -1,20 +1,48 @@ \ No newline at end of file diff --git a/web-src/src/main-app/components/scripts/script-parameters-view.vue b/web-src/src/main-app/components/scripts/script-parameters-view.vue index e6261452..701b1a09 100644 --- a/web-src/src/main-app/components/scripts/script-parameters-view.vue +++ b/web-src/src/main-app/components/scripts/script-parameters-view.vue @@ -67,13 +67,13 @@