Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
a42140d0
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,发现更多精彩内容 >>
提交
a42140d0
编写于
10月 31, 2016
作者:
R
Regis
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
page specific js - remove inline js - refactor
上级
c32c77a0
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
45 addition
and
23 deletion
+45
-23
app/assets/javascripts/vue_pipelines_index/index.js.es6
app/assets/javascripts/vue_pipelines_index/index.js.es6
+23
-0
app/assets/javascripts/vue_pipelines_index/pipelines.vue.js.es6
...sets/javascripts/vue_pipelines_index/pipelines.vue.js.es6
+8
-0
app/assets/javascripts/vue_pipelines_index/store.js.es6
app/assets/javascripts/vue_pipelines_index/store.js.es6
+10
-3
app/assets/javascripts/vue_pipelines_loader.js.es6
app/assets/javascripts/vue_pipelines_loader.js.es6
+0
-1
app/views/projects/pipelines/index.html.haml
app/views/projects/pipelines/index.html.haml
+3
-19
config/application.rb
config/application.rb
+1
-0
未找到文件。
app/assets/javascripts/vue_pipelines_index/index.js.es6
浏览文件 @
a42140d0
/* global Vue, VueResource, gl */
//= require vue
//= require vue-resource
...
...
@@ -5,3 +7,24 @@
//= require ./running_icon.vue.js.es6
//= require ./running.vue.js.es6
//= require ./pipelines.vue.js.es6
(() => {
const project = document.querySelector('.table-holder');
Vue.use(VueResource);
new Vue({
el: '.vue-pipelines-index',
data: {
scope: project.dataset.projectId,
store: new gl.PipelineStore(),
},
components: {
'vue-pipelines': gl.VuePipeLines,
},
template: ''
+ '<div>'
+ "<vue-pipelines :scope='scope' :store='store'></vue-pipelines>"
+ '</div>',
});
})();
app/assets/javascripts/vue_pipelines_index/pipelines.vue.js.es6
浏览文件 @
a42140d0
...
...
@@ -10,6 +10,8 @@
return {
pipelines: [],
commits: [],
currentPage: '',
intervalId: '',
};
},
props: [
...
...
@@ -24,6 +26,11 @@
shortSha(pipeline) {
return pipeline.sha.slice(0, 8);
},
changePage() {
// clearInterval(this.intervalId);
// this.store.fetchCommits.call(this, Vue);
// this.store.fetchDataLoop.call(this, Vue);
},
},
template: `
<thead>
...
...
@@ -52,6 +59,7 @@
<div class="icon-container">
<i class="fa fa-code-fork"></i>
</div>
<!-- I need to know which branch things are comming from -->
<a class="monospace branch-name" href="/gitlab-org/gitlab-ce/commits/master">master</a>
<div class="icon-container commit-icon">
<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40">
...
...
app/assets/javascripts/vue_pipelines_index/store.js.es6
浏览文件 @
a42140d0
...
...
@@ -2,8 +2,12 @@
/* eslint-disable no-param-reassign */
((gl) => {
const api = '/api/v3/projects';
const goFetch = (that, vue) =>
that.$http.get(`/api/v3/projects/${that.scope}/pipelines?per_page=5&page=1`)
that.$http.get(
`${api}/${that.scope}/pipelines?per_page=5&page=1`
)
.then((response) => {
vue.set(that, 'pipelines', JSON.parse(response.body));
}, () => {
...
...
@@ -12,14 +16,17 @@
gl.PipelineStore = class {
fetchDataLoop(Vue) {
setInterval(() => {
// eventually clearInterval(this.intervalId)
this.intervalId = setInterval(() => {
console.log('DID IT');
goFetch(this, Vue);
}, 30000);
}
fetchCommits(vue) {
this.$http.get(`/api/v3/projects/${this.scope}/repository/commits?per_page=5&page=1`)
this.$http.get(
`${api}/${this.scope}/repository/commits?per_page=5&page=1`
)
.then((response) => {
vue.set(this, 'commits', JSON.parse(response.body));
}, () => {
...
...
app/assets/javascripts/vue_pipelines_loader.js.es6
已删除
100644 → 0
浏览文件 @
c32c77a0
//= require_tree ./vue_pipelines_index
app/views/projects/pipelines/index.html.haml
浏览文件 @
a42140d0
...
...
@@ -42,24 +42,8 @@
%div
.nothing-here-block
No pipelines to show
-
else
.table-holder
.table-holder
{
"data-project-id"
:
"#{@project.id}"
}
%table
.table.ci-table
%tbody
.
app
%tbody
.
vue-pipelines-index
:javascript
Vue
.
use
(
VueResource
);
var
vm
=
new
Vue
({
el
:
"
.app
"
,
data
:{
scope
:
"
#{
@project
.
id
}
"
,
store
:
new
gl
.
PipelineStore
(),
},
components
:
{
'
vue-pipelines
'
:
gl
.
VuePipeLines
,
},
template
:
""
+
"
<div>
"
+
"
<vue-pipelines :scope='scope' :store='store'></vue-pipelines>
"
+
"
</div>
"
,
})
=
page_specific_javascript_tag
(
'vue_pipelines_index/index.js'
)
\ No newline at end of file
config/application.rb
浏览文件 @
a42140d0
...
...
@@ -99,6 +99,7 @@ module Gitlab
config
.
assets
.
precompile
<<
"lib/utils/*.js"
config
.
assets
.
precompile
<<
"lib/*.js"
config
.
assets
.
precompile
<<
"u2f.js"
config
.
assets
.
precompile
<<
"vue_pipelines_index/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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录