diff --git a/code/web/client/src/layout/components/header/index.jsx b/code/web/client/src/layout/components/header/index.jsx index ec69b69..8f6080b 100644 --- a/code/web/client/src/layout/components/header/index.jsx +++ b/code/web/client/src/layout/components/header/index.jsx @@ -16,7 +16,9 @@ const Header = (props) => { // if (socket) { // socket.disconnect(); // } - history.push(`/signin`); + history.push(`/signin`) + localStorage.setItem('fs_iot_auth_selected_sider', JSON.stringify(['gateway'])) + localStorage.setItem('fs_iot_auth_open_sider', JSON.stringify(['edgeGateway'])) } }} style={{ diff --git a/code/web/client/src/sections/auth/containers/login.jsx b/code/web/client/src/sections/auth/containers/login.jsx index 496b80e..9ef05c6 100644 --- a/code/web/client/src/sections/auth/containers/login.jsx +++ b/code/web/client/src/sections/auth/containers/login.jsx @@ -8,90 +8,90 @@ import { IconLock, IconUser } from '@douyinfe/semi-icons'; import '../style.less' const Login = props => { - const { dispatch, user, error, actions, apiRoot, isRequesting } = props - const form = useRef(); + const { dispatch, user, error, actions, apiRoot, isRequesting } = props + const form = useRef(); - useEffect(() => { - if (error) { - Toast.error(error); - form.current.setValue('password', '') - } - }, [error]) + useEffect(() => { + if (error) { + Toast.error(error); + form.current.setValue('password', '') + } + }, [error]) - useEffect(() => { - if (user && user.authorized) { - dispatch(push('/edgeGateway/gateway')); - // localStorage.setItem('fs_iot_auth_selected_sider', JSON.stringify([])) - // localStorage.setItem('fs_iot_auth_open_sider', JSON.stringify([])) - } - }, [user]) + useEffect(() => { + if (user && user.authorized) { + dispatch(push('/edgeGateway/gateway')); + localStorage.setItem('fs_iot_auth_selected_sider', JSON.stringify(['gateway'])) + localStorage.setItem('fs_iot_auth_open_sider', JSON.stringify(['edgeGateway'])) + } + }, [user]) - return ( -
+
-
-
- -
-
{ - dispatch(login(values.username, values.password)).then(res => { - const data = res.payload.user - // dispatch(actions.layout.initWebSocket({ ioUrl: apiRoot, token: data.token })) - }) - }} - getFormApi={formApi => form.current = formApi} - > - } - style={{ background: 'rgba(24, 89, 193, 0.08)', height: 40, marginTop: 26 }} - /> - } - style={{ background: 'rgba(24, 89, 193, 0.08)', height: 40 }} - /> - - + position: 'absolute', + top: '33.89%', + right: '16.43%', + }}> +
+
-
- ); +
{ + dispatch(login(values.username, values.password)).then(res => { + const data = res.payload.user + // dispatch(actions.layout.initWebSocket({ ioUrl: apiRoot, token: data.token })) + }) + }} + getFormApi={formApi => form.current = formApi} + > + } + style={{ background: 'rgba(24, 89, 193, 0.08)', height: 40, marginTop: 26 }} + /> + } + style={{ background: 'rgba(24, 89, 193, 0.08)', height: 40 }} + /> + + +
+
+ ); } -function mapStateToProps(state) { - const { auth, global } = state; - return { - user: auth.user, - error: auth.error, - actions: global.actions, - apiRoot: global.apiRoot, - isRequesting: auth.isRequesting - } +function mapStateToProps (state) { + const { auth, global } = state; + return { + user: auth.user, + error: auth.error, + actions: global.actions, + apiRoot: global.apiRoot, + isRequesting: auth.isRequesting + } } export default connect(mapStateToProps)(Login); \ No newline at end of file diff --git a/code/web/client/src/sections/edition/containers/administer.jsx b/code/web/client/src/sections/edition/containers/administer.jsx index 0d1cc0f..b4e6174 100644 --- a/code/web/client/src/sections/edition/containers/administer.jsx +++ b/code/web/client/src/sections/edition/containers/administer.jsx @@ -5,6 +5,7 @@ import { push } from 'react-router-redux'; import { Form, Button, Table, Pagination, Modal } from '@douyinfe/semi-ui'; import { IconLock, IconUser } from '@douyinfe/semi-icons'; import { useState } from 'react'; +import moment from "moment"; const EditionManage = props => { const { dispatch, user, error, actions, apiRoot, isRequesting } = props @@ -141,11 +142,13 @@ const EditionManage = props => { -
+
{ onOk={() => { api.current.validate().then(r => { console.log(r); - dispatch(edition.postVersion({ build: 0, - createdAt: "2022-12-12 10:00:00", - desc: "fix温度修正", - // id: 1, - imageBase: "registry.cn-hangzhou.aliyuncs.com/fs-cloud/fs-edge", - imageVersion: "3.22-12-30", - major: 0, - minor: 2, - patch: 1, - type: "beta"})).then(res => { + for (let key in r) { + if (['major', 'minor', 'patch', 'build'].includes(key)) { + r[key] = Number(r[key]) + } + } + dispatch(edition.postVersion({ ...r, createdAt: moment().format("YYYY-MM-DD HH:MM:SS") })).then(res => { if (res.success) { - // requestData() - // setaddVersion(false) + requestData() + setaddVersion(false) } }) }) @@ -209,22 +208,80 @@ const EditionManage = props => { getFormApi={(formApi) => (api.current = formApi)} layout="horizontal" labelAlign="right" - labelWidth="90px" + labelWidth="114px" style={{ display: 'flex', flexDirection: 'column' }} > - - - - - + + + + + beta alpha release LTS - - - + + +