Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
35066c85
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
35066c85
编写于
11月 05, 2016
作者:
R
Regis
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
making reusable status and status icons components
上级
45992dc9
变更
13
显示空白变更内容
内联
并排
Showing
13 changed file
with
208 addition
and
39 deletion
+208
-39
app/assets/javascripts/svg_icons/index.js.es6
app/assets/javascripts/svg_icons/index.js.es6
+38
-0
app/assets/javascripts/vue_icons/index.js.es6
app/assets/javascripts/vue_icons/index.js.es6
+49
-0
app/assets/javascripts/vue_pipelines_index/index.js.es6
app/assets/javascripts/vue_pipelines_index/index.js.es6
+11
-11
app/assets/javascripts/vue_pipelines_index/pipelines.js.es6
app/assets/javascripts/vue_pipelines_index/pipelines.js.es6
+6
-7
app/assets/javascripts/vue_pipelines_index/running_icon.js.es6
...ssets/javascripts/vue_pipelines_index/running_icon.js.es6
+0
-13
app/assets/javascripts/vue_pipelines_index/store.js.es6
app/assets/javascripts/vue_pipelines_index/store.js.es6
+9
-0
app/assets/javascripts/vue_pipelines_status/failed.js.es6
app/assets/javascripts/vue_pipelines_status/failed.js.es6
+24
-0
app/assets/javascripts/vue_pipelines_status/index.js.es6
app/assets/javascripts/vue_pipelines_status/index.js.es6
+4
-0
app/assets/javascripts/vue_pipelines_status/pending.js.es6
app/assets/javascripts/vue_pipelines_status/pending.js.es6
+24
-0
app/assets/javascripts/vue_pipelines_status/running.js.es6
app/assets/javascripts/vue_pipelines_status/running.js.es6
+1
-8
app/assets/javascripts/vue_pipelines_status/status.js.es6
app/assets/javascripts/vue_pipelines_status/status.js.es6
+38
-0
app/views/projects/pipelines/index.html.haml
app/views/projects/pipelines/index.html.haml
+2
-0
config/application.rb
config/application.rb
+2
-0
未找到文件。
app/assets/javascripts/svg_icons/index.js.es6
0 → 100644
浏览文件 @
35066c85
//= require vue
/* global Vue, gl */
/* eslint-disable no-param-reassign */
((gl) => {
gl.VueRunningIcon = Vue.extend({
template: `
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 14 14">
<g fill="#2D9FD8" fill-rule="evenodd">
<path d="M12.5,7 C12.5,3.96243388 10.0375661,1.5 7,1.5 C3.96243388,1.5 1.5,3.96243388 1.5,7 C1.5,10.0375661 3.96243388,12.5 7,12.5 C10.0375661,12.5 12.5,10.0375661 12.5,7 Z M0,7 C0,3.13400675 3.13400675,0 7,0 C10.8659932,0 14,3.13400675 14,7 C14,10.8659932 10.8659932,14 7,14 C3.13400675,14 0,10.8659932 0,7 Z"></path>
<path d="M7,3 C9.209139,3 11,4.790861 11,7 C11,9.209139 9.209139,11 7,11 C5.65802855,11 4.47040669,10.3391508 3.74481446,9.32513253 L7,7 L7,3 L7,3 Z"></path>
</g>
</svg>
`,
});
gl.VuePendingIcon = Vue.extend({
template: `
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 14 14">
<g fill="#E75E40" fill-rule="evenodd">
<path d="M12.5,7 C12.5,3.96243388 10.0375661,1.5 7,1.5 C3.96243388,1.5 1.5,3.96243388 1.5,7 C1.5,10.0375661 3.96243388,12.5 7,12.5 C10.0375661,12.5 12.5,10.0375661 12.5,7 Z M0,7 C0,3.13400675 3.13400675,0 7,0 C10.8659932,0 14,3.13400675 14,7 C14,10.8659932 10.8659932,14 7,14 C3.13400675,14 0,10.8659932 0,7 Z"/>
<path d="M4.69999981,5.30065012 C4.69999981,5.13460564 4.83842754,5 5.00354719,5 L5.89645243,5 C6.06409702,5 6.19999981,5.13308716 6.19999981,5.30065012 L6.19999981,8.69934988 C6.19999981,8.86539436 6.06157207,9 5.89645243,9 L5.00354719,9 C4.8359026,9 4.69999981,8.86691284 4.69999981,8.69934988 L4.69999981,5.30065012 Z M7.69999981,5.30065012 C7.69999981,5.13460564 7.83842754,5 8.00354719,5 L8.89645243,5 C9.06409702,5 9.19999981,5.13308716 9.19999981,5.30065012 L9.19999981,8.69934988 C9.19999981,8.86539436 9.06157207,9 8.89645243,9 L8.00354719,9 C7.8359026,9 7.69999981,8.86691284 7.69999981,8.69934988 L7.69999981,5.30065012 Z"/>
</g>
</svg>
`,
});
gl.VueSuccessIcon = Vue.extend({
template: `
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 14 14">
<g fill="#31AF64" fill-rule="evenodd">
<path d="M12.5,7 C12.5,3.96243388 10.0375661,1.5 7,1.5 C3.96243388,1.5 1.5,3.96243388 1.5,7 C1.5,10.0375661 3.96243388,12.5 7,12.5 C10.0375661,12.5 12.5,10.0375661 12.5,7 Z M0,7 C0,3.13400675 3.13400675,0 7,0 C10.8659932,0 14,3.13400675 14,7 C14,10.8659932 10.8659932,14 7,14 C3.13400675,14 0,10.8659932 0,7 Z"/>
<path d="M7.29166667,7.875 L5.54840803,7.875 C5.38293028,7.875 5.25,8.00712771 5.25,8.17011551 L5.25,9.03821782 C5.25,9.19875081 5.38360183,9.33333333 5.54840803,9.33333333 L8.24853534,9.33333333 C8.52035522,9.33333333 8.75,9.11228506 8.75,8.83960819 L8.75,8.46475969 L8.75,4.07392947 C8.75,3.92144267 8.61787229,3.79166667 8.45488449,3.79166667 L7.58678218,3.79166667 C7.42624919,3.79166667 7.29166667,3.91804003 7.29166667,4.07392947 L7.29166667,7.875 Z" transform="rotate(45 7 6.563)"/>
</g>
</svg>
`,
});
})(window.gl || (window.gl = {}));
app/assets/javascripts/vue_icons/index.js.es6
0 → 100644
浏览文件 @
35066c85
//= require vue
/* global Vue, gl */
/* eslint-disable no-param-reassign */
((gl) => {
gl.VueRunningIcon = Vue.extend({
template: `
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 14 14">
<g fill="#2D9FD8" fill-rule="evenodd">
<path d="M12.5,7 C12.5,3.96243388 10.0375661,1.5 7,1.5 C3.96243388,1.5 1.5,3.96243388 1.5,7 C1.5,10.0375661 3.96243388,12.5 7,12.5 C10.0375661,12.5 12.5,10.0375661 12.5,7 Z M0,7 C0,3.13400675 3.13400675,0 7,0 C10.8659932,0 14,3.13400675 14,7 C14,10.8659932 10.8659932,14 7,14 C3.13400675,14 0,10.8659932 0,7 Z"></path>
<path d="M7,3 C9.209139,3 11,4.790861 11,7 C11,9.209139 9.209139,11 7,11 C5.65802855,11 4.47040669,10.3391508 3.74481446,9.32513253 L7,7 L7,3 L7,3 Z"></path>
</g>
</svg>
`,
});
gl.VuePendingIcon = Vue.extend({
template: `
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 14 14">
<g fill="#E75E40" fill-rule="evenodd">
<path d="M12.5,7 C12.5,3.96243388 10.0375661,1.5 7,1.5 C3.96243388,1.5 1.5,3.96243388 1.5,7 C1.5,10.0375661 3.96243388,12.5 7,12.5 C10.0375661,12.5 12.5,10.0375661 12.5,7 Z M0,7 C0,3.13400675 3.13400675,0 7,0 C10.8659932,0 14,3.13400675 14,7 C14,10.8659932 10.8659932,14 7,14 C3.13400675,14 0,10.8659932 0,7 Z"/>
<path d="M4.69999981,5.30065012 C4.69999981,5.13460564 4.83842754,5 5.00354719,5 L5.89645243,5 C6.06409702,5 6.19999981,5.13308716 6.19999981,5.30065012 L6.19999981,8.69934988 C6.19999981,8.86539436 6.06157207,9 5.89645243,9 L5.00354719,9 C4.8359026,9 4.69999981,8.86691284 4.69999981,8.69934988 L4.69999981,5.30065012 Z M7.69999981,5.30065012 C7.69999981,5.13460564 7.83842754,5 8.00354719,5 L8.89645243,5 C9.06409702,5 9.19999981,5.13308716 9.19999981,5.30065012 L9.19999981,8.69934988 C9.19999981,8.86539436 9.06157207,9 8.89645243,9 L8.00354719,9 C7.8359026,9 7.69999981,8.86691284 7.69999981,8.69934988 L7.69999981,5.30065012 Z"/>
</g>
</svg>
`,
});
gl.VueSuccessIcon = Vue.extend({
template: `
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 14 14">
<g fill="#31AF64" fill-rule="evenodd">
<path d="M12.5,7 C12.5,3.96243388 10.0375661,1.5 7,1.5 C3.96243388,1.5 1.5,3.96243388 1.5,7 C1.5,10.0375661 3.96243388,12.5 7,12.5 C10.0375661,12.5 12.5,10.0375661 12.5,7 Z M0,7 C0,3.13400675 3.13400675,0 7,0 C10.8659932,0 14,3.13400675 14,7 C14,10.8659932 10.8659932,14 7,14 C3.13400675,14 0,10.8659932 0,7 Z"/>
<path d="M7.29166667,7.875 L5.54840803,7.875 C5.38293028,7.875 5.25,8.00712771 5.25,8.17011551 L5.25,9.03821782 C5.25,9.19875081 5.38360183,9.33333333 5.54840803,9.33333333 L8.24853534,9.33333333 C8.52035522,9.33333333 8.75,9.11228506 8.75,8.83960819 L8.75,8.46475969 L8.75,4.07392947 C8.75,3.92144267 8.61787229,3.79166667 8.45488449,3.79166667 L7.58678218,3.79166667 C7.42624919,3.79166667 7.29166667,3.91804003 7.29166667,4.07392947 L7.29166667,7.875 Z" transform="rotate(45 7 6.563)"/>
</g>
</svg>
`,
});
gl.VueFailedIcon = Vue.extend({
template: `
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 14 14">
<g fill="#D22852" fill-rule="evenodd">
<path d="M12.5,7 C12.5,3.96243388 10.0375661,1.5 7,1.5 C3.96243388,1.5 1.5,3.96243388 1.5,7 C1.5,10.0375661 3.96243388,12.5 7,12.5 C10.0375661,12.5 12.5,10.0375661 12.5,7 Z M0,7 C0,3.13400675 3.13400675,0 7,0 C10.8659932,0 14,3.13400675 14,7 C14,10.8659932 10.8659932,14 7,14 C3.13400675,14 0,10.8659932 0,7 Z"/>
<path d="M7.72916667,6.27083333 L7.72916667,4.28939247 C7.72916667,4.12531853 7.59703895,4 7.43405116,4 L6.56594884,4 C6.40541585,4 6.27083333,4.12956542 6.27083333,4.28939247 L6.27083333,6.27083333 L4.28939247,6.27083333 C4.12531853,6.27083333 4,6.40296105 4,6.56594884 L4,7.43405116 C4,7.59458415 4.12956542,7.72916667 4.28939247,7.72916667 L6.27083333,7.72916667 L6.27083333,9.71060753 C6.27083333,9.87468147 6.40296105,10 6.56594884,10 L7.43405116,10 C7.59458415,10 7.72916667,9.87043458 7.72916667,9.71060753 L7.72916667,7.72916667 L9.71060753,7.72916667 C9.87468147,7.72916667 10,7.59703895 10,7.43405116 L10,6.56594884 C10,6.40541585 9.87043458,6.27083333 9.71060753,6.27083333 L7.72916667,6.27083333 Z" transform="rotate(-45 7 7)"/>
</g>
</svg>
`,
});
})(window.gl || (window.gl = {}));
app/assets/javascripts/vue_pipelines_index/index.js.es6
浏览文件 @
35066c85
/* global Vue, VueResource, gl */
/* eslint-disable no-bitwise*/
//= require vue
//= require vue-resource
//= require ./store.js.es6
//= require ./pipeline_url.vue.js.es6
//= require ./vue_gl_pagination.vue.js.es6
//= require ./pipeline_head.vue.js.es6
//= require ./running_icon.vue.js.es6
//= require ./running.vue.js.es6
//= require ./stages.vue.js.es6
//= require ./pipeline_actions.vue.js.es6
//= require ./branch_commit.vue.js.es6
//= require ./pipelines.vue.js.es6
//= require ./pipeline_url.js.es6
//= require ./gl_pagination.js.es6
//= require ./pipeline_head.js.es6
//= require ./stages.js.es6
//= require ./pipeline_actions.js.es6
//= require ./branch_commit.js.es6
//= require ./pipelines.js.es6
(() => {
if (~window.location.href.indexOf('scope')) return null;
const url = window.location.href;
if (~url.indexOf('scope')) return null;
const project = document.querySelector('.pipelines');
Vue.use(VueResource);
...
...
app/assets/javascripts/vue_pipelines_index/pipelines.js.es6
浏览文件 @
35066c85
...
...
@@ -11,6 +11,7 @@
'vue-pipeline-url': gl.VuePipelineUrl,
'vue-pipeline-head': gl.VuePipelineHead,
'vue-gl-pagination': gl.VueGlPagination,
'vue-status-pipeline': gl.VueStatusPipeline,
},
data() {
return {
...
...
@@ -53,13 +54,11 @@
<vue-pipeline-head></vue-pipeline-head>
<tbody>
<tr class="commit" v-for='pipeline in pipelines'>
<td class="commit-link" v-if="pipeline.status">
<vue-running-pipeline
<vue-status-pipeline
:pipeline='pipeline'
:pipelineurl='pipelineurl'
>
</vue-running-pipeline>
</td>
</vue-status-pipeline>
<vue-pipeline-url
:pipeline='pipeline'
:pipelineurl='pipelineurl'
...
...
app/assets/javascripts/vue_pipelines_index/running_icon.js.es6
已删除
100644 → 0
浏览文件 @
45992dc9
/* global Vue, gl */
/* eslint-disable no-param-reassign */
((gl) => {
gl.VueRunningIcon = Vue.extend({
template: `
<g fill="#2D9FD8" fill-rule="evenodd">
<path d="M12.5,7 C12.5,3.96243388 10.0375661,1.5 7,1.5 C3.96243388,1.5 1.5,3.96243388 1.5,7 C1.5,10.0375661 3.96243388,12.5 7,12.5 C10.0375661,12.5 12.5,10.0375661 12.5,7 Z M0,7 C0,3.13400675 3.13400675,0 7,0 C10.8659932,0 14,3.13400675 14,7 C14,10.8659932 10.8659932,14 7,14 C3.13400675,14 0,10.8659932 0,7 Z"></path>
<path d="M7,3 C9.209139,3 11,4.790861 11,7 C11,9.209139 9.209139,11 7,11 C5.65802855,11 4.47040669,10.3391508 3.74481446,9.32513253 L7,7 L7,3 L7,3 Z"></path>
</g>
`,
});
})(window.gl || (window.gl = {}));
app/assets/javascripts/vue_pipelines_index/store.js.es6
浏览文件 @
35066c85
...
...
@@ -23,5 +23,14 @@
goFetch();
}, 60000);
}
fetchSvg(type, icon) {
this.$http.get(`/shared/icons/${icon}`)
.then((response) => {
this[type] = JSON.parse(response.body);
}, () => new Flash(
'Something went wrong on our end.'
));
}
};
})(window.gl || (window.gl = {}));
app/assets/javascripts/vue_pipelines_status/failed.js.es6
0 → 100644
浏览文件 @
35066c85
/* global Vue, gl */
/* eslint-disable no-param-reassign */
((gl) => {
gl.VueFailedPipeline = Vue.extend({
components: {
'vue-failed-icon': gl.VuePendingIcon,
},
props: [
'pipeline',
'pipelineurl',
],
template: `
<td class="commit-link">
<a :href='pipelineurl(pipeline.id)'>
<span class="ci-status ci-failed">
<vue-failed-icon></vue-failed-icon>
failed
</span>
</a>
</td>
`,
});
})(window.gl || (window.gl = {}));
app/assets/javascripts/vue_pipelines_status/index.js.es6
0 → 100644
浏览文件 @
35066c85
//= require ./pending.js.es6
//= require ./failed.js.es6
//= require ./running.js.es6
//= require ./status.js.es6
app/assets/javascripts/vue_pipelines_status/pending.js.es6
0 → 100644
浏览文件 @
35066c85
/* global Vue, gl */
/* eslint-disable no-param-reassign */
((gl) => {
gl.VuePendingPipeline = Vue.extend({
components: {
'vue-pending-icon': gl.VuePendingIcon,
},
props: [
'pipeline',
'pipelineurl',
],
template: `
<td class="commit-link">
<a :href='pipelineurl(pipeline.id)'>
<span class="ci-status ci-pending">
<vue-pending-icon></vue-pending-icon>
pending
</span>
</a>
</td>
`,
});
})(window.gl || (window.gl = {}));
\ No newline at end of file
app/assets/javascripts/vue_pipelines_
index
/running.js.es6
→
app/assets/javascripts/vue_pipelines_
status
/running.js.es6
浏览文件 @
35066c85
...
...
@@ -14,14 +14,7 @@
<td class="commit-link">
<a :href='pipelineurl(pipeline.id)'>
<span class="ci-status ci-running">
<svg
xmlns="http://www.w3.org/2000/svg"
width="14"
height="14"
viewBox="0 0 14 14"
>
<vue-running-icon></vue-running-icon>
</svg>
running
</span>
</a>
...
...
app/assets/javascripts/vue_pipelines_status/status.js.es6
0 → 100644
浏览文件 @
35066c85
/* global Vue, gl */
/* eslint-disable no-param-reassign */
((gl) => {
gl.VueStatusPipeline = Vue.extend({
components: {
'vue-running-pipeline': gl.VueRunningPipeline,
'vue-pending-pipeline': gl.VuePendingPipeline,
'vue-failed-pipeline': gl.VueFailedPipeline,
},
props: [
'pipeline',
'pipelineurl',
],
template: `
<td class="commit-link">
<vue-running-pipeline
v-if="pipeline.status === 'running'"
:pipeline='pipeline'
:pipelineurl='pipelineurl'
>
</vue-running-pipeline>
<vue-pending-pipeline
v-if="pipeline.status === 'pending'"
:pipeline='pipeline'
:pipelineurl='pipelineurl'
>
</vue-pending-pipeline>
<vue-failed-pipeline
v-if="pipeline.status === 'failed'"
:pipeline='pipeline'
:pipelineurl='pipelineurl'
>
</vue-failed-pipeline>
</td>
`,
});
})(window.gl || (window.gl = {}));
app/views/projects/pipelines/index.html.haml
浏览文件 @
35066c85
...
...
@@ -57,4 +57,6 @@
-
else
.vue-pipelines-index
=
page_specific_javascript_tag
(
'vue_icons/index.js'
)
=
page_specific_javascript_tag
(
'vue_pipelines_status/index.js'
)
=
page_specific_javascript_tag
(
'vue_pipelines_index/index.js'
)
config/application.rb
浏览文件 @
35066c85
...
...
@@ -100,6 +100,8 @@ module Gitlab
config
.
assets
.
precompile
<<
"lib/*.js"
config
.
assets
.
precompile
<<
"u2f.js"
config
.
assets
.
precompile
<<
"vue_pipelines_index/index.js"
config
.
assets
.
precompile
<<
"vue_pipelines_status/index.js"
config
.
assets
.
precompile
<<
"vue_icons/index.js"
# Version of your assets, change this if you want to expire all your assets
config
.
assets
.
version
=
'1.0'
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录