Skip to content

Commit

Permalink
More images added
Browse files Browse the repository at this point in the history
  • Loading branch information
jdrodjpl committed Mar 26, 2024
1 parent 0e0f540 commit e5d94fa
Show file tree
Hide file tree
Showing 17 changed files with 83 additions and 26 deletions.
38 changes: 36 additions & 2 deletions cws-test/src/test/java/jpl/cws/test/integration/ui/WebTestIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.openqa.selenium.JavascriptExecutor;

/**
*
* @author ghollins
Expand Down Expand Up @@ -209,14 +211,27 @@ public void runHelloWorldTest() {

waitForElementXPath("//div[@id=\'processes-table_filter\']/label/input");

driver.findElement(By.xpath("//div[@id=\'processes-table_filter\']/label/input")).click();
WebElement filter = driver.findElement(By.xpath("//div[@id=\'processes-table_filter\']/label/input"));

JavascriptExecutor js = (JavascriptExecutor) driver;
js.executeScript("arguments[0].scrollIntoViewIfNeeded();", filter);
// filter.click();

driver.findElement(By.xpath("//div[@id=\'processes-table_filter\']/label/input")).sendKeys("test_hello_world");
driver.findElement(By.xpath("//div[@id=\'processes-table_filter\']/label/input")).sendKeys(Keys.ENTER);

waitForElementID("processes-table");

waitForElementXPath("//a[contains(text(),'History')]");
WebElement historyButton = driver.findElement(By.xpath("//a[contains(text(),'History')]"));
js.executeScript("arguments[0].scrollIntoViewIfNeeded();", historyButton);

try {
File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
// Now you can do whatever you need to do with it, for example copy somewhere
FileUtils.copyFile(scrFile, new File("/tmp/history_button.png"));
} catch(IOException e) {}

historyButton.click();
sleep(1000);

Expand Down Expand Up @@ -252,17 +267,36 @@ public void runGroovyTest() {

waitForElementXPath("//div[@id=\'processes-table_filter\']/label/input");

driver.findElement(By.xpath("//div[@id=\'processes-table_filter\']/label/input")).click();
WebElement filter = driver.findElement(By.xpath("//div[@id=\'processes-table_filter\']/label/input"));

JavascriptExecutor js = (JavascriptExecutor) driver;
js.executeScript("arguments[0].scrollIntoViewIfNeeded();", filter);

// filter.click();
driver.findElement(By.xpath("//div[@id=\'processes-table_filter\']/label/input")).sendKeys("test_groovy_script");
driver.findElement(By.xpath("//div[@id=\'processes-table_filter\']/label/input")).sendKeys(Keys.ENTER);

waitForElementID("processes-table");

waitForElementXPath("//a[contains(text(),'History')]");
WebElement historyButton = driver.findElement(By.xpath("//a[contains(text(),'History')]"));
js.executeScript("arguments[0].scrollIntoViewIfNeeded();", historyButton);

try {
File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
// Now you can do whatever you need to do with it, for example copy somewhere
FileUtils.copyFile(scrFile, new File("/tmp/groovy_button.png"));
} catch(IOException e) {}
historyButton.click();

sleep(1000);

try {
File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
// Now you can do whatever you need to do with it, for example copy somewhere
FileUtils.copyFile(scrFile, new File("/tmp/groovy.png"));
} catch(IOException e) {}

findOnPage("Groovy.");

sleep(9000);
Expand Down
1 change: 1 addition & 0 deletions cws-ui/src/main/webapp/css/dashboard.css
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,7 @@ a.nav-link img {
margin-top: 13px;
position: absolute;
left: 75px;
width: calc(100% - 100px);
}

:target {
Expand Down
3 changes: 3 additions & 0 deletions cws-ui/src/main/webapp/images/check_green.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions cws-ui/src/main/webapp/images/minus_red.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions cws-ui/src/main/webapp/images/pen.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions cws-ui/src/main/webapp/images/save.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions cws-ui/src/main/webapp/images/waterfall.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion install/cws-ui/configuration.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@
<div class="container-fluid">
<div class="row">
<#include "sidebar.ftl">
<div class="col-sm-9 col-md-10 main">
<div class="main-content">

<span id="statusMessageDiv">
<h2>${msg}</h2>
Expand Down
14 changes: 5 additions & 9 deletions install/cws-ui/deployments.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@
}
returnVal += `<a href="/${base}/modeler?procDefKey=` + data.key + `" target="_blank" aria-label="Edit" data-microtip-position="top-right" role="tooltip">`
+ `<span style="float: right;" id="edit-` + data.key + `" class="glyphicon glyphicon-pencil"></span></a>`
+ `<span style="float: right;" id="edit-` + data.key + `"><img height="16" width="16" src="/${base}/images/pen.svg" /></span></a>`
+ `<a data-proc-key="` + data.key + `" onClick="handleDeleteProcDef('` + data.key + `')" aria-label="Delete" data-microtip-position="top-right" role="tooltip">`
+ `<img height="16" width="16" src="/${base}/images/trash.svg" style="cursor: pointer; float: right; color: #d9534f;" id="delete-`
+ data.key + `" /></a>`;
Expand Down Expand Up @@ -598,16 +598,14 @@
var procDefKey = this.data()["key"];
var procDefId = this.data()["id"];
if (status == "false") {
$("#suspend-" + procDefKey).removeClass("glyphicon-play");
$("#suspend-" + procDefKey).addClass("glyphicon-pause");
$("#suspend-" + procDefKey).attr("src", "/${base}/images/pin_pause.svg");
$("#suspend-" + procDefKey).css("color", "#d9534f");
$("#btn-suspend-" + procDefKey).attr("onclick", "suspendProcDef('" + procDefId + "', '" + procDefKey + "')");
$("#status-txt-" + procDefKey).html("Active");
$("#" + procDefKey).removeClass("disabled");
$("#pv-" + procDefKey).removeClass("disabled");
} else {
$("#suspend-" + procDefKey).removeClass("glyphicon-pause");
$("#suspend-" + procDefKey).addClass("glyphicon-play");
$("#suspend-" + procDefKey).attr("src", "/${base}/images/play.svg");
$("#suspend-" + procDefKey).css("color", "green");
$("#btn-suspend-" + procDefKey).attr("onclick", "resumeProcDef('" + procDefId + "', '" + procDefKey + "')");
$("#status-txt-" + procDefKey).html("Suspended");
Expand Down Expand Up @@ -749,8 +747,7 @@
success: function (data) {
console.log("successfully suspended");
//change the glyphicon to play & make green
$("#suspend-" + procDefKey).removeClass("glyphicon-pause");
$("#suspend-" + procDefKey).addClass("glyphicon-play");
$("#suspend-" + procDefKey).attr("src", "/${base}/images/play.svg");
$("#suspend-" + procDefKey).css("color", "green");
$("#btn-suspend-" + procDefKey).attr("onclick", "resumeProcDef('" + procDefId + "', '" + procDefKey + "')");
$("#status-txt-" + procDefKey).html("Suspended");
Expand All @@ -775,8 +772,7 @@
success: function (data) {
console.log("successfully activated");
//change the glyphicon to pause & make color #d9534f
$("#suspend-" + procDefKey).removeClass("glyphicon-play");
$("#suspend-" + procDefKey).addClass("glyphicon-pause");
$("#suspend-" + procDefKey).attr("src", "/${base}/images/pin_pause.svg");
$("#suspend-" + procDefKey).css("color", "#d9534f");
$("#btn-suspend-" + procDefKey).attr("onclick", "suspendProcDef('" + procDefId + "', '" + procDefKey + "')");
$("#status-txt-" + procDefKey).html("Active");
Expand Down
2 changes: 1 addition & 1 deletion install/cws-ui/documentation.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<div class="container-fluid">
<div class="row">
<#include "sidebar.ftl">
<div class="col-sm-9 col-md-10 main">
<div class="main-content">

<span id="statusMessageDiv">
<h2>${msg}</h2>
Expand Down
2 changes: 1 addition & 1 deletion install/cws-ui/initiators.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
<div class="row">
<#include "sidebar.ftl">

<div class="col-sm-9 col-md-10 main">
<div class="main-content">
<span id="statusMessageDiv"><h2>${msg}</h2></span>

<h2 class="sub-header">Initiators</h2>
Expand Down
4 changes: 2 additions & 2 deletions install/cws-ui/logs.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@
$("#logData").DataTable({
language: {
searchBuilder: {
add: "<i class=\"glyphicon glyphicon-search btn-icon\"></i>Add Local Filter",
add: "<img height=\"16\" width=\"16\" src=\"/${base}/images/search.svg\" /> Add Local Filter",
}
},
deferRender: true,
Expand Down Expand Up @@ -647,7 +647,7 @@
<div class="container-fluid">
<div class="row">
<#include "sidebar.ftl">
<div class="col-sm-9 col-md-10 main">
<div class="main-content">

<span id="statusMessageDiv">
<h2>${msg}</h2>
Expand Down
4 changes: 2 additions & 2 deletions install/cws-ui/processes.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<div class="container-fluid">
<div class="row">
<#include "sidebar.ftl">
<div class="col-sm-9 col-md-10 main">
<div class="main-content">

<span id="statusMessageDiv">
<h2>${msg}</h2>
Expand Down Expand Up @@ -979,7 +979,7 @@
});
//add our action dropdown button to the div that datatables created (created in dom: above)
$('<div class="btn-group"><button id="menu3" class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown"><i class="glyphicon glyphicon-tasks btn-icon"></i>&nbsp;Actions &nbsp;'
$('<div class="btn-group"><button id="menu3" class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown"><img height="16" width="16" src="/${base}/images/waterfall.svg" />&nbsp;Actions &nbsp;'
+ '<span class="caret"></span>'
+ '</button>'
+ '<ul id="action-list" class="dropdown-menu" role="menu" aria-labelledby="menu3">'
Expand Down
2 changes: 1 addition & 1 deletion install/cws-ui/sidebar.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstra
<li <#if springMacroRequestContext.requestUri?contains("/summary")> class="active"</#if>><a href="/${base}/summary">System Summary</a></li>
------>

<li <#if springMacroRequestContext.requestUri?contains("/deployments")> class="active"</#if>><a href="/${base}/deployments data-bs-toggle="tooltip" data-bs-title="Deployments"><img height="32" width="32" src="/${base}/images/locate.svg" /></a></li>
<li <#if springMacroRequestContext.requestUri?contains("/deployments")> class="active"</#if>><a href="/${base}/deployments" data-bs-toggle="tooltip" data-bs-title="Deployments"><img height="32" width="32" src="/${base}/images/locate.svg" /></a></li>
<li <#if springMacroRequestContext.requestUri?contains("/workers")> class="active"</#if>><a href="/${base}/workers" data-bs-toggle="tooltip" data-bs-title="Workers"><img height="32" width="32" src="/${base}/images/cpu.svg" /></a></li>
<li <#if springMacroRequestContext.requestUri?contains("/snippets")> class="active"</#if>><a href="/${base}/snippets" data-bs-toggle="tooltip" data-bs-title="Snippets"><img height="32" width="32" src="/${base}/images/snippet.svg" /></a></li>
<li <#if springMacroRequestContext.requestUri?contains("/initiators")> class="active"</#if>><a href="/${base}/initiators" data-bs-toggle="tooltip" data-bs-title="Initiators"><img height="32" width="32" src="/${base}/images/double_chevron_right.svg" /></a></li>
Expand Down
2 changes: 1 addition & 1 deletion install/cws-ui/snippets.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<div class="container-fluid">
<div class="row">
<#include "sidebar.ftl">
<div class="col-sm-9 col-md-10 main">
<div class="main-content">

<span id="statusMessageDiv">
<h2>${msg}</h2>
Expand Down
10 changes: 5 additions & 5 deletions install/cws-ui/summary.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
function refreshElasticsearchStats() {
var greenHtml = 'Good <span class="glyphicon glyphicon-ok" style="color: #51cf66;"></span>';
var redHtml = '<span class="glyphicon glyphicon-remove" style="color: #ff6b6b;"></span> Red';
var offlineHtml = '<span class="glyphicon glyphicon-remove" style="color: #ff6b6b;"></span> Offline';
var timedOutHtml = '<span class="glyphicon glyphicon-remove" style="color: #ff6b6b;"></span> Timed out';
var greenHtml = 'Good <img height="16" width="16" src="/${base}/images/check_green.svg" /></span>';
var redHtml = '<img height="16" width="16" src="/${base}/images/minus_red.svg" /> Red';
var offlineHtml = '<img height="16" width="16" src="/${base}/images/minus_red.svg" /> Offline';
var timedOutHtml = '<img height="16" width="16" src="/${base}/images/minus_red.svg" /> Timed out';
$.ajax({
url: "/${base}/rest/stats/es/cluster/health",
Expand Down Expand Up @@ -79,7 +79,7 @@

<#include "sidebar.ftl">

<div class="col-sm-9 col-md-10 main">
<div class="main-content">
<span id="statusMessageDiv"><h2>${msg}</h2></span>
<h2 class="sub-header">Deployment Summary: <a href="/${base}/deployments">${numTotalProcDefs} deployed, ${numActiveProcDefs} active</a></h2>
<br/>
Expand Down
2 changes: 1 addition & 1 deletion install/cws-ui/workers.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@
<#include "sidebar.ftl">
<div class="col-sm-9 col-md-10 main">
<div class="main-content">
<span id="statusMessageDiv"><h2>${msg}</h2></span>
Expand Down

0 comments on commit e5d94fa

Please sign in to comment.