Skip to content
Snippets Groups Projects
Commit af64ff05 authored by Jonas Blatt's avatar Jonas Blatt :ant:
Browse files

Add status icon for backend + tool tips for buttons

parent 2a42ccd8
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
html, body { html, body {
padding: 0; padding: 0;
font-size: 11pt; font-size: 11pt;
font-family: 'Open Sans', sans-serif;
} }
h1 { h1 {
...@@ -17,6 +18,27 @@ h2 { ...@@ -17,6 +18,27 @@ h2 {
margin: 10px; margin: 10px;
} }
.status-dot {
height: 15px;
width: 15px;
background-color: #bbb;
border-radius: 50%;
display: inline-block;
}
.status-dot.active {
background-color: #0f0;
}
.status-dot.inactive {
background-color: #f00;
}
#backend-status {
float: right;
flex-grow: 1;
}
select { select {
-moz-appearance: none; -moz-appearance: none;
-webkit-appearance: none; -webkit-appearance: none;
......
...@@ -23,23 +23,26 @@ ...@@ -23,23 +23,26 @@
<div class="dmn-root"> <div class="dmn-root">
<div class="dmn-top"> <div class="dmn-top">
<div class="dmn-top-item dmn-upload"> <div class="dmn-top-item dmn-upload">
<label class="clickable" for="dmn-file-upload"> <label class="clickable" for="dmn-file-upload" title="Upload dmn">
</label> </label>
<input id="dmn-file-upload" type="file"/> <input id="dmn-file-upload" type="file"/>
</div> </div>
<div class="dmn-top-item dmn-empty-file"> <div class="dmn-top-item dmn-empty-file">
<label class="clickable" for="dmn-file-empty"> <label class="clickable" for="dmn-file-empty" title="Create empty dmn">
</label> </label>
<input id="dmn-file-empty" type="button"/> <input id="dmn-file-empty" type="button"/>
</div> </div>
<div class="dmn-top-item dmn-download"> <div class="dmn-top-item dmn-download">
<label class="clickable" for="dmn-file-download"> <label class="clickable" for="dmn-file-download" title="Download current dmn">
</label> </label>
<input id="dmn-file-download" type="button"/> <input id="dmn-file-download" type="button"/>
</div> </div>
<div class="dmn-top-item"> <div class="dmn-top-item">
<h1>Verification for Decision Modeling Notation</h1> <h1>Verification for Decision Modeling Notation</h1>
</div> </div>
<div class="dmn-top-item">
<span class="status-dot" id="backend-status" title="Backend status"/>
</div>
</div> </div>
<div id="content-dmn"> <div id="content-dmn">
<div class="editor-parent"> <div class="editor-parent">
......
let rootUrl = 'http://' + window.location.hostname + ':8080/'; let rootUrl = 'http://' + window.location.hostname + ':8080/';
let dmnApi = rootUrl + 'api/dmn/'; let dmnApi = rootUrl + 'api/dmn/';
let inactiveBackend = true;
/** /**
* Global definition for verification results * Global definition for verification results
...@@ -15,12 +16,31 @@ let types = []; ...@@ -15,12 +16,31 @@ let types = [];
let $verifierTypes; let $verifierTypes;
function handleStatus() {
let $dot = $('#backend-status');
if (inactiveBackend) {
$dot.removeClass('active');
$dot.addClass('inactive');
} else {
$dot.removeClass('inactive');
$dot.addClass('active');
}
}
// load types // load types
$.ajax({ $.ajax({
timeout: 500,
url: dmnApi + 'verification/types', url: dmnApi + 'verification/types',
type: 'GET', type: 'GET',
contentType: 'text/xml', contentType: 'text/xml',
error: function (err) {
verifierResults = {};
inactiveBackend = true;
handleStatus();
},
success: function (data) { success: function (data) {
inactiveBackend = false;
handleStatus();
types = data; types = data;
// sort types by classification and name // sort types by classification and name
types.sort(function ( types.sort(function (
...@@ -59,7 +79,8 @@ function cleanDmnVerifierRoot() { ...@@ -59,7 +79,8 @@ function cleanDmnVerifierRoot() {
}); });
// Add Button // Add Button
$header.append($(` $header.append($(`
<button class="clickable dmn-verifier-header-item" id="dmn-button-verify" onClick="checkVerifications()"> <button class="clickable dmn-verifier-header-item" id="dmn-button-verify"
title="Request verifications" onClick="checkVerifications()">
Verify</button> Verify</button>
`)); `));
// add header to root // add header to root
...@@ -95,6 +116,7 @@ function getVerifications() { ...@@ -95,6 +116,7 @@ function getVerifications() {
} }
} }
$.ajax({ $.ajax({
timeout: 0, // ??
url: apiPath, url: apiPath,
type: 'POST', type: 'POST',
contentType: 'text/xml', contentType: 'text/xml',
...@@ -132,6 +154,7 @@ function getVerifications() { ...@@ -132,6 +154,7 @@ function getVerifications() {
function renderTypeOptions() { function renderTypeOptions() {
let $select = $(` let $select = $(`
<select name="verifier[]" id="dmn-verifier-types" multiple="multiple" <select name="verifier[]" id="dmn-verifier-types" multiple="multiple"
title="Preselect verifications"
class="dmn-verifier-header-item dmn-verifier-select clickable"> class="dmn-verifier-header-item dmn-verifier-select clickable">
`); `);
let currentOpt = ''; let currentOpt = '';
...@@ -162,6 +185,7 @@ function renderDmnVerifierOptions() { ...@@ -162,6 +185,7 @@ function renderDmnVerifierOptions() {
let $select = $(` let $select = $(`
<select name="verifier" id="verifier" <select name="verifier" id="verifier"
class="dmn-verifier-header-item dmn-verifier-select clickable" class="dmn-verifier-header-item dmn-verifier-select clickable"
title="Select calculated verification"
onchange="renderVerifierResult(this)"> onchange="renderVerifierResult(this)">
`); `);
$select.append($(`<option>Select a verifier</option>`)); $select.append($(`<option>Select a verifier</option>`));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment