update
This commit is contained in:
+17
-1
@@ -2,7 +2,6 @@ const defState = () => ({
|
||||
network: {},
|
||||
time: '',
|
||||
dashboard: {
|
||||
time: '',
|
||||
ip: '',
|
||||
version: '',
|
||||
di: [],
|
||||
@@ -16,6 +15,23 @@ const sysinfoReducer = (state = defState(), action) => {
|
||||
return {...state, network: action.network};
|
||||
case 'system_time':
|
||||
return {...state, time: action.time || ''};
|
||||
case 'dashboard':
|
||||
return {
|
||||
...state,
|
||||
dashboard: {
|
||||
ip: action.ip,
|
||||
version: action.version,
|
||||
di: action.di,
|
||||
leone: action.leone
|
||||
}
|
||||
}
|
||||
case 'clear_dashboard':
|
||||
return {
|
||||
...state,
|
||||
dashboard:{
|
||||
...defState().dashboard
|
||||
}
|
||||
}
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
||||
+9
-3
@@ -1,7 +1,9 @@
|
||||
const uiReducer = (state = {
|
||||
const defState = () => ({
|
||||
showMenu: false,
|
||||
showLoading: false
|
||||
}, action) => {
|
||||
showLoading: false,
|
||||
showDashboard: false
|
||||
})
|
||||
const uiReducer = (state = defState(), action) => {
|
||||
switch (action.type) {
|
||||
case 'ui_show_menu':
|
||||
return {...state, showMenu: true };
|
||||
@@ -11,6 +13,10 @@ const uiReducer = (state = {
|
||||
return {...state, showLoading: true};
|
||||
case 'ui_hide_loading':
|
||||
return {...state, showLoading: false};
|
||||
case 'ui_show_dashboard':
|
||||
return {...state, showDashboard: true};
|
||||
case 'ui_hide_dashboard':
|
||||
return {...state, showDashboard: false};
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user