-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
194 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/components/matches-table/components/match-row/components/match-button.component.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module.exports = { | ||
onModalPressed(event) { | ||
this.emit('show-modal', this.input.data); | ||
this.emit('show-modal', this.input.data, this.input.modal); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
...rnament/components/tournament/components/start-remote-form/start-remote-form.component.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
const io = require('../../../../../../util/socket.io-helper'); | ||
const axios = require('axios'); | ||
|
||
module.exports = { | ||
onCreate(input, out) { | ||
this.state = { | ||
match: undefined, | ||
venueId: -1, | ||
locals: out.global.kcapp | ||
} | ||
}, | ||
onMount() { | ||
$(function() { | ||
$("#start-remote-modal").on('shown.bs.modal', function(){ | ||
const matchId = $("#start-remote-modal").data('matchId'); | ||
if (matchId) { | ||
this.setMatch(matchId, true); | ||
} | ||
}.bind(this)); | ||
}.bind(this)); | ||
}, | ||
onVenueChange(event) { | ||
this.state.venueId = parseInt(event.target.value); | ||
}, | ||
setMatch(matchId, isBracket) { | ||
const match = this.input.matches[matchId]; | ||
this.state.match = match; | ||
this.state.venueId = match.venue ? match.venue.id : -1; | ||
}, | ||
startRemote(event) { | ||
const socket = io.connect(`${window.location.origin}/venue/${this.state.venueId}`); | ||
socket.on("connect", () => { | ||
const match = this.state.match; | ||
match.venue.id = this.state.venueId; | ||
|
||
axios.put(`${window.location.protocol}//${window.location.hostname}${this.state.locals.api_path}/match/${match.id}`, match) | ||
.then(response => { | ||
this.state.venues = response.data; | ||
socket.emit('start_remote', { match: match }); | ||
$("#start-remote-modal").modal('hide'); | ||
}).catch(error => { | ||
console.log('Error when updating match ' + error); | ||
alert(`Error updating match ${error}`); | ||
}); | ||
}); | ||
event.preventDefault(); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...ges/tournament/components/tournament/components/start-remote-form/start-remote-form.marko
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<div class="modal fade start-remote-modal" id=`start-remote-modal` data-matchId="-1" tabindex="-1" role="dialog" aria-labelledby=`start-remote-modal-label`> | ||
<div class="modal-dialog" role="document"> | ||
<div class="block-container-header"> | ||
<i class="fas fa-user-plus"/> | ||
<span class="ml-10">Start Remote</span> | ||
<button class="close" type="button" data-dismiss="modal" aria-label="Close"> | ||
<span aria-hidden="true">×</span> | ||
</button> | ||
</div> | ||
<div class="block-container-with-header"> | ||
<form> | ||
<select class="form-control" onChange("onVenueChange")> | ||
<for|venue| of=input.venues> | ||
<option value=venue.id selected=(venue.id === state.venueId)>${venue.name}</option> | ||
</for> | ||
</select> | ||
<button class="btn btn-primary btn-submit mt-10" type="submit" on-click("startRemote")> | ||
<i class="fas fa-user-plus"/> | ||
<span class="ml-10">Start Remote</span> | ||
</button> | ||
</form> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.