mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 02:37:08 -07:00
Added Auth, startup options to UI
Added caching to ConfigFileProvider,
This commit is contained in:
parent
8a5bd31da7
commit
4da6654440
34 changed files with 579 additions and 365 deletions
16
UI/Settings/General/GeneralSettingsModel.js
Normal file
16
UI/Settings/General/GeneralSettingsModel.js
Normal file
|
@ -0,0 +1,16 @@
|
|||
"use strict";
|
||||
define(['app'], function () {
|
||||
NzbDrone.Settings.General.GeneralSettingsModel = Backbone.Model.extend({
|
||||
url: NzbDrone.Constants.ApiRoot + '/settings/host',
|
||||
|
||||
initialize: function () {
|
||||
this.on('change', function () {
|
||||
this.isSaved = false;
|
||||
}, this);
|
||||
|
||||
this.on('sync', function () {
|
||||
this.isSaved = true;
|
||||
}, this);
|
||||
}
|
||||
});
|
||||
});
|
70
UI/Settings/General/GeneralTemplate.html
Normal file
70
UI/Settings/General/GeneralTemplate.html
Normal file
|
@ -0,0 +1,70 @@
|
|||
<div class="form-horizontal">
|
||||
<fieldset>
|
||||
<legend>Start-Up</legend>
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label">Port Number</label>
|
||||
|
||||
<div class="controls">
|
||||
<input type="text" placeholder="8989" name="port"/>
|
||||
<span>
|
||||
<i class="icon-exclamation-sign danger" title="Requires restart to take effect"></i>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label">Open browser on start</label>
|
||||
|
||||
<div class="controls">
|
||||
<label class="checkbox toggle well">
|
||||
<input type="checkbox" name="launchBrowser"/>
|
||||
|
||||
<p>
|
||||
<span>Yes</span>
|
||||
<span>No</span>
|
||||
</p>
|
||||
|
||||
<div class="btn btn-primary slide-button"></div>
|
||||
</label>
|
||||
|
||||
<span class="help-inline-checkbox">
|
||||
<i class="icon-question-sign" title="Open a web browser and navigate to NzbDrone homepage on app start. Has no effect if installed as a windows service"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<legend>Security</legend>
|
||||
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label">Authentication</label>
|
||||
|
||||
<div class="controls">
|
||||
<select class="inputClass" name="authenticationType">
|
||||
<option value="Anonymous">Anonymous</option>
|
||||
<option value="Basic">Basic</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">Username</label>
|
||||
|
||||
<div class="controls">
|
||||
<input type="text" placeholder="Username" name="basicAuthUsername"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">Password</label>
|
||||
|
||||
<div class="controls">
|
||||
<input type="password" name="basicAuthPassword"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</fieldset>
|
||||
</div>
|
31
UI/Settings/General/GeneralView.js
Normal file
31
UI/Settings/General/GeneralView.js
Normal file
|
@ -0,0 +1,31 @@
|
|||
'use strict';
|
||||
define(['app', 'Settings/SettingsModel', 'Shared/Messenger'], function () {
|
||||
|
||||
NzbDrone.Settings.General.GeneralView = Backbone.Marionette.ItemView.extend({
|
||||
template: 'Settings/General/GeneralTemplate',
|
||||
|
||||
initialize: function () {
|
||||
|
||||
NzbDrone.vent.on(NzbDrone.Commands.SaveSettings, this.saveSettings, this);
|
||||
},
|
||||
|
||||
saveSettings: function () {
|
||||
if (!this.model.isSaved) {
|
||||
this.model.save(undefined, this.syncNotification("Naming Settings Saved", "Couldn't Save Naming Settings"));
|
||||
}
|
||||
},
|
||||
|
||||
syncNotification: function (success, error) {
|
||||
return {
|
||||
success: function () {
|
||||
NzbDrone.Shared.Messenger.show({message: 'General Settings Saved'});
|
||||
},
|
||||
error : function () {
|
||||
NzbDrone.Shared.Messenger.show({message: "Couldn't Save General Settings", type: 'error'});
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue