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,7 +108,35 @@ async function createWindow() {
|
|||||||
|
|
||||||
ipc.on("retryLogin", () => {
|
ipc.on("retryLogin", () => {
|
||||||
log.client("Reconnexion au serveur ... Progressing !")
|
log.client("Reconnexion au serveur ... Progressing !")
|
||||||
|
socket.close()
|
||||||
socket.connect()
|
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", () => {
|
ipc.on("discordlogin", () => {
|
||||||
@ -128,6 +154,12 @@ async function createWindow() {
|
|||||||
log.client("Discord Auth : Erreur lors de la connexion vers Discord !")
|
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) => {
|
socket.on("authOpenLink", (link) => {
|
||||||
log.client("Discord Auth : Redirection vers le service Discord !")
|
log.client("Discord Auth : Redirection vers le service Discord !")
|
||||||
shell.openExternal(link)
|
shell.openExternal(link)
|
||||||
@ -309,7 +341,7 @@ async function createWindow() {
|
|||||||
socket.on("disconnect", async () => {
|
socket.on("disconnect", async () => {
|
||||||
await win.loadFile("templates/login/login.html")
|
await win.loadFile("templates/login/login.html")
|
||||||
await win.webContents.send("connectFailed")
|
await win.webContents.send("connectFailed")
|
||||||
socket.connect()
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "subsonics-manager",
|
"name": "subsonics-manager",
|
||||||
"version": "1.1.0",
|
"version": "2.0.0",
|
||||||
"description": "Manager for subsonics",
|
"description": "Manager for subsonics",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "electron .",
|
"start": "electron .",
|
||||||
"dev": "set DEV=true& 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": {
|
"repository": {
|
||||||
|
@ -47,7 +47,7 @@ restart.addEventListener("click", () => {
|
|||||||
var durationAll = 0
|
var durationAll = 0
|
||||||
var durationProgress = 0
|
var durationProgress = 0
|
||||||
var isPlaying = false
|
var isPlaying = false
|
||||||
var changeMusic = null
|
|
||||||
|
|
||||||
|
|
||||||
settings.addEventListener("click", () => {
|
settings.addEventListener("click", () => {
|
||||||
@ -69,7 +69,6 @@ listNumber.classList.add("exitNotShow")
|
|||||||
function setTime() {
|
function setTime() {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
durationBar.max = durationAll
|
durationBar.max = durationAll
|
||||||
durationProgress += 1000
|
durationProgress += 1000
|
||||||
durationBar.value = durationProgress
|
durationBar.value = durationProgress
|
||||||
@ -136,10 +135,7 @@ setInterval(() => {
|
|||||||
if(isPlaying == true) {
|
if(isPlaying == true) {
|
||||||
setTime()
|
setTime()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}, 1000)
|
}, 1000)
|
||||||
|
|
||||||
@ -293,12 +289,8 @@ forward.addEventListener("click" ,() => {
|
|||||||
|
|
||||||
ipc.on("actualize", (ev, data) => {
|
ipc.on("actualize", (ev, data) => {
|
||||||
|
|
||||||
|
|
||||||
isPlaying = false
|
isPlaying = false
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
console.log(data)
|
console.log(data)
|
||||||
onlineNumber.innerHTML = data.onlineNumber
|
onlineNumber.innerHTML = data.onlineNumber
|
||||||
|
|
||||||
@ -310,22 +302,7 @@ ipc.on("actualize", (ev, data) => {
|
|||||||
loop.innerHTML = '<i class="fa fa-retweet"></i>'
|
loop.innerHTML = '<i class="fa fa-retweet"></i>'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
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) {
|
if(data.volume) {
|
||||||
volCursor.step = 1
|
volCursor.step = 1
|
||||||
volCursor.max = 100
|
volCursor.max = 100
|
||||||
@ -424,13 +401,14 @@ ipc.on("actualize", (ev, data) => {
|
|||||||
musicTitle.innerHTML = data.current.title
|
musicTitle.innerHTML = data.current.title
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(data.changeMusic != changeMusic && changeMusic != null) {
|
|
||||||
|
|
||||||
changeMusic = data.changeMusic
|
durationProgress = 0
|
||||||
durationProgress = 0
|
durationAll = 0
|
||||||
setTime()
|
durationBar.value = 0
|
||||||
}
|
durationText.innerHTML = "=:==/=:=="
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(data.durationAll) {
|
if(data.durationAll) {
|
||||||
isPlaying = true
|
isPlaying = true
|
||||||
@ -443,6 +421,8 @@ ipc.on("actualize", (ev, data) => {
|
|||||||
durationBar.value = durationProgress
|
durationBar.value = durationProgress
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
|
||||||
isPlaying = false
|
isPlaying = false
|
||||||
durationAll = 0
|
durationAll = 0
|
||||||
durationProgress = 0
|
durationProgress = 0
|
||||||
@ -457,14 +437,22 @@ ipc.on("actualize", (ev, data) => {
|
|||||||
if(data.playing == 1) {
|
if(data.playing == 1) {
|
||||||
play.innerHTML = '<i style="width: 25px; height: 25px" class="fas fa-pause"></i>'
|
play.innerHTML = '<i style="width: 25px; height: 25px" class="fas fa-pause"></i>'
|
||||||
isPlaying = true
|
isPlaying = true
|
||||||
|
setTime()
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
|
||||||
play.innerHTML = '<i style="width: 25px; height: 25px" class="fas fa-play"></i>'
|
play.innerHTML = '<i style="width: 25px; height: 25px" class="fas fa-play"></i>'
|
||||||
isPlaying = false
|
isPlaying = false
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(data.current && data.playing == 0) {
|
||||||
|
setTime()
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -12,8 +12,12 @@ const minimizeBtn = document.getElementById("minimizeBtn")
|
|||||||
|
|
||||||
document.getElementById("version").innerHTML = packageJson.version
|
document.getElementById("version").innerHTML = packageJson.version
|
||||||
|
|
||||||
|
ipc.on("needRetry", () => {
|
||||||
|
|
||||||
ipc.send("retryLogin")
|
ipc.send("retryLogin")
|
||||||
|
})
|
||||||
|
|
||||||
|
ipc.send("stateOfConnection")
|
||||||
|
|
||||||
closeBtn.addEventListener("click", () => {
|
closeBtn.addEventListener("click", () => {
|
||||||
|
|
||||||
@ -30,9 +34,10 @@ minimizeBtn.addEventListener("click", () => {
|
|||||||
|
|
||||||
ipc.on("connectSuccess", () => {
|
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 discordconnect = document.getElementById("discord-connect")
|
||||||
const discorSpan = document.getElementById("discord-span")
|
const discorSpan = document.getElementById("discord-span")
|
||||||
|
const discordLogoSpan = document.getElementById("discordLogoSpan")
|
||||||
|
|
||||||
discordconnect.addEventListener("click", () => {
|
discordconnect.addEventListener("click", () => {
|
||||||
|
|
||||||
@ -45,7 +50,20 @@ ipc.on("connectSuccess", () => {
|
|||||||
discorSpan.innerHTML = '<button id="discord-connect" class="buttonTryAgain">Vérifier</button>'
|
discorSpan.innerHTML = '<button id="discord-connect" class="buttonTryAgain">Vérifier</button>'
|
||||||
const reDiscord = document.getElementById("discord-connect")
|
const reDiscord = document.getElementById("discord-connect")
|
||||||
reDiscord.addEventListener("click", () => {
|
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">'
|
discorSpan.innerHTML = '<img style="width: 5%; height: 5%;" class="loading" src="../common/spinner-third-svgrepo-com.svg">'
|
||||||
ipc.send("discordlogin")
|
ipc.send("discordlogin")
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user