-
-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
105 additions
and
9 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
82 changes: 82 additions & 0 deletions
82
src/renderer/windows/main/dialog/BaseTaskdialogNotificationView.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,82 @@ | ||
<template> | ||
<v-card | ||
flat | ||
style="min-height: 300px; max-height: 400px; max-width: 100%; overflow: auto;" | ||
dark | ||
color="grey darken-4" | ||
> | ||
<v-card-text> | ||
{{ queue.length === 0 ? $t('notification.empty') : '' }} | ||
<v-list | ||
style="background: transparent" | ||
> | ||
<transition-group | ||
name="transition-list" | ||
tag="div" | ||
> | ||
<template v-for="item in queue"> | ||
<v-list-tile | ||
:key="item.title" | ||
@click="onClick(item)" | ||
> | ||
<v-list-tile-avatar> | ||
<v-icon | ||
:color="colors[item.level]" | ||
left | ||
>{{ icons[item.level] }}</v-icon> | ||
</v-list-tile-avatar> | ||
<v-list-tile-content> | ||
<v-list-tile-title v-html="item.title"></v-list-tile-title> | ||
<v-list-tile-sub-title v-html="item.body"></v-list-tile-sub-title> | ||
</v-list-tile-content> | ||
</v-list-tile> | ||
</template> | ||
</transition-group> | ||
</v-list> | ||
</v-card-text> | ||
</v-card> | ||
</template> | ||
|
||
<script lang=ts> | ||
import { defineComponent } from '@vue/composition-api'; | ||
import { useNotificationQueue, LocalNotification } from '../hooks'; | ||
export default defineComponent({ | ||
setup() { | ||
const queue = useNotificationQueue(); | ||
function onClick(not: LocalNotification) { | ||
queue.value = queue.value.filter(q => q !== not); | ||
} | ||
return { | ||
queue, | ||
icons: { | ||
success: 'check_circle', | ||
info: 'info', | ||
warning: 'priority_high', | ||
error: 'warning', | ||
}, | ||
colors: { | ||
success: 'green', | ||
error: 'red', | ||
info: 'white', | ||
warning: 'orange', | ||
}, | ||
onClick, | ||
}; | ||
}, | ||
}); | ||
</script> | ||
|
||
<style scoped=true> | ||
.v-treeview-node__label { | ||
font-size: 14px; | ||
} | ||
.v-treeview-node__label .material-icons-outlined { | ||
font-size: 20px; | ||
} | ||
.tree-minor-label { | ||
color: grey; | ||
font-size: 12px; | ||
font-style: italic; | ||
} | ||
</style> |
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