Commit b5b33200 authored by Jacob Schatz's avatar Jacob Schatz

Add timeago

parent a922d904
......@@ -28,12 +28,12 @@ export default class SettingsDeployKeys {
</div>
<div class="deploy-key-content">
<span class="key-created-at">
created {{deployKey.created_at}}
created {{timeagoDate}}
</span>
<div class="visible-xs-block visible-sm-block"></div>
<a v-if="!enabled" class="btn btn-sm prepend-left-10" rel="nofollow" data-method="put" href="enableURL">Enable
</a>
<a v-else-if="deployKey.destroyed_when_orphaned && deployKey.almost_orphaned" class="btn btn-warning btn-sm prepend-left-10" rel="nofollow" data-method="put" :href="removeURL">Remove</a>
<a v-else-if="deployKey.destroyed_when_orphaned && deployKey.almost_orphaned" class="btn btn-warning btn-sm prepend-left-10" rel="nofollow" data-method="put" :href="disableURL">Remove</a>
<a v-else class="btn btn-warning btn-sm prepend-left-10" rel="nofollow" data-method="put" :href="disableURL">Disable</a>
</div>
</li>`
......@@ -48,6 +48,10 @@ export default class SettingsDeployKeys {
},
computed: {
timeagoDate() {
return gl.utils.getTimeago().format(this.deployKey.createdAt, 'gl_en');
},
disableURL() {
return self.disableEndpoint.replace(':id', this.deployKey.id);
},
......
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