Compare commits
40 Commits
Author | SHA1 | Date |
---|---|---|
|
91d2cdffe2 | |
|
55ea025f4a | |
|
06adfeb533 | |
|
22750d737e | |
|
fa4fbc235d | |
|
399a100045 | |
|
51558c70f0 | |
|
385d47c6f9 | |
|
5e53adf9a6 | |
|
634b4fd256 | |
![]() |
61fa10504f | |
|
b2b27fe0fe | |
|
ff0d71a238 | |
|
cc893c3ad0 | |
|
102cd94820 | |
|
a012cc9031 | |
|
56a77aaf87 | |
|
db57e499af | |
|
06180e71c4 | |
|
3e37a28df1 | |
|
778e0c5236 | |
|
69847d3a31 | |
|
f4ebbade15 | |
|
99e575124f | |
|
995f55ff23 | |
|
471f6ba976 | |
![]() |
d3ce661208 | |
![]() |
4562fa5a6f | |
![]() |
b6d146dc44 | |
![]() |
f05bdeb776 | |
![]() |
5acab2c8ff | |
![]() |
874c3f3c48 | |
![]() |
6baee56cf6 | |
![]() |
a47778e525 | |
![]() |
3b86837d33 | |
![]() |
e853bdb758 | |
![]() |
614770ae9b | |
![]() |
3a49e66c3e | |
|
54e74dcf70 | |
|
d5a7e6ec20 |
|
@ -8,9 +8,9 @@ trigger:
|
|||
event:
|
||||
- ref: pr
|
||||
ruleset:
|
||||
- param-ref: source_branch
|
||||
- param-ref: target_branch
|
||||
operator: EQ
|
||||
value: '""'
|
||||
value: '"master"'
|
||||
ruleset-operator: AND
|
||||
workflow:
|
||||
- ref: start
|
||||
|
@ -35,12 +35,14 @@ workflow:
|
|||
name: docker镜像构建
|
||||
task: docker_image_build@1.6.0
|
||||
input:
|
||||
image_name: '""'
|
||||
docker_username: ((docker.username))
|
||||
docker_password: ((docker.password))
|
||||
image_name: '"registry.cn-guangzhou.aliyuncs.com/nudt_devops/gitlink_help_center"'
|
||||
image_tag: '"latest"'
|
||||
registry_address: '""'
|
||||
registry_address: '"registry.cn-guangzhou.aliyuncs.com"'
|
||||
docker_file: '"Dockerfile"'
|
||||
docker_build_path: '"."'
|
||||
workspace: '"."'
|
||||
workspace: git_clone_0.git_path
|
||||
image_push: true
|
||||
build_args: '""'
|
||||
needs:
|
||||
|
@ -49,10 +51,14 @@ workflow:
|
|||
name: ssh执行命令
|
||||
task: ssh_cmd@1.1.1
|
||||
input:
|
||||
ssh_ip: '""'
|
||||
ssh_pass: ((ssh_key.ssh_pass))
|
||||
ssh_ip: '"116.62.120.115"'
|
||||
ssh_port: '"22"'
|
||||
ssh_user: '"root"'
|
||||
ssh_cmd: '""'
|
||||
ssh_cmd: '"docker stop ghc_group6 && docker rm ghc_group6 && docker pull
|
||||
registry.cn-guangzhou.aliyuncs.com/nudt_devops/gitlink_help_center_group6:latest
|
||||
&& docker run -d -p 3000:3000 --name ghc_group6
|
||||
registry.cn-guangzhou.aliyuncs.com/nudt_devops/gitlink_help_center_group6:latest"'
|
||||
needs:
|
||||
- docker_image_build_0
|
||||
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
version: 2
|
||||
name: 刘德华
|
||||
description: ""
|
||||
global:
|
||||
concurrent: 1
|
||||
workflow:
|
||||
- ref: start
|
||||
name: 开始
|
||||
task: start
|
||||
- ref: ssh_cmd_0
|
||||
name: ssh执行命令
|
||||
task: ssh_cmd@1.1.1
|
||||
input:
|
||||
ssh_pass: ((ssh_key.ssh_key))
|
||||
ssh_private_key: ((ssh_key.ssh_key))
|
||||
ssh_ip: '"116.62.120.115"'
|
||||
ssh_port: '"22"'
|
||||
ssh_user: '""'
|
||||
ssh_cmd: '"docker stop ghc_group6 && docker rm ghc_group6 && docker pull
|
||||
registry.cn-guangzhou.aliyuncs.com/nudt_devops/gitlink_help_center_group6:latest
|
||||
&& docker run -p 3000:3000 –name ghc_group6
|
||||
registry.cn-guangzhou.aliyuncs.com/nudt_devops/gitlink_help_center_group6:latest"'
|
||||
needs:
|
||||
- start
|
||||
- ref: end
|
||||
name: 结束
|
||||
task: end
|
||||
needs:
|
||||
- ssh_cmd_0
|
||||
|
|
@ -21,6 +21,8 @@ workflow:
|
|||
name: docker镜像构建
|
||||
task: docker_image_build@1.6.0
|
||||
input:
|
||||
docker_username: ((ssh_key.ssh_private_key))
|
||||
docker_password: ((ssh_key.ssh_private_key))
|
||||
image_name: '""'
|
||||
image_tag: '"latest"'
|
||||
registry_address: '""'
|
||||
|
@ -35,6 +37,7 @@ workflow:
|
|||
name: ssh执行命令
|
||||
task: ssh_cmd@1.1.1
|
||||
input:
|
||||
ssh_pass: ((ssh_key.ssh_private_key))
|
||||
ssh_ip: '""'
|
||||
ssh_port: '"22"'
|
||||
ssh_user: '"root"'
|
||||
|
@ -45,6 +48,8 @@ workflow:
|
|||
name: git_push
|
||||
task: sailstar/git_push@1.0.6
|
||||
input:
|
||||
username: ((ssh_key.ssh_private_key))
|
||||
password: ((ssh_key.ssh_private_key))
|
||||
remote_url: '""'
|
||||
remote_branch: '"master"'
|
||||
source_path: '""'
|
||||
|
|
|
@ -0,0 +1,58 @@
|
|||
version: 2
|
||||
name: 添加功能流水线
|
||||
description: ""
|
||||
global:
|
||||
concurrent: 1
|
||||
trigger:
|
||||
webhook: gitlink@1.0.0
|
||||
event:
|
||||
- ref: pr
|
||||
ruleset:
|
||||
- param-ref: target_branch
|
||||
operator: EQ
|
||||
value: '"master"'
|
||||
ruleset-operator: AND
|
||||
workflow:
|
||||
- ref: start
|
||||
name: 开始
|
||||
task: start
|
||||
- ref: git_clone_0
|
||||
name: git clone
|
||||
task: git_clone@1.2.9
|
||||
input:
|
||||
remote_url: '"https://gitlink.org.cn/SheYuWu03/reposync.git"'
|
||||
ref: '"refs/heads/master"'
|
||||
commit_id: '""'
|
||||
depth: 1
|
||||
needs:
|
||||
- start
|
||||
- ref: docker_image_build_0
|
||||
name: docker镜像构建
|
||||
task: docker_image_build@1.6.0
|
||||
input:
|
||||
image_name: '""'
|
||||
image_tag: '"latest"'
|
||||
registry_address: '""'
|
||||
docker_file: '"Dockerfile"'
|
||||
docker_build_path: '"."'
|
||||
workspace: '"."'
|
||||
image_push: true
|
||||
build_args: '""'
|
||||
needs:
|
||||
- git_clone_0
|
||||
- ref: ssh_cmd_0
|
||||
name: ssh执行命令
|
||||
task: ssh_cmd@1.1.1
|
||||
input:
|
||||
ssh_ip: '""'
|
||||
ssh_port: '"22"'
|
||||
ssh_user: '"root"'
|
||||
ssh_cmd: '""'
|
||||
needs:
|
||||
- docker_image_build_0
|
||||
- ref: end
|
||||
name: 结束
|
||||
task: end
|
||||
needs:
|
||||
- ssh_cmd_0
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
FROM node:18-alpine
|
||||
LABEL maintainer="niezhiwei <3143901237@qq.com>"
|
||||
|
||||
WORKDIR /gitlink_help_center
|
||||
|
||||
COPY ./ /gitlink_help_center/
|
||||
|
||||
RUN yarn install
|
||||
RUN npm run build -- --locale zh-cn
|
||||
CMD ["npm", "run", "serve"]
|
|
@ -58,6 +58,13 @@ module.exports = {
|
|||
position: 'left',
|
||||
label: '帮助中心'
|
||||
},
|
||||
{
|
||||
type: 'doc',
|
||||
docId: 'intro',
|
||||
position: 'right',
|
||||
label: '意见反馈',
|
||||
href:"/ratingpage"
|
||||
},
|
||||
// {
|
||||
// href: 'https://github.com/boxyhq',
|
||||
// position: 'right',
|
||||
|
|
|
@ -0,0 +1,93 @@
|
|||
import React, { useState } from 'react';
|
||||
|
||||
|
||||
const SatisfactionRating = () => {
|
||||
const [selectedUsabilityRating, setSelectedUsabilityRating] = useState(-1);
|
||||
const [selectedHelpRating, setSelectedHelpRating] = useState(-1);
|
||||
const [comment, setComment] = useState('');
|
||||
|
||||
const usabilityRatings = ['非常满意', '比较满意', '一般', '不太满意', '非常不满意'];
|
||||
const helpRatings = ['很有帮助', '比较有帮助', '帮助不大', '毫无帮助'];
|
||||
|
||||
const handleUsabilityRatingClick = (index) => {
|
||||
setSelectedUsabilityRating(index);
|
||||
};
|
||||
|
||||
const handleHelpRatingClick = (index) => {
|
||||
setSelectedHelpRating(index);
|
||||
};
|
||||
|
||||
const handleSubmit = () => {
|
||||
if (selectedUsabilityRating === -1 || selectedHelpRating === -1) {
|
||||
alert('请对两个选项都进行选择!');
|
||||
} else {
|
||||
const usabilityRating = usabilityRatings[selectedUsabilityRating];
|
||||
const helpRating = helpRatings[selectedHelpRating];
|
||||
alert(`感谢您的反馈`);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div style={{ maxWidth: '600px', margin: 'auto', textAlign: 'center' }}>
|
||||
<h2 style={{ marginBottom: '20px' }}>请留下您的意见</h2>
|
||||
<div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', marginBottom: '20px' }}>
|
||||
<h3>满意度:</h3>
|
||||
<div style={{ display: 'flex', justifyContent: 'center', marginBottom: '10px' }}>
|
||||
{usabilityRatings.map((rating, index) => (
|
||||
<button key={index} onClick={() => handleUsabilityRatingClick(index)} style={{ margin: '5px', padding: '10px 20px', backgroundColor: selectedUsabilityRating === index ? '#337ab7' : '#f0f0f0', color: selectedUsabilityRating === index ? '#ffffff' : '#333', border: 'none', borderRadius: '5px', cursor: 'pointer', boxShadow: '0px 3px 5px rgba(0,0,0,0.1)', transition: 'background-color 0.3s ease' }}>
|
||||
{rating}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
<div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', marginBottom: '20px' }}>
|
||||
<h3>该文档对您是否有帮助?:</h3>
|
||||
<div style={{ display: 'flex', justifyContent: 'center', marginBottom: '10px' }}>
|
||||
{helpRatings.map((rating, index) => (
|
||||
<button key={index} onClick={() => handleHelpRatingClick(index)} style={{ margin: '5px', padding: '10px 20px', backgroundColor: selectedHelpRating === index ? '#337ab7' : '#f0f0f0', color: selectedHelpRating === index ? '#ffffff' : '#333', border: 'none', borderRadius: '5px', cursor: 'pointer', boxShadow: '0px 3px 5px rgba(0,0,0,0.1)', transition: 'background-color 0.3s ease' }}>
|
||||
{rating}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
<div style={{marginBottom: '20px'}}>
|
||||
<h3>意见和建议:</h3>
|
||||
<textarea
|
||||
value={comment}
|
||||
onChange={(e) => setComment(e.target.value)}
|
||||
placeholder="写下想说的话"
|
||||
style={{
|
||||
width: '100%',
|
||||
height: '100px',
|
||||
padding: '10px',
|
||||
borderRadius: '5px',
|
||||
border: '1px solid #ccc',
|
||||
transition: 'box-shadow 0.3s, border-color 0.3s', // 添加过渡效果
|
||||
boxShadow: comment ? '0 0 5px rgba(81, 203, 238, 1)' : 'none', // 根据内容是否为空添加幽影效果
|
||||
borderColor: comment ? '#51cbee' : '#ccc', // 根据内容是否为空修改边框颜色
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<button onClick={handleSubmit} style={{
|
||||
backgroundColor: '#337ab7',
|
||||
color: '#ffffff',
|
||||
padding: '10px 20px',
|
||||
border: 'none',
|
||||
borderRadius: '5px',
|
||||
cursor: 'pointer',
|
||||
boxShadow: '0px 3px 5px rgba(0,0,0,0.1)',
|
||||
transition: 'background-color 0.3s ease',
|
||||
':hover': {backgroundColor: '#286090'}
|
||||
}}>提交
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default function HelloReactPage() {
|
||||
return (
|
||||
<div style={{display: 'flex', justifyContent: 'center', alignItems: 'center', height: '100vh', background: '#f9f9f9' }}>
|
||||
<SatisfactionRating />
|
||||
</div>
|
||||
);
|
||||
}
|
Loading…
Reference in New Issue