Added in-app login

This commit is contained in:
RemixDev 2020-08-12 16:32:58 +02:00
parent 77b202d88e
commit a32ba2e455
3 changed files with 17 additions and 4 deletions

File diff suppressed because one or more lines are too long

View File

@ -33,6 +33,7 @@ function initClient() {
window.clientMode = true
document.querySelector(`#open_downloads_folder`).classList.remove('hide')
document.querySelector(`#select_downloads_folder`).classList.remove('hide')
document.querySelector(`#settings_btn_applogin`).classList.remove('hide')
}
document.addEventListener('DOMContentLoaded', startApp)

View File

@ -26,6 +26,9 @@
<a href="https://codeberg.org/RemixDev/deemix/wiki/Getting-your-own-ARL" target="_blank">
{{ $t('settings.login.arl.question') }}
</a>
<a id="settings_btn_applogin" class="hide" href="#" @click="applogin">
Automated login
</a>
<button id="settings_btn_updateArl" @click="login" style="width: 100%;">
{{ $t('settings.login.arl.update') }}
</button>
@ -678,6 +681,7 @@ export default {
socket.on('accountChanged', this.accountChanged)
socket.on('familyAccounts', this.initAccounts)
socket.on('downloadFolderSelected', this.downloadFolderSelected)
socket.on('applogin_arl', this.setArl)
},
methods: {
revertSettings() {
@ -742,6 +746,14 @@ export default {
socket.emit('login', arl, true, this.accountNum)
}
},
applogin(e) {
e.preventDefault()
if (window.clientMode) socket.emit('applogin')
},
setArl(arl) {
this.$refs.loginInput.value = arl
this.login()
},
changeAccount() {
socket.emit('changeAccount', this.accountNum)
},