Commit a3c93ee8 authored by Regis's avatar Regis

waiting for api changes

parent 0541bffa
...@@ -11,13 +11,17 @@ ...@@ -11,13 +11,17 @@
alt() { alt() {
return `${this.pipeline.commit.author_name}'s avatar`; return `${this.pipeline.commit.author_name}'s avatar`;
}, },
avatarUrl() {
const author = this.pipeline.commit.author;
if (author) return author.avatar_url;
return this.pipeline.commit.author_gravatar_url;
},
}, },
template: ` template: `
<td class="branch-commit"> <td class="branch-commit">
<div class="icon-container"> <div class="icon-container">
<i class="fa fa-code-fork"></i> <i class="fa fa-code-fork"></i>
</div> </div>
<!-- ** will need branch_url for this branch ** -->
<a <a
class="monospace branch-name" class="monospace branch-name"
:href='pipeline.ref.url' :href='pipeline.ref.url'
...@@ -45,7 +49,7 @@ ...@@ -45,7 +49,7 @@
:alt='alt' :alt='alt'
:title='pipeline.commit.author_name' :title='pipeline.commit.author_name'
data-container="body" data-container="body"
src="http://www.gravatar.com/avatar/80d3b651b4be1f1db39435c2d11f1f23?s=40&amp;d=identicon" :src='avatarUrl'
> >
</a> </a>
<a <a
......
...@@ -19,15 +19,13 @@ ...@@ -19,15 +19,13 @@
seconds(date) { seconds(date) {
return this.formatSection(date.getSeconds()); return this.formatSection(date.getSeconds());
}, },
}, // need created_at or created_at for finish and running
computed: {
// need started_at or created_at for finish and running
finishdate() { finishdate() {
const date = new Date( const date = new Date(
new Date( new Date(
this.pipeline.details.finished_at this.pipeline.details.finished_at
).getTime() - new Date( ).getTime() - new Date(
this.pipeline.started_at this.pipeline.created_at
).getTime() ).getTime()
); );
return ( return (
...@@ -36,7 +34,7 @@ ...@@ -36,7 +34,7 @@
}, },
runningdate() { runningdate() {
const date = new Date( const date = new Date(
new Date().getTime() - new Date(this.pipeline.started_at).getTime() new Date().getTime() - new Date(this.pipeline.created_at).getTime()
); );
return ( return (
`${this.hours(date)}:${this.minutes(date)}:${this.seconds(date)}` `${this.hours(date)}:${this.minutes(date)}:${this.seconds(date)}`
...@@ -61,8 +59,8 @@ ...@@ -61,8 +59,8 @@
}; };
}, },
duration() { duration() {
if (this.timeStopped) return this.finishdate; if (this.timeStopped()) return this.finishdate();
return this.runningdate; return this.runningdate();
}, },
}, },
template: ` template: `
...@@ -78,9 +76,9 @@ ...@@ -78,9 +76,9 @@
<path d="M29.513 10.134A15.922 15.922 0 0 0 23 7.28V6h2.993C26.55 6 27 5.552 27 5V2a1 1 0 0 0-1.007-1H14.007C13.45 1 13 1.448 13 2v3a1 1 0 0 0 1.007 1H17v1.28C9.597 8.686 4 15.19 4 23c0 8.837 7.163 16 16 16s16-7.163 16-16c0-3.461-1.099-6.665-2.967-9.283l1.327-1.58a2.498 2.498 0 0 0-.303-3.53 2.499 2.499 0 0 0-3.528.315l-1.016 1.212zM20 34c6.075 0 11-4.925 11-11s-4.925-11-11-11S9 16.925 9 23s4.925 11 11 11z"></path><path d="M19 21h-4.002c-.552 0-.998.452-.998 1.01v1.98c0 .567.447 1.01.998 1.01h7.004c.274 0 .521-.111.701-.291a.979.979 0 0 0 .297-.704v-8.01c0-.54-.452-.995-1.01-.995h-1.98a.997.997 0 0 0-1.01.995V21z"></path> <path d="M29.513 10.134A15.922 15.922 0 0 0 23 7.28V6h2.993C26.55 6 27 5.552 27 5V2a1 1 0 0 0-1.007-1H14.007C13.45 1 13 1.448 13 2v3a1 1 0 0 0 1.007 1H17v1.28C9.597 8.686 4 15.19 4 23c0 8.837 7.163 16 16 16s16-7.163 16-16c0-3.461-1.099-6.665-2.967-9.283l1.327-1.58a2.498 2.498 0 0 0-.303-3.53 2.499 2.499 0 0 0-3.528.315l-1.016 1.212zM20 34c6.075 0 11-4.925 11-11s-4.925-11-11-11S9 16.925 9 23s4.925 11 11 11z"></path><path d="M19 21h-4.002c-.552 0-.998.452-.998 1.01v1.98c0 .567.447 1.01.998 1.01h7.004c.274 0 .521-.111.701-.291a.979.979 0 0 0 .297-.704v-8.01c0-.54-.452-.995-1.01-.995h-1.98a.997.997 0 0 0-1.01.995V21z"></path>
</g> </g>
</svg> </svg>
{{duration}} {{duration()}}
</p> </p>
<p class="finished-at" v-if='timeStopped'> <p class="finished-at" v-if='timeStopped()'>
<i class="fa fa-calendar"></i> <i class="fa fa-calendar"></i>
<time <time
data-toggle="tooltip" data-toggle="tooltip"
...@@ -88,7 +86,7 @@ ...@@ -88,7 +86,7 @@
data-container="body" data-container="body"
:data-original-title='9 + 9' :data-original-title='9 + 9'
> >
{{timeStopped.words}} {{timeStopped().words}}
</time> </time>
</p> </p>
</td> </td>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment