[Extensions UI] Action URLs now point to the Execute panel.

This commit is contained in:
Fabio Manganiello 2023-10-18 02:57:32 +02:00
parent 6f01c35a0f
commit e5d84242bb
Signed by untrusted user: blacklight
GPG key ID: D90FBA7F76362774

View file

@ -20,8 +20,8 @@
<ul> <ul>
<li class="action" v-for="actionName in actionNames" :key="actionName"> <li class="action" v-for="actionName in actionNames" :key="actionName">
<a :href="extension.actions[actionName].doc_url" target="_blank"> <a :href="`/#execute?action=${extension.name}.${actionName}`">
<pre>{{ extension.name }}.{{ actionName }}</pre> {{ extension.name }}.{{ actionName }}
</a> </a>
</li> </li>
</ul> </ul>
@ -36,7 +36,7 @@
<ul> <ul>
<li class="event" v-for="eventName in eventNames" :key="eventName"> <li class="event" v-for="eventName in eventNames" :key="eventName">
<a :href="extension.events[eventName].doc_url" target="_blank"> <a :href="extension.events[eventName].doc_url" target="_blank">
<pre>{{ eventName }}</pre> {{ eventName }}
</a> </a>
</li> </li>
</ul> </ul>
@ -62,6 +62,7 @@ export default {
data() { data() {
return { return {
doc: null, doc: null,
localPageRegex: new RegExp('^/?#.*$'),
} }
}, },
@ -102,6 +103,11 @@ export default {
if (!href) if (!href)
return true return true
if (href.match(this.localPageRegex)) {
window.location.href = href
return true
}
const match = href.match(/^https:\/\/docs\.platypush\.tech\/platypush\/(plugins|backend)\/([\w.]+)\.html#?.*$/) const match = href.match(/^https:\/\/docs\.platypush\.tech\/platypush\/(plugins|backend)\/([\w.]+)\.html#?.*$/)
if (!match) { if (!match) {
event.preventDefault() event.preventDefault()
@ -176,8 +182,15 @@ section {
margin: 0; margin: 0;
li { li {
width: 100%;
display: block;
margin: 0.5em 0; margin: 0.5em 0;
list-style: none; list-style: none;
a {
width: 100%;
display: block;
}
} }
} }