Add community section where public functions can be viewed

This commit is contained in:
Peter Stockings
2025-11-21 10:30:14 +11:00
parent 8eb9b7dceb
commit 213abbfe93
10 changed files with 365 additions and 10 deletions

View File

@@ -16,6 +16,7 @@ const Editor = {
this.name = vnode.attrs.name || "foo";
this.path = vnode.attrs.path || "";
this.versionNumber = vnode.attrs.versionNumber || "1";
this.description = vnode.attrs.description || "";
this.nameEditing = false;
this.pathEditing = false;
this.jsValue = vnode.attrs.jsValue || "";
@@ -131,6 +132,7 @@ const Editor = {
log_request: this.logRequest,
log_response: this.logResponse,
runtime: this.runtime,
description: this.description,
};
payload = this.isTimer
@@ -145,6 +147,7 @@ const Editor = {
: null,
run_date: this.triggerType === "date" ? this.runDate : null,
is_enabled: this.isEnabled,
description: this.description,
}
: {
name: this.name,
@@ -155,6 +158,7 @@ const Editor = {
log_request: this.logRequest,
log_response: this.logResponse,
runtime: this.runtime,
description: this.description,
};
const response = await m.request({
@@ -603,6 +607,16 @@ const Editor = {
this.showFunctionSettings &&
m("div", { class: "bg-gray-100 dark:bg-gray-800 p-4 border-b" }, [
m("div", { class: "flex flex-col space-y-4" }, [
m("div", { class: "flex flex-col space-y-2" }, [
m("label", { class: "text-sm font-medium text-gray-700 dark:text-gray-300" }, "Description"),
m("textarea", {
class: "w-full p-2 border rounded bg-white dark:bg-gray-700 dark:border-gray-600 text-sm",
rows: 2,
placeholder: "Describe what this function does...",
value: this.description,
oninput: (e) => (this.description = e.target.value)
})
]),
m("div", { class: "flex flex-wrap gap-6" }, [
this.showPublicToggle &&
m(