ServerShowdirectory admin API command to show directory

This commit is contained in:
shortcutme 2017-07-27 16:29:39 +02:00
parent f45ecb6cf4
commit 35efd6b107
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -34,8 +34,8 @@ class UiWebsocket(object):
self.send_queue = [] # Messages to send to client
self.admin_commands = (
"sitePause", "siteResume", "siteDelete", "siteList", "siteSetLimit", "siteClone",
"channelJoinAllsite", "serverUpdate", "serverPortcheck", "serverShutdown", "certSet", "configSet",
"permissionAdd", "permissionRemove"
"channelJoinAllsite", "serverUpdate", "serverPortcheck", "serverShutdown", "serverShowdirectory",
"certSet", "configSet", "permissionAdd", "permissionRemove"
)
self.async_commands = ("fileGet", "fileList", "dirList")
@ -848,6 +848,10 @@ class UiWebsocket(object):
sys.modules["main"].file_server.stop()
sys.modules["main"].ui_server.stop()
def actionServerShowdirectory(self, to, directory="backup"):
import webbrowser
webbrowser.open('file://' + os.path.abspath(config.data_dir))
def actionConfigSet(self, to, key, value):
if key not in ["tor", "language"]:
self.response(to, {"error": "Forbidden"})