Skip to content

Commit 2224e26

Browse files
committed
feat(plugin): logo
1 parent 223e1fe commit 2224e26

File tree

5 files changed

+31
-0
lines changed

5 files changed

+31
-0
lines changed

packages/api/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export interface PluginDescriptor {
1111
packageName?: string
1212
homepage?: string
1313
componentStateTypes?: string[]
14+
logo?: string
1415
}
1516

1617
export type SetupFunction = (api: DevtoolsPluginApi) => void

packages/app-backend-core/src/plugin.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ export function serializePlugin (plugin: Plugin) {
6262
appId: getAppRecordId(plugin.descriptor.app),
6363
packageName: plugin.descriptor.packageName,
6464
homepage: plugin.descriptor.homepage,
65+
logo: plugin.descriptor.logo,
6566
componentStateTypes: plugin.descriptor.componentStateTypes
6667
}
6768
}

packages/app-frontend/src/features/plugin/PluginDetails.vue

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,14 @@ export default {
2828
>
2929
<div class="px-6 py-4 border-b border-gray-200 dark:border-gray-800 flex space-x-6">
3030
<div class="flex items-center justify-center w-16 h-16 bg-gray-200 dark:bg-gray-700 rounded-full">
31+
<img
32+
v-if="plugin.logo"
33+
:src="plugin.logo"
34+
alt="Plugin logo"
35+
class="logo"
36+
>
3137
<VueIcon
38+
v-else
3239
icon="extension"
3340
class="big text-gray-500"
3441
/>
@@ -59,3 +66,10 @@ export default {
5966
</div>
6067
</div>
6168
</template>
69+
70+
<style lang="postcss" scoped>
71+
.logo {
72+
max-width: 48px;
73+
max-height: 48px;
74+
}
75+
</style>

packages/app-frontend/src/features/plugin/PluginSourceIcon.vue

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,14 @@ export default {
4949
<template #popper>
5050
<div class="flex space-x-3 items-center">
5151
<div class="flex items-center justify-center w-8 h-8 bg-gray-700 dark:bg-gray-200 rounded-full">
52+
<img
53+
v-if="plugin.logo"
54+
:src="plugin.logo"
55+
alt="Plugin logo"
56+
class="logo"
57+
>
5258
<VueIcon
59+
v-else
5360
icon="extension"
5461
/>
5562
</div>
@@ -66,3 +73,10 @@ export default {
6673
</template>
6774
</VTooltip>
6875
</template>
76+
77+
<style lang="postcss" scoped>
78+
.logo {
79+
max-width: 24px;
80+
max-height: 24px;
81+
}
82+
</style>

packages/shell-dev-vue3/src/devtools-plugin/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export default {
1212
label: 'Test devtools plugin',
1313
packageName: '@vue/devtools-shell-dev-vue3',
1414
homepage: 'https://github.com/vuejs/vue-devtools',
15+
logo: 'https://nodepackjs.com/favicon.png',
1516
componentStateTypes: [
1617
stateType
1718
],

0 commit comments

Comments
 (0)