Commit 23024a70 authored by Filipa Lacerda's avatar Filipa Lacerda

Adds clipboard button component

parent 13c86bb4
<script> <script>
import clipboardButton from '../../vue_shared/components/clipboard_button.vue';
export default { export default {
name: 'collapsibeContainerRegisty', name: 'collapsibeContainerRegisty',
props: { props: {
canDelete: { title: {
type: Boolean, type: String,
required: true, required: true,
}, },
title: { clipboardContent: {
type: String, type: String,
required: true, required: true,
}, },
repoData: {
type: Object,
required: true,
},
}, },
components: { components: {
clipboardButton,
}, },
data() { data() {
return { return {
...@@ -20,13 +26,17 @@ ...@@ -20,13 +26,17 @@
}; };
}, },
methods: { methods: {
itemSize(item) {
const pluralize = gl.text.pluralize('layer', item.layers);
return `${item.size}&middot;${item.layers}${pluralize}`;
}
} }
} }
</script> </script>
<template> <template>
<div class="container-image"> <div class="container-image">
<div class="container-image-head">
<i <i
class="fa" class="fa"
:class="{ :class="{
...@@ -37,6 +47,85 @@ ...@@ -37,6 +47,85 @@
</i> </i>
{{title}} {{title}}
<clipboard-button
:text=""
:title=""
/>
</div>
<div
class="container-image-tags"
:class="{ hide: !isOpen }">
<table class="table tags" v-if="true">
<thead>
<tr>
<th>{{__("Tag")}}</th>
<th>{{__("Tag ID")}}</th>
<th>{{__("Size")}}</th>
<th>{{__("Created")}}</th>
<th v-if="true"></th>
</tr>
</thead>
<tbody>
<tr
v-for="(item, i) in repo.list"
:key="i">
<td>
{{item.name}}
<clipboard-button
:title="item.location"
:text="item.location"
/>
</td>
<td>
<span
v-tooltip
:title="item.revision"
>
{{item.shortRevision}}
</span>
</td>
<td>
<template v-if="item.size">
{{itemSize(item)}}
</template>
<div v-else class="light">
\-
</div>
</td>
<td>
<template v-if="item.createdAt">
format {{item.createdAt}}
</template>
<div v-else class="light">
\-
</div>
</td>
<td>
<button
type="button"
class="btn btn-remove"
title="Remove tag"
v-tooltip
@click="deleteTag(item)">
<i
class="fa fa-trash cred"
aria-hidden="true">
</i>
</button>
</td>
</tr>
</tbody>
</table>
<div
v-else
class="nothing-here-block">
{{__("No tags in Container Registry for this container image.")}}
</div>
</div>
</div> </div>
</template> </template>
import Clipboard from 'vendor/clipboard';
<script> <script>
import Clipboard from 'vendor/clipboard';
export default { export default {
name: 'clipboardButton', name: 'clipboardButton',
props: { props: {
......
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