pull/26/head
Louis Vézina 7 years ago
parent 7e2f3b87fc
commit f63ce12dbd

@ -261,6 +261,8 @@ def save_settings():
settings_general_pathmapping = []
settings_general_pathmapping.extend([list(a) for a in zip(settings_general_sourcepath, settings_general_destpath)])
c.execute("UPDATE table_settings_general SET ip = ?, port = ?, base_url = ?, path_mapping = ?, log_level = ?", (settings_general_ip, settings_general_port, settings_general_baseurl, str(settings_general_pathmapping), settings_general_loglevel))
settings_general_branch = request.forms.get('settings_general_branch')
settings_general_automatic = request.forms.get('settings_general_automatic')
settings_sonarr_ip = request.forms.get('settings_sonarr_ip')
settings_sonarr_port = request.forms.get('settings_sonarr_port')

@ -36,9 +36,11 @@ CREATE TABLE "table_settings_general" (
`port` INTEGER NOT NULL,
`base_url` TEXT,
`path_mapping` TEXT,
`log_level` TEXT
`log_level` TEXT,
`branch` TEXT,
`auto_update` INTEGER
);
INSERT INTO `table_settings_general` (ip,port,base_url,path_mapping,log_level) VALUES ('0.0.0.0',6767,'/',Null,'WARNING');
INSERT INTO `table_settings_general` (ip,port,base_url,path_mapping,log_level, branch, auto_update) VALUES ('0.0.0.0',6767,'/',Null,'WARNING','master','True');
CREATE TABLE `table_scheduler` (
`id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT UNIQUE,
`name` TEXT NOT NULL,

@ -202,6 +202,36 @@
%end
</div>
</div>
<div class="ui dividing header">Updates</div>
<div class="twelve wide column">
<div class="ui grid">
<div class="middle aligned row">
<div class="right aligned four wide column">
<label>Branch</label>
</div>
<div class="eleven wide column">
<select name="settings_general_branch" id="settings_branch" class="ui fluid selection dropdown">
<option value="">Branch</option>
<option value="master">master</option>
<option value="development">development</option>
</select>
</div>
</div>
<div class="middle aligned row">
<div class="right aligned four wide column">
<label>Automatic</label>
</div>
<div class="eleven wide column">
<div id="settings_automatic_div" class="ui toggle checkbox" data-automatic={{settings_sonarr[6]}}>
<input name="settings_general_automatic" type="checkbox">
<label></label>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="ui bottom attached tab segment" data-tab="sonarr">
<div class="ui container"><button class="ui blue right floated button">Save</button></div>
@ -341,6 +371,12 @@
} else {
$("#sonarr_ssl_div").checkbox('uncheck');
}
if ($('#settings_automatic_div').data("automatic") == "True") {
$("#settings_automatic_div").checkbox('check');
} else {
$("#settings_automatic_div").checkbox('uncheck');
}
$('#settings_loglevel').dropdown('clear');
$('#settings_loglevel').dropdown('set selected','{{!settings_general[4]}}');
@ -348,8 +384,11 @@
$('#settings_providers').dropdown('set selected',{{!enabled_providers}});
$('#settings_languages').dropdown('clear');
$('#settings_languages').dropdown('set selected',{{!enabled_languages}});
$('#settings_branch').dropdown('clear');
$('#settings_branch').dropdown('set selected',{{!settings_general[5]}});
$('#settings_loglevel').dropdown();
$('#settings_providers').dropdown();
$('#settings_languages').dropdown();
$('#settings_branch').dropdown();
</script>
Loading…
Cancel
Save