1
1
<script lang="ts" setup>
2
2
import { computed , inject } from ' vue' ;
3
+ import { NCard } from ' naive-ui' ;
3
4
5
+ import Button from ' @/components/Buttons/Button.vue' ;
4
6
import IconLabel from ' @/components/IconLabel.vue' ;
5
7
import LocationDrawer from ' @/components/ConnectionDetails/LocationDrawer.vue' ;
6
8
import ProxyGlobal from ' @/components/Proxy/ProxyGlobal.vue' ;
7
9
import ProxyHost from ' @/components/Proxy/ProxyHost.vue' ;
10
+ import TitleCategory from ' @/components/TitleCategory.vue' ;
8
11
9
12
import useActiveTab from ' @/composables/useActiveTab' ;
10
13
import { ConnectionKey , defaultConnection } from ' @/composables/useConnection' ;
14
+ import useProxyPermissions from ' @/composables/useProxyPermissions' ;
11
15
16
+ const { proxyPermissionsGranted, triggerProxyPermissions } = useProxyPermissions ();
12
17
const { isAboutPage } = useActiveTab ();
13
18
const { connection } = inject (ConnectionKey , defaultConnection );
14
19
@@ -20,13 +25,33 @@ const isWireGuard = computed(
20
25
</script >
21
26
22
27
<template >
23
- <IconLabel v-if =" !isWireGuard" type =" warning" class =" my-2" >
24
- Connect first to Mullvad VPN (WireGuard) to use the proxy.
25
- </IconLabel >
26
-
27
- <div >
28
- <ProxyHost v-if =" !isAboutPage" />
29
- <ProxyGlobal />
30
- <LocationDrawer />
31
- </div >
28
+ <template v-if =" proxyPermissionsGranted " >
29
+ <IconLabel v-if =" !isWireGuard" type =" warning" class =" my-2" >
30
+ Connect first to Mullvad VPN (WireGuard) to use the proxy.
31
+ </IconLabel >
32
+
33
+ <div >
34
+ <ProxyHost v-if =" !isAboutPage" />
35
+ <ProxyGlobal />
36
+ <LocationDrawer />
37
+ </div >
38
+ </template >
39
+
40
+ <template v-else >
41
+ <n-card :bordered =" false" class =" mb-4" >
42
+ <div class =" flex justify-between" >
43
+ <TitleCategory title =" Permissions required" />
44
+ </div >
45
+
46
+ <IconLabel type =" warning" class =" my-2" >
47
+ <ul >
48
+ <li >- <strong >tabs</strong > to show proxy settings from the active tab</li >
49
+ <li >- <strong >proxy</strong > to configure and use Mullvad proxy servers</li >
50
+ <li >- <strong >< ; all_urls> ; </strong > to have granular proxy settings</li >
51
+ </ul >
52
+ </IconLabel >
53
+
54
+ <Button class =" mt-3" @click =" triggerProxyPermissions" > Grant permissions </Button >
55
+ </n-card >
56
+ </template >
32
57
</template >
0 commit comments