Removing SSL config - non HTTPS can't use SSL anyway

This commit is contained in:
James Barnsley
2018-10-04 21:07:25 +13:00
parent 5d827902e4
commit 62fe788395
9 changed files with 14100 additions and 10787 deletions

View File

@ -28,7 +28,6 @@ class Settings extends React.Component {
this.state = {
mopidy_host: this.props.mopidy.host,
mopidy_port: this.props.mopidy.port,
mopidy_ssl: this.props.mopidy.ssl,
mopidy_library_artists_uri: this.props.mopidy.library_artists_uri,
mopidy_library_albums_uri: this.props.mopidy.library_albums_uri,
pusher_username: this.props.pusher.username,
@ -67,8 +66,7 @@ class Settings extends React.Component {
this.props.mopidyActions.set({
host: this.state.mopidy_host,
port: this.state.mopidy_port,
ssl: this.state.mopidy_ssl
port: this.state.mopidy_port
});
window.location.reload(true);
@ -103,8 +101,7 @@ class Settings extends React.Component {
renderApplyButton(){
if (this.props.mopidy.host == this.state.mopidy_host &&
this.props.mopidy.port == this.state.mopidy_port &&
this.props.mopidy.ssl == this.state.mopidy_ssl){
this.props.mopidy.port == this.state.mopidy_port){
return null;
}
@ -227,22 +224,6 @@ class Settings extends React.Component {
value={ this.state.mopidy_port } />
</div>
</div>
<div className="field checkbox">
<div className="name">Encryption</div>
<div className="input">
<label>
<input
type="checkbox"
name="ssl"
checked={this.state.mopidy_ssl}
onChange={e => this.setState({mopidy_ssl: !this.state.mopidy_ssl})} />
<span className="label tooltip">
Enable SSL
<span className="tooltip__content">Requires SSL proxy</span>
</span>
</label>
</div>
</div>
{this.renderApplyButton()}
</form>

View File

@ -10,6 +10,8 @@ import TrackList from '../../components/TrackList'
import GridItem from '../../components/GridItem'
import DropdownField from '../../components/Fields/DropdownField'
import Icon from '../../components/Icon'
import URILink from '../../components/URILink'
import ErrorBoundary from '../../components/ErrorBoundary'
import * as helpers from '../../helpers'
import * as uiActions from '../../services/ui/actions'
@ -63,6 +65,45 @@ class LibraryBrowse extends React.Component{
this.props.uiActions.hideContextMenu();
}
renderBreadcrumbs(){
if (this.props.params.uri){
var parent_uri = this.props.params.uri;
} else {
return null;
}
if (parent_uri.startsWith('file://')){
var uri = parent_uri.replace('file:///','');
var uri_elements = uri.split('/');
return (
<h4>
{uri_elements.map((uri_element, index) => {
// Reconstruct a URL to this element
var uri = "file://";
for (var i = 0; i <= index; i++){
uri += "/"+uri_elements[i];
}
return (
<span key={uri}>
{index > 0 ? <span>&nbsp; <Icon type="fontawesome" name="angle-right" /> &nbsp;&nbsp;</span> : null}
<URILink type="browse" uri={uri}>
{uri_element}
</URILink>
</span>
);
})}
</h4>
);
}
return null;
}
renderSubdirectories(subdirectories){
if (this.props.view == 'list'){
return (
@ -152,15 +193,19 @@ class LibraryBrowse extends React.Component{
{title}
</Header>
<section className="content-wrapper">
<ErrorBoundary>
{subdirectories ? this.renderSubdirectories(subdirectories) : null}
{this.renderBreadcrumbs()}
{tracks ? <TrackList
tracks={this.props.directory.tracks}
uri={"iris:browse:"+this.props.params.uri}
className="library-local-track-list"
/> : null }
{subdirectories ? this.renderSubdirectories(subdirectories) : null}
{tracks ? <TrackList
tracks={this.props.directory.tracks}
uri={"iris:browse:"+this.props.params.uri}
className="library-local-track-list"
/> : null }
</ErrorBoundary>
</section>
</div>
);
@ -229,21 +274,23 @@ class LibraryBrowse extends React.Component{
Browse
</Header>
<section className="content-wrapper">
<div className="grid category-grid">
{
grid_items.map(
(item, index) => {
return (
<GridItem
item={item}
key={index}
type="category"
onClick={e => hashHistory.push(item.link)}
/>
)
}
)
}
<div className="grid category-grid">
<ErrorBoundary>
{
grid_items.map(
(item, index) => {
return (
<GridItem
item={item}
key={index}
type="category"
onClick={e => hashHistory.push(item.link)}
/>
)
}
)
}
</ErrorBoundary>
</div>
</section>
</div>

View File

@ -24,8 +24,7 @@ class InitialSetup extends React.Component{
username: this.props.username,
allow_reporting: this.props.allow_reporting,
host: this.props.host,
port: this.props.port,
ssl: this.props.ssl
port: this.props.port
}
}
@ -46,8 +45,7 @@ class InitialSetup extends React.Component{
});
this.props.mopidyActions.set({
host: this.state.host,
port: this.state.port,
ssl: this.state.ssl
port: this.state.port
});
this.setState({saving: true});
@ -56,7 +54,7 @@ class InitialSetup extends React.Component{
setTimeout(function(){
// We've changed a connection setting, so need to reload
if (self.state.host !== self.props.host || self.state.port !== self.props.port || self.state.ssl !== self.props.ssl){
if (self.state.host !== self.props.host || self.state.port !== self.props.port){
window.location = global.baseURL;
@ -108,21 +106,6 @@ class InitialSetup extends React.Component{
value={ this.state.port } />
</div>
</div>
<div className="field checkbox">
<div className="input">
<label>
<input
type="checkbox"
name="ssl"
checked={this.state.ssl}
onChange={e => this.setState({ssl: !this.state.ssl})} />
<span className="label tooltip">
Enable SSL
<span className="tooltip__content">Requires SSL proxy</span>
</span>
</label>
</div>
</div>
{helpers.isHosted() ? null : <div className="field checkbox">
<div className="input">
@ -157,8 +140,7 @@ const mapStateToProps = (state, ownProps) => {
allow_reporting: state.ui.allow_reporting,
username: (state.pusher && state.pusher.username ? state.pusher.username : 'Anonymous'),
host: state.mopidy.host,
port: state.mopidy.port,
ssl: state.mopidy.ssl
port: state.mopidy.port
}
}