-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Ryan Wang <[email protected]>
- Loading branch information
Showing
3 changed files
with
77 additions
and
38 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
43 changes: 43 additions & 0 deletions
43
console/src/modules/system/users/components/NotificationContent.vue
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,43 @@ | ||
<script lang="ts" setup> | ||
import type { Notification } from "@halo-dev/api-client"; | ||
import { computed } from "vue"; | ||
import { OverlayScrollbarsComponent } from "overlayscrollbars-vue"; | ||
const props = withDefaults( | ||
defineProps<{ | ||
notification?: Notification; | ||
}>(), | ||
{ notification: undefined } | ||
); | ||
const htmlContent = computed(() => { | ||
const styles = ` | ||
<style> | ||
html { | ||
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; | ||
font-size: 0.875rem; | ||
line-height: 1.25rem; | ||
} | ||
</style> | ||
`; | ||
if (!props.notification?.spec?.htmlContent) { | ||
return ""; | ||
} | ||
return styles + props.notification?.spec?.htmlContent; | ||
}); | ||
</script> | ||
|
||
<template> | ||
<div class="h-full w-full overflow-auto"> | ||
<OverlayScrollbarsComponent | ||
element="div" | ||
:options="{ scrollbars: { autoHide: 'scroll' } }" | ||
class="h-full w-full" | ||
defer | ||
> | ||
<iframe class="h-full w-full p-2" :srcdoc="htmlContent"></iframe> | ||
</OverlayScrollbarsComponent> | ||
</div> | ||
</template> |
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