BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
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
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
26 deletions
+32
-26
index.js.es6
app/assets/javascripts/vue_pipelines_index/index.js.es6
+6
-4
pipelines.js.es6
app/assets/javascripts/vue_pipelines_index/pipelines.js.es6
+24
-6
store.js.es6
app/assets/javascripts/vue_pipelines_index/store.js.es6
+2
-3
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,15 +17,14 @@
//= 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);
if (entry) {
return new Vue({
el: '.vue-pipelines-index'
,
el: entry
,
data: {
scope: project.dataset.url,
store: new gl.PipelineStore(),
...
...
@@ -43,4 +42,7 @@
</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