2.0.0 PreRelease
This commit is contained in:
parent
112c5bbf39
commit
aeb0ba6320
38
main.js
38
main.js
@ -55,8 +55,6 @@ async function createWindow() {
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -110,9 +108,37 @@ async function createWindow() {
|
||||
|
||||
ipc.on("retryLogin", () => {
|
||||
log.client("Reconnexion au serveur ... Progressing !")
|
||||
socket.close()
|
||||
socket.connect()
|
||||
})
|
||||
|
||||
|
||||
ipc.on("stateOfConnection", () => {
|
||||
|
||||
if(socket.disconnected == true) {
|
||||
socket.connect()
|
||||
|
||||
} else {
|
||||
|
||||
if(!fs.existsSync( __dirname + path.sep + "settings.json")) {
|
||||
win.webContents.send("connectSuccess")
|
||||
} else {
|
||||
|
||||
const settings = require( __dirname + path.sep + "settings.json")
|
||||
|
||||
if(settings.token) {
|
||||
log.client("Auth : Connexion avec le Token Discord !")
|
||||
socket.emit("authByToken", settings.token)
|
||||
} else {
|
||||
|
||||
win.webContents.send("connectSuccess")
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
ipc.on("discordlogin", () => {
|
||||
|
||||
|
||||
@ -128,6 +154,12 @@ async function createWindow() {
|
||||
log.client("Discord Auth : Erreur lors de la connexion vers Discord !")
|
||||
})
|
||||
|
||||
socket.on("checkFailed", () => {
|
||||
win.webContents.send("discordCheckFailed")
|
||||
win.restore()
|
||||
log.client("Discord Auth : Erreur lors de la vérification de Discord !")
|
||||
})
|
||||
|
||||
socket.on("authOpenLink", (link) => {
|
||||
log.client("Discord Auth : Redirection vers le service Discord !")
|
||||
shell.openExternal(link)
|
||||
@ -309,7 +341,7 @@ async function createWindow() {
|
||||
socket.on("disconnect", async () => {
|
||||
await win.loadFile("templates/login/login.html")
|
||||
await win.webContents.send("connectFailed")
|
||||
socket.connect()
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "subsonics-manager",
|
||||
"version": "1.1.0",
|
||||
"version": "2.0.0",
|
||||
"description": "Manager for subsonics",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
"start": "electron .",
|
||||
"dev": "set DEV=true& electron .",
|
||||
"build": "electron-packager . submanager-app --platform='win32' --out='./dist/' --icon='./src/logo.ico' --overwrite --ignore='(settings.json)' && iscc 'C:\\Users\\picot\\OneDrive\\Bureau\\Developement\\SubSonics BOT\\manager\\dist\\compilescript.iss' "
|
||||
"build": "electron-packager . submanager-app --platform='win32' --out='./dist/' --icon='./src/logo.ico' --overwrite --ignore='(settings.json)'"
|
||||
|
||||
},
|
||||
"repository": {
|
||||
|
@ -47,7 +47,7 @@ restart.addEventListener("click", () => {
|
||||
var durationAll = 0
|
||||
var durationProgress = 0
|
||||
var isPlaying = false
|
||||
var changeMusic = null
|
||||
|
||||
|
||||
|
||||
settings.addEventListener("click", () => {
|
||||
@ -69,7 +69,6 @@ listNumber.classList.add("exitNotShow")
|
||||
function setTime() {
|
||||
|
||||
|
||||
|
||||
durationBar.max = durationAll
|
||||
durationProgress += 1000
|
||||
durationBar.value = durationProgress
|
||||
@ -138,9 +137,6 @@ setInterval(() => {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}, 1000)
|
||||
|
||||
|
||||
@ -293,12 +289,8 @@ forward.addEventListener("click" ,() => {
|
||||
|
||||
ipc.on("actualize", (ev, data) => {
|
||||
|
||||
|
||||
isPlaying = false
|
||||
|
||||
|
||||
|
||||
|
||||
console.log(data)
|
||||
onlineNumber.innerHTML = data.onlineNumber
|
||||
|
||||
@ -311,21 +303,6 @@ ipc.on("actualize", (ev, data) => {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if(data.playing == 1) {
|
||||
play.innerHTML = '<i style="width: 25px; height: 25px" class="fas fa-pause"></i>'
|
||||
isPlaying = true
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
play.innerHTML = '<i style="width: 25px; height: 25px" class="fas fa-play"></i>'
|
||||
isPlaying = false
|
||||
}
|
||||
|
||||
if(data.volume) {
|
||||
volCursor.step = 1
|
||||
volCursor.max = 100
|
||||
@ -425,12 +402,13 @@ ipc.on("actualize", (ev, data) => {
|
||||
}
|
||||
|
||||
|
||||
if(data.changeMusic != changeMusic && changeMusic != null) {
|
||||
durationProgress = 0
|
||||
durationAll = 0
|
||||
durationBar.value = 0
|
||||
durationText.innerHTML = "=:==/=:=="
|
||||
|
||||
|
||||
|
||||
changeMusic = data.changeMusic
|
||||
durationProgress = 0
|
||||
setTime()
|
||||
}
|
||||
|
||||
if(data.durationAll) {
|
||||
isPlaying = true
|
||||
@ -443,6 +421,8 @@ ipc.on("actualize", (ev, data) => {
|
||||
durationBar.value = durationProgress
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
isPlaying = false
|
||||
durationAll = 0
|
||||
durationProgress = 0
|
||||
@ -457,14 +437,22 @@ ipc.on("actualize", (ev, data) => {
|
||||
if(data.playing == 1) {
|
||||
play.innerHTML = '<i style="width: 25px; height: 25px" class="fas fa-pause"></i>'
|
||||
isPlaying = true
|
||||
|
||||
setTime()
|
||||
} else {
|
||||
|
||||
|
||||
play.innerHTML = '<i style="width: 25px; height: 25px" class="fas fa-play"></i>'
|
||||
isPlaying = false
|
||||
|
||||
}
|
||||
|
||||
if(data.current && data.playing == 0) {
|
||||
setTime()
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
})
|
||||
|
||||
|
@ -12,8 +12,12 @@ const minimizeBtn = document.getElementById("minimizeBtn")
|
||||
|
||||
document.getElementById("version").innerHTML = packageJson.version
|
||||
|
||||
ipc.on("needRetry", () => {
|
||||
|
||||
ipc.send("retryLogin")
|
||||
ipc.send("retryLogin")
|
||||
})
|
||||
|
||||
ipc.send("stateOfConnection")
|
||||
|
||||
closeBtn.addEventListener("click", () => {
|
||||
|
||||
@ -30,9 +34,10 @@ minimizeBtn.addEventListener("click", () => {
|
||||
|
||||
ipc.on("connectSuccess", () => {
|
||||
|
||||
content.innerHTML = '<div class="content"> <div class="box"> <p>Connexion vers Discord</p> <span class="loadingSpan"><img class="discord-logo" src="../common/discord-icon-svgrepo-com.svg"></span> <br> <span class="infoSpan"><p>Pour contrôler le bot, vérifie ton compte Discord !</p></span> <br> <span id="discord-span" class="actionsSpan"><button id="discord-connect" class="buttonTryAgain">Vérifier</button></span> </div> </div>'
|
||||
content.innerHTML = '<div class="content"> <div class="box"> <p>Connexion vers Discord</p> <span id="discordLogoSpan" class="loadingSpan"><img class="discord-logo" src="../common/discord-icon-svgrepo-com.svg"></span> <br> <span class="infoSpan"><p>Pour contrôler le bot, vérifie ton compte Discord !</p></span> <br> <span id="discord-span" class="actionsSpan"><button id="discord-connect" class="buttonTryAgain">Vérifier</button></span> </div> </div>'
|
||||
const discordconnect = document.getElementById("discord-connect")
|
||||
const discorSpan = document.getElementById("discord-span")
|
||||
const discordLogoSpan = document.getElementById("discordLogoSpan")
|
||||
|
||||
discordconnect.addEventListener("click", () => {
|
||||
|
||||
@ -45,7 +50,20 @@ ipc.on("connectSuccess", () => {
|
||||
discorSpan.innerHTML = '<button id="discord-connect" class="buttonTryAgain">Vérifier</button>'
|
||||
const reDiscord = document.getElementById("discord-connect")
|
||||
reDiscord.addEventListener("click", () => {
|
||||
discordLogoSpan.innerHTML = '<img class="discord-logo" src="../common/discord-icon-svgrepo-com.svg">'
|
||||
discorSpan.innerHTML = '<img style="width: 5%; height: 5%;" class="loading" src="../common/spinner-third-svgrepo-com.svg">'
|
||||
ipc.send("discordlogin")
|
||||
})
|
||||
|
||||
}),
|
||||
|
||||
ipc.on("discordCheckFailed", () => {
|
||||
|
||||
discorSpan.innerHTML = '<button id="discord-connect" class="buttonTryAgain">Vérifier</button>'
|
||||
discordLogoSpan.innerHTML = "<p style='font-size: 16px; color: red;'>Vérification échouée : Vous n'êtes pas sur le serveur de Code Luc Player ou vous n'avez pas le Code Scipio</p>"
|
||||
const reDiscord = document.getElementById("discord-connect")
|
||||
reDiscord.addEventListener("click", () => {
|
||||
discordLogoSpan.innerHTML = '<img class="discord-logo" src="../common/discord-icon-svgrepo-com.svg">'
|
||||
discorSpan.innerHTML = '<img style="width: 5%; height: 5%;" class="loading" src="../common/spinner-third-svgrepo-com.svg">'
|
||||
ipc.send("discordlogin")
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user