Files
ucvl-home-vision/web/vue-bridge.js
T

13 lines
982 B
JavaScript
Raw Normal View History

'use strict';
Object.assign(window.ZhaoVue,{
boot:bootApplication,
publish(){this.accept({state,user:currentUser,admin:isAdmin(),platformAdmin:isPlatformAdmin(),loggedIn,page:activePage,session:sessionGeneration,device:selectedDevice(),brandName:branding.name});},
api,refresh,notify:toast,address:ZhaoGeography.describe,
async saveLayout(value){const saved=await api('/api/households/layout',value);state.householdLayout=saved;this.publish();return saved;},
async enterHome(id,network=false){try{if(id!==state.familyId&&!await switchHousehold(id))return;if(network){devicePresentation='topology';showPage('objects');}else showPage('overview');}catch(e){if(!e.stale)toast(e.message);}},
enterDevice,showPage,
async editAccount(id,familyId){if(familyId!==state.familyId&&!await switchHousehold(familyId))return;showPage('users');if(await loadUsers())openUser(id);},
location(id){return siteName(id);},
network(device){return ZhaoDevices.network(device,state);}
});