Browse Source

版本管理修改

master
wenlele 2 years ago
parent
commit
76792a8616
  1. 4
      code/web/client/src/layout/components/header/index.jsx
  2. 6
      code/web/client/src/sections/auth/containers/login.jsx
  3. 103
      code/web/client/src/sections/edition/containers/administer.jsx

4
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={{

6
code/web/client/src/sections/auth/containers/login.jsx

@ -21,8 +21,8 @@ const Login = props => {
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([]))
localStorage.setItem('fs_iot_auth_selected_sider', JSON.stringify(['gateway']))
localStorage.setItem('fs_iot_auth_open_sider', JSON.stringify(['edgeGateway']))
}
}, [user])
@ -83,7 +83,7 @@ const Login = props => {
);
}
function mapStateToProps(state) {
function mapStateToProps (state) {
const { auth, global } = state;
return {
user: auth.user,

103
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 => {
</div>
</div>
</div>
<div style={{ width: "100%",
<div style={{
width: "100%",
background: "#FFFFFF",
borderRadius: 3,
padding: "8px 20px",
marginTop: 20, }}>
marginTop: 20,
}}>
<Table
columns={columns}
dataSource={versionList}
@ -185,19 +188,15 @@ 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' }}
>
<Form.Input field='major' label='主版本号:' labelPosition="left" placeholder='请输入主版本号' style={{ width: 200, marginBottom: 10 }} />
<Form.Input field='minor' label='次版本号:' labelPosition="left" placeholder='请输入次版本号' style={{ width: 200, marginBottom: 10 }} />
<Form.Input field='patch' label='补丁版本号:' labelPosition="left" placeholder='请输入补丁版本号' style={{ width: 200, marginBottom: 10 }} />
<Form.Input field='build' label='构建号:' labelPosition="left" placeholder='请输入构建号' style={{ width: 200, marginBottom: 10 }} />
<Form.Select field="type" label='Type:' labelPosition="left" placeholder='请选择类型' style={{ width: 200, marginBottom: 10 }}>
<Form.Input
field='major'
label='主版本号:'
labelPosition="left"
hideButtons={true}
placeholder='请输入主版本号'
style={{ width: 200, marginBottom: 10 }}
rules={[{ required: true, message: "请输入主版本号" }, { pattern: "^[0-9]+$", message: "只能输入数字" },]}
/>
<Form.Input
field='minor'
label='次版本号:'
labelPosition="left"
hideButtons={true}
placeholder='请输入次版本号'
style={{ width: 200, marginBottom: 10 }}
rules={[{ required: true, message: "请输入次版本号" }, { pattern: "^[0-9]+$", message: "只能输入数字" },]}
/>
<Form.Input
field='patch'
label='补丁版本号:'
labelPosition="left"
hideButtons={true}
placeholder='请输入补丁版本号'
style={{ width: 200, marginBottom: 10 }}
rules={[{ required: true, message: "请输入补丁版本号" }, { pattern: "^[0-9]+$", message: "只能输入数字" },]}
/>
<Form.Input
field='build' label='构建号:'
labelPosition="left"
hideButtons={true}
placeholder='请输入构建号'
style={{ width: 200, marginBottom: 10 }}
rules={[{ required: true, message: "请输入构建号" }, { pattern: "^[0-9]+$", message: "只能输入数字" },]}
/>
<Form.Select
field="type"
label='Type:'
labelPosition="left"
placeholder='请选择类型'
style={{ width: 200, marginBottom: 10 }}
rules={[{ required: true, message: "请选择类型" }]}
>
<Form.Select.Option value="beta">beta</Form.Select.Option>
<Form.Select.Option value="alpha">alpha</Form.Select.Option>
<Form.Select.Option value="release">release</Form.Select.Option>
<Form.Select.Option value="LTS">LTS</Form.Select.Option>
</Form.Select>
<Form.Input field='imageBase' label='基础镜像地址:' labelPosition="left" placeholder='请输入基础镜像地址' style={{ width: 460, marginBottom: 10 }} />
<Form.Input field='tmageVersion' label='镜像版本:' labelPosition="left" placeholder='请输入镜像版本' style={{ width: 200, marginBottom: 10 }} />
<Form.TextArea field='desc' label='描述:' labelPosition="left" placeholder='请输入描述' style={{ width: 460 }} />
<Form.Input
field='imageBase'
label='基础镜像地址:'
labelPosition="left"
placeholder='请输入基础镜像地址'
style={{ width: 440, marginBottom: 10 }}
rules={[{ required: true, message: "请输入基础镜像地址" }]}
/>
<Form.Input
field='imageVersion'
label='镜像版本:'
labelPosition="left"
placeholder='请输入镜像版本'
style={{ width: 200, marginBottom: 10 }}
rules={[{ required: true, message: "请输入镜像版本" }]}
/>
<Form.TextArea
field='desc'
label='描述:'
labelPosition="left"
placeholder='请输入描述'
style={{ width: 440 }}
/>
</Form>
</Modal>

Loading…
Cancel
Save