Merge branch 'daniel' of https://gitlab.psi.ch/samenv/seweb into daniel
# Conflicts: # client/jsFiles/SEAWebClientMain.js
This commit is contained in:
@ -48,7 +48,7 @@
|
||||
}
|
||||
|
||||
.row-waiting-for-answer {
|
||||
background-color: orangered;
|
||||
background-color: LightGoldenrodYellow;
|
||||
}
|
||||
|
||||
/* ------------------------------ icon-modules ------------------------------ */
|
||||
|
@ -72,12 +72,18 @@ function handleUpdateMessage(src, message) {
|
||||
clientID = message.id;
|
||||
if ("device" in message) {
|
||||
if (message.device == "_inst_select") {
|
||||
clientTitle = "select instrument";
|
||||
window.clientTitle = "select instrument";
|
||||
console.log('IDselect')
|
||||
pushInitCommand("getblock?path=_inst_select&", "instrument selection");
|
||||
sizeChange();
|
||||
} else {
|
||||
clientTitle = message.instrument + " " + message.device;
|
||||
if (message.instrument) {
|
||||
window.instrument = message.instrument;
|
||||
}
|
||||
if (message.device) {
|
||||
window.device = message.device;
|
||||
}
|
||||
window.clientTitle = window.instrument + " " + window.device;
|
||||
// console.log('loadBlocks', message);
|
||||
loadFirstBlocks();
|
||||
}
|
||||
|
@ -181,11 +181,15 @@ window.onload = function() {
|
||||
icon_lock_container.onclick = function(){
|
||||
let array_icon_edit = document.getElementsByClassName('icon-edit');
|
||||
let array_button = document.getElementsByClassName('input-element-button');
|
||||
|
||||
if (writePermission == false) {
|
||||
alertify.prompt( 'WRITE PERMISSION', "Please enter the name of the instrument you want to work on."
|
||||
// TODO: here instead of asking "Please confirm we are on <instrument>", do not show the instrument,
|
||||
// ask the user "Please confrim the instrument:" and check it the entered instrument is correct
|
||||
// (case insensitive)
|
||||
alertify.prompt( "WRITE PERMISSION", "Current device: <b>"+ window.device + "</br></br>Please confirm the instrument:", ""
|
||||
, function(evt, value) {
|
||||
// User decided to proceed
|
||||
if (clientTitle.includes(value)) {
|
||||
if (window.instrument === value) {
|
||||
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++) {
|
||||
@ -197,7 +201,6 @@ window.onload = function() {
|
||||
} else {
|
||||
console.log(clientTitle);
|
||||
}
|
||||
// prompt = false;
|
||||
}
|
||||
, function() {
|
||||
// User decided to cancel
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.2 KiB |
@ -25,7 +25,8 @@ hefill=-
|
||||
ln2fill=-
|
||||
hepump=-
|
||||
hemot=-
|
||||
nv=-
|
||||
flow_sensor=-
|
||||
nv.speed=unit:1
|
||||
nv.flow=unit:ln/min
|
||||
nv.flowtarget=unit:ln/min
|
||||
nv.flowp=unit:ln/min
|
||||
|
@ -274,7 +274,7 @@ class InfluxGraph(HandlerBase):
|
||||
pass # skip not existing or already removed items
|
||||
# add remaining curves
|
||||
curves.extend(curve_dict.values())
|
||||
print(key, curves)
|
||||
# print(key, curves)
|
||||
group['curves'] = curves
|
||||
result.append(group)
|
||||
return result
|
||||
@ -370,8 +370,8 @@ class InfluxGraph(HandlerBase):
|
||||
if len(curve) > l:
|
||||
del curve[:l]
|
||||
else:
|
||||
if fullminute:
|
||||
print('R', key)
|
||||
# if fullminute:
|
||||
# print('R', key)
|
||||
result.pop(key)
|
||||
# print('poll', sum(len(c) for c in result.values()), self.last_time)
|
||||
if len(result) > 0:
|
||||
|
5
secop.py
5
secop.py
@ -73,7 +73,6 @@ class SecopInteractor(SecopClient):
|
||||
component['info'] = info
|
||||
component['name'] = f'{name}:value'
|
||||
component['title'] = name
|
||||
print(component)
|
||||
components.append(component)
|
||||
self.param_updates.add('value')
|
||||
self.param_updates.add('status')
|
||||
@ -153,7 +152,9 @@ class SecopInteractor(SecopClient):
|
||||
logging.info('SENDCOMMAND %r', command)
|
||||
try:
|
||||
if is_param:
|
||||
self.setParameterFromString(module, parameter, strvalue)
|
||||
entry = self.setParameterFromString(module, parameter, strvalue)
|
||||
item = {'name': f'{module}:{parameter}', 'value': str(entry), 'formatted': entry.formatted()}
|
||||
self.updates[module, parameter] = item
|
||||
result = True
|
||||
else:
|
||||
result = self.execCommandFromString(module, parameter, strvalue)[0]
|
||||
|
@ -147,7 +147,7 @@ def get_update(_=None):
|
||||
logging.info('UPDATE %s %s', client.id, socket.getfqdn(flask.request.remote_addr.split(':')[-1]))
|
||||
# msg = dict(type='id', id=client.id, title=instrument.title);
|
||||
# yield to_json_sse(msg)
|
||||
msg = dict(type='id', id=client.id, instrument=kwargs.get('instrument', '<unknown>'),
|
||||
msg = dict(type='id', id=client.id, instrument=kwargs.get('instrument') or 'n_a',
|
||||
device=client.device_name)
|
||||
yield to_json_sse(msg)
|
||||
try:
|
||||
@ -385,7 +385,6 @@ a {
|
||||
title('older than 30 days')
|
||||
showtitle = 2
|
||||
|
||||
print('A', args)
|
||||
out.append(f'<tr><th><a href="/?{"&".join(args)}">{key[1]} / {" ".join(devices)}</a></th>')
|
||||
out.append(f'<td>{daterange}</td></tr>')
|
||||
if timerange:
|
||||
|
Reference in New Issue
Block a user