Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
312c504f
Commit
312c504f
authored
Dec 05, 2016
by
Regis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
can render all tabs for pipelines - remove uneeded properties - [ci skip]
parent
cd111ffa
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
44 deletions
+50
-44
app/assets/javascripts/vue_pipelines_index/index.js.es6
app/assets/javascripts/vue_pipelines_index/index.js.es6
+24
-22
app/assets/javascripts/vue_pipelines_index/pipelines.js.es6
app/assets/javascripts/vue_pipelines_index/pipelines.js.es6
+24
-6
app/assets/javascripts/vue_pipelines_index/store.js.es6
app/assets/javascripts/vue_pipelines_index/store.js.es6
+2
-3
app/views/projects/pipelines/index.html.haml
app/views/projects/pipelines/index.html.haml
+0
-13
No files found.
app/assets/javascripts/vue_pipelines_index/index.js.es6
View file @
312c504f
...
...
@@ -17,30 +17,32 @@
//= require ./pipelines.js.es6
(() => {
const url = window.location.href;
if (~url.indexOf('scope') && !~url.indexOf('scope=pipelines')) return null;
const project = document.querySelector('.pipelines');
const entry = document.querySelector('.vue-pipelines-index');
Vue.use(VueResource);
return new Vue({
el: '.vue-pipelines-index',
data: {
scope: project.dataset.url,
store: new gl.PipelineStore(),
},
components: {
'vue-pipelines': gl.VuePipelines,
},
template: `
<div>
<vue-pipelines
:scope='scope'
:store='store'
>
</vue-pipelines>
</div>
`,
});
if (entry) {
return new Vue({
el: entry,
data: {
scope: project.dataset.url,
store: new gl.PipelineStore(),
},
components: {
'vue-pipelines': gl.VuePipelines,
},
template: `
<div>
<vue-pipelines
:scope='scope'
:store='store'
>
</vue-pipelines>
</div>
`,
});
}
return null;
})();
app/assets/javascripts/vue_pipelines_index/pipelines.js.es6
View file @
312c504f
...
...
@@ -8,6 +8,16 @@
const FIRST = '<< First';
const LAST = 'Last >>';
const getParameterByName = (name) => {
const url = window.location.href;
name = name.replace(/[[\]]/g, '\\$&');
const regex = new RegExp(`[?&]${name}(=([^&#]*)|&|#|$)`);
const results = regex.exec(url);
if (!results) return null;
if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, ' '));
};
gl.VuePipelines = Vue.extend({
components: {
runningPipeline: gl.VueRunningPipeline,
...
...
@@ -25,8 +35,8 @@
pipelines: [],
timeLoopInterval: '',
intervalId: '',
updatedAt: '',
pagenum: 1,
apiScope: 'all',
count: {
all: 0,
running_or_pending: 0,
...
...
@@ -39,11 +49,19 @@
'store',
],
created() {
const url = window.location.toString();
if (~url.indexOf('?') && !~url.indexOf('scope=pipelines')) {
this.pagenum = url.split('?')[1].split('=')[1];
}
this.store.fetchDataLoop.call(this, Vue, this.pagenum, this.scope);
const pagenum = getParameterByName('p');
const scope = getParameterByName('scope');
if (pagenum) this.pagenum = pagenum;
if (scope) this.apiScope = scope;
this.store.fetchDataLoop.call(
this,
Vue,
this.pagenum,
this.scope,
this.apiScope,
);
},
methods: {
changepage(e, last) {
...
...
app/assets/javascripts/vue_pipelines_index/store.js.es6
View file @
312c504f
...
...
@@ -3,7 +3,7 @@
((gl) => {
gl.PipelineStore = class {
fetchDataLoop(Vue, pageNum, url) {
fetchDataLoop(Vue, pageNum, url
, apiScope
) {
const setVueResources = () => { Vue.activeResources = 1; };
const resetVueResources = () => { Vue.activeResources = 0; };
const addToVueResources = () => { Vue.activeResources += 1; };
...
...
@@ -27,10 +27,9 @@
};
const goFetch = () =>
this.$http.get(`${url}?page=${pageNum}`)
this.$http.get(`${url}?
scope=${apiScope}&
page=${pageNum}`)
.then((response) => {
const res = JSON.parse(response.body);
Vue.set(this, 'updatedAt', res.updated_at);
Vue.set(this, 'pipelines', res.pipelines);
Vue.set(this, 'count', res.count);
updatePipelineNums(this.count);
...
...
app/views/projects/pipelines/index.html.haml
View file @
312c504f
...
...
@@ -39,19 +39,6 @@
-
if
@pipelines
.
blank?
%div
.nothing-here-block
No pipelines to show
-
elsif
@scope
==
'branches'
||
@scope
==
'tags'
||
@scope
==
'running'
.table-holder
%table
.table.ci-table
%thead
%th
Status
%th
Pipeline
%th
Commit
%th
Stages
%th
%th
.hidden-xs
=
render
@pipelines
,
commit_sha:
true
,
stage:
true
,
allow_retry:
true
=
paginate
@pipelines
,
theme:
'gitlab'
-
else
.commit-icon-svg.hidden
=
custom_icon
(
"icon_commit"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment