@@ -228,8 +228,11 @@ | |||||
<div v-if="device.status.lastHandshakeTime"> | <div v-if="device.status.lastHandshakeTime"> | ||||
<hr /> | <hr /> | ||||
{{ messages.label_field_device_connection_handshake }}: | {{ messages.label_field_device_connection_handshake }}: | ||||
<span v-if="device.status.lastHandshakeDay"> | |||||
{{ device.status.lastHandshakeDays }}{{ messages.units_days }} | |||||
</span> | |||||
<span | <span | ||||
v-if=" | |||||
v-else-if=" | |||||
device.status.lastHandshakeHours && | device.status.lastHandshakeHours && | ||||
device.status.lastHandshakeMinutes | device.status.lastHandshakeMinutes | ||||
" | " | ||||
@@ -199,7 +199,7 @@ | |||||
actionIsAvailable(action, row) { | actionIsAvailable(action, row) { | ||||
if (typeof action.when === 'undefined' || action.when === null) return true; | if (typeof action.when === 'undefined' || action.when === null) return true; | ||||
try { | try { | ||||
return safeEval(action.when, {'item': row}) === true; | |||||
return safeEval(action.when, {'item': row, 'account': this.user}) === true; | |||||
} catch (e) { | } catch (e) { | ||||
console.log('actionIsAvailable: error evaluating when='+action.when+' for item='+JSON.stringify(row)+': '+e); | console.log('actionIsAvailable: error evaluating when='+action.when+' for item='+JSON.stringify(row)+': '+e); | ||||
return false; | return false; | ||||
@@ -145,7 +145,7 @@ | |||||
viewIsAvailable(view) { | viewIsAvailable(view) { | ||||
if (typeof view.when === 'undefined' || view.when === null) return true; | if (typeof view.when === 'undefined' || view.when === null) return true; | ||||
try { | try { | ||||
return safeEval(view.when, {'configs': this.configs}) === true; | |||||
return safeEval(view.when, {'configs': this.configs, 'account': this.user}) === true; | |||||
} catch (e) { | } catch (e) { | ||||
console.log('viewIsAvailable: error evaluating when='+view.when+': '+e); | console.log('viewIsAvailable: error evaluating when='+view.when+': '+e); | ||||
return false; | return false; | ||||
@@ -171,9 +171,10 @@ | |||||
const allConfigViews = a.dataConfig.configViews; | const allConfigViews = a.dataConfig.configViews; | ||||
const appConfigViews = []; | const appConfigViews = []; | ||||
for (let i=0; i<allConfigViews.length; i++) { | for (let i=0; i<allConfigViews.length; i++) { | ||||
if (typeof allConfigViews[i].root !== 'undefined' && allConfigViews[i].root !== null && allConfigViews[i].root === true) { | |||||
if (this.viewIsAvailable(allConfigViews[i])) { | |||||
appConfigViews.push(allConfigViews[i]); | |||||
let configView = allConfigViews[i]; | |||||
if (typeof configView.root !== 'undefined' && configView.root !== null && configView.root === true) { | |||||
if (this.viewIsAvailable(configView)) { | |||||
appConfigViews.push(configView); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -99,7 +99,8 @@ | |||||
<div v-if="device.status.lastHandshakeTime"> | <div v-if="device.status.lastHandshakeTime"> | ||||
<hr/> | <hr/> | ||||
{{messages.label_field_device_connection_handshake}}: | {{messages.label_field_device_connection_handshake}}: | ||||
<span v-if="device.status.lastHandshakeHours && device.status.lastHandshakeMinutes">{{device.status.lastHandshakeHours}}{{messages.units_hours_short}}, {{device.status.lastHandshakeMinutes}}{{messages.units_minutes_short}}</span> | |||||
<span v-if="device.status.lastHandshakeDays">{{device.status.lastHandshakeDays}}{{messages.units_days}}</span> | |||||
<span v-else-if="device.status.lastHandshakeHours && device.status.lastHandshakeMinutes">{{device.status.lastHandshakeHours}}{{messages.units_hours_short}}, {{device.status.lastHandshakeMinutes}}{{messages.units_minutes_short}}</span> | |||||
<span v-else-if="device.status.lastHandshakeHours">{{device.status.lastHandshakeHours}}{{messages.units_hours_short}}</span> | <span v-else-if="device.status.lastHandshakeHours">{{device.status.lastHandshakeHours}}{{messages.units_hours_short}}</span> | ||||
<span v-else-if="device.status.lastHandshakeMinutes && device.status.lastHandshakeSeconds">{{device.status.lastHandshakeMinutes}}{{messages.units_minutes_short}}, {{device.status.lastHandshakeSeconds}}{{messages.units_seconds_short}}</span> | <span v-else-if="device.status.lastHandshakeMinutes && device.status.lastHandshakeSeconds">{{device.status.lastHandshakeMinutes}}{{messages.units_minutes_short}}, {{device.status.lastHandshakeSeconds}}{{messages.units_seconds_short}}</span> | ||||
<span v-else-if="device.status.lastHandshakeMinutes">{{device.status.lastHandshakeMinutes}}{{messages.units_minutes_short}}</span> | <span v-else-if="device.status.lastHandshakeMinutes">{{device.status.lastHandshakeMinutes}}{{messages.units_minutes_short}}</span> | ||||