Kaynağa Gözat

show days field in device handshake time. add account to ctx for 'when' config clauses

pull/57/head
Jonathan Cobb 4 yıl önce
ebeveyn
işleme
61a7f288e5
4 değiştirilmiş dosya ile 12 ekleme ve 7 silme
  1. +4
    -1
      src/_pages/main/account/Devices.vue
  2. +1
    -1
      src/account/AppConfigPage.vue
  3. +5
    -4
      src/account/AppPage.vue
  4. +2
    -1
      src/account/DevicesPage.vue

+ 4
- 1
src/_pages/main/account/Devices.vue Dosyayı Görüntüle

@@ -228,8 +228,11 @@
<div v-if="device.status.lastHandshakeTime">
<hr />
{{ messages.label_field_device_connection_handshake }}:
<span v-if="device.status.lastHandshakeDay">
{{ device.status.lastHandshakeDays }}{{ messages.units_days }}
</span>
<span
v-if="
v-else-if="
device.status.lastHandshakeHours &&
device.status.lastHandshakeMinutes
"


+ 1
- 1
src/account/AppConfigPage.vue Dosyayı Görüntüle

@@ -199,7 +199,7 @@
actionIsAvailable(action, row) {
if (typeof action.when === 'undefined' || action.when === null) return true;
try {
return safeEval(action.when, {'item': row}) === true;
return safeEval(action.when, {'item': row, 'account': this.user}) === true;
} catch (e) {
console.log('actionIsAvailable: error evaluating when='+action.when+' for item='+JSON.stringify(row)+': '+e);
return false;


+ 5
- 4
src/account/AppPage.vue Dosyayı Görüntüle

@@ -145,7 +145,7 @@
viewIsAvailable(view) {
if (typeof view.when === 'undefined' || view.when === null) return true;
try {
return safeEval(view.when, {'configs': this.configs}) === true;
return safeEval(view.when, {'configs': this.configs, 'account': this.user}) === true;
} catch (e) {
console.log('viewIsAvailable: error evaluating when='+view.when+': '+e);
return false;
@@ -171,9 +171,10 @@
const allConfigViews = a.dataConfig.configViews;
const appConfigViews = [];
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);
}
}
}


+ 2
- 1
src/account/DevicesPage.vue Dosyayı Görüntüle

@@ -99,7 +99,8 @@
<div v-if="device.status.lastHandshakeTime">
<hr/>
{{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.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>


Yükleniyor…
İptal
Kaydet