-
Notifications
You must be signed in to change notification settings - Fork 342
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: actions on log messages (#2572)
- Loading branch information
1 parent
cdf9005
commit e6fa8ce
Showing
8 changed files
with
82 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<template> | ||
<div | ||
class="flex min-w-[0.98rem] items-start justify-end align-bottom hover:cursor-pointer" | ||
v-if="isSupported && message.trim() != ''" | ||
:title="t('copy_log.title')" | ||
> | ||
<span | ||
class="rounded bg-slate-800/60 px-1.5 py-1 text-primary hover:bg-slate-700" | ||
@click="copyLogMessageToClipBoard()" | ||
> | ||
<carbon:copy-file /> | ||
</span> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
const { message } = defineProps<{ | ||
message: string; | ||
}>(); | ||
const { showToast } = useToast(); | ||
const { copy, isSupported, copied } = useClipboard(); | ||
const { t } = useI18n(); | ||
async function copyLogMessageToClipBoard() { | ||
await copy(message); | ||
if (copied.value) { | ||
showToast( | ||
{ | ||
title: t("toasts.copied.title"), | ||
message: t("toasts.copied.message"), | ||
type: "info", | ||
}, | ||
{ expire: 2000 }, | ||
); | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters