Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/backup #5

Merged
merged 3 commits into from
Jun 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion routes/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def handle(self, app, item):

elif item == 'config':
try:
subprocess.call(['tar', '-xzf', filename, '-C', '/'])
subprocess.check_output(['tar', '-xzf', filename, '-C', '/'])
retval['return'] = {'reboot': False, 'restart': True}
except Exception:
logging.error("Failed to install config from %s", filename)
Expand Down
4 changes: 0 additions & 4 deletions static/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,6 @@ $("#dnldcfg").click(function() {

$('#config').fileupload({
add: function (e, data) {
$('#config-button').prop('disabled', 'disabled');
data.submit();
},
done: function (e, data) {
Expand All @@ -371,9 +370,6 @@ $('#config').fileupload({
fail: function (e, data) {
alert('Failed to upload configuration');
},
always: function(e, data) {
$('#driver-button').prop('disabled', '');
}
});

$("#config-button").click(function() {
Expand Down
4 changes: 2 additions & 2 deletions static/template/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ <h1><a href="https://github.com/mrworf/photoframe">PhotoFrame Configuration</a>
<input type="button" id="backup" value="Backup Settings">
<input type="button" id="restore" value="Restore Settings">
<div style="display: inline-block; width: 50px"></div>
<input type="button" id="dnldcfg" value="Download Config">
<input style="position:absolute; top: -100px" type="file" data-url="upload/config" id="config" name="filename"><button id="config-button">Upload Config</button>
<input type="button" id="dnldcfg" value="Download Settings">
<input style="position:absolute; top: -100px" type="file" data-url="upload/config" id="config" name="filename"><button id="config-button">Upload Settings</button>
</div>
</div>
<br>
Expand Down