mirror of
https://github.com/onionshare/onionshare.git
synced 2024-10-01 01:35:40 -04:00
Improve webhook label in GUI, improve webhook message that gets POSTed, and display webhook errors without verbose mode
This commit is contained in:
parent
eb628ad093
commit
839b23f87a
@ -108,7 +108,11 @@ class ReceiveModeWeb:
|
||||
and not request.upload_error
|
||||
and len(files) > 0
|
||||
):
|
||||
self.send_webhook_notification(f"{len(files)} files uploaded")
|
||||
if len(files) == 1:
|
||||
file_msg = "1 file"
|
||||
else:
|
||||
file_msg = f"{len(files)} files"
|
||||
self.send_webhook_notification(f"{file_msg} uploaded to OnionShare")
|
||||
|
||||
if request.upload_error:
|
||||
self.common.log(
|
||||
@ -191,11 +195,7 @@ class ReceiveModeWeb:
|
||||
proxies=self.web.proxies,
|
||||
)
|
||||
except Exception as e:
|
||||
self.common.log(
|
||||
"ReceiveModeWeb",
|
||||
"send_webhook_notification",
|
||||
f"sending failed: {e}",
|
||||
)
|
||||
print(f"Webhook notification failed: {e}")
|
||||
|
||||
|
||||
class ReceiveModeWSGIMiddleware(object):
|
||||
|
@ -174,7 +174,7 @@
|
||||
"mode_settings_share_autostop_sharing_checkbox": "Stop sharing after files have been sent (uncheck to allow downloading individual files)",
|
||||
"mode_settings_receive_data_dir_label": "Save files to",
|
||||
"mode_settings_receive_data_dir_browse_button": "Browse",
|
||||
"mode_settings_receive_webhook_url_checkbox": "Use webhook URL",
|
||||
"mode_settings_receive_webhook_url_checkbox": "Use notification webhook",
|
||||
"mode_settings_website_disable_csp_checkbox": "Don't send Content Security Policy header (allows your website to use third-party resources)",
|
||||
"gui_all_modes_transfer_finished_range": "Transferred {} - {}",
|
||||
"gui_all_modes_transfer_finished": "Transferred {}",
|
||||
|
Loading…
Reference in New Issue
Block a user