Browse Source

版本管理修改

master
wenlele 2 years ago
parent
commit
76792a8616
  1. 4
      code/web/client/src/layout/components/header/index.jsx
  2. 4
      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) { // if (socket) {
// socket.disconnect(); // 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={{ style={{

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

@ -21,8 +21,8 @@ const Login = props => {
useEffect(() => { useEffect(() => {
if (user && user.authorized) { if (user && user.authorized) {
dispatch(push('/edgeGateway/gateway')); dispatch(push('/edgeGateway/gateway'));
// localStorage.setItem('fs_iot_auth_selected_sider', JSON.stringify([])) localStorage.setItem('fs_iot_auth_selected_sider', JSON.stringify(['gateway']))
// localStorage.setItem('fs_iot_auth_open_sider', JSON.stringify([])) localStorage.setItem('fs_iot_auth_open_sider', JSON.stringify(['edgeGateway']))
} }
}, [user]) }, [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 { Form, Button, Table, Pagination, Modal } from '@douyinfe/semi-ui';
import { IconLock, IconUser } from '@douyinfe/semi-icons'; import { IconLock, IconUser } from '@douyinfe/semi-icons';
import { useState } from 'react'; import { useState } from 'react';
import moment from "moment";
const EditionManage = props => { const EditionManage = props => {
const { dispatch, user, error, actions, apiRoot, isRequesting } = props const { dispatch, user, error, actions, apiRoot, isRequesting } = props
@ -141,11 +142,13 @@ const EditionManage = props => {
</div> </div>
</div> </div>
</div> </div>
<div style={{ width: "100%", <div style={{
width: "100%",
background: "#FFFFFF", background: "#FFFFFF",
borderRadius: 3, borderRadius: 3,
padding: "8px 20px", padding: "8px 20px",
marginTop: 20, }}> marginTop: 20,
}}>
<Table <Table
columns={columns} columns={columns}
dataSource={versionList} dataSource={versionList}
@ -185,19 +188,15 @@ const EditionManage = props => {
onOk={() => { onOk={() => {
api.current.validate().then(r => { api.current.validate().then(r => {
console.log(r); console.log(r);
dispatch(edition.postVersion({ build: 0, for (let key in r) {
createdAt: "2022-12-12 10:00:00", if (['major', 'minor', 'patch', 'build'].includes(key)) {
desc: "fix温度修正", r[key] = Number(r[key])
// id: 1, }
imageBase: "registry.cn-hangzhou.aliyuncs.com/fs-cloud/fs-edge", }
imageVersion: "3.22-12-30", dispatch(edition.postVersion({ ...r, createdAt: moment().format("YYYY-MM-DD HH:MM:SS") })).then(res => {
major: 0,
minor: 2,
patch: 1,
type: "beta"})).then(res => {
if (res.success) { if (res.success) {
// requestData() requestData()
// setaddVersion(false) setaddVersion(false)
} }
}) })
}) })
@ -209,22 +208,80 @@ const EditionManage = props => {
getFormApi={(formApi) => (api.current = formApi)} getFormApi={(formApi) => (api.current = formApi)}
layout="horizontal" layout="horizontal"
labelAlign="right" labelAlign="right"
labelWidth="90px" labelWidth="114px"
style={{ display: 'flex', flexDirection: 'column' }} style={{ display: 'flex', flexDirection: 'column' }}
> >
<Form.Input field='major' label='主版本号:' labelPosition="left" placeholder='请输入主版本号' style={{ width: 200, marginBottom: 10 }} /> <Form.Input
<Form.Input field='minor' label='次版本号:' labelPosition="left" placeholder='请输入次版本号' style={{ width: 200, marginBottom: 10 }} /> field='major'
<Form.Input field='patch' label='补丁版本号:' labelPosition="left" placeholder='请输入补丁版本号' style={{ width: 200, marginBottom: 10 }} /> label='主版本号:'
<Form.Input field='build' label='构建号:' labelPosition="left" placeholder='请输入构建号' style={{ width: 200, marginBottom: 10 }} /> labelPosition="left"
<Form.Select field="type" label='Type:' labelPosition="left" placeholder='请选择类型' style={{ width: 200, marginBottom: 10 }}> 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="beta">beta</Form.Select.Option>
<Form.Select.Option value="alpha">alpha</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="release">release</Form.Select.Option>
<Form.Select.Option value="LTS">LTS</Form.Select.Option> <Form.Select.Option value="LTS">LTS</Form.Select.Option>
</Form.Select> </Form.Select>
<Form.Input field='imageBase' label='基础镜像地址:' labelPosition="left" placeholder='请输入基础镜像地址' style={{ width: 460, marginBottom: 10 }} /> <Form.Input
<Form.Input field='tmageVersion' label='镜像版本:' labelPosition="left" placeholder='请输入镜像版本' style={{ width: 200, marginBottom: 10 }} /> field='imageBase'
<Form.TextArea field='desc' label='描述:' labelPosition="left" placeholder='请输入描述' style={{ width: 460 }} /> 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> </Form>
</Modal> </Modal>

Loading…
Cancel
Save