mirror of
https://github.com/open5gs/open5gs.git
synced 2025-11-03 05:23:38 +00:00
client directory structure is changed
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import withRedux from 'next-redux-wrapper';
|
import withRedux from 'next-redux-wrapper';
|
||||||
|
|
||||||
import { initStore } from 'store.js';
|
import { initStore } from 'modules/store.js';
|
||||||
import withSession from 'helpers/with-session';
|
import withSession from 'helpers/with-session';
|
||||||
|
|
||||||
import Auth from 'containers/Auth';
|
import Auth from 'containers/Auth';
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
|||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { bindActionCreators, compose } from 'redux';
|
import { bindActionCreators, compose } from 'redux';
|
||||||
|
|
||||||
import * as uiActions from 'actions/ui';
|
import * as uiActions from 'modules/ui';
|
||||||
import withWidth, { SMALL } from 'helpers/with-width';
|
import withWidth, { SMALL } from 'helpers/with-width';
|
||||||
|
|
||||||
import { Layout } from 'components';
|
import { Layout } from 'components';
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import PropTypes from 'prop-types';
|
|||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { bindActionCreators } from 'redux';
|
import { bindActionCreators } from 'redux';
|
||||||
|
|
||||||
import * as uiActions from 'actions/ui';
|
import * as uiActions from 'modules/ui';
|
||||||
|
|
||||||
import Session from 'services/session';
|
import Session from 'services/session';
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { connect } from 'react-redux';
|
|||||||
import { bindActionCreators, compose } from 'redux';
|
import { bindActionCreators, compose } from 'redux';
|
||||||
|
|
||||||
import withWidth, { SMALL } from 'helpers/with-width';
|
import withWidth, { SMALL } from 'helpers/with-width';
|
||||||
import * as uiActions from 'actions/ui';
|
import * as uiActions from 'modules/ui';
|
||||||
|
|
||||||
import { Sidebar } from 'components';
|
import { Sidebar } from 'components';
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,7 @@ import { Component } from 'react';
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
|
|
||||||
import { fetchSubscribers } from 'actions/subscriber';
|
import { fetchSubscribers } from 'modules/crud/subscriber';
|
||||||
import { fetchCollection } from 'actions/crud';
|
|
||||||
|
|
||||||
class SubscriberContainer extends Component {
|
class SubscriberContainer extends Component {
|
||||||
componentWillMount() {
|
componentWillMount() {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { AUTH } from 'actions/auth';
|
import { AUTH } from './actions';
|
||||||
|
|
||||||
const initialState = {
|
const initialState = {
|
||||||
isAuthenticating: false,
|
isAuthenticating: false,
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import { take, fork, cancel, call, put } from 'redux-saga/effects';
|
import { take, fork, cancel, call, put } from 'redux-saga/effects';
|
||||||
|
|
||||||
import Session from 'services/session';
|
import Session from 'services/session';
|
||||||
import { AUTH, loginSuccess } from 'actions/auth';
|
import { AUTH, loginSuccess } from './actions';
|
||||||
|
|
||||||
function* authorize(username, password) {
|
function* authorize(username, password) {
|
||||||
try {
|
try {
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { CRUD } from 'actions/crud';
|
import { CRUD } from './actions';
|
||||||
import { fromJS, toJS } from 'immutable';
|
import { fromJS, toJS } from 'immutable';
|
||||||
import { isEqual } from 'lodash/lang';
|
import { isEqual } from 'lodash/lang';
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { all, takeEvery, put, call, take, fork } from 'redux-saga/effects';
|
import { all, takeEvery, put, call, take, fork } from 'redux-saga/effects';
|
||||||
import { CRUD } from 'actions/crud';
|
import { CRUD } from './actions';
|
||||||
|
|
||||||
const crudApi = (method, url, { params, data } = {} ) => {
|
const crudApi = (method, url, { params, data } = {} ) => {
|
||||||
return axios({ baseURL: '/api/db', method, url, params, data });
|
return axios({ baseURL: '/api/db', method, url, params, data });
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import {
|
import {
|
||||||
fetchCollection
|
fetchCollection
|
||||||
} from 'actions/crud'
|
} from './actions'
|
||||||
|
|
||||||
const MODEL = 'subscribers';
|
const MODEL = 'subscribers';
|
||||||
const ID = 'imsi';
|
const ID = 'imsi';
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import { combineReducers } from 'redux';
|
import { combineReducers } from 'redux';
|
||||||
|
|
||||||
import auth from './auth';
|
import auth from './auth/reducers';
|
||||||
import crud from './crud';
|
import crud from './crud/reducers';
|
||||||
import ui from './ui';
|
import ui from './ui';
|
||||||
|
|
||||||
export default combineReducers({
|
export default combineReducers({
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { all, fork } from 'redux-saga/effects';
|
import { all, fork } from 'redux-saga/effects';
|
||||||
import auth from './auth';
|
import auth from './auth/sagas';
|
||||||
import crud from './crud';
|
import crud from './crud/sagas';
|
||||||
|
|
||||||
export default function* rootSaga() {
|
export default function* rootSaga() {
|
||||||
yield all([
|
yield all([
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
import { createAction } from 'redux-actions';
|
import { createAction } from 'redux-actions';
|
||||||
|
import { handleActions } from 'redux-actions';
|
||||||
|
|
||||||
export const UI = {
|
export const UI = {
|
||||||
TOGGLE_SIDEBAR: 'ui/TOGGLE_SIDEBAR',
|
TOGGLE_SIDEBAR: 'ui/TOGGLE_SIDEBAR',
|
||||||
@@ -25,3 +26,34 @@ export const toggleSidebar = createAction(UI.TOGGLE_SIDEBAR);
|
|||||||
export const setSidebarVisibility = createAction(UI.SET_SIDEBAR_VISIBILITY);
|
export const setSidebarVisibility = createAction(UI.SET_SIDEBAR_VISIBILITY);
|
||||||
export const selectView = createAction(UI.SELECT_VIEW);
|
export const selectView = createAction(UI.SELECT_VIEW);
|
||||||
export const testUI = ({type:UI.TEST_UI, argu:true})
|
export const testUI = ({type:UI.TEST_UI, argu:true})
|
||||||
|
|
||||||
|
const initialState = {
|
||||||
|
sidebar: {
|
||||||
|
isOpen: false,
|
||||||
|
view: "subscriber"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default handleActions({
|
||||||
|
[UI.TOGGLE_SIDEBAR]: (state, action) => ({
|
||||||
|
...state,
|
||||||
|
sidebar: {
|
||||||
|
...state.sidebar,
|
||||||
|
isOpen: !state.sidebar.isOpen
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
[UI.SET_SIDEBAR_VISIBILITY]: (state, action) => ({
|
||||||
|
...state,
|
||||||
|
sidebar: {
|
||||||
|
...state.sidebar,
|
||||||
|
isOpen: action.payload
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
[UI.SELECT_VIEW]: (state, action) => ({
|
||||||
|
...state,
|
||||||
|
sidebar: {
|
||||||
|
...state.sidebar,
|
||||||
|
view: action.payload
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}, initialState);
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
import { handleActions } from 'redux-actions';
|
|
||||||
import { UI } from 'actions/ui';
|
|
||||||
|
|
||||||
const initialState = {
|
|
||||||
sidebar: {
|
|
||||||
isOpen: false,
|
|
||||||
view: "subscriber"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default handleActions({
|
|
||||||
[UI.TOGGLE_SIDEBAR]: (state, action) => ({
|
|
||||||
...state,
|
|
||||||
sidebar: {
|
|
||||||
...state.sidebar,
|
|
||||||
isOpen: !state.sidebar.isOpen
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
[UI.SET_SIDEBAR_VISIBILITY]: (state, action) => ({
|
|
||||||
...state,
|
|
||||||
sidebar: {
|
|
||||||
...state.sidebar,
|
|
||||||
isOpen: action.payload
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
[UI.SELECT_VIEW]: (state, action) => ({
|
|
||||||
...state,
|
|
||||||
sidebar: {
|
|
||||||
...state.sidebar,
|
|
||||||
view: action.payload
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}, initialState);
|
|
||||||
Reference in New Issue
Block a user