mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-08-19 21:03:21 -07:00
Download config and database from the settings
This commit is contained in:
parent
7c0c7eea30
commit
84bfe99017
3 changed files with 43 additions and 5 deletions
|
@ -31,15 +31,15 @@ DOCUMENTATION :: END
|
|||
% endif
|
||||
<tr>
|
||||
<td>Configuration File:</td>
|
||||
<td>${plexpy.CONFIG_FILE}</td>
|
||||
<td><a class="no-highlight" href="download_config" data-toggle="tooltip" data-placement="right" title="Download Configuration">${plexpy.CONFIG_FILE}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Database File:</td>
|
||||
<td>${plexpy.DB_FILE}</td>
|
||||
<td><a class="no-highlight" href="download_database" data-toggle="tooltip" data-placement="right" title="Download Database">${plexpy.DB_FILE}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Log File:</td>
|
||||
<td><a class="no-highlight" href="logFile" target="_blank">${os.path.join(plexpy.CONFIG.LOG_DIR, logger.FILENAME)}</a></td>
|
||||
<td><a class="no-highlight" href="download_log" data-toggle="tooltip" data-placement="right" title="Download Log">${os.path.join(plexpy.CONFIG.LOG_DIR, logger.FILENAME)}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Backup Directory:</td>
|
||||
|
@ -128,5 +128,11 @@ DOCUMENTATION :: END
|
|||
$('#support-modal').modal('hide');
|
||||
});
|
||||
});
|
||||
|
||||
$('body').tooltip({
|
||||
selector: '[data-toggle="tooltip"]',
|
||||
container: 'body'
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
|
@ -615,7 +615,8 @@
|
|||
<div id="pms_logs_folder_error" class="alert alert-danger settings-alert" role="alert"></div>
|
||||
</div>
|
||||
<p class="help-block">
|
||||
Set the complete folder path where your Plex Server logs are, shortcuts are not recognized.
|
||||
Optional: Set your Plex logs folder to use PlexPy as a log viewer. Plex logs are not needed for PlexPy to function.
|
||||
A complete folder path is required, shortcuts are not recognized.
|
||||
<a href="${anon_url('https://support.plex.tv/hc/en-us/articles/200250417-Plex-Media-Server-Log-Files')}" target="_blank">Click here</a> for help.
|
||||
</p>
|
||||
</div>
|
||||
|
@ -960,7 +961,7 @@
|
|||
<input type="text" class="form-control" id="git_path" name="git_path" value="${config['git_path']}" size="30">
|
||||
</div>
|
||||
</div>
|
||||
<p class="help-block">The path to your git environment variable. Leave blank for default.</p>
|
||||
<p class="help-block">Optional: The path to your git environment variable. Leave blank for default.</p>
|
||||
</div>
|
||||
% endif
|
||||
|
||||
|
|
|
@ -3630,6 +3630,37 @@ class WebInterface(object):
|
|||
return serve_file(path=fp, content_type='image/png')
|
||||
|
||||
|
||||
@cherrypy.expose
|
||||
@requireAuth(member_of("admin"))
|
||||
@addtoapi()
|
||||
def download_config(self, **kwargs):
|
||||
""" Download the PlexPy configuration file. """
|
||||
config_file = config.FILENAME
|
||||
|
||||
try:
|
||||
plexpy.CONFIG.write()
|
||||
except:
|
||||
pass
|
||||
|
||||
return serve_download(plexpy.CONFIG_FILE, name=config_file)
|
||||
|
||||
@cherrypy.expose
|
||||
@requireAuth(member_of("admin"))
|
||||
@addtoapi()
|
||||
def download_database(self, **kwargs):
|
||||
""" Download the PlexPy database file. """
|
||||
database_file = database.FILENAME
|
||||
|
||||
try:
|
||||
db = database.MonitorDatabase()
|
||||
db.connection.execute('begin immediate')
|
||||
shutil.copyfile(plexpy.DB_FILE, os.path.join(plexpy.CONFIG.CACHE_DIR, database_file))
|
||||
db.connection.rollback()
|
||||
except:
|
||||
pass
|
||||
|
||||
return serve_download(os.path.join(plexpy.CONFIG.CACHE_DIR, database_file), name=database_file)
|
||||
|
||||
@cherrypy.expose
|
||||
@requireAuth(member_of("admin"))
|
||||
@addtoapi()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue