-
Notifications
You must be signed in to change notification settings - Fork 69
Expand file tree
/
Copy pathMainMenu.vue
More file actions
83 lines (72 loc) · 2.74 KB
/
MainMenu.vue
File metadata and controls
83 lines (72 loc) · 2.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<!--
- SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
- SPDX-License-Identifier: AGPL-3.0-or-later
-->
<script setup lang="ts">
import type { Ref } from 'vue'
import { t } from '@nextcloud/l10n'
import { generateUrl } from '@nextcloud/router'
import { inject } from 'vue'
import NcActionButton from '@nextcloud/vue/components/NcActionButton'
import NcActionLink from '@nextcloud/vue/components/NcActionLink'
import NcActions from '@nextcloud/vue/components/NcActions'
import NcActionSeparator from '@nextcloud/vue/components/NcActionSeparator'
import IconBugOutline from 'vue-material-design-icons/BugOutline.vue'
import IconCogOutline from 'vue-material-design-icons/CogOutline.vue'
import IconInformationOutline from 'vue-material-design-icons/InformationOutline.vue'
import IconMenu from 'vue-material-design-icons/Menu.vue'
import IconReload from 'vue-material-design-icons/Reload.vue'
import IconWeb from 'vue-material-design-icons/Web.vue'
import { BUILD_CONFIG } from '../../../../shared/build.config.ts'
import { getCurrentTalkRoutePath } from '../../TalkWrapper/talk.service.ts'
const packageInfo = window.TALK_DESKTOP.packageInfo
const isTalkInitialized = inject<Ref<boolean>>('talk:isInitialized')
const showHelp = () => window.TALK_DESKTOP.showHelp()
const reload = () => window.location.reload()
const openSettings = () => window.OCA.Talk.Settings.open()
const openInWeb = () => window.open(generateUrl(getCurrentTalkRoutePath()), '_blank')
</script>
<template>
<NcActions
:aria-label="t('talk_desktop', 'Menu')"
variant="tertiary-no-background"
container="body">
<template #icon>
<IconMenu :size="20" fill-color="var(--color-background-plain-text)" />
</template>
<template v-if="isTalkInitialized">
<NcActionButton @click="openInWeb">
<template #icon>
<IconWeb :size="20" />
</template>
{{ t('talk_desktop', 'Open in web browser') }}
</NcActionButton>
</template>
<NcActionSeparator />
<NcActionButton @click="reload">
<template #icon>
<IconReload :size="20" />
</template>
{{ t('talk_desktop', 'Force reload') }}
</NcActionButton>
<NcActionLink v-if="!BUILD_CONFIG.isBranded" :href="packageInfo.bugs.create || packageInfo.bugs.url" target="_blank">
<template #icon>
<IconBugOutline :size="20" />
</template>
{{ t('talk_desktop', 'Report a bug') }}
</NcActionLink>
<NcActionSeparator />
<NcActionButton close-after-click @click="openSettings">
<template #icon>
<IconCogOutline :size="20" />
</template>
{{ t('talk_desktop', 'Settings') }}
</NcActionButton>
<NcActionButton @click="showHelp">
<template #icon>
<IconInformationOutline :size="20" />
</template>
{{ t('talk_desktop', 'About') }}
</NcActionButton>
</NcActions>
</template>