Share config
This commit is contained in:
@ -3435,6 +3435,10 @@ input[type="submit"] {
|
|||||||
padding: 5px 5px 5px 28px;
|
padding: 5px 5px 5px 28px;
|
||||||
position: relative;
|
position: relative;
|
||||||
cursor: pointer; }
|
cursor: pointer; }
|
||||||
|
.field.radio--block .label,
|
||||||
|
.field.radio--block label, .field.checkbox--block .label,
|
||||||
|
.field.checkbox--block label {
|
||||||
|
display: block; }
|
||||||
.field.range {
|
.field.range {
|
||||||
position: relative; }
|
position: relative; }
|
||||||
.field.range .input-range {
|
.field.range .input-range {
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -98,7 +98,7 @@
|
|||||||
|
|
||||||
// Release details
|
// Release details
|
||||||
// These are automatically injected to built HTML
|
// These are automatically injected to built HTML
|
||||||
var build = "1538265321";
|
var build = "1538334647";
|
||||||
var version = "3.26.2";
|
var version = "3.26.2";
|
||||||
|
|
||||||
// Construct the script tag
|
// Construct the script tag
|
||||||
|
|||||||
@ -22,6 +22,7 @@ import * as mopidyActions from './services/mopidy/actions';
|
|||||||
import * as spotifyActions from './services/spotify/actions';
|
import * as spotifyActions from './services/spotify/actions';
|
||||||
import * as lastfmActions from './services/lastfm/actions';
|
import * as lastfmActions from './services/lastfm/actions';
|
||||||
import * as geniusActions from './services/genius/actions';
|
import * as geniusActions from './services/genius/actions';
|
||||||
|
import * as snapcastActions from './services/snapcast/actions';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -315,6 +316,7 @@ class App extends React.Component{
|
|||||||
spotifyActions={this.props.spotifyActions}
|
spotifyActions={this.props.spotifyActions}
|
||||||
geniusActions={this.props.geniusActions}
|
geniusActions={this.props.geniusActions}
|
||||||
lastfmActions={this.props.lastfmActions}
|
lastfmActions={this.props.lastfmActions}
|
||||||
|
snapcastActions={this.props.snapcastActions}
|
||||||
notifications={this.props.notifications}
|
notifications={this.props.notifications}
|
||||||
processes={this.props.processes}
|
processes={this.props.processes}
|
||||||
broadcasts={this.props.broadcasts}
|
broadcasts={this.props.broadcasts}
|
||||||
@ -367,7 +369,8 @@ const mapDispatchToProps = (dispatch) => {
|
|||||||
mopidyActions: bindActionCreators(mopidyActions, dispatch),
|
mopidyActions: bindActionCreators(mopidyActions, dispatch),
|
||||||
spotifyActions: bindActionCreators(spotifyActions, dispatch),
|
spotifyActions: bindActionCreators(spotifyActions, dispatch),
|
||||||
lastfmActions: bindActionCreators(lastfmActions, dispatch),
|
lastfmActions: bindActionCreators(lastfmActions, dispatch),
|
||||||
geniusActions: bindActionCreators(geniusActions, dispatch)
|
geniusActions: bindActionCreators(geniusActions, dispatch),
|
||||||
|
snapcastActions: bindActionCreators(snapcastActions, dispatch)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -28,6 +28,10 @@ export default class Notifications extends React.Component{
|
|||||||
this.props.geniusActions.importAuthorization(configuration.genius_authorization);
|
this.props.geniusActions.importAuthorization(configuration.genius_authorization);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (configuration.snapcast_client_commands){
|
||||||
|
this.props.snapcastActions.clientCommandsUpdated(configuration.snapcast_client_commands);
|
||||||
|
}
|
||||||
|
|
||||||
this.props.uiActions.removeNotification(notification_key, true);
|
this.props.uiActions.removeNotification(notification_key, true);
|
||||||
this.props.uiActions.createNotification({type: 'info', content: 'Import successful'});
|
this.props.uiActions.createNotification({type: 'info', content: 'Import successful'});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -69,15 +69,6 @@ class Services extends React.Component{
|
|||||||
}
|
}
|
||||||
|
|
||||||
renderSpotify(){
|
renderSpotify(){
|
||||||
var share_authorization_button = null;
|
|
||||||
if (this.props.spotify.authorization){
|
|
||||||
share_authorization_button = (
|
|
||||||
<Link className="button" to={global.baseURL+'settings/share-authorization'}>
|
|
||||||
Share authorization
|
|
||||||
</Link>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
var user_object = (this.props.spotify.me && this.props.core.users[this.props.spotify.me.uri] ? this.props.core.users[this.props.spotify.me.uri] : null);
|
var user_object = (this.props.spotify.me && this.props.core.users[this.props.spotify.me.uri] ? this.props.core.users[this.props.spotify.me.uri] : null);
|
||||||
if (user_object){
|
if (user_object){
|
||||||
var user = (
|
var user = (
|
||||||
@ -156,7 +147,6 @@ class Services extends React.Component{
|
|||||||
<div className="name">Authorization</div>
|
<div className="name">Authorization</div>
|
||||||
<div className="input">
|
<div className="input">
|
||||||
<SpotifyAuthenticationFrame />
|
<SpotifyAuthenticationFrame />
|
||||||
{share_authorization_button}
|
|
||||||
{this.props.spotify.refreshing_token ? <button className="working">Refreshing...</button> : <button onClick={e => this.props.spotifyActions.refreshingToken()}>Force token refresh</button>}
|
{this.props.spotify.refreshing_token ? <button className="working">Refreshing...</button> : <button onClick={e => this.props.spotifyActions.refreshingToken()}>Force token refresh</button>}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -90,7 +90,6 @@ const PusherMiddleware = (function(){
|
|||||||
store.dispatch(spotifyActions.tokenChanged(message.params.spotify_token));
|
store.dispatch(spotifyActions.tokenChanged(message.params.spotify_token));
|
||||||
break;
|
break;
|
||||||
case 'share_configuration_received':
|
case 'share_configuration_received':
|
||||||
console.log(message);
|
|
||||||
store.dispatch(uiActions.createNotification({
|
store.dispatch(uiActions.createNotification({
|
||||||
type: 'share-configuration-received',
|
type: 'share-configuration-received',
|
||||||
configuration: message.params,
|
configuration: message.params,
|
||||||
|
|||||||
@ -250,16 +250,13 @@ const SnapcastMiddleware = (function(){
|
|||||||
var command = JSON.parse(action.command);
|
var command = JSON.parse(action.command);
|
||||||
command.crossDomain = true;
|
command.crossDomain = true;
|
||||||
command.dataType = "jsonp";
|
command.dataType = "jsonp";
|
||||||
|
command.success = function(response){
|
||||||
|
store.dispatch(uiActions.createNotification({type: 'info', content: 'Command sent', description: command.url}));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Actually send the request
|
||||||
|
$.ajax(command);
|
||||||
|
|
||||||
$.ajax(command)
|
|
||||||
.then(
|
|
||||||
response => {
|
|
||||||
console.log(response);
|
|
||||||
},
|
|
||||||
(xhr, status, error) => {
|
|
||||||
console.error(error);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
break
|
break
|
||||||
|
|
||||||
case 'SNAPCAST_SET_CLIENT_GROUP':
|
case 'SNAPCAST_SET_CLIENT_GROUP':
|
||||||
|
|||||||
@ -18,9 +18,10 @@ class ShareConfiguration extends React.Component {
|
|||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
recipients: [],
|
recipients: [],
|
||||||
spotify_authorization: true,
|
spotify_authorization: false,
|
||||||
lastfm_authorization: true,
|
lastfm_authorization: false,
|
||||||
genius_authorization: true,
|
genius_authorization: false,
|
||||||
|
snapcast_client_commands: false,
|
||||||
interface: true
|
interface: true
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -56,6 +57,9 @@ class ShareConfiguration extends React.Component {
|
|||||||
if (this.state.interface){
|
if (this.state.interface){
|
||||||
configuration.interface = this.props.interface;
|
configuration.interface = this.props.interface;
|
||||||
}
|
}
|
||||||
|
if (this.state.interface){
|
||||||
|
configuration.snapcast_client_commands = this.props.snapcast_client_commands;
|
||||||
|
}
|
||||||
|
|
||||||
for (var recipient of this.state.recipients){
|
for (var recipient of this.state.recipients){
|
||||||
this.props.pusherActions.deliverMessage(
|
this.props.pusherActions.deliverMessage(
|
||||||
@ -122,8 +126,8 @@ class ShareConfiguration extends React.Component {
|
|||||||
{recipients}
|
{recipients}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="field checkbox">
|
<div className="field checkbox checkbox--block">
|
||||||
<div className="name">Interface</div>
|
<div className="name">Configurations</div>
|
||||||
<div className="input">
|
<div className="input">
|
||||||
<label>
|
<label>
|
||||||
<input
|
<input
|
||||||
@ -135,61 +139,55 @@ class ShareConfiguration extends React.Component {
|
|||||||
UI customisation (theme, sorting, filters)
|
UI customisation (theme, sorting, filters)
|
||||||
</span>
|
</span>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="field checkbox">
|
{this.props.snapcast_client_commands ? <label>
|
||||||
<div className="name">Spotify</div>
|
<input
|
||||||
<div className="input">
|
type="checkbox"
|
||||||
<label>
|
name="snapcast_client_commands"
|
||||||
|
checked={this.state.snapcast_client_commands}
|
||||||
|
onChange={ e => this.setState({ snapcast_client_commands: !this.state.snapcast_client_commands })} />
|
||||||
|
<span className="label">
|
||||||
|
Snapcast client commands
|
||||||
|
</span>
|
||||||
|
</label> : null}
|
||||||
|
|
||||||
|
{this.props.spotify_me && this.props.spotify_authorization ? <label>
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
name="spotify_authorization"
|
name="spotify_authorization"
|
||||||
checked={ this.state.spotify_authorization }
|
checked={this.state.spotify_authorization}
|
||||||
onChange={ e => this.setState({ spotify_authorization: !this.state.spotify_authorization })} />
|
onChange={ e => this.setState({ spotify_authorization: !this.state.spotify_authorization })} />
|
||||||
<span className="label">
|
<span className="label">
|
||||||
Authorization {this.props.spotify_me ? '('+this.props.spotify_me.name+')' : null}
|
Spotify authorization <span className="grey-text"> Logged in as {this.props.spotify_me.name}</span>
|
||||||
</span>
|
</span>
|
||||||
</label>
|
</label> : null}
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="field checkbox">
|
{this.props.lastfm_me && this.props.lastfm_authorization ? <label>
|
||||||
<div className="name">LastFM</div>
|
|
||||||
<div className="input">
|
|
||||||
<label>
|
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
name="lastfm_authorization"
|
name="lastfm_authorization"
|
||||||
checked={ this.state.lastfm_authorization }
|
checked={this.state.lastfm_authorization}
|
||||||
onChange={ e => this.setState({ lastfm_authorization: !this.state.lastfm_authorization })} />
|
onChange={ e => this.setState({ lastfm_authorization: !this.state.lastfm_authorization })} />
|
||||||
<span className="label">
|
<span className="label">
|
||||||
Authorization {this.props.lastfm_me ? '('+this.props.lastfm_me.name+')' : null}
|
LastFM authorization <span className="grey-text"> Logged in as {this.props.lastfm_me.name}</span>
|
||||||
</span>
|
</span>
|
||||||
</label>
|
</label> : null}
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="field checkbox">
|
{this.props.genius_me && this.props.genius_authorization ? <label>
|
||||||
<div className="name">Genius</div>
|
|
||||||
<div className="input">
|
|
||||||
<label>
|
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
name="genius_authorization"
|
name="genius_authorization"
|
||||||
checked={ this.state.genius_authorization }
|
checked={this.state.genius_authorization}
|
||||||
onChange={ e => this.setState({ genius_authorization: !this.state.genius_authorization })} />
|
onChange={ e => this.setState({ genius_authorization: !this.state.genius_authorization })} />
|
||||||
<span className="label">
|
<span className="label">
|
||||||
Authorization {this.props.genius_me ? '('+this.props.genius_me.name+')' : null}
|
Genius authorization <span className="grey-text"> Logged in as {this.props.genius_me.name}</span>
|
||||||
</span>
|
</span>
|
||||||
</label>
|
</label> : null}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="actions centered-text">
|
<div className="actions centered-text">
|
||||||
<button className="primary large" onClick={e => this.handleSubmit(e)}>
|
{this.state.recipients.length > 0 ? <button className="primary large" onClick={e => this.handleSubmit(e)}>Send</button> : <button className="primary large" disabled="disabled" onClick={e => this.handleSubmit(e)}>Send</button>}
|
||||||
Send
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</Modal>
|
</Modal>
|
||||||
@ -205,6 +203,7 @@ const mapStateToProps = (state, ownProps) => {
|
|||||||
genius_me: state.genius.me,
|
genius_me: state.genius.me,
|
||||||
lastfm_authorization: state.lastfm.authorization,
|
lastfm_authorization: state.lastfm.authorization,
|
||||||
lastfm_me: state.lastfm.me,
|
lastfm_me: state.lastfm.me,
|
||||||
|
snapcast_client_commands: state.snapcast.client_commands,
|
||||||
interface: state.ui,
|
interface: state.ui,
|
||||||
connection_id: state.pusher.connection_id,
|
connection_id: state.pusher.connection_id,
|
||||||
connections: state.pusher.connections
|
connections: state.pusher.connections
|
||||||
|
|||||||
@ -442,6 +442,13 @@ input[type="submit"] {
|
|||||||
position: relative;
|
position: relative;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&--block {
|
||||||
|
.label,
|
||||||
|
label {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.range {
|
&.range {
|
||||||
|
|||||||
Reference in New Issue
Block a user