Global write permission | lock button
+ lock icon added: click -> toggle global write permission
This commit is contained in:
@ -76,12 +76,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="center"></div>
|
<div id="center"></div>
|
||||||
<div id="close-cross">
|
<div class = "icon-close-container icon-main-container">
|
||||||
<!-- × -->
|
<img class = "icon-close icon-main" src="res/icon_sinus.png">
|
||||||
<img class = "icon-close" src="res/icon_sinus.png">
|
|
||||||
</div>
|
</div>
|
||||||
<div class="log-icon-container">
|
<div class="icon-log-container icon-main-container">
|
||||||
<img class = "log-icon" src="res/icon_log.png">
|
<img class = "icon-log icon-main" src="res/icon_log.png">
|
||||||
|
</div>
|
||||||
|
<div class="icon-lock-container icon-main-container">
|
||||||
|
<img class = "icon-lock icon-main" src="res/icon_lock_closed.png">
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
@ -21,8 +21,6 @@
|
|||||||
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% */
|
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% */
|
||||||
/* panel */
|
/* panel */
|
||||||
|
|
||||||
/* ------------------------------ modules-icons ------------------------------ */
|
|
||||||
|
|
||||||
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% */
|
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% */
|
||||||
/* row */
|
/* row */
|
||||||
|
|
||||||
@ -53,7 +51,9 @@
|
|||||||
background-color: orangered;
|
background-color: orangered;
|
||||||
}
|
}
|
||||||
|
|
||||||
.modules-icon {
|
/* ------------------------------ icon-modules ------------------------------ */
|
||||||
|
|
||||||
|
.icon-modules {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 12px;
|
width: 12px;
|
||||||
height: 12px;
|
height: 12px;
|
||||||
@ -95,31 +95,31 @@
|
|||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ------------------------------ status-icon ------------------------------ */
|
/* ------------------------------ icon-status ------------------------------ */
|
||||||
|
|
||||||
.status-icon {
|
.icon-status {
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
background-color: lightgray;
|
background-color: lightgray;
|
||||||
margin-right: 4px;
|
margin-right: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.status-icon-idle {
|
.icon-status-idle {
|
||||||
background-color: lightgray;
|
background-color: lightgray;
|
||||||
}
|
}
|
||||||
|
|
||||||
.status-icon-idle {
|
.icon-status-idle {
|
||||||
background-color: white;
|
background-color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
.status-icon-busy {
|
.icon-status-busy {
|
||||||
background-color: yellow;
|
background-color: yellow;
|
||||||
}
|
}
|
||||||
|
|
||||||
.status-icon-warn {
|
.icon-status-warn {
|
||||||
background-color: orange;
|
background-color: orange;
|
||||||
}
|
}
|
||||||
|
|
||||||
.status-icon-error {
|
.icon-status-error {
|
||||||
background-color: red;
|
background-color: red;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -134,7 +134,7 @@
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.status-icon:hover ~ .status-info {
|
.icon-status:hover ~ .status-info {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -163,18 +163,22 @@
|
|||||||
|
|
||||||
/* ------------------------------ edit-icon ------------------------------ */
|
/* ------------------------------ edit-icon ------------------------------ */
|
||||||
|
|
||||||
.edit-icon {
|
.icon-edit {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 4px;
|
top: 4px;
|
||||||
right: 2px;
|
right: 2px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.edit-icon:hover {
|
.icon-edit:hover {
|
||||||
transform: scale(.8);
|
transform: scale(.8);
|
||||||
opacity: .6;
|
opacity: .6;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.icon-edit-hidden {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% */
|
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% */
|
||||||
/* INPUT ELEMENTS */
|
/* INPUT ELEMENTS */
|
||||||
|
|
||||||
@ -188,7 +192,7 @@
|
|||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
.input-element-hidden {
|
.input-element-hidden, .input-element-button-hidden {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -179,48 +179,57 @@ meta, body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% */
|
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% */
|
||||||
/* CLOSE CROSS */
|
/* MAIN ICONS */
|
||||||
|
|
||||||
#close-cross {
|
.icon-main-container {
|
||||||
z-index: 50;
|
|
||||||
top: 9px;
|
|
||||||
right: 12px;
|
|
||||||
position: fixed;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-close {
|
|
||||||
height: 20px;
|
|
||||||
width: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-close:hover {
|
|
||||||
transform: scale(90%);
|
|
||||||
transition: .5s;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% */
|
|
||||||
/* LOG ICON */
|
|
||||||
|
|
||||||
.log-icon-container {
|
|
||||||
z-index: 1001;
|
z-index: 1001;
|
||||||
bottom: 9px;
|
|
||||||
right: 12px;
|
|
||||||
position: fixed;
|
position: fixed;
|
||||||
color: white;
|
color: white;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.log-icon-container-hidden {
|
.icon-main {
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.log-icon {
|
|
||||||
height: 20px;
|
height: 20px;
|
||||||
width: 20px;
|
width: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.log-icon:hover {
|
.icon-main:hover {
|
||||||
transform: scale(90%);
|
transform: scale(90%);
|
||||||
transition: .5s;
|
transition: .5s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-main-container-hidden {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------------------------------------------------- */
|
||||||
|
/* CLOSE CROSS */
|
||||||
|
|
||||||
|
.icon-close-container {
|
||||||
|
top: 9px;
|
||||||
|
right: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------------------------------------------------- */
|
||||||
|
/* LOG ICON */
|
||||||
|
|
||||||
|
.icon-log-container {
|
||||||
|
bottom: 9px;
|
||||||
|
right: 42px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-log-container-hidden {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------------------------------------------------- */
|
||||||
|
/* LOCK ICON */
|
||||||
|
|
||||||
|
.icon-lock-container {
|
||||||
|
bottom: 9px;
|
||||||
|
right: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-lock-container-hidden {
|
||||||
|
display: none;
|
||||||
}
|
}
|
@ -239,31 +239,31 @@ function updateStatus(component) {
|
|||||||
status_info.innerHTML = component.formatted;
|
status_info.innerHTML = component.formatted;
|
||||||
}
|
}
|
||||||
|
|
||||||
status_icon.classList.remove('status-icon-disabled');
|
status_icon.classList.remove('icon-status-disabled');
|
||||||
status_icon.classList.remove('status-icon-idle');
|
status_icon.classList.remove('icon-status-idle');
|
||||||
status_icon.classList.remove('status-icon-warn');
|
status_icon.classList.remove('icon-status-warn');
|
||||||
status_icon.classList.remove('status-icon-busy');
|
status_icon.classList.remove('icon-status-busy');
|
||||||
status_icon.classList.remove('status-icon-error');
|
status_icon.classList.remove('icon-status-error');
|
||||||
row.classList.remove('row-disabled');
|
row.classList.remove('row-disabled');
|
||||||
right.classList.remove = 'col-right-disabled';
|
right.classList.remove = 'col-right-disabled';
|
||||||
|
|
||||||
switch (statusCode) {
|
switch (statusCode) {
|
||||||
case 0:
|
case 0:
|
||||||
status_icon.classList.add('status-icon-disabled');
|
status_icon.classList.add('icon-status-disabled');
|
||||||
row.classList.add('row-disabled');
|
row.classList.add('row-disabled');
|
||||||
right.classList.add = 'col-right-disabled';
|
right.classList.add = 'col-right-disabled';
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
status_icon.classList.add('status-icon-idle');
|
status_icon.classList.add('icon-status-idle');
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
status_icon.classList.add('status-icon-warn');
|
status_icon.classList.add('icon-status-warn');
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
status_icon.classList.add('status-icon-busy');
|
status_icon.classList.add('icon-status-busy');
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
status_icon.classList.add('status-icon-error');
|
status_icon.classList.add('icon-status-error');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -399,7 +399,7 @@ function successHandler(s, message) {
|
|||||||
isl = appendToGridElement(2, message.title, 'parameters', createContent(message));
|
isl = appendToGridElement(2, message.title, 'parameters', createContent(message));
|
||||||
adjustGrid();
|
adjustGrid();
|
||||||
if (nColumns == 1 || nColumns == 2 || nColumns == 3) {
|
if (nColumns == 1 || nColumns == 2 || nColumns == 3) {
|
||||||
document.getElementById('close-cross').innerHTML = '<img class = "icon-close" src="res/icon_close.png">';
|
document.getElementsByClassName('icon-close-container')[0].innerHTML = '<img class = "icon-main icon-close" src="res/icon_close.png">';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
nextInitCommand();
|
nextInitCommand();
|
||||||
|
@ -82,7 +82,7 @@ function createRowForParameters(component) {
|
|||||||
break;
|
break;
|
||||||
case 'pushbutton':
|
case 'pushbutton':
|
||||||
input_element = createPushbutton(component);
|
input_element = createPushbutton(component);
|
||||||
input_element.classList.add('input-element-button');
|
input_element.classList.add('input-element-button', 'input-element-button-hidden');
|
||||||
break;
|
break;
|
||||||
case 'input':
|
case 'input':
|
||||||
input_element = createInput(component);
|
input_element = createInput(component);
|
||||||
@ -104,7 +104,7 @@ function createRowForParameters(component) {
|
|||||||
function createIconEdit () {
|
function createIconEdit () {
|
||||||
let icon_edit = document.createElement('img');
|
let icon_edit = document.createElement('img');
|
||||||
icon_edit.setAttribute('src', 'res/icon_edit.png');
|
icon_edit.setAttribute('src', 'res/icon_edit.png');
|
||||||
icon_edit.classList.add('modules-icon', 'edit-icon');
|
icon_edit.classList.add('icon-modules', 'icon-edit', 'icon-edit-hidden');
|
||||||
|
|
||||||
icon_edit.onclick = function () {
|
icon_edit.onclick = function () {
|
||||||
let is_hidden = input_element.classList.contains('input-element-hidden');
|
let is_hidden = input_element.classList.contains('input-element-hidden');
|
||||||
@ -156,14 +156,14 @@ function createLeftColumnForModules(component) {
|
|||||||
let icon_status = document.createElement('img');
|
let icon_status = document.createElement('img');
|
||||||
icon_status.setAttribute('src', 'res/icon_status.png');
|
icon_status.setAttribute('src', 'res/icon_status.png');
|
||||||
icon_status.setAttribute('name', component.title + ':status');
|
icon_status.setAttribute('name', component.title + ':status');
|
||||||
icon_status.classList.add('modules-icon', 'status-icon');
|
icon_status.classList.add('icon-modules', 'icon-status');
|
||||||
return icon_status;
|
return icon_status;
|
||||||
}
|
}
|
||||||
|
|
||||||
function createInfoIcon(component) {
|
function createInfoIcon(component) {
|
||||||
let icon_info = document.createElement('img');
|
let icon_info = document.createElement('img');
|
||||||
icon_info.setAttribute('src', 'res/icon_info.png');
|
icon_info.setAttribute('src', 'res/icon_info.png');
|
||||||
icon_info.classList.add('modules-icon', 'icon-info');
|
icon_info.classList.add('icon-modules', 'icon-info');
|
||||||
if (isTouchDevice) {
|
if (isTouchDevice) {
|
||||||
icon_info.onclick = function (event) {
|
icon_info.onclick = function (event) {
|
||||||
event.stopPropagation()
|
event.stopPropagation()
|
||||||
@ -206,7 +206,7 @@ function createRightColumnForModules(component) {
|
|||||||
function createIconEdit () {
|
function createIconEdit () {
|
||||||
let icon_edit = document.createElement('img');
|
let icon_edit = document.createElement('img');
|
||||||
icon_edit.setAttribute('src', 'res/icon_edit.png');
|
icon_edit.setAttribute('src', 'res/icon_edit.png');
|
||||||
icon_edit.classList.add('modules-icon', 'edit-icon');
|
icon_edit.classList.add('icon-modules', 'icon-edit', 'icon-edit-hidden');
|
||||||
|
|
||||||
icon_edit.onclick = function (event) {
|
icon_edit.onclick = function (event) {
|
||||||
event.stopPropagation()
|
event.stopPropagation()
|
||||||
|
@ -148,32 +148,36 @@ window.onload = function() {
|
|||||||
// rows 'n'
|
// rows 'n'
|
||||||
adjustGrid();
|
adjustGrid();
|
||||||
|
|
||||||
let crossElement = document.getElementById("close-cross");
|
/* ----------------------------------------------------------------------------------------------------- */
|
||||||
|
/* MIAN ICONS */
|
||||||
|
|
||||||
|
let icon_close_container = document.getElementsByClassName("icon-close-container")[0];
|
||||||
|
let icon_log_container = document.getElementsByClassName("icon-log-container")[0];
|
||||||
|
let icon_lock_container = document.getElementsByClassName("icon-lock-container")[0];
|
||||||
|
|
||||||
if (window.hideRightPart){
|
if (window.hideRightPart){
|
||||||
document.body.removeChild(crossElement);
|
document.body.removeChild(icon_close_container);
|
||||||
} else {
|
} else {
|
||||||
crossElement.onclick = function(){
|
icon_close_container.onclick = function(){
|
||||||
if (showParams) {
|
if (showParams) {
|
||||||
showParams = false;
|
showParams = false;
|
||||||
document.getElementById('close-cross').innerHTML = '<img class = "icon-close" src="res/icon_sinus.png">';
|
icon_close_container.innerHTML = '<img class = "icon-main icon-close" src="res/icon_sinus.png">';
|
||||||
} else {
|
} else {
|
||||||
if (window.wideGraphs) {
|
if (window.wideGraphs) {
|
||||||
window.wideGraphs = false;
|
window.wideGraphs = false;
|
||||||
document.getElementById('close-cross').innerHTML = '<img class = "icon-close" src="res/icon_sinus.png">';
|
icon_close_container.innerHTML = '<img class = "icon-main icon-close" src="res/icon_sinus.png">';
|
||||||
document.getElementsByClassName('log-icon-container')[0].classList.remove("log-icon-container-hidden");
|
icon_log_container.classList.remove("icon-main-container-hidden");
|
||||||
} else {
|
} else {
|
||||||
window.wideGraphs = true;
|
window.wideGraphs = true;
|
||||||
document.getElementById('close-cross').innerHTML = '<img class = "icon-close" src="res/icon_modules.png">';
|
icon_close_container.innerHTML = '<img class = "icon-main icon-close" src="res/icon_modules.png">';
|
||||||
document.getElementsByClassName('log-icon-container')[0].classList.add("log-icon-container-hidden");
|
icon_log_container.classList.add("icon-main-container-hidden");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
adjustGrid();
|
adjustGrid();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let logIcon = document.getElementsByClassName("log-icon-container")[0];
|
icon_log_container.onclick = function(){
|
||||||
logIcon.onclick = function(){
|
|
||||||
if (showConsole) {
|
if (showConsole) {
|
||||||
showConsole = false;
|
showConsole = false;
|
||||||
} else {
|
} else {
|
||||||
@ -182,6 +186,30 @@ window.onload = function() {
|
|||||||
adjustGrid();
|
adjustGrid();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
icon_lock_container.onclick = function(){
|
||||||
|
let array_icon_edit = document.getElementsByClassName('icon-edit');
|
||||||
|
let array_button = document.getElementsByClassName('input-element-button');
|
||||||
|
if (writePermission == false) {
|
||||||
|
writePermission = true;
|
||||||
|
icon_lock_container.innerHTML = '<img class = "icon-main icon-lock" src="res/icon_lock_open.png">';
|
||||||
|
for(i = 0; i < array_icon_edit.length; i++) {
|
||||||
|
array_icon_edit[i].classList.remove('icon-edit-hidden');
|
||||||
|
}
|
||||||
|
for(i = 0; i < array_button.length; i++) {
|
||||||
|
array_button[i].classList.remove('input-element-button-hidden');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
writePermission = false;
|
||||||
|
icon_lock_container.innerHTML = '<img class = "icon-main icon-lock" src="res/icon_lock_closed.png">';
|
||||||
|
for(i = 0; i < array_icon_edit.length; i++) {
|
||||||
|
array_icon_edit[i].classList.add('icon-edit-hidden');
|
||||||
|
}
|
||||||
|
for(i = 0; i < array_button.length; i++) {
|
||||||
|
array_button[i].classList.add('input-element-button-hidden');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var homeButton = document.getElementById("home-icon");
|
var homeButton = document.getElementById("home-icon");
|
||||||
|
|
||||||
homeButton.onclick = function () {
|
homeButton.onclick = function () {
|
||||||
|
BIN
client/res/icon_lock_closed.png
Normal file
BIN
client/res/icon_lock_closed.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.2 KiB |
BIN
client/res/icon_lock_open.png
Normal file
BIN
client/res/icon_lock_open.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.3 KiB |
Reference in New Issue
Block a user