This commit is contained in:
Jay
2017-03-24 16:14:30 +08:00
parent c5236f9ad3
commit d6250577fe
14 changed files with 261 additions and 153257 deletions
+17 -1
View File
@@ -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
View File
@@ -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;
}