summaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
authormarios8543 <marios8543@gmail.com>2024-02-23 22:22:10 +0200
committermarios8543 <marios8543@gmail.com>2024-02-23 22:22:10 +0200
commit6b7f842233534a11ae3878d5fe843761dda7692a (patch)
treef707419475e13d6d7288d3fa72ffd03a24d42ae8 /backend
parent6b5f7c8642062906ecb36d905e52d0fcc6172783 (diff)
downloaddecky-loader-6b7f842233534a11ae3878d5fe843761dda7692a.tar.gz
decky-loader-6b7f842233534a11ae3878d5fe843761dda7692a.zip
Add log uploadingmarios8543/log-viewer
Diffstat (limited to 'backend')
-rw-r--r--backend/locales/en-US.json7
-rw-r--r--backend/src/utilities.py7
2 files changed, 13 insertions, 1 deletions
diff --git a/backend/locales/en-US.json b/backend/locales/en-US.json
index ca18f7da..ac6d9bda 100644
--- a/backend/locales/en-US.json
+++ b/backend/locales/en-US.json
@@ -266,5 +266,12 @@
},
"Testing": {
"download": "Download"
+ },
+ "LogViewer": {
+ "viewLog": "View Log",
+ "uploadLog": "Upload Log",
+ "textError": "Error loading text",
+ "uploadConfirm": "Are you sure you want to upload this log ?",
+ "uploadDisclaimer": "Depending on how this plugin is written, this log might contain confidential information. Are you sure you want to continue ? If unsure, ask the plugin developer."
}
}
diff --git a/backend/src/utilities.py b/backend/src/utilities.py
index 92715645..5dea0e94 100644
--- a/backend/src/utilities.py
+++ b/backend/src/utilities.py
@@ -396,4 +396,9 @@ class Utilities:
return log_file.read()
async def upload_log(self, plugin_name: str, log_name: str):
- raise RuntimeError("Not Implemented") \ No newline at end of file
+ text = await self.get_plugin_log_text(plugin_name, log_name)
+ async with ClientSession() as web:
+ res = await web.put("https://lp.deckbrew.xyz", data=text)
+ res.raise_for_status()
+ upload_id = (await res.json())["id"]
+ return f"https://lp.deckbrew.xyz/{upload_id}" \ No newline at end of file