mirror of
https://github.com/moonlight-stream/moonlight-chrome.git
synced 2025-08-17 16:46:31 +00:00
Remove unpair functionality because it doesn't work on modern GFE versions
This commit is contained in:
parent
6e9de371d7
commit
da960c0be1
12
index.html
12
index.html
@ -104,16 +104,16 @@
|
|||||||
</div>
|
</div>
|
||||||
</dialog>
|
</dialog>
|
||||||
|
|
||||||
<dialog id="unpairHostDialog" class="mdl-dialog">
|
<dialog id="deleteHostDialog" class="mdl-dialog">
|
||||||
<h3 class="mdl-dialog__title">Unpair from this host?</h3>
|
<h3 class="mdl-dialog__title">Delete PC</h3>
|
||||||
<div class="mdl-dialog__content">
|
<div class="mdl-dialog__content">
|
||||||
<p id="unpairHostDialogText">
|
<p id="deleteHostDialogText">
|
||||||
Are you sure you want to unpair from this host?
|
Are you sure you want to delete this host?
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="mdl-dialog__actions">
|
<div class="mdl-dialog__actions">
|
||||||
<button type="button" class="mdl-button mdl-js-button mdl-button--raised mdl-button--colored" id="cancelUnpairHost">No</button>
|
<button type="button" class="mdl-button mdl-js-button mdl-button--raised mdl-button--colored" id="cancelDeleteHost">No</button>
|
||||||
<button type="button" class="mdl-button mdl-js-button mdl-button--raised mdl-button--colored" id="continueUnpairHost">Yes</button>
|
<button type="button" class="mdl-button mdl-js-button mdl-button--raised mdl-button--colored" id="continueDeleteHost">Yes</button>
|
||||||
</div>
|
</div>
|
||||||
</dialog>
|
</dialog>
|
||||||
|
|
||||||
|
@ -297,7 +297,7 @@ function addHostToGrid(host, ismDNSDiscovered=false) {
|
|||||||
var removalButton = $("<div>", {class: "remove-host", id: "removeHostButton-" + host.serverUid});
|
var removalButton = $("<div>", {class: "remove-host", id: "removeHostButton-" + host.serverUid});
|
||||||
removalButton.off('click');
|
removalButton.off('click');
|
||||||
removalButton.click(function () {
|
removalButton.click(function () {
|
||||||
unpairClicked(host);
|
removeClicked(host);
|
||||||
});
|
});
|
||||||
cell.off('click');
|
cell.off('click');
|
||||||
cell.click(function () {
|
cell.click(function () {
|
||||||
@ -305,41 +305,35 @@ function addHostToGrid(host, ismDNSDiscovered=false) {
|
|||||||
});
|
});
|
||||||
$(outerDiv).append(cell);
|
$(outerDiv).append(cell);
|
||||||
if (!ismDNSDiscovered) {
|
if (!ismDNSDiscovered) {
|
||||||
// we don't have the option to unpair from mDNS hosts. So don't show it to the user.
|
// we don't have the option to delete mDNS hosts. So don't show it to the user.
|
||||||
$(outerDiv).append(removalButton);
|
$(outerDiv).append(removalButton);
|
||||||
}
|
}
|
||||||
$('#host-grid').append(outerDiv);
|
$('#host-grid').append(outerDiv);
|
||||||
hosts[host.serverUid] = host;
|
hosts[host.serverUid] = host;
|
||||||
}
|
}
|
||||||
|
|
||||||
function unpairClicked(host) {
|
function removeClicked(host) {
|
||||||
var unpairHostDialog = document.querySelector('#unpairHostDialog');
|
var deleteHostDialog = document.querySelector('#deleteHostDialog');
|
||||||
document.getElementById('unpairHostDialogText').innerHTML =
|
document.getElementById('deleteHostDialogText').innerHTML =
|
||||||
' Are you sure you want like to unpair from ' + host.hostname + '?';
|
' Are you sure you want like to delete ' + host.hostname + '?';
|
||||||
unpairHostDialog.showModal();
|
deleteHostDialog.showModal();
|
||||||
|
|
||||||
$('#cancelUnpairHost').off('click');
|
$('#cancelDeleteHost').off('click');
|
||||||
$('#cancelUnpairHost').on('click', function () {
|
$('#cancelDeleteHost').on('click', function () {
|
||||||
unpairHostDialog.close();
|
deleteHostDialog.close();
|
||||||
});
|
});
|
||||||
|
|
||||||
// locally remove the hostname/ip from the saved `hosts` array.
|
// locally remove the hostname/ip from the saved `hosts` array.
|
||||||
// note: this does not make the host forget the pairing to us.
|
// note: this does not make the host forget the pairing to us.
|
||||||
// this means we can re-add the host, and will still be paired.
|
// this means we can re-add the host, and will still be paired.
|
||||||
$('#continueUnpairHost').off('click');
|
$('#continueDeleteHost').off('click');
|
||||||
$('#continueUnpairHost').on('click', function () {
|
$('#continueDeleteHost').on('click', function () {
|
||||||
host.unpair().then(function (onSuccess) {
|
var deleteHostDialog = document.querySelector('#deleteHostDialog');
|
||||||
var unpairHostDialog = document.querySelector('#unpairHostDialog');
|
$('#host-container-' + host.serverUid).remove();
|
||||||
$('#host-container-' + host.serverUid).remove();
|
delete hosts[host.serverUid]; // remove the host from the array;
|
||||||
snackbarLog('Successfully unpaired from host');
|
saveHosts();
|
||||||
delete hosts[host.serverUid]; // remove the host from the array;
|
deleteHostDialog.close();
|
||||||
saveHosts();
|
|
||||||
}, function (onFailure) {
|
|
||||||
snackbarLog('Failed to unpair from host!');
|
|
||||||
});
|
|
||||||
unpairHostDialog.close();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// puts the CSS style for current app on the app that's currently running
|
// puts the CSS style for current app on the app that's currently running
|
||||||
|
@ -465,10 +465,6 @@ NvHTTP.prototype = {
|
|||||||
}.bind(this));
|
}.bind(this));
|
||||||
},
|
},
|
||||||
|
|
||||||
unpair: function () {
|
|
||||||
return sendMessage('openUrl', [this._baseUrlHttps + '/unpair?' + this._buildUidStr(), false]);
|
|
||||||
},
|
|
||||||
|
|
||||||
_buildUidStr: function () {
|
_buildUidStr: function () {
|
||||||
return 'uniqueid=' + this.clientUid + '&uuid=' + guuid();
|
return 'uniqueid=' + this.clientUid + '&uuid=' + guuid();
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user