@@ -24,7 +24,17 @@ import router from '@/router'
2424import store from '@/store'
2525import { login , logout , api } from '@/api'
2626import { i18n } from '@/locales'
27- import { ACCESS_TOKEN , CURRENT_PROJECT , DEFAULT_THEME , APIS , ASYNC_JOB_IDS , ZONES , TIMEZONE_OFFSET , USE_BROWSER_TIMEZONE } from '@/store/mutation-types'
27+ import {
28+ ACCESS_TOKEN ,
29+ CURRENT_PROJECT ,
30+ DEFAULT_THEME ,
31+ APIS ,
32+ ZONES ,
33+ TIMEZONE_OFFSET ,
34+ USE_BROWSER_TIMEZONE ,
35+ ASYNC_JOB_IDS ,
36+ DOMAIN_STORE
37+ } from '@/store/mutation-types'
2838
2939const user = {
3040 state : {
@@ -40,7 +50,8 @@ const user = {
4050 cloudian : { } ,
4151 zones : { } ,
4252 timezoneoffset : 0.0 ,
43- usebrowsertimezone : false
53+ usebrowsertimezone : false ,
54+ domainStore : { }
4455 } ,
4556
4657 mutations : {
@@ -91,6 +102,10 @@ const user = {
91102 SET_ZONES : ( state , zones ) => {
92103 state . zones = zones
93104 Vue . ls . set ( ZONES , zones )
105+ } ,
106+ SET_DOMAIN_STORE ( state , domainStore ) {
107+ state . domainStore = domainStore
108+ Vue . ls . set ( DOMAIN_STORE , domainStore )
94109 }
95110 } ,
96111
@@ -126,6 +141,7 @@ const user = {
126141 commit ( 'SET_FEATURES' , { } )
127142 commit ( 'SET_LDAP' , { } )
128143 commit ( 'SET_CLOUDIAN' , { } )
144+ commit ( 'SET_DOMAIN_STORE' , { } )
129145
130146 notification . destroy ( )
131147
@@ -142,7 +158,10 @@ const user = {
142158 const cachedZones = Vue . ls . get ( ZONES , [ ] )
143159 const cachedTimezoneOffset = Vue . ls . get ( TIMEZONE_OFFSET , 0.0 )
144160 const cachedUseBrowserTimezone = Vue . ls . get ( USE_BROWSER_TIMEZONE , false )
161+ const domainStore = Vue . ls . get ( DOMAIN_STORE , { } )
145162 const hasAuth = Object . keys ( cachedApis ) . length > 0
163+
164+ commit ( 'SET_DOMAIN_STORE' , domainStore )
146165 if ( hasAuth ) {
147166 console . log ( 'Login detected, using cached APIs' )
148167 commit ( 'SET_ZONES' , cachedZones )
@@ -250,6 +269,7 @@ const user = {
250269 commit ( 'SET_LDAP' , { } )
251270 commit ( 'SET_CLOUDIAN' , { } )
252271 commit ( 'RESET_THEME' )
272+ commit ( 'SET_DOMAIN_STORE' , { } )
253273 Vue . ls . remove ( CURRENT_PROJECT )
254274 Vue . ls . remove ( ACCESS_TOKEN )
255275 Vue . ls . remove ( ASYNC_JOB_IDS )
@@ -304,6 +324,10 @@ const user = {
304324 reject ( error )
305325 } )
306326 } )
327+ } ,
328+
329+ SetDomainStore ( { commit } , domainStore ) {
330+ commit ( 'SET_DOMAIN_STORE' , domainStore )
307331 }
308332 }
309333}
0 commit comments