Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion octoprint_webhooks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,8 @@ def get_assets(self):
css=["css/webhooks.css"],
js=["js/webhooks.js"],
json=["templates/simple.json", "templates/fulldata.json", "templates/snapshot.json",
"templates/oauth.json", "templates/dotnotation.json", "templates/slack.json", "templates/plivo.json"]
"templates/oauth.json", "templates/dotnotation.json", "templates/slack.json",
"templates/plivo.json", "templates/gotify.json"]
)

def register_custom_events(self, *args, **kwargs):
Expand Down
3 changes: 2 additions & 1 deletion octoprint_webhooks/static/js/webhooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ $(function() {
self.selectHook(0)
//Get the list of available templates.
let templates = ["simple.json", "fulldata.json", "snapshot.json",
"oauth.json", "dotnotation.json", "slack.json", "plivo.json"]
"oauth.json", "dotnotation.json", "slack.json", "plivo.json",
"gotify.json"]
let callbacksLeft = templates.length;
for (let i = 0; i < templates.length; i = i + 1) {
let templateFile = "plugin/webhooks/static/templates/" + templates[i]
Expand Down
17 changes: 17 additions & 0 deletions octoprint_webhooks/static/templates/gotify.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"content_type": "JSON",
"data": "{\n \"title\":\"@topic\",\n \"priority\": 5,\n \"message\":\"@message\"\n}",
"eventErrorMessage": "There was an error.",
"eventPrintDoneMessage": "Your print is done.",
"eventPrintFailedMessage": "Something went wrong and your print has failed.",
"eventPrintPausedMessage": "Your print has paused. You might need to change the filament color.",
"eventPrintProgressMessage": "Your print is @percentCompleteMilestone % complete.",
"eventPrintStartedMessage": "Your print has started",
"eventUserActionNeededMessage": "User action needed. You might need to change the filament color.",
"event_print_progress_interval": "50",
"headers": "{\n \"Content-Type\": \"application/json\",\n \"X-Gotify-Key\": \"@apiSecret\"\n}",
"http_method": "POST",
"oauth": false,
"_name": "Gotify Message",
"_description": "This template will send a message to your Gotify Server. As URL enter the API Endpoint for message creation (Note: your URL should look something like https://your.gotify.server.com/message). Inside Gotify, you need to create a new application in the apps section. Copy the app token and paste it here in the field API SECRET in the Webhook Parameters section. The priority can be changed in the field DATA in the Advanced section. Now, you should be able to test out your integration and see a message appear in your gotify account."
}