feat: Add template plugin

This commit is contained in:
Nathan Woodburn 2024-02-13 13:41:56 +11:00
parent fea42b1177
commit 7085fbfa5c
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1
5 changed files with 35 additions and 2 deletions

View File

@ -345,8 +345,7 @@ def setDNS(account,domain,records):
newRecords.append({
'type': 'TXT',
'txt': TXTRecords
})
})
data = '{"records":'+str(newRecords).replace("'","\"")+'}'
response = hsw.sendUPDATE(account_name,password,domain,data)
return response

BIN
assets/plugin_page.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

BIN
assets/plugins.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

View File

@ -12,6 +12,8 @@ def listPlugins():
if file.endswith(".py"):
if file != "main.py":
plugin = importlib.import_module("plugins."+file[:-3])
if "info" not in dir(plugin):
continue
details = plugin.info
details["link"] = file[:-3]
plugins.append(details)

32
plugins/template.py Normal file
View File

@ -0,0 +1,32 @@
import json
import account
import requests
# Plugin Data
info = {
"name": "Plugin Template",
"description": "Plugin Description",
"version": "1.0",
"author": "Nathan.Woodburn/"
}
# Functions
functions = {
"main":{
"name": "Function name",
"type": "dashboard",
"description": "Description",
"params": {},
"returns": {
"status":
{
"name": "Status of the function",
"type": "text"
}
}
}
}
def main(params, authentication):
return {"status": "Success"}