File tree Expand file tree Collapse file tree 3 files changed +94
-55
lines changed
packages/app-frontend/src/features Expand file tree Collapse file tree 3 files changed +94
-55
lines changed Original file line number Diff line number Diff line change 1
1
<script lang="ts">
2
- import PluginSourceIcon from ' @front/features/plugin/PluginSourceIcon.vue'
3
2
import AppHeaderLogo from ' ./AppHeaderLogo.vue'
4
3
import AppHistoryNav from ' ./AppHistoryNav.vue'
5
4
import AppSelect from ' ../apps/AppSelect.vue'
6
5
import AppHeaderSelect from ' ./AppHeaderSelect.vue'
6
+ import PluginSourceIcon from ' @front/features/plugin/PluginSourceIcon.vue'
7
+ import PluginSourceDescription from ' ../plugin/PluginSourceDescription.vue'
7
8
8
9
import { computed , ref , watch , defineComponent } from ' vue'
9
10
import type { RawLocation , Route } from ' vue-router'
@@ -30,6 +31,7 @@ export default defineComponent({
30
31
AppSelect ,
31
32
AppHeaderSelect ,
32
33
PluginSourceIcon ,
34
+ PluginSourceDescription ,
33
35
},
34
36
35
37
setup () {
@@ -132,22 +134,26 @@ export default defineComponent({
132
134
indicator
133
135
@update =" route => $router.push(route.targetRoute)"
134
136
>
135
- <VueGroupButton
137
+ <VTooltip
136
138
v-for =" (item, index) of headerRoutes"
137
139
:key =" index"
138
- :value =" item"
139
- :icon-left =" item.icon"
140
- class =" flat"
140
+ :disabled =" !item.pluginId"
141
+ class =" leading-none"
141
142
>
142
- <div class =" flex items-center space-x-2" >
143
- <span class =" flex-1" >{{ item.label }}</span >
144
- <PluginSourceIcon
145
- v-if =" item.pluginId"
143
+ <VueGroupButton
144
+ :value =" item"
145
+ :icon-left =" item.icon"
146
+ class =" flat"
147
+ >
148
+ {{ item.label }}
149
+ </VueGroupButton >
150
+
151
+ <template #popper >
152
+ <PluginSourceDescription
146
153
:plugin-id =" item.pluginId"
147
- class =" flex-none"
148
154
/>
149
- </div >
150
- </VueGroupButton >
155
+ </template >
156
+ </VTooltip >
151
157
</VueGroup >
152
158
</template >
153
159
Original file line number Diff line number Diff line change
1
+ <script lang="ts">
2
+ import { computed , defineComponent } from ' vue'
3
+ import { useRouter } from ' @front/util/router'
4
+ import { usePlugins } from ' .'
5
+
6
+ export default defineComponent ({
7
+ props: {
8
+ pluginId: {
9
+ type: String ,
10
+ required: true ,
11
+ },
12
+ },
13
+
14
+ setup (props ) {
15
+ const {
16
+ plugins,
17
+ } = usePlugins ()
18
+
19
+ const plugin = computed (() => plugins .value .find (p => p .id === props .pluginId ))
20
+
21
+ const router = useRouter ()
22
+ function go () {
23
+ router .push ({
24
+ name: ' plugin-details' ,
25
+ params: {
26
+ pluginId: props .pluginId ,
27
+ },
28
+ })
29
+ }
30
+
31
+ return {
32
+ plugin ,
33
+ go ,
34
+ }
35
+ },
36
+ })
37
+ </script >
38
+
39
+ <template >
40
+ <div
41
+ v-if =" plugin"
42
+ class =" flex space-x-3 items-center"
43
+ >
44
+ <div class =" flex items-center justify-center w-8 h-8 bg-gray-700 dark:bg-gray-200 rounded" >
45
+ <img
46
+ v-if =" plugin.logo"
47
+ :src =" plugin.logo"
48
+ alt =" Plugin logo"
49
+ class =" max-w-[24px] max-h-[24px]"
50
+ >
51
+ <VueIcon
52
+ v-else
53
+ icon =" extension"
54
+ />
55
+ </div >
56
+ <div >
57
+ <div >Provided by <b >{{ plugin ? plugin.label : pluginId }}</b ></div >
58
+ <div
59
+ v-if =" plugin"
60
+ class =" opacity-50"
61
+ >
62
+ <div >Plugin ID: {{ plugin.id }}</div >
63
+ </div >
64
+ </div >
65
+ </div >
66
+ </template >
Original file line number Diff line number Diff line change 1
1
<script lang="ts">
2
- import { computed , defineComponent } from ' vue'
2
+ import { defineComponent } from ' vue'
3
3
import { useRouter } from ' @front/util/router'
4
- import { usePlugins } from ' .'
4
+ import PluginSourceDescription from ' ./PluginSourceDescription.vue '
5
5
6
6
export default defineComponent ({
7
+ components: {
8
+ PluginSourceDescription ,
9
+ },
10
+
7
11
props: {
8
12
pluginId: {
9
13
type: String ,
@@ -12,12 +16,6 @@ export default defineComponent({
12
16
},
13
17
14
18
setup (props ) {
15
- const {
16
- plugins,
17
- } = usePlugins ()
18
-
19
- const plugin = computed (() => plugins .value .find (p => p .id === props .pluginId ))
20
-
21
19
const router = useRouter ()
22
20
function go () {
23
21
router .push ({
@@ -29,7 +27,6 @@ export default defineComponent({
29
27
}
30
28
31
29
return {
32
- plugin ,
33
30
go ,
34
31
}
35
32
},
@@ -46,40 +43,10 @@ export default defineComponent({
46
43
@click.stop =" go()"
47
44
/>
48
45
49
- <template
50
- v-if =" plugin "
51
- #popper
52
- >
53
- <div class =" flex space-x-3 items-center" >
54
- <div class =" flex items-center justify-center w-8 h-8 bg-gray-700 dark:bg-gray-200 rounded" >
55
- <img
56
- v-if =" plugin.logo"
57
- :src =" plugin.logo"
58
- alt =" Plugin logo"
59
- class =" logo"
60
- >
61
- <VueIcon
62
- v-else
63
- icon =" extension"
64
- />
65
- </div >
66
- <div >
67
- <div >Provided by <b >{{ plugin ? plugin.label : pluginId }}</b ></div >
68
- <div
69
- v-if =" plugin"
70
- class =" opacity-50"
71
- >
72
- <div >ID: {{ plugin.id }}</div >
73
- </div >
74
- </div >
75
- </div >
46
+ <template #popper >
47
+ <PluginSourceDescription
48
+ :plugin-id =" pluginId"
49
+ />
76
50
</template >
77
51
</VTooltip >
78
52
</template >
79
-
80
- <style lang="postcss" scoped>
81
- .logo {
82
- max-width : 24 px ;
83
- max-height : 24 px ;
84
- }
85
- </style >
You can’t perform that action at this time.
0 commit comments