Skip to content

Commit

Permalink
add api key to octodash update mesh, #632
Browse files Browse the repository at this point in the history
  • Loading branch information
jneilliii committed Oct 8, 2023
1 parent 77bc887 commit 9188cbd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion octoprint_bedlevelvisualizer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,8 @@ def bedlevelvisualizer_route(self):
self._bedlevelvisualizer_logger.debug("using stored mesh for octodash view: {}".format(mesh))
bed = self.bed_type
commands = self._settings.get(["command"]).split("\n")
render_kwargs = {"mesh": mesh, "bed": bed, "commands": commands}
apikey = self._settings.global_get(["api", "key"])
render_kwargs = {"mesh": mesh, "bed": bed, "commands": commands, "apikey": apikey}
except Exception as e:
self._logger.debug("Bed Visualizer error: {}".format(e))
render_kwargs = {"error": "{}".format(e)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@
type: "POST",
dataType: "json",
data: JSON.stringify({commands:gcode_commands, parameters: {}}),
contentType: "application/json; charset=UTF-8"
contentType: "application/json; charset=UTF-8",
headers: {
"X-Api-Key": "{{ apikey }}",
},
}).done(function(response){
window.location.reload(true);
});
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
plugin_name = "Bed Visualizer"

# The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module
plugin_version = "1.1.2rc6"
plugin_version = "1.1.2rc7"

# The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin
# module
Expand Down

0 comments on commit 9188cbd

Please sign in to comment.