Skip to content

Commit

Permalink
Merge branch 'master' into do_not_hardcode_docker_socket
Browse files Browse the repository at this point in the history
  • Loading branch information
6543 authored Feb 8, 2022
2 parents a3125a0 + 7521336 commit 43b9bda
Show file tree
Hide file tree
Showing 7 changed files with 474 additions and 407 deletions.
1 change: 1 addition & 0 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"@kyvg/vue3-notification": "2.3.4",
"@meforma/vue-toaster": "1.2.2",
"ansi-to-html": "0.7.2",
"floating-vue": "2.0.0-beta.5",
"fuse.js": "6.4.6",
"humanize-duration": "3.27.0",
"javascript-time-ago": "2.3.10",
Expand Down
6 changes: 3 additions & 3 deletions web/src/components/build-feed/BuildFeedItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div class="flex flex-col mt-2">
<div class="flex space-x-2 items-center">
<Icon name="since" />
<span>{{ since }}</span>
<span v-tooltip="'Created at ' + created">{{ since }}</span>
</div>
<div class="flex space-x-2 items-center">
<Icon name="duration" />
Expand Down Expand Up @@ -40,9 +40,9 @@ export default defineComponent({
setup(props) {
const build = toRef(props, 'build');
const { since, duration, message } = useBuild(build);
const { since, duration, message, created } = useBuild(build);
return { since, duration, message };
return { since, duration, message, created };
},
});
</script>
6 changes: 3 additions & 3 deletions web/src/components/repo/build/BuildItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@

<div class="flex space-x-2 items-center min-w-0">
<Icon name="since" />
<span class="truncate">{{ since }}</span>
<span v-tooltip="'Created at ' + created" class="truncate">{{ since }}</span>
</div>
</div>
</div>
Expand Down Expand Up @@ -92,9 +92,9 @@ export default defineComponent({
setup(props) {
const build = toRef(props, 'build');
const { since, duration, message, prettyRef } = useBuild(build);
const { since, duration, message, prettyRef, created } = useBuild(build);
return { since, duration, message, prettyRef, buildStatusColors };
return { since, duration, message, prettyRef, buildStatusColors, created };
},
});
</script>
12 changes: 11 additions & 1 deletion web/src/compositions/useBuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,15 @@ export default (build: Ref<Build | undefined>) => {
return build.value?.ref;
});

return { since, duration, message, prettyRef };
const created = computed(() => {
if (!build.value) {
return undefined;
}

const start = build.value.created_at || 0;

// sv-SE is in format YYYY-MM-DD HH:m:s
return new Date(start * 1000).toLocaleString('sv-SE');
});
return { since, duration, message, prettyRef, created };
};
8 changes: 8 additions & 0 deletions web/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import 'windi.css';
import 'floating-vue/dist/style.css'; // eslint-disable-line no-restricted-imports
import '~/compositions/useFavicon';

import { Tooltip, VClosePopper, VTooltip } from 'floating-vue';
import { createPinia } from 'pinia';
import { createApp } from 'vue';

Expand All @@ -13,6 +15,12 @@ const app = createApp(App);

app.use(router);
app.use(notifications);

app.directive('tooltip', VTooltip);
app.directive('close-popper', VClosePopper);
app.component('v-tooltip', Tooltip); // eslint-disable-line vue/component-definition-name-casing
app.component('VTooltip', Tooltip);

app.use(createPinia());
app.mount('#app');

Expand Down
5 changes: 3 additions & 2 deletions web/src/views/repo/build/BuildWrapper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<div class="flex justify-between gap-x-4 text-gray-500 flex-shrink-0 pb-2 md:p-0 mx-auto md:mr-0">
<div class="flex space-x-1 items-center flex-shrink-0">
<Icon name="since" />
<span>{{ since }}</span>
<span v-tooltip="'Created at ' + created">{{ since }}</span>
</div>
<div class="flex space-x-1 items-center flex-shrink-0">
<Icon name="duration" />
Expand Down Expand Up @@ -153,7 +153,7 @@ export default defineComponent({
}
const build = buildStore.getBuild(repoOwner, repoName, buildId);
const { since, duration } = useBuild(build);
const { since, duration, created } = useBuild(build);
provide('build', build);
const { message } = useBuild(build);
Expand Down Expand Up @@ -245,6 +245,7 @@ export default defineComponent({
cancelBuild,
restartBuild,
goBack: useRouteBackOrDefault({ name: 'repo' }),
created,
};
},
});
Expand Down
Loading

0 comments on commit 43b9bda

Please sign in to comment.