巴林闲侠 2 years ago
parent
commit
9a1d30daa6
  1. 2
      api/.vscode/launch.json
  2. 6
      api/Dockerfile
  3. 6
      api/app/lib/controllers/means/index.js
  4. 2
      api/app/lib/models/project_folder.js
  5. 1
      jenkinsfilenew_api
  6. 1
      jenkinsfilenew_web
  7. 1
      script/0.26/schema/updata_project_folder.sql
  8. 8
      web/Dockerfile
  9. 30
      web/client/src/sections/means/containers/devOpsStandard.jsx
  10. 33
      web/client/src/sections/means/containers/faultInformation.jsx
  11. 36
      web/client/src/sections/means/containers/repairFQA.jsx

2
api/.vscode/launch.json

@ -26,7 +26,7 @@
"--redisPort 6379", "--redisPort 6379",
"--apMergeDeVeAnxinProjectId 1,2,3", "--apMergeDeVeAnxinProjectId 1,2,3",
"--axyApiUrl http://127.0.0.1:4100", "--axyApiUrl http://127.0.0.1:4100",
// "--apiEmisUrl http://10.8.30.112:14000", "--apiEmisUrl http://10.8.30.112:14000",
// //
// "--apiEmisUrl http://10.8.30.161:1111", // "--apiEmisUrl http://10.8.30.161:1111",
// "--apiEmisUrl http://10.8.30.161:31111/", // "--apiEmisUrl http://10.8.30.161:31111/",

6
api/Dockerfile

@ -6,11 +6,13 @@ WORKDIR /var/app
EXPOSE 8080 EXPOSE 8080
RUN npm config set registry=https://nexus.ngaiot.com/repository/fs-npm/ RUN npm config set registry=http://10.8.30.22:7000
# RUN npm config set registry=https://nexus.ngaiot.com/repository/fs-npm/
RUN echo "{\"time\":\"$BUILD_TIMESTAMP\",\"build\": \"$BUILD_NUMBER\",\"revision\": \"$SVN_REVISION_1\",\"URL\":\"$SVN_URL_1\"}" > version.json RUN echo "{\"time\":\"$BUILD_TIMESTAMP\",\"build\": \"$BUILD_NUMBER\",\"revision\": \"$SVN_REVISION_1\",\"URL\":\"$SVN_URL_1\"}" > version.json
RUN npm cache clean -f RUN npm cache clean -f
# RUN rm -rf package-lock.json # RUN rm -rf package-lock.json
RUN npm install --registry https://nexus.ngaiot.com/repository/fs-npm/ RUN npm install --registry http://10.8.30.22:7000
# RUN npm install --registry https://nexus.ngaiot.com/repository/fs-npm/
FROM registry.cn-hangzhou.aliyuncs.com/fs-devops/node:12 FROM registry.cn-hangzhou.aliyuncs.com/fs-devops/node:12

6
api/app/lib/controllers/means/index.js

