Skip to content

Commit

Permalink
Fix image location for tips
Browse files Browse the repository at this point in the history
  • Loading branch information
laffra committed Jul 31, 2023
1 parent 4c878b9 commit 04143f8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dashboard/tips.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def createButton(self, provider, logo, url):
return (js.jQuery("<button>")
.addClass("tips-button")
.append(
js.jQuery("<img>").addClass("tips-logo").attr("src", logo),
js.jQuery("<img>").addClass("tips-logo").attr("src", f"microlog/{logo}"),
js.jQuery("<span>").text(provider),
)
.click(pyodide.ffi.create_proxy(lambda event: self.open(url)))
Expand Down
6 changes: 5 additions & 1 deletion microlog/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ def do_GET(self):
if self.path in ["/stop"]:
return

if self.path.startswith("/microlog/images/"):

if "/images/" in self.path:
while self.path.startswith("/microlog//microlog/"):
self.path = self.path[10:]
print("GET", self.path)
with open(self.path[1:], "rb") as fd:
return self.sendData("image/png", fd.read())

Expand Down

0 comments on commit 04143f8

Please sign in to comment.