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
Léo-Paul Géneau
gitlab-ce
Commits
cdbbce17
Commit
cdbbce17
authored
Nov 08, 2016
by
Regis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup
parent
e95a2b15
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
27 additions
and
111 deletions
+27
-111
app/assets/javascripts/vue_pagination/index.js.es6
app/assets/javascripts/vue_pagination/index.js.es6
+18
-97
app/assets/javascripts/vue_pipelines_index/index.js.es6
app/assets/javascripts/vue_pipelines_index/index.js.es6
+1
-1
app/assets/javascripts/vue_pipelines_index/pipeline_head.js.es6
...sets/javascripts/vue_pipelines_index/pipeline_head.js.es6
+0
-7
app/assets/javascripts/vue_pipelines_index/pipelines.js.es6
app/assets/javascripts/vue_pipelines_index/pipelines.js.es6
+6
-4
app/assets/javascripts/vue_pipelines_index/store.js.es6
app/assets/javascripts/vue_pipelines_index/store.js.es6
+1
-1
app/assets/javascripts/vue_pipelines_status/failed.js.es6
app/assets/javascripts/vue_pipelines_status/failed.js.es6
+1
-1
No files found.
app/assets/javascripts/vue_pagination/index.js.es6
View file @
cdbbce17
...
...
@@ -8,117 +8,38 @@
'count',
'pagenum',
],
data() {
return {
nslice: +this.pagenum,
endcount: this.last,
};
},
methods: {
pagenumberstatus(n) {
if (n - 1 === +this.pagenum) return 'active';
return '';
},
prevstatus() {
if (+this.pagenum > 1) return '';
return 'disabled';
},
createSection(n) {
return Array.from(Array(n)).map((e, i) => i);
},
createSection(n) { return Array.from(Array(n)).map((e, i) => i); },
},
computed: {
dynamicpage() {
const section = this.createSection(this.upcount);
section.shift();
this.nslice = +this.pagenum;
this.endcount = +this.pagenum + 5;
if (+this.pagenum + 5 <= this.last) {
return section.slice(+this.pagenum, +this.pagenum + 5);
}
if (+this.pagenum + 5 > this.last) {
return section.slice(this.last - 5, this.last);
}
},
paginationsection() {
if (this.last < 6 && this.pagenum < 6) {
const pageArray = this.createSection(6);
pageArray.shift();
return pageArray.slice(0, this.upcount);
}
return this.dynamicpage;
},
last() {
return Math.ceil(+this.count / 5);
},
upcount() {
return +this.last + 1;
},
endspread() {
if (+this.pagenum < this.last) return true;
return false;
},
begspread() {
if (+this.pagenum > 5 && +this.pagenum < this.last) return true;
return false;
last() { return Math.ceil(+this.count / 5); },
getItems() {
const items = [];
const pages = this.createSection(+this.last + 1);
pages.shift();
if (+this.pagenum !== 1) items.push({ text: 'Prev' });
pages.forEach(i => items.push({ text: i }));
if (+this.pagenum < this.last) items.push({ text: 'Next' });
if (+this.pagenum !== this.last) items.push({ text: 'Last »' });
return items;
},
},
template: `
<div class="gl-pagination">
<ul class="pagination clearfix" v-for='n in paginationsection'>
<li
:class='prevstatus(n)'
v-if='n - 1 === 1 || n - 1 === nslice || n - 1 === this.last - 5'
>
<span @click='changepage($event, {where: pagenum - 1})'>Prev</span>
</li>
<li v-if='n - 1 === last && upcount > 4 && begspread'>
<span class="gap">…</span>
</li>
<li :class='pagenumberstatus(n)' v-if='n >= 2'>
<span @click='changepage($event)'>{{(n - 1)}}</span>
</li>
<li v-if='(n === upcount || n === endcount) && +pagenum + 5 !== last'>
<span class="gap">…</span>
</li>
<li
class="next"
v-if='(n === upcount || n === endcount) && pagenum !== last'
>
<span @click='changepage($event,{where: +pagenum + 1})'>Next</span>
</li>
<li
class="last"
v-if='(n === upcount || n === endcount) && +pagenum !== last'
>
<span @click='changepage($event, {where: last})'>Last »</span>
<ul class="pagination clearfix" v-for='(item, index) in getItems'>
<li :class='pagenumberstatus(index + 1)'>
<span @click='changepage($event, last)'>{{item.text}}</span>
</li>
</ul>
</div>
`,
// render(createElement) {
// return createElement('div', {
// class: {
// 'gl-pagination': true,
// },
// }, [createElement('ul', {
// class: {
// pagination: true,
// clearfix: true,
// },
// }, this.paginationsection.map((e, i) => {
// if (!i) return createElement('li', [createElement('span', {
// class: {
// prev: this.prevstatus,
// },
// }, 'Prev')]);
// if (i) {
// return createElement('li',
// [createElement('span', i)]
// );
// }
// })),
// ]);
// },
});
})(window.gl || (window.gl = {}));
app/assets/javascripts/vue_pipelines_index/index.js.es6
View file @
cdbbce17
...
...
@@ -34,7 +34,7 @@
<vue-pipelines
:scope='scope'
:store='store'
:count='
90
'
:count='
count
'
>
</vue-pipelines>
</div>
...
...
app/assets/javascripts/vue_pipelines_index/pipeline_head.js.es6
View file @
cdbbce17
...
...
@@ -3,13 +3,6 @@
((gl) => {
gl.VuePipelineHead = Vue.extend({
components: {
'vue-running-icon': gl.VueRunningIcon,
},
props: [
'pipeline',
'pipelineurl',
],
template: `
<thead>
<tr>
...
...
app/assets/javascripts/vue_pipelines_index/pipelines.js.es6
View file @
cdbbce17
...
...
@@ -35,10 +35,12 @@
shortsha(pipeline) {
return pipeline.sha.slice(0, 8);
},
changepage(event, page = {}) {
if (page) this.pagenum = +event.target.innerText;
if (page.where) this.pagenum = +page.where;
if (page.where) this.pagenum = +page.where;
changepage(event, last) {
const text = event.target.innerText;
if (typeof +text === 'number') this.pagenum = +text;
if (text === 'Last »') this.pagenum = last;
if (text === 'Next') this.pagnum = +this.pagenum + 1;
if (text === 'Prev') this.pagenum = +this.pagenum - 1;
window.history.pushState({}, null, `?p=${this.pagenum}`);
clearInterval(this.intervalId);
...
...
app/assets/javascripts/vue_pipelines_index/store.js.es6
View file @
cdbbce17
...
...
@@ -21,7 +21,7 @@
// eventually clearInterval(this.intervalId)
this.intervalId = setInterval(() => {
goFetch();
},
60
000);
},
3
000);
}
};
})(window.gl || (window.gl = {}));
app/assets/javascripts/vue_pipelines_status/failed.js.es6
View file @
cdbbce17
...
...
@@ -4,7 +4,7 @@
((gl) => {
gl.VueFailedScope = Vue.extend({
components: {
'vue-failed-icon': gl.Vue
Pending
Icon,
'vue-failed-icon': gl.Vue
Failed
Icon,
},
props: [
'scope',
...
...
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