@ -48,9 +48,9 @@ async function fileList (ctx, next) {
const { projectId, type } = ctx.query; const { projectId, type } = ctx.query;
let options = { where: {}, } let options = { where: {}, }
if (projectId) {
options.where.projectId = projectId options.where.projectId = projectId || null
}
if (type) { if (type) {
options.where.type = type options.where.type = type
} }

2
api/app/lib/models/project_folder.js

@ -17,7 +17,7 @@ module.exports = dc => {
}, },
projectId: { projectId: {
type: DataTypes.INTEGER, type: DataTypes.INTEGER,
allowNull: false, allowNull: true,
defaultValue: null, defaultValue: null,
comment: null, comment: null,
primaryKey: false, primaryKey: false,

1
jenkinsfilenew_api

@ -9,6 +9,7 @@ podTemplate {
container('image-builder') { container('image-builder') {
sh''' sh'''
find . -depth -name '.svn' -type d -exec rm -rf {} +
/kaniko/executor --context=${BUILD_WORKSPACE} --dockerfile=./api/Dockerfile --destination=${IMAGE_NAME}:${IMAGE_VERSION} --cache=false --cleanup /kaniko/executor --context=${BUILD_WORKSPACE} --dockerfile=./api/Dockerfile --destination=${IMAGE_NAME}:${IMAGE_VERSION} --cache=false --cleanup
''' '''
} }

1
jenkinsfilenew_web

@ -10,6 +10,7 @@ podTemplate {
container('image-builder') { container('image-builder') {
sh''' sh'''
find . -depth -name '.svn' -type d -exec rm -rf {} +
/kaniko/executor --context=${BUILD_WORKSPACE} --dockerfile=./web/Dockerfile --destination=${IMAGE_NAME}:${IMAGE_VERSION} --cache=false --cleanup /kaniko/executor --context=${BUILD_WORKSPACE} --dockerfile=./web/Dockerfile --destination=${IMAGE_NAME}:${IMAGE_VERSION} --cache=false --cleanup
''' '''
} }

1
script/0.26/schema/updata_project_folder.sql

@ -0,0 +1 @@
alter table project_folder alter column project_id drop not null;

8
web/Dockerfile

@ -6,15 +6,17 @@ WORKDIR /var/app
EXPOSE 8080 EXPOSE 8080
RUN npm config set registry=https://nexus.ngaiot.com/repository/fs-npm/ RUN npm config set registry=http://10.8.30.22:7000
# RUN npm config set registry=https://nexus.ngaiot.com/repository/fs-npm/
RUN echo "{\"time\":\"$BUILD_TIMESTAMP\",\"build\": \"$BUILD_NUMBER\",\"revision\": \"$SVN_REVISION_1\",\"URL\":\"$SVN_URL_1\"}" > version.json RUN echo "{\"time\":\"$BUILD_TIMESTAMP\",\"build\": \"$BUILD_NUMBER\",\"revision\": \"$SVN_REVISION_1\",\"URL\":\"$SVN_URL_1\"}" > version.json
RUN npm cache clean -f RUN npm cache clean -f
RUN rm -rf package-lock.json RUN rm -rf package-lock.json
RUN npm install --registry https://nexus.ngaiot.com/repository/fs-npm/ RUN npm install --registry http://10.8.30.22:7000
RUN npm run build RUN npm run build
RUN rm -rf client/src RUN rm -rf client/src
RUN rm -rf node_modules RUN rm -rf node_modules
RUN npm install --production --registry https://nexus.ngaiot.com/repository/fs-npm/ RUN npm install --production --registry http://10.8.30.22:7000
# RUN npm install --production --registry https://nexus.ngaiot.com/repository/fs-npm/
FROM registry.cn-hangzhou.aliyuncs.com/fs-devops/node-16:7.22-06-20 FROM registry.cn-hangzhou.aliyuncs.com/fs-devops/node-16:7.22-06-20

30
web/client/src/sections/means/containers/devOpsStandard.jsx

@ -39,11 +39,11 @@ const Rest = (props) => {
let data = res.payload.data?.rows?.filter(v => v.pepProjectIsDelete !== 1)?.map(v => ({ pepProjectId: v.id, pepProjectName: v.pepProjectName || v.name })) let data = res.payload.data?.rows?.filter(v => v.pepProjectIsDelete !== 1)?.map(v => ({ pepProjectId: v.id, pepProjectName: v.pepProjectName || v.name }))
setPomsList(data) setPomsList(data)
setShowPomsList(data) setShowPomsList(data)
setPepProjectId(data[0]?.pepProjectId)
fileList(data[0]?.pepProjectId)
} }
})) }))
// setPepProjectId(data[0]?.pepProjectId)
fileList(null)
}, []) }, [])
useEffect(() => { useEffect(() => {
@ -54,8 +54,8 @@ const Rest = (props) => {
data = pomsList?.filter(v => v.pepProjectName?.indexOf(projectSearch) != -1) data = pomsList?.filter(v => v.pepProjectName?.indexOf(projectSearch) != -1)
} }
setShowPomsList(data) setShowPomsList(data)
setPepProjectId(data[0]?.pepProjectId) setPepProjectId(data[0]?.pepProjectId || null)
fileList(data[0]?.pepProjectId) fileList(data[0]?.pepProjectId || null)
setDataSource([]) setDataSource([])
setFileId('') setFileId('')
setFileSearch('') setFileSearch('')
@ -70,8 +70,8 @@ const Rest = (props) => {
data = pomsList data = pomsList
} }
setShowPomsList(data) setShowPomsList(data)
setPepProjectId(data[0]?.pepProjectId) setPepProjectId(data[0]?.pepProjectId || null)
fileList(data[0]?.pepProjectId) fileList(data[0]?.pepProjectId || null)
setDataSource([]) setDataSource([])
setFileId('') setFileId('')
setFileSearch('') setFileSearch('')
@ -152,7 +152,7 @@ const Rest = (props) => {
if (!fileData && !list?.children?.length) { if (!fileData && !list?.children?.length) {
dispatch(means.delFile(v.id)).then((res => { dispatch(means.delFile(v.id)).then((res => {
if (res.success) { if (res.success) {
fileList(v.projectId) fileList(v.projectId || null)
} }
})) }))
} }
@ -279,6 +279,16 @@ const Rest = (props) => {
<div style={{ width: 200, height: '100%', padding: '16px 10px', boxShadow: '0 0 4px 2px #0000000d' }}> <div style={{ width: 200, height: '100%', padding: '16px 10px', boxShadow: '0 0 4px 2px #0000000d' }}>
<Input placeholder='请输入项目名称' value={projectSearch} onChange={v => setProjectSearch(v)} /> <Input placeholder='请输入项目名称' value={projectSearch} onChange={v => setProjectSearch(v)} />
<SimpleBar style={{ height: 'calc(100% - 24px', }} forceVisible="y" > <SimpleBar style={{ height: 'calc(100% - 24px', }} forceVisible="y" >
<div style={{ cursor: 'pointer', background: pepProjectId == null ? 'rgb(15 126 251 / 16%)' : '', width: 180, height: 30, display: 'flex', alignItems: 'center' }}
onClick={() => {
setPepProjectId(null)
fileList(null)
setDataSource([])
setFileId('')
}}>
<img src="/assets/images/icon/project-icon.png" style={{ width: 14, marginRight: 8 }} />
<div style={{ fontSize: 14, width: 152, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>项目通用</div>
</div>
{showPomsList?.map(v => { {showPomsList?.map(v => {
return <div key={'pepProjectId' + v.pepProjectId} title={v.pepProjectName} style={{ cursor: 'pointer', background: v.pepProjectId == pepProjectId ? 'rgb(15 126 251 / 16%)' : '', width: 180, height: 30, display: 'flex', alignItems: 'center' }} return <div key={'pepProjectId' + v.pepProjectId} title={v.pepProjectName} style={{ cursor: 'pointer', background: v.pepProjectId == pepProjectId ? 'rgb(15 126 251 / 16%)' : '', width: 180, height: 30, display: 'flex', alignItems: 'center' }}
onClick={() => { onClick={() => {
@ -309,14 +319,14 @@ const Rest = (props) => {
<FileModal <FileModal
editData={editData} editData={editData}
higherFile={higherFile} higherFile={higherFile}
pepProjectId={pepProjectId} pepProjectId={pepProjectId || null}
type={4} type={4}
close={() => { close={() => {
setIsFileModal(false) setIsFileModal(false)
setEditData({}) setEditData({})
}} }}
success={() => { success={() => {
fileList(pepProjectId) fileList(pepProjectId || null)
}} }}
/> : "" /> : ""
} }

33
web/client/src/sections/means/containers/faultInformation.jsx

@ -10,7 +10,7 @@ import './style.less'
const Rest = (props) => { const Rest = (props) => {
const { dispatch, actions, user, qiniu, loading, clientHeight, overallProjectId ,apiRoot} = props const { dispatch, actions, user, qiniu, loading, clientHeight, overallProjectId, apiRoot } = props
const { install, means } = actions const { install, means } = actions
const [pomsList, setPomsList] = useState([]); // const [pomsList, setPomsList] = useState([]); //
const [showPomsList, setShowPomsList] = useState([]); // const [showPomsList, setShowPomsList] = useState([]); //
@ -39,11 +39,10 @@ const Rest = (props) => {
let data = res.payload.data?.rows?.filter(v => v.pepProjectIsDelete !== 1)?.map(v => ({ pepProjectId: v.id, pepProjectName: v.pepProjectName || v.name })) let data = res.payload.data?.rows?.filter(v => v.pepProjectIsDelete !== 1)?.map(v => ({ pepProjectId: v.id, pepProjectName: v.pepProjectName || v.name }))
setPomsList(data) setPomsList(data)
setShowPomsList(data) setShowPomsList(data)
setPepProjectId(data[0]?.pepProjectId)
fileList(data[0]?.pepProjectId)
} }
})) }))
// setPepProjectId(data[0]?.pepProjectId)
fileList(null)
}, []) }, [])
useEffect(() => { useEffect(() => {
@ -54,8 +53,8 @@ const Rest = (props) => {
data = pomsList?.filter(v => v.pepProjectName?.indexOf(projectSearch) != -1) data = pomsList?.filter(v => v.pepProjectName?.indexOf(projectSearch) != -1)
} }
setShowPomsList(data) setShowPomsList(data)
setPepProjectId(data[0]?.pepProjectId) setPepProjectId(data[0]?.pepProjectId || null)
fileList(data[0]?.pepProjectId) fileList(data[0]?.pepProjectId || null)
setDataSource([]) setDataSource([])
setFileId('') setFileId('')
setFileSearch('') setFileSearch('')
@ -70,8 +69,8 @@ const Rest = (props) => {
data = pomsList data = pomsList
} }
setShowPomsList(data) setShowPomsList(data)
setPepProjectId(data[0]?.pepProjectId) setPepProjectId(data[0]?.pepProjectId || null)
fileList(data[0]?.pepProjectId) fileList(data[0]?.pepProjectId || null)
setDataSource([]) setDataSource([])
setFileId('') setFileId('')
setFileSearch('') setFileSearch('')
@ -152,7 +151,7 @@ const Rest = (props) => {
if (!fileData && !list?.children?.length) { if (!fileData && !list?.children?.length) {
dispatch(means.delFile(v.id)).then((res => { dispatch(means.delFile(v.id)).then((res => {
if (res.success) { if (res.success) {
fileList(v.projectId) fileList(v.projectId || null)
} }
})) }))
} }
@ -279,6 +278,16 @@ const Rest = (props) => {
<div style={{ width: 200, height: '100%', padding: '16px 10px', boxShadow: '0 0 4px 2px #0000000d' }}> <div style={{ width: 200, height: '100%', padding: '16px 10px', boxShadow: '0 0 4px 2px #0000000d' }}>
<Input placeholder='请输入项目名称' value={projectSearch} onChange={v => setProjectSearch(v)} /> <Input placeholder='请输入项目名称' value={projectSearch} onChange={v => setProjectSearch(v)} />
<SimpleBar style={{ height: 'calc(100% - 24px', }} forceVisible="y" > <SimpleBar style={{ height: 'calc(100% - 24px', }} forceVisible="y" >
<div style={{ cursor: 'pointer', background: pepProjectId == null ? 'rgb(15 126 251 / 16%)' : '', width: 180, height: 30, display: 'flex', alignItems: 'center' }}
onClick={() => {
setPepProjectId(null)
fileList(null)
setDataSource([])
setFileId('')
}}>
<img src="/assets/images/icon/project-icon.png" style={{ width: 14, marginRight: 8 }} />
<div style={{ fontSize: 14, width: 152, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>项目通用</div>
</div>
{showPomsList?.map(v => { {showPomsList?.map(v => {
return <div key={'pepProjectId' + v.pepProjectId} title={v.pepProjectName} style={{ cursor: 'pointer', background: v.pepProjectId == pepProjectId ? 'rgb(15 126 251 / 16%)' : '', width: 180, height: 30, display: 'flex', alignItems: 'center' }} return <div key={'pepProjectId' + v.pepProjectId} title={v.pepProjectName} style={{ cursor: 'pointer', background: v.pepProjectId == pepProjectId ? 'rgb(15 126 251 / 16%)' : '', width: 180, height: 30, display: 'flex', alignItems: 'center' }}
onClick={() => { onClick={() => {
@ -309,14 +318,14 @@ const Rest = (props) => {
<FileModal <FileModal
editData={editData} editData={editData}
higherFile={higherFile} higherFile={higherFile}
pepProjectId={pepProjectId} pepProjectId={pepProjectId || null}
type={3} type={3}
close={() => { close={() => {
setIsFileModal(false) setIsFileModal(false)
setEditData({}) setEditData({})
}} }}
success={() => { success={() => {
fileList(pepProjectId) fileList(pepProjectId || null)
}} }}
/> : "" /> : ""
} }
@ -559,7 +568,7 @@ function mapStateToProps (state) {
// socket: webSocket.socket // socket: webSocket.socket
clientHeight: global.clientHeight, clientHeight: global.clientHeight,
qiniu: global.qiniu?.domain, qiniu: global.qiniu?.domain,
apiRoot:global.apiRoot apiRoot: global.apiRoot
}; };
} }

36
web/client/src/sections/means/containers/repairFQA.jsx

@ -10,11 +10,11 @@ import './style.less'
const Rest = (props) => { const Rest = (props) => {
const { dispatch, actions, user, qiniu, loading, clientHeight, overallProjectId ,apiRoot} = props const { dispatch, actions, user, qiniu, loading, clientHeight, overallProjectId, apiRoot } = props
const { install, means } = actions const { install, means } = actions
const [pomsList, setPomsList] = useState([]); // const [pomsList, setPomsList] = useState([]); //
const [showPomsList, setShowPomsList] = useState([]); // const [showPomsList, setShowPomsList] = useState([]); //
const [pepProjectId, setPepProjectId] = useState() //id const [pepProjectId, setPepProjectId] = useState(null) //id
const [projectSearch, setProjectSearch] = useState() // const [projectSearch, setProjectSearch] = useState() //
const [isFileModal, setIsFileModal] = useState(false) // const [isFileModal, setIsFileModal] = useState(false) //
const [editData, setEditData] = useState({}) // const [editData, setEditData] = useState({}) //
@ -39,11 +39,10 @@ const Rest = (props) => {
let data = res.payload.data?.rows?.filter(v => v.pepProjectIsDelete !== 1)?.map(v => ({ pepProjectId: v.id, pepProjectName: v.pepProjectName || v.name })) let data = res.payload.data?.rows?.filter(v => v.pepProjectIsDelete !== 1)?.map(v => ({ pepProjectId: v.id, pepProjectName: v.pepProjectName || v.name }))
setPomsList(data) setPomsList(data)
setShowPomsList(data) setShowPomsList(data)
setPepProjectId(data[0]?.pepProjectId)
fileList(data[0]?.pepProjectId)
} }
})) }))
// setPepProjectId(data[0]?.pepProjectId)
fileList(null)
}, []) }, [])
useEffect(() => { useEffect(() => {
@ -54,8 +53,8 @@ const Rest = (props) => {
data = pomsList?.filter(v => v.pepProjectName?.indexOf(projectSearch) != -1) data = pomsList?.filter(v => v.pepProjectName?.indexOf(projectSearch) != -1)
} }
setShowPomsList(data) setShowPomsList(data)
setPepProjectId(data[0]?.pepProjectId) setPepProjectId(data[0]?.pepProjectId || null)
fileList(data[0]?.pepProjectId) fileList(data[0]?.pepProjectId || null)
setDataSource([]) setDataSource([])
setFileId('') setFileId('')
setFileSearch('') setFileSearch('')
@ -70,8 +69,8 @@ const Rest = (props) => {
data = pomsList data = pomsList
} }
setShowPomsList(data) setShowPomsList(data)
setPepProjectId(data[0]?.pepProjectId) setPepProjectId(data[0]?.pepProjectId || null)
fileList(data[0]?.pepProjectId) fileList(data[0]?.pepProjectId || null)
setDataSource([]) setDataSource([])
setFileId('') setFileId('')
setFileSearch('') setFileSearch('')
@ -152,7 +151,7 @@ const Rest = (props) => {
if (!fileData && !list?.children?.length) { if (!fileData && !list?.children?.length) {
dispatch(means.delFile(v.id)).then((res => { dispatch(means.delFile(v.id)).then((res => {
if (res.success) { if (res.success) {
fileList(v.projectId) fileList(v.projectId || null)
} }
})) }))
} }
@ -279,6 +278,17 @@ const Rest = (props) => {
<div style={{ width: 200, height: '100%', padding: '16px 10px', boxShadow: '0 0 4px 2px #0000000d' }}> <div style={{ width: 200, height: '100%', padding: '16px 10px', boxShadow: '0 0 4px 2px #0000000d' }}>
<Input placeholder='请输入项目名称' value={projectSearch} onChange={v => setProjectSearch(v)} /> <Input placeholder='请输入项目名称' value={projectSearch} onChange={v => setProjectSearch(v)} />
<SimpleBar style={{ height: 'calc(100% - 24px', }} forceVisible="y" > <SimpleBar style={{ height: 'calc(100% - 24px', }} forceVisible="y" >
<div style={{ cursor: 'pointer', background: pepProjectId == null ? 'rgb(15 126 251 / 16%)' : '', width: 180, height: 30, display: 'flex', alignItems: 'center' }}
onClick={() => {
setPepProjectId(null)
fileList(null)
setDataSource([])
setFileId('')
}}>
<img src="/assets/images/icon/project-icon.png" style={{ width: 14, marginRight: 8 }} />
<div style={{ fontSize: 14, width: 152, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>项目通用</div>
</div>
{showPomsList?.map(v => { {showPomsList?.map(v => {
return <div key={'pepProjectId' + v.pepProjectId} title={v.pepProjectName} style={{ cursor: 'pointer', background: v.pepProjectId == pepProjectId ? 'rgb(15 126 251 / 16%)' : '', width: 180, height: 30, display: 'flex', alignItems: 'center' }} return <div key={'pepProjectId' + v.pepProjectId} title={v.pepProjectName} style={{ cursor: 'pointer', background: v.pepProjectId == pepProjectId ? 'rgb(15 126 251 / 16%)' : '', width: 180, height: 30, display: 'flex', alignItems: 'center' }}
onClick={() => { onClick={() => {
@ -309,14 +319,14 @@ const Rest = (props) => {
<FileModal <FileModal
editData={editData} editData={editData}
higherFile={higherFile} higherFile={higherFile}
pepProjectId={pepProjectId} pepProjectId={pepProjectId || null}
type={2} type={2}
close={() => { close={() => {
setIsFileModal(false) setIsFileModal(false)
setEditData({}) setEditData({})
}} }}
success={() => { success={() => {
fileList(pepProjectId) fileList(pepProjectId || null)
}} }}
/> : "" /> : ""
} }
@ -559,7 +569,7 @@ function mapStateToProps (state) {
// socket: webSocket.socket // socket: webSocket.socket
clientHeight: global.clientHeight, clientHeight: global.clientHeight,
qiniu: global.qiniu?.domain, qiniu: global.qiniu?.domain,
apiRoot:global.apiRoot apiRoot: global.apiRoot
}; };
} }

Loading…
Cancel
Save