diff --git a/packages/applet/src/components/settings/Settings.vue b/packages/applet/src/components/settings/Settings.vue new file mode 100644 index 000000000..6b7b24a8c --- /dev/null +++ b/packages/applet/src/components/settings/Settings.vue @@ -0,0 +1,59 @@ + + + diff --git a/packages/applet/src/modules/custom-inspector/components/Settings.vue b/packages/applet/src/modules/custom-inspector/components/Settings.vue new file mode 100644 index 000000000..90c5c8f03 --- /dev/null +++ b/packages/applet/src/modules/custom-inspector/components/Settings.vue @@ -0,0 +1,24 @@ + + + diff --git a/packages/applet/src/modules/custom-inspector/index.vue b/packages/applet/src/modules/custom-inspector/index.vue index 4f3fe4c9e..4a307ffe1 100644 --- a/packages/applet/src/modules/custom-inspector/index.vue +++ b/packages/applet/src/modules/custom-inspector/index.vue @@ -3,6 +3,7 @@ import { computed, onUnmounted, ref, watch } from 'vue' import { onRpcConnected, rpc } from '@vue/devtools-core' import About from './components/About.vue' +import Settings from './components/Settings.vue' import State from './components/state/Index.vue' import Timeline from './components/timeline/Index.vue' import AppConnecting from '~/components/basic/AppConnecting.vue' @@ -17,6 +18,9 @@ const emit = defineEmits(['loadError']) const inspectorState = createCustomInspectorStateContext() const loading = ref(false) +const pluginSettings = ref(null) +provide('pluginSettings', pluginSettings) + const routes = computed(() => { return [ { @@ -36,6 +40,12 @@ const routes = computed(() => { name: 'About', component: About, }, + pluginSettings.value && ({ + path: '/settings', + name: 'Settings', + component: Settings, + icon: 'i-mdi:cog-outline', + }), ].filter(Boolean) as VirtualRoute[] }) @@ -62,6 +72,14 @@ function getInspectorInfo() { restoreRouter() loading.value = false }) + rpc.value.getPluginSettings(props.id).then((settings) => { + if (settings.options) { + pluginSettings.value = settings + } + else { + pluginSettings.value = null + } + }) }) } diff --git a/packages/applet/src/modules/pinia/components/Settings.vue b/packages/applet/src/modules/pinia/components/Settings.vue new file mode 100644 index 000000000..058506946 --- /dev/null +++ b/packages/applet/src/modules/pinia/components/Settings.vue @@ -0,0 +1,23 @@ + + + diff --git a/packages/applet/src/modules/pinia/index.vue b/packages/applet/src/modules/pinia/index.vue index 595bd6d68..6d3452cdd 100644 --- a/packages/applet/src/modules/pinia/index.vue +++ b/packages/applet/src/modules/pinia/index.vue @@ -1,31 +1,57 @@