Commit 6bef5cc8 by luyt

add;测试git hook

1 parent 6c31cb93
This diff could not be displayed because it is too large.
......@@ -23,6 +23,8 @@
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^6.2.2",
"node-sass": "^4.14.1",
"sass-loader": "^10.1.0",
"vue-template-compiler": "^2.6.11"
},
"eslintConfig": {
......
import request2 from '@/plugins/axios/index2.js';
// console.log('request2',request2)
const gitLog = {
getCommitList(id) {
return request2({
url: '/commons/getList',
method: 'get',
params: {
project_id:id
}
})
},
getBranches(id) {
return request2({
url: `/${id}/repository/branches`,
method: 'get',
})
},
}
export default gitLog
\ No newline at end of file
import project from './project';
import documentation from './documentation';
import commons from './commons'
import gitLog from './gitLog'
export default {
project,
documentation,
commons
commons,
gitLog
}
......@@ -12,6 +12,7 @@ import {
Select,
Comment,
Tooltip,
Popover
} from 'ant-design-vue'
......@@ -30,4 +31,5 @@ export const components = [
Select,
Comment,
Tooltip,
Popover
]
\ No newline at end of file
......@@ -7,7 +7,7 @@
import axios from 'axios'
import { message } from "ant-design-vue";
let url = process.env.NODE_ENV == "development" ? "/api" : "http://glsk-front-node.test.glsx.com.cn"
let url = process.env.NODE_ENV == "development" ? "/api3" : "http://glsk-front-node.test.glsx.com.cn"
// let url = process.env.NODE_ENV == "development" ? "http://192.168.2.24:7001" : "http://192.168.3.182:7001"
const service = axios.create({
withCredentials: false,
......
/*
* @Author: huyue
* @Date: 2021-09-06 15:19:47
* @Last Modified by: huyue
* @Last Modified time: 2021-09-10 15:16:03
*/
import axios from 'axios'
import { message } from "ant-design-vue";
let url = process.env.NODE_ENV == "development" ? "/api2" : "http://192.168.3.233:8090/api/v4/projects"
const service = axios.create({
withCredentials: false,
baseURL: url,
headers:{
'PRIVATE-TOKEN':'3Jx5WzakT73dR2ybKQh3'
}
})
// 添加请求拦截器
service.interceptors.request.use(function (config) {
// 在发送请求之前做些什么
return config;
}, function (error) {
// 对请求错误做些什么
return Promise.reject(error);
});
// 添加响应拦截器
service.interceptors.response.use(response => {
// 对响应数据做点什么
const { data,status } = response
// console.log(response)
if (status != 200) {
message.error('网络错误,请稍后再试')
return Promise.reject({status, msg:'网络错误,请稍后再试'})
} else {
return Promise.resolve(data)
}
}, error => {
// 对响应错误做点什么
message.error(JSON.stringify(error))
return Promise.reject(error);
});
export default service
......@@ -34,6 +34,12 @@ const routes = Object.freeze([
path: '/record',
component: resolve => require(['../views/record/index.vue'], resolve)
}
,
{
name: 'GitLog',
path: '/gitLog',
component: resolve => require(['../views/gitLog.vue'], resolve)
}
])
export default routes
\ No newline at end of file
<template>
<div class="gitlog">
<div class="branch">
<a-select
default-value="master"
style="width: 120px"
@change="handleChange"
>
<a-select-option v-for="(item,index) in branchs" :key="index+'branch'" :value="index"> {{ item.name}} </a-select-option>
</a-select>
<span class="current">当前分支:{{currentBranch.name}}</span>
</div>
<a-list item-layout="horizontal" :data-source="data">
<a-list-item slot="renderItem" slot-scope="item">
<a-list-item-meta :description="item.message">
<span slot="title"
>{{ item.title }}---{{ item.created_at | dateTime }} by author:
{{ item.author }}
<span class="author">{{ item.author_name }}</span></span
>
<a-avatar
slot="avatar"
src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"
/>
</a-list-item-meta>
</a-list-item>
</a-list>
</div>
</template>
<script>
import moment from "moment";
export default {
name: "",
props: {},
data() {
return {
data: [
{
id: "98285ed4f3df5ef58a01607651f61592248dd101",
short_id: "98285ed4",
title: "add:主题色加深色值调整",
created_at: "2022-02-10T14:00:54.000+08:00",
parent_ids: ["37efaa1ece09035aafd490a8e4d94931b23fedd2"],
message: "add:主题色加深色值调整\n",
author_name: "luyt",
author_email: "q9OUYzI2",
authored_date: "2022-02-10T14:00:54.000+08:00",
committer_name: "luyt",
committer_email: "q9OUYzI2",
committed_date: "2022-02-10T14:00:54.000+08:00",
},
],
branchs: [
{
name: "SCRM-V1.0.2",
commit: {
id: "266eb49b58dbc3dfdf12e52395fb5de9edcbf47a",
short_id: "266eb49b",
title: "1.3.7",
created_at: "2022-01-17T14:26:31.000+08:00",
parent_ids: ["aa7f2e56c33073428325efb7deff5f25e1da9c80"],
message: "1.3.7\n",
author_name: "limin",
author_email: "17653212@qq.com",
authored_date: "2022-01-17T14:26:31.000+08:00",
committer_name: "limin",
committer_email: "17653212@qq.com",
committed_date: "2022-01-17T14:26:31.000+08:00",
},
merged: true,
protected: false,
developers_can_push: false,
developers_can_merge: false,
},
{
name: "dev",
commit: {
id: "d51cb098bf2eae3295c336c9cf8000776e8e2a3a",
short_id: "d51cb098",
title: "add:修改table左对齐,金额右对齐",
created_at: "2022-02-16T15:39:30.000+08:00",
parent_ids: ["a423fa7e0afb347a2854ac03069dd19167d3acbb"],
message: "add:修改table左对齐,金额右对齐\n",
author_name: "luyt",
author_email: "q9OUYzI2",
authored_date: "2022-02-16T15:39:30.000+08:00",
committer_name: "luyt",
committer_email: "q9OUYzI2",
committed_date: "2022-02-16T15:39:30.000+08:00",
},
merged: false,
protected: false,
developers_can_push: false,
developers_can_merge: false,
},
],
currentBranch: {
"name": "master",
"commit": {
"id": "98285ed4f3df5ef58a01607651f61592248dd101",
"short_id": "98285ed4",
"title": "add:主题色加深色值调整",
"created_at": "2022-02-10T14:00:54.000+08:00",
"parent_ids": [
"37efaa1ece09035aafd490a8e4d94931b23fedd2"
],
"message": "add:主题色加深色值调整\n",
"author_name": "luyt",
"author_email": "q9OUYzI2",
"authored_date": "2022-02-10T14:00:54.000+08:00",
"committer_name": "luyt",
"committer_email": "q9OUYzI2",
"committed_date": "2022-02-10T14:00:54.000+08:00"
},
"merged": false,
"protected": true,
"developers_can_push": false,
"developers_can_merge": false
},
};
},
filters: {
dateTime(value) {
if (!value) return;
return moment(value).format("YYYY-MM-DD HH:MM:ss");
},
},
created() {
this.getBranchData()
},
mounted() {},
methods: {
handleChange(value) {
this.currentBranch = this.branchs[value]
// console.log('value: ', value);
},
defaultBranch(){
},
getBranchData(value) {
console.log('value: ', value);
this.api.gitLog.getBranches(173).then(res=>{
console.log('res: ', res);
})
}
},
components: {},
computed: {},
};
</script>
<style lang='scss'>
.gitlog {
.branch {
margin-bottom: 30px;
.current {
margin-left: 20px;
}
}
.author {
color: #008dff;
}
}
</style>
\ No newline at end of file
......@@ -25,6 +25,12 @@
<a-form-model-item label="相关技术栈" prop="technology">
<a-input v-model="form.technology" />
</a-form-model-item>
<a-form-model-item label="git地址" prop="git_url">
<a-input v-model="form.git_url" />
</a-form-model-item>
<a-form-model-item label="git项目ID" prop="git_id">
<a-input v-model="form.git_id" />
</a-form-model-item>
<a-form-model-item label="请输入项目描述" prop="project_description">
<a-input v-model="form.project_description" type="textarea" />
</a-form-model-item>
......
<template>
<div>
<div class="home-project">
<a-list item-layout="horizontal" :data-source="projectData">
<a-list-item slot="renderItem" slot-scope="item">
<a-list-item-meta>
......@@ -19,7 +19,7 @@
>{{ item.test_url }}</a
>
</a-descriptions-item>
<a-descriptions-item label="上产项目地址">
<a-descriptions-item label="生产项目地址">
<a
:href="item.test_url"
target="_blank"
......@@ -33,6 +33,35 @@
<a-descriptions-item label="配置名称">
{{ item.config_name }}
</a-descriptions-item>
<a-descriptions-item label="git地址">
<a
:href="item.git_url"
target="_blank"
rel="noopener noreferrer"
>{{ item.git_url }}</a
>
</a-descriptions-item>
<a-descriptions-item label="git提交信息">
<!-- <a
:href="item.git_commit"
target="_blank"
rel="noopener noreferrer"
>{{ item.git_commit }}</a
> -->
<a-button type="link" @click="checkGitLog(item)">
查看git提交信息
</a-button>
</a-descriptions-item>
<a-descriptions-item label="git项目ID">
<a-popover title="什么是git ID">
<template slot="content">
<p>1.进入git仓库项目设置</p>
<p>2.查看 Project ID</p>
</template>
{{ item.git_id }} <a-icon type="question" />
</a-popover>
</a-descriptions-item>
</a-descriptions>
</div>
<a slot="actions" @click="editFn(item)">编辑</a>
......@@ -56,6 +85,9 @@ const data = [
test_url: "http://sso.test.glsx.com.cn/#/login",
product_url: "http://sso.glsx.com.cn/#/login",
technology: "vue",
git_url:'http://giturl.com/',
// git_commit:'http://gitcommit.com/',
git_id:12
},
{
id: 2,
......@@ -66,6 +98,9 @@ const data = [
test_url: "http://glsx-account-merchants.test.glsx.com.cn",
product_url: "http://glsx-account.glsx.com.cn",
technology: "vue",
git_url:'http://giturl.com/',
// git_commit:'http://gitcommit.com/',
git_id:25
},
];
import projectImgUrl from "@/assets/project.jpg";
......@@ -95,7 +130,10 @@ export default {
},
commentsFn(item) {
// this.to("Record", comments);
this.$router.push({name:"Record",query: {id: item.id,title: item.project_title}})
this.$router.push({
name: "Record",
query: { id: item.id, title: item.project_title },
});
},
delFn(item) {
let that = this;
......@@ -119,18 +157,23 @@ export default {
}
});
},
checkGitLog(item){
console.log('item: ', item);
}
},
};
</script>
<style>
<style lang="scss">
.home-project {
.ant-list-item {
padding: 10px;
}
}
.ant-list-split .ant-list-item {
transition: all 0.3s;
}
.ant-list-split .ant-list-item:hover {
border-color: rgba(0, 0, 0, 0.09);
box-shadow: 0 2px 8px rgb(0 0 0 / 9%);
}
.ant-list-item {
padding: 10px;
box-shadow: 0 2px 8px rgba(0, 0, 0,0.09);
}
</style>
......@@ -3,12 +3,20 @@ module.exports = {
port: 8080, // 端口
proxy: {
//配置跨域
"/api": {
"/api3": {
target: "http://192.168.2.24:7001",
ws:true,
changOrigin: true,
pathRewrite: {
"^/api": "/"
"^/api3": "/"
}
},
"/api2": {
target: "http://192.168.3.233:8090/api/v4/projects",
ws:true,
changOrigin: true,
pathRewrite: {
"^/api2": "/"
}
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!