diff --git a/src/js/bootstrap.js b/src/js/bootstrap.js
index 8fedb251..d61ef5b8 100755
--- a/src/js/bootstrap.js
+++ b/src/js/bootstrap.js
@@ -55,6 +55,7 @@ var initialState = {
}
},
lastfm: {
+ connected: false,
album: {},
artist: {},
track: {}
@@ -62,6 +63,7 @@ var initialState = {
spotify: {
enabled: true,
connected: false,
+ authentication_provider: 'backend',
me: false,
autocomplete_results: {},
authorization_url: 'https://jamesbarnsley.co.nz/auth_v2.php'
diff --git a/src/js/components/Settings/Debug.js b/src/js/components/Settings/Debug.js
new file mode 100755
index 00000000..c85c7225
--- /dev/null
+++ b/src/js/components/Settings/Debug.js
@@ -0,0 +1,196 @@
+
+import React, { PropTypes } from 'react'
+import { connect } from 'react-redux'
+import { Link, hashHistory } from 'react-router'
+import { bindActionCreators } from 'redux'
+import FontAwesome from 'react-fontawesome'
+
+import SpotifyAuthenticationFrame from '../SpotifyAuthenticationFrame'
+
+import * as uiActions from '../../services/ui/actions'
+import * as pusherActions from '../../services/pusher/actions'
+import * as mopidyActions from '../../services/mopidy/actions'
+import * as spotifyActions from '../../services/spotify/actions'
+
+class Debug extends React.Component{
+
+ constructor(props) {
+ super(props);
+ this.state = {
+ mopidy_call: 'playlists.asList',
+ mopidy_data: '{}',
+ pusher_data: '{"method":"get_config"}',
+ access_token: (this.props.access_token ? this.props.access_token : '')
+ }
+ }
+
+ callMopidy(e){
+ e.preventDefault()
+ this.props.mopidyActions.debug( this.state.mopidy_call, JSON.parse(this.state.mopidy_data) )
+ }
+
+ callPusher(e){
+ e.preventDefault()
+ this.props.pusherActions.debug( JSON.parse(this.state.pusher_data) )
+ }
+
+ render(){
+ return (
+
-
-
- Apply and reload
-
+
+
System
+ Services
+ Debug
+ About
)
}
- serviceStatus(service){
+ renderSubView(){
+ switch (this.props.params.sub_view){
- var icon = null
- var status = 'Unknown'
+ case 'services':
+ return (
+
+
+
+ )
- if (this.props[service].enabled !== undefined && !this.props[service].enabled){
- icon =
- status = 'disabled'
- } else if (this.props[service].connecting){
- icon =
- status = 'connecting'
- } else if (this.props[service].connected){
- icon =
- status = 'connected'
- } else {
- icon =
- status = 'disconnected'
+ case 'debug':
+ return (
+
+
+
+ )
+
+ case 'about':
+ return (
+
+
+
+
Iris is an open-source project by
James Barnsley . It is provided free and with absolutely no warranty. If you paid someone for this software, please let me know.
+
+
+ Google Analytics is used to help trace issues and provide valuable insight into how we can continue to make improvements.
+
+
+
+
+
+
+ )
+
+ default:
+ return (
+
+
+
+ )
}
-
- return (
-
-
- {service}
- {icon} {status}
-
-
- )
}
render(){
-
- var options = (
-
- hashHistory.push(global.baseURL+'settings/debug')}>
-
- Debug
-
-
-
- Help
-
-
- )
-
return (
-
+
-
- {this.serviceStatus('mopidy')}
- {this.serviceStatus('pusher')}
- {this.serviceStatus('spotify')}
-
-
- System
-
-
- Spotify
-
-
-
Current user
-
-
- { this.renderSpotifyUser() }
-
-
-
-
-
Authentication
-
-
- { this.renderSendAuthorizationButton() }
-
-
-
- Advanced
-
-
-
Customise behavior
-
-
- this.props.uiActions.set({ clear_tracklist_on_play: !this.props.ui.clear_tracklist_on_play })} />
- Clear tracklist on play of URI(s)
-
-
-
-
-
-
-
-
-
-
System
-
- this.resetAllSettings()} />
-
-
-
-
- About
-
-
-
-
Iris is an open-source project by
James Barnsley . It is provided free and with absolutely no warranty. If you paid someone for this software, please let me know.
-
-
- Google Analytics is used to help trace issues and provide valuable insight into how we can continue to make improvements.
-
-
-
-
-
+ {this.renderSubViewMenu()}
+ {this.renderSubView()}
);
}
-}
-
-
-/**
- * Export our component
- *
- * We also integrate our global store, using connect()
- **/
-
-const mapStateToProps = (state, ownProps) => {
- return state;
-}
-
-const mapDispatchToProps = (dispatch) => {
- return {
- uiActions: bindActionCreators(uiActions, dispatch),
- pusherActions: bindActionCreators(pusherActions, dispatch),
- mopidyActions: bindActionCreators(mopidyActions, dispatch),
- spotifyActions: bindActionCreators(spotifyActions, dispatch)
- }
-}
-
-export default connect(mapStateToProps, mapDispatchToProps)(Settings)
\ No newline at end of file
+}
\ No newline at end of file
diff --git a/src/scss/app.scss b/src/scss/app.scss
index 54d34989..93cb1750 100755
--- a/src/scss/app.scss
+++ b/src/scss/app.scss
@@ -23,6 +23,7 @@
@import 'components/notifications';
@import 'components/dropdown-field';
@import 'components/autocomplete-field';
+@import 'components/sub-views';
@import 'components/debug';
@import 'views/artist';
diff --git a/src/scss/components/_sub-views.scss b/src/scss/components/_sub-views.scss
new file mode 100755
index 00000000..10a8d264
--- /dev/null
+++ b/src/scss/components/_sub-views.scss
@@ -0,0 +1,26 @@
+
+
+.sub-views {
+ .option {
+ @include feature_font();
+ color: $white;
+ display: inline-block;
+ margin-right: 25px;
+ font-size: 15px;
+ font-weight: 500;
+ border-bottom: 3px solid transparent;
+ cursor: pointer;
+
+ h4 {
+ margin: 8px 0 4px;
+ }
+
+ &.active {
+ border-color: $white;
+ }
+
+ &:not(.active):hover {
+ border-color: rgba(255,255,255,0.2);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/scss/global/_forms.scss b/src/scss/global/_forms.scss
index 4a47af81..6699bc06 100755
--- a/src/scss/global/_forms.scss
+++ b/src/scss/global/_forms.scss
@@ -194,7 +194,7 @@ input[type="submit"] {
.name {
display: block;
padding-top: 10px;
- width: 15%;
+ width: 20%;
float: left;
}
@@ -208,7 +208,7 @@ input[type="submit"] {
}
.input {
- width: 85%;
+ width: 80%;
float: left;
input,
diff --git a/src/scss/views/_artist.scss b/src/scss/views/_artist.scss
index afc6aa21..b470695e 100755
--- a/src/scss/views/_artist.scss
+++ b/src/scss/views/_artist.scss
@@ -37,31 +37,6 @@
color: $white;
}
}
-
- .sub-views {
- .option {
- @include feature_font();
- color: $white;
- display: inline-block;
- margin-right: 25px;
- font-size: 15px;
- font-weight: 500;
- border-bottom: 3px solid transparent;
- cursor: pointer;
-
- h4 {
- margin: 8px 0 4px;
- }
-
- &.active {
- border-color: $white;
- }
-
- &:not(.active):hover {
- border-color: rgba(255,255,255,0.2);
- }
- }
- }
}
}
diff --git a/src/scss/views/_settings.scss b/src/scss/views/_settings.scss
index b1cfe36e..283b4fa0 100755
--- a/src/scss/views/_settings.scss
+++ b/src/scss/views/_settings.scss
@@ -1,6 +1,10 @@
.settings-view {
+ .sub-views {
+ padding-bottom: 40px;
+ }
+
.services {
@include clearfix();
@@ -8,7 +12,7 @@
background: lighten($dark_grey,2%);
padding: 12px 15px;
width: 24%;
- margin-right: 2%;
+ margin-right: 1.3334%;
float: left;
border-radius: 3px;
box-sizing: border-box;
@@ -27,13 +31,15 @@
}
}
- &.connected {
+ &.connected,
+ &.available {
.status {
color: $green;
}
}
- &.disconnected {
+ &.disconnected,
+ &.unavailable {
.status {
color: $red;
}