Compare commits

..

No commits in common. "main" and "1.0" have entirely different histories.
main ... 1.0

35 changed files with 1912 additions and 1753 deletions

193
README.md
View File

@ -1,193 +1,2 @@
<h1><u>Subsonics 2.2.7</u></h1>
<p>Sortie le : 04/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
# manager
<li><strong>[CHANGE]</strong> : Volume : Possibilité d'aller à 200%</li>
</ul>
<hr>
<h1><u>Subsonics 2.2.6</u></h1>
<p>Sortie le : 04/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[CHANGE]</strong> : Modification de certains textes</li>
<li><strong>[CHANGE]</strong> : Modification des tailles et du positionnement des éléments </li>
</ul>
<hr>
<h1><u>Subsonics 2.2.5</u></h1>
<p>Sortie le : 04/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[FIX]</strong> : Changement du titre pour toutes les fenêtres de l'application</li>
</ul>
<hr>
<h1><u>Subsonics 2.2.4</u></h1>
<p>Sortie le : 03/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[CHANGE]</strong> : Changement du titre de l'application</li>
</ul>
<hr>
<h1><u>Subsonics 2.2.3</u></h1>
<p>Sortie le : 02/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[FIX]</strong> : Update : Fix Canal</li>
</ul>
<hr>
<h1><u>Subsonics 2.2.2</u></h1>
<p>Sortie le : 02/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[FIX]</strong> : Update : Fix import settings</li>
</ul>
<hr>
<h1><u>Subsonics 2.2.1</u></h1>
<p>Sortie le : 02/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[FIX]</strong> : Update : Fix import settings</li>
</ul>
<hr>
<h1><u>Subsonics 2.2.0</u></h1>
<p>Sortie le : 02/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[AJOUT]</strong> : Update : Add Dev & Stable Canal for update.</li>
</ul>
<hr>
<h1><u>Subsonics 2.1.7</u></h1>
<p>Sortie le : 01/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[FIX]</strong> : Settings : Favoris won't be deleted on new connection</li>
<li><strong>[FIX]</strong> : Logs : Logs goes on wrong folder</li>
</ul>
<hr>
<h1><u>Subsonics 2.1.6</u></h1>
<p>Sortie le : 01/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[FIX]</strong> : Logs : Logs goes on wrong folder</li>
</ul>
<hr>
<h1><u>Subsonics 2.1.5</u></h1>
<p>Sortie le : 01/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[FIX]</strong> : Update : Second Tentative to fix Update Checker</li>
</ul>
<hr>
<h1><u>Subsonics 2.1.4</u></h1>
<p>Sortie le : 01/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[FIX]</strong> : Settings : Settings wont't be deleted after signout</li>
</ul>
<hr>
<h1><u>Subsonics 2.1.3</u></h1>
<p>Sortie le : 01/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[FIX]</strong> : Update : Update Checker</li>
</ul>
<hr>
<h1><u>Subsonics 2.1.2</u></h1>
<p>Sortie le : 01/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[AJOUT]</strong> : Favoris : Vous pouvez désormais sauvegarder plusieurs playlists de lecture.</li>
<li><strong>[FIX]</strong> : Profil : Augumentation de la taille de l'image</li>
<li><strong>[AJOUT]</strong> : Site : Création d'un site pour télécharger le logiciel. </li>
</ul>
<hr>
<h1><u>Subsonics 2.1.1</u></h1>
<p>Sortie le : 31/04/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[FIX]</strong> : Bug ou Suggestion Report : Se clear après utilisation</li>
<li><strong>[AJOUT]</strong> : Update : Ajout de l'Update forcée.</li>
</ul>
<hr>
<h1><u>Subsonics 2.1.0</u></h1>
<p>Sortie le : 30/04/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[AJOUT]</strong> : Bug ou Suggestion Report : Disponible dans les paramètres. Nouvelle onglet qui permet de soit faire une suggestion ou de reporter un bug.</li>
<li><strong>[FIX]</strong> : UserState : Enième tentative qui a l'air de marcher pour fixer le bug du token et du user inconnu ce qui empechait d'afficher le pseudo de l'utilisateur</li>
<li><strong>[AJOUT]</strong> : Liste de lecture : Déplacement des chansons dans la liste de lecture.</li>
<li><strong>[FIX]</strong> : Tray : Fix de l'icone qui ne se chargait pas.</li>
<li><strong>[CHANGE]</strong> : Dev Version : Remise en forme de la banderole pour éviter le gros bandeau rouge abusif</li>
</ul>
<hr>
<h1><u>Subsonics 2.0.9</u></h1>
<p>Sortie le : 29/04/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[FIX]</strong> : Update : Le fichier de MAJ compressé est désormais supprimé au début et à la fin de la MAJ afin d'éviter les SoftLock en cas de bugs</li>
<li><strong>[AJOUT]</strong> : Dev Version : Une banderole s'affiche lorsque la version est expérimentale.</li>
<li><strong>[AJOUT]</strong> : Logs : Disponible dans l'emplacement de l'application puis dans ./resources/app/logs/</li>
<li><strong>[AJOUT]</strong> : Patch Note : Ajout de la fonctionnalité de ce que vous lisez en ce moment.</li>
<li><strong>[CHANGE]</strong> : Graphique : Uniformisation des couleurs.</li>
</ul>
<hr>
<!--Info version Example
<hr>
<h1><u>Subsonics x.x.x</u></h1>
<p>Sortie le : --/--/----</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[AJOUT]</strong> </li>
<li><strong>[FIX]</strong> </li>
</ul>
<hr>
-->

4
electron-builder.yml Normal file
View File

@ -0,0 +1,4 @@
appId: fr.raphix.submanager
publish:
provider: gitea
token: c6ba721f1224c4b0170725495030bef9045cf42e

View File

@ -1,230 +0,0 @@
<h1><u>Subsonics 2.3.0</u></h1>
<p>Sortie le : 05/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[CHANGE]</strong> : Modification des tailles et du positionnement des éléments </li>
</ul>
<hr>
<h1><u>Subsonics 2.2.9</u></h1>
<p>Sortie le : 05/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[CHANGE]</strong> : Modification des tailles et du positionnement des éléments </li>
<li><strong>[CHANGE]</strong> : Modification des couleurs pour préparer au rework graphique. </li>
</ul>
<hr>
<h1><u>Subsonics 2.2.8</u></h1>
<p>Sortie le : 05/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[CHANGE]</strong> : Modification des tailles et du positionnement des éléments </li>
<li><strong>[CHANGE]</strong> : Modification des couleurs pour préparer au rework graphique. </li>
<li><strong>[FIX]</strong> : Volume : Se reset après déconnexion</li>
</ul>
<hr>
<h1><u>Subsonics 2.2.7</u></h1>
<p>Sortie le : 04/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[CHANGE]</strong> : Volume : Possibilité d'aller à 200%</li>
</ul>
<hr>
<h1><u>Subsonics 2.2.6</u></h1>
<p>Sortie le : 04/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[CHANGE]</strong> : Modification de certains textes</li>
<li><strong>[CHANGE]</strong> : Modification des tailles et du positionnement des éléments </li>
</ul>
<hr>
<h1><u>Subsonics 2.2.5</u></h1>
<p>Sortie le : 04/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[FIX]</strong> : Changement du titre pour toutes les fenêtres de l'application</li>
</ul>
<hr>
<h1><u>Subsonics 2.2.4</u></h1>
<p>Sortie le : 03/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[CHANGE]</strong> : Changement du titre de l'application</li>
</ul>
<hr>
<h1><u>Subsonics 2.2.3</u></h1>
<p>Sortie le : 02/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[FIX]</strong> : Update : Fix Canal</li>
</ul>
<hr>
<h1><u>Subsonics 2.2.2</u></h1>
<p>Sortie le : 02/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[FIX]</strong> : Update : Fix import settings</li>
</ul>
<hr>
<h1><u>Subsonics 2.2.1</u></h1>
<p>Sortie le : 02/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[FIX]</strong> : Update : Fix import settings</li>
</ul>
<hr>
<h1><u>Subsonics 2.2.0</u></h1>
<p>Sortie le : 02/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[AJOUT]</strong> : Update : Add Dev & Stable Canal for update.</li>
</ul>
<hr>
<h1><u>Subsonics 2.1.7</u></h1>
<p>Sortie le : 01/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[FIX]</strong> : Settings : Favoris won't be deleted on new connection</li>
<li><strong>[FIX]</strong> : Logs : Logs goes on wrong folder</li>
</ul>
<hr>
<h1><u>Subsonics 2.1.6</u></h1>
<p>Sortie le : 01/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[FIX]</strong> : Logs : Logs goes on wrong folder</li>
</ul>
<hr>
<h1><u>Subsonics 2.1.5</u></h1>
<p>Sortie le : 01/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[FIX]</strong> : Update : Second Tentative to fix Update Checker</li>
</ul>
<hr>
<h1><u>Subsonics 2.1.4</u></h1>
<p>Sortie le : 01/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[FIX]</strong> : Settings : Settings wont't be deleted after signout</li>
</ul>
<hr>
<h1><u>Subsonics 2.1.3</u></h1>
<p>Sortie le : 01/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[FIX]</strong> : Update : Update Checker</li>
</ul>
<hr>
<h1><u>Subsonics 2.1.2</u></h1>
<p>Sortie le : 01/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[AJOUT]</strong> : Favoris : Vous pouvez désormais sauvegarder plusieurs playlists de lecture.</li>
<li><strong>[FIX]</strong> : Profil : Augumentation de la taille de l'image</li>
<li><strong>[AJOUT]</strong> : Site : Création d'un site pour télécharger le logiciel. </li>
</ul>
<hr>
<h1><u>Subsonics 2.1.1</u></h1>
<p>Sortie le : 31/04/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[FIX]</strong> : Bug ou Suggestion Report : Se clear après utilisation</li>
<li><strong>[AJOUT]</strong> : Update : Ajout de l'Update forcée.</li>
</ul>
<hr>
<h1><u>Subsonics 2.1.0</u></h1>
<p>Sortie le : 30/04/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[AJOUT]</strong> : Bug ou Suggestion Report : Disponible dans les paramètres. Nouvelle onglet qui permet de soit faire une suggestion ou de reporter un bug.</li>
<li><strong>[FIX]</strong> : UserState : Enième tentative qui a l'air de marcher pour fixer le bug du token et du user inconnu ce qui empechait d'afficher le pseudo de l'utilisateur</li>
<li><strong>[AJOUT]</strong> : Liste de lecture : Déplacement des chansons dans la liste de lecture.</li>
<li><strong>[FIX]</strong> : Tray : Fix de l'icone qui ne se chargait pas.</li>
<li><strong>[CHANGE]</strong> : Dev Version : Remise en forme de la banderole pour éviter le gros bandeau rouge abusif</li>
</ul>
<hr>
<h1><u>Subsonics 2.0.9</u></h1>
<p>Sortie le : 29/04/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[FIX]</strong> : Update : Le fichier de MAJ compressé est désormais supprimé au début et à la fin de la MAJ afin d'éviter les SoftLock en cas de bugs</li>
<li><strong>[AJOUT]</strong> : Dev Version : Une banderole s'affiche lorsque la version est expérimentale.</li>
<li><strong>[AJOUT]</strong> : Logs : Disponible dans l'emplacement de l'application puis dans ./resources/app/logs/</li>
<li><strong>[AJOUT]</strong> : Patch Note : Ajout de la fonctionnalité de ce que vous lisez en ce moment.</li>
<li><strong>[CHANGE]</strong> : Graphique : Uniformisation des couleurs.</li>
</ul>
<hr>
<!--Info version Example
<hr>
<h1><u>Subsonics x.x.x</u></h1>
<p>Sortie le : --/--/----</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[AJOUT]</strong> </li>
<li><strong>[FIX]</strong> </li>
</ul>
<hr>
-->

285
main.js
View File

@ -1,57 +1,280 @@
const {app, BrowserWindow, ipcMain, Notification, nativeImage, Tray, Menu, shell} = require("electron")
const { autoUpdater } = require("electron-updater")
const path = require("path")
const fs = require("fs")
const ipc = ipcMain
const { io } = require("socket.io-client");
const log = require("./sub-log");
const updater = require("./updatetools")
const log = require("./sublog");
const { platform } = require("os");
// [Function] Main Window Function
// BUILDER "build": "
async function createWindow() {
const win = new BrowserWindow({
width: 1920,
height: 1080,
minWidth: 1280,
minHeight: 720,
resizable: true,
width: 300,
height: 500,
minWidth: 300,
minHeight: 500,
resizable: false,
movable: true,
closable: true,
frame: true,
autoHideMenuBar: true,
frame: false,
icon: path.join(__dirname, './src/logo.ico'),
title: "Submanager",
webPreferences: {
nodeIntegration: true,
contextIsolation: false,
devTools: true
}
})
if(process.env.DEV != "true") {
updater.checkUpdate()
await win.loadFile("templates/login/login.html")
const socket = io("ws://localhost:4000", {
autoConnect: false,
reconnection: false
});
socket.connect()
socket.on("connect", () => {
log.client("Connexion au serveur ... Finish !")
if(!fs.existsSync( __dirname + path.sep + "settings.json")) {
win.webContents.send("connectSuccess")
} else {
log.update("Desactivation des mises a jour -> DEV MOD ENABLE")
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")
}
await win.loadURL("https://subsonics.raphix.fr")
}
})
socket.on("authByTokenAnswer", (resp, token) => {
if(resp == true) {
win.loadFile("templates/app/app.html")
} else {
fs.rmSync( __dirname + path.sep + "settings.json")
win.webContents.send("connectSuccess")
}
})
socket.io.on("error", () => {
log.client("Erreur lors de la connexion entre le serveur et le client !")
win.webContents.send("connectFailed")
})
ipc.on("retryLogin", () => {
log.client("Reconnexion au serveur ... Progressing !")
socket.connect()
})
ipc.on("discordlogin", () => {
socket.emit("authNeedLogin")
log.client("Discord Auth : Demande du Token vers le serveur !")
win.minimize()
})
socket.on("authFailed", () => {
win.webContents.send("discordFailed")
log.client("Discord Auth : Erreur lors de la connexion vers Discord !")
})
socket.on("authOpenLink", (link) => {
log.client("Discord Auth : Redirection vers le service Discord !")
shell.openExternal(link)
})
socket.on("successLogin", () => {
log.client("Discord Auth : Redirection fait avec succes !")
win.loadFile("templates/app/app.html")
askUpdateState()
win.restore()
})
socket.on("updateState", (data) => {
log.client("State : Update en cours !")
win.webContents.send("updateData", data)
})
socket.on("actualize", (data) => {
log.client("Actualisation : Update en cours !")
win.webContents.send("actualize", data)
})
socket.on("findResult", (data) => {
log.client("Recherche : Terminé et récupéré")
win.webContents.send("findResult", data)
})
ipc.on("play", () => {
const settings = require( __dirname + path.sep + "settings.json")
log.client("Control : Play / Pause Requested !")
socket.emit("play", settings.token)
})
ipc.on("forward", () => {
const settings = require( __dirname + path.sep + "settings.json")
log.client("Control : Forward Requested !")
socket.emit("forward", settings.token)
})
ipc.on("backward", () => {
const settings = require( __dirname + path.sep + "settings.json")
log.client("Control : Backward Requsted !")
socket.emit("backward", settings.token)
})
ipc.on("exitBot", () => {
const settings = require( __dirname + path.sep + "settings.json")
log.client("Control : Exit Bot Requsted !")
socket.emit("exit", settings.token)
})
ipc.on("deleteQueue", (ev, identifier) => {
const settings = require( __dirname + path.sep + "settings.json")
log.client("Control : Delete Track queue Bot Requsted !")
socket.emit("deleteQueue", settings.token, identifier)
})
ipc.on("findReq", (ev, value) => {
const settings = require( __dirname + path.sep + "settings.json")
log.client("Control : Find search Bot Requsted !")
socket.emit("find", settings.token, value)
})
ipc.on("addQueue", (ev, url) => {
const settings = require( __dirname + path.sep + "settings.json")
log.client("Control : Add song Bot Requsted !")
socket.emit("addQueue", settings.token, url)
})
ipc.on("listClear", () => {
const settings = require( __dirname + path.sep + "settings.json")
log.client("Control : Clear Queue Bot Requsted !")
socket.emit("listClear", settings.token)
})
ipc.on("signout", () => {
if(fs.statSync(__dirname + path.sep + "settings.json")) {
fs.rmSync(__dirname + path.sep + "settings.json")
}
win.loadFile("template/login/login.html")
socket.disconnect()
})
socket.on("registerToken", (token) => {
const settings = {}
settings["token"] = token
fs.writeFileSync( __dirname + path.sep + "settings.json", JSON.stringify(settings, null, 2))
log.client("Saving token in settings !")
})
if (process.defaultApp) {
if (process.argv.length >= 2) {
app.setAsDefaultProtocolClient('submanager', process.execPath, [path.resolve(process.argv[1])])
}
} else {
app.setAsDefaultProtocolClient('submanager')
}
ipc.on("close", () => {
socket.disconnect()
app.quit()
})
ipc.on("minimize", () => {
win.minimize()
})
ipc.on("askUpdateState", () => {
askUpdateState()
})
function askUpdateState() {
const settings = require( __dirname + path.sep + "settings.json")
socket.emit("getState", settings.token)
}
socket.on("disconnect", async () => {
await win.loadFile("templates/login/login.html")
await win.webContents.send("connectFailed")
socket.connect()
});
}
function sts() {
const settings = require( __dirname + path.sep + "settings.json")
return settings
}
app.on("open-url", (ev, url) => {
app.quit()
})
})
app.whenReady().then(() => {
const icon = nativeImage.createFromPath(__dirname + path.sep + 'src' + path.sep + "logo.ico")
const icon = nativeImage.createFromPath('src/logo.png')
tray = new Tray(icon)
@ -64,10 +287,8 @@ app.whenReady().then(() => {
//[Operation] - Check settings
log.client("Submanager - Version : " + require("./package.json").version + " - Raphix")
log.client("Starting Application")
createWindow()
log.client("Starting Application")
app.on('activate', () => {
@ -85,6 +306,32 @@ app.whenReady().then(() => {
})
autoUpdater.on("update-available", (_event, releaseNotes, releaseName) => {
const dialogOpts = {
type: 'info',
buttons: ['Ok'],
title: 'Mise à jour de Submanager',
message: process.platform === 'win32' ? releaseNotes : releaseName,
detail: 'Cette version va être téléchargé automatiquement !'
}
dialog.showMessageBox(dialogOpts, (response) => {
});
})
autoUpdater.on("update-downloaded", (_event, releaseNotes, releaseName) => {
const dialogOpts = {
type: 'info',
buttons: ['Restart', 'Later'],
title: 'Mise à jour de Submanager',
message: process.platform === 'win32' ? releaseNotes : releaseName,
detail: 'Une nouvelle version a été téléchargé ! Redémarrer l\'application afin d\'effectuer les changements !'
};
dialog.showMessageBox(dialogOpts).then((returnValue) => {
if (returnValue.response === 0) autoUpdater.quitAndInstall()
})
});

1643
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,12 +1,12 @@
{
"name": "subsonics-manager",
"version": "2.4.2",
"version": "DEV 1.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)'"
"build": "electron-builder build --win --publish never",
"deploy": "electron-builder build --win --publish always"
},
"repository": {
"type": "git",
@ -16,13 +16,12 @@
"author": "Raphix",
"license": "ISC",
"dependencies": {
"decompress": "^4.2.1",
"fs-extra": "^11.1.1",
"electron": "^24.1.2",
"electron-updater": "^5.3.0",
"nodemon": "^2.0.22",
"socket.io-client": "^4.6.1"
},
"devDependencies": {
"electron": "^24.1.2",
"electron-packager": "^17.1.1"
},
"dev": true
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 204 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

View File

@ -1,88 +0,0 @@
const fs = require("fs")
const path = require("path")
const { app } = require("electron")
if(!fs.existsSync(__dirname + path.sep + "logs" + path.sep)) {
fs.mkdirSync(__dirname + path.sep + "logs")
}
var logStream = fs.createWriteStream(__dirname + path.sep + "logs" + path.sep + getDate() + ".log", {
flags: 'a'
});
logStream.write("[" + require("./package.json").name + "@" + require("./package.json").version + "] - [" + getDate() + "]" + "\n")
logStream.write("Submanager by Raphix" + "\n")
logStream.write("----------------------------------------------------------------" + "\n")
module.exports.client = (message) => {
logStream.write("[Subsonics-Client] - " + getDate() + " - " + message + "\n")
console.log("[Subsonics-Client] - " + getDate() + " - " + message)
}
module.exports.client.error = (message) => {
logStream.write("[Subsonics-Client] - [ERROR] - " + getDate() + " - " + message + "\n")
console.error("[Subsonics-Client] - [ERROR] - " + getDate() + " - " + message)
}
module.exports.update = (message) => {
logStream.write("[Subsonics-Update] - " + getDate() + " - " + message + "\n")
console.error("[Subsonics-Update] - " + getDate() + " - " + message)
}
function getDate() {
var date = new Date()
// [Date Format] - Format de la date
var gmonth = date.getMonth()
var gday = date.getDate()
var gHour = date.getHours()
var gMinute = date.getMinutes()
var gSecondes = date.getSeconds()
if(date.getMonth() + 1 <= 9) {
gmonth = "0" + (date.getMonth() + 1)
}
if(date.getDate() + 1 <= 9) {
gday = "0" + date.getDate()
}
if(date.getHours() + 1 <= 9) {
gHour = "0" + date.getHours()
}
if(date.getMinutes() + 1 <= 9) {
gMinute = "0" + date.getMinutes()
}
if(date.getSeconds() + 1 <= 9) {
gSecondes = "0" + date.getSeconds()
}
return date.getFullYear() + "-" + gmonth + "-" + gday + "-" + gHour + "h" + "-" + gMinute + "m" + "-" + gSecondes + "s"
}
process.on('uncaughtException', (err) => {
logStream.write("[" + getDate() + "] - ["+ "FATAL" + "] - [ Subsonics-Manager ]" + " The programm has encountered an error ! Please Restart ! #E = " + err + "\n")
logStream.end( "["+ "UNCAUGHT_EXCEPTION" + "]" + " - [END OF LOGS] - [" + getDate() + ']')
logStream.close()
});
app.on("before-quit", () => {
logStream.end( "["+ "NORMAL_END" + "]" + " - [END OF LOGS] - [" + getDate() + ']')
logStream.close()
})

76
sublog.js Normal file
View File

@ -0,0 +1,76 @@
module.exports.client = (message) => {
var date = new Date()
// [Date Format] - Format de la date
var gmonth = date.getMonth()
var gday = date.getDate()
var gHour = date.getHours()
var gMinute = date.getMinutes()
var gSecondes = date.getSeconds()
if(date.getMonth() + 1 <= 9) {
gmonth = "0" + (date.getMonth() + 1)
}
if(date.getDate() + 1 <= 9) {
gday = "0" + date.getDate()
}
if(date.getHours() + 1 <= 9) {
gHour = "0" + date.getHours()
}
if(date.getMinutes() + 1 <= 9) {
gMinute = "0" + date.getMinutes()
}
if(date.getSeconds() + 1 <= 9) {
gSecondes = "0" + date.getSeconds()
}
var currentDate = date.getFullYear() + "-" + gmonth + "-" + gday + "-" + gHour + "h" + "-" + gMinute + "m" + "-" + gSecondes + "s"
console.log("[Subsonics-Client] - " + currentDate + " - " + message)
}
module.exports.client.error = (message) => {
var date = new Date()
// [Date Format] - Format de la date
var gmonth = date.getMonth()
var gday = date.getDate()
var gHour = date.getHours()
var gMinute = date.getMinutes()
var gSecondes = date.getSeconds()
if(date.getMonth() + 1 <= 9) {
gmonth = "0" + (date.getMonth() + 1)
}
if(date.getDate() + 1 <= 9) {
gday = "0" + date.getDate()
}
if(date.getHours() + 1 <= 9) {
gHour = "0" + date.getHours()
}
if(date.getMinutes() + 1 <= 9) {
gMinute = "0" + date.getMinutes()
}
if(date.getSeconds() + 1 <= 9) {
gSecondes = "0" + date.getSeconds()
}
var currentDate = date.getFullYear() + "-" + gmonth + "-" + gday + "-" + gHour + "h" + "-" + gMinute + "m" + "-" + gSecondes + "s"
console.error("[Subsonics-Client] - [ERROR] - " + currentDate + " - " + message)
}

314
templates/app/app.css Normal file
View File

@ -0,0 +1,314 @@
.logo {
width: 15%;
border-radius: 100%;
margin-right: 5px;
}
.box {
display: flex;
padding: 5%;
color: white;
border-radius: 15px;
background-color: rgb(38, 37, 37);
font-size: 12px;
justify-content: space-between;
align-items: center;
margin-top: 5px;
}
.controller-box {
display: flex;
flex-direction: column;
padding: 5%;
color: white;
border-radius: 15px;
background-color: rgb(38, 37, 37);
font-size: 12px;
justify-content: space-between;
align-items: center;
margin-top: 5px;
}
.signout {
background-color: transparent;
color: red;
border: none;
transition: all 0.2s ease 0s;
height: 30px;
width: 30px;
}
.signout:hover {
border-radius: 100%;
background-color: red;
border-color: transparent;
color: white;
}
.signout:active {
background-color: transparent;
color: red;
border: none;
transition: all 0.2s ease 0s;
width: 13%;
}
.online-light {
border-radius: 15%;
background-color: rgb(55, 255, 37);
padding: 2%;
color: black;
display: flex;
align-items: center;
vertical-align: center;
margin-left: 10px;
}
.thumbnail {
width: 30px;
height: 20px;
margin-right: 10px;
}
.title {
word-break: keep-all;
}
.playbar {
width: 100%;
border: none;
row-gap: 10px;
display: flex;
text-align: center;
align-items: center;
justify-content: center;
gap: 10px;
}
.bbar {
width: 100%;
padding: 10%;
display: flex;
display: flex;
text-align: center;
align-items: center;
justify-content: space-between;
}
.secondary {
background-color: #171A21;
color: white;
border: none;
border-radius: 100%;
font-size: 30px;
padding: 2%;
padding-right: 7%;
padding-left: 7%;
transition: all 0.2s ease 0s;
border: solid;
border-width: 5px;
border-color: #171A21 ;
}
.secondary:active {
background-color: transparent;
}
.primary {
background-color: white ;
color: #171A21;
border: none;
border-radius: 100%;
font-size: 35px;
padding: 5%;
padding-right: 10%;
padding-left: 10%;
transition: all 0.2s ease 0s;
border: solid;
border-width: 5px;
border-color: white ;
}
.primary:active {
background-color: transparent;
color: white;
}
.third {
color: white;
background-color: transparent;
border: none;
border-radius: 100%;
text-shadow: 1px 1px 10px white;
font-size: 16px;
}
.third-join {
color: rgb(53, 255, 35);
background-color: transparent;
border: none;
border-radius: 100%;
text-shadow: 1px 1px 10px rgb(53, 255, 35);
font-size: 16px;
}
.third-leave {
color: rgb(255, 35, 35);
background-color: transparent;
border: none;
border-radius: 100%;
text-shadow: 1px 1px 10px rgb(255, 27, 27);
font-size: 16px;
}
.error {
color: rgb(255, 35, 35);
background-color: transparent;
border: none;
border-radius: 100%;
text-shadow: 1px 1px 5px rgb(255, 27, 27);
font-size: 12px;
text-align: center;
}
#listContent {
padding: 5%;
}
.infoVersion {
color: rgb(31, 30, 30);
text-align: center;
font-size: 13px;
}
.menu {
border: none;
padding: 5%;
color: white;
border-radius: 15px;
background-color: rgb(61, 61, 61);
font-size: 12px;
justify-content: space-between;
align-items: center;
width: 100%;
}
.listTitle {
color: white;
margin: 0;
font-size: 10px;
}
.menuheader {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
text-align: center;
}
.listHeader {
text-align: center;
margin: 0;
font-size: 16px;
text-shadow: 1px 1px 3px white;
}
/* width */
::-webkit-scrollbar {
width: 5px;
margin-right: 10px;
}
/* Track */
::-webkit-scrollbar-track {
box-shadow: inset 0 0 5px grey;
border-radius: 10px;
}
/* Handle */
::-webkit-scrollbar-thumb {
background: #171A21;
border-radius: 10px;
}
.song {
display: flex;
flex-direction: row;
margin: 0;
vertical-align: middle;
align-items: center;
justify-content: space-between;
}
.titleSong {
width: 100%;
}
.finder {
margin-top: 10px;
width: 100%;
background-color: transparent;
transition: all 0.2s ease 0s;
border: solid white 1px;
border-radius: 15px;
padding: 7px;
color: white;
padding-left: 20px;
text-decoration: none;
margin-bottom: 10px;
}
.finder:hover {
box-shadow: 1px 1px 5px white;
}

83
templates/app/app.html Normal file
View File

@ -0,0 +1,83 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Submanager - Login</title>
<link rel="stylesheet" href="../common/common.css">
<link rel="stylesheet" href="app.css">
</head>
<body>
<header>
<div class="top-title">
<h1><img class="top-logo rounded" src="../../src/logo.png" alt="Logo"> Subsonics</h1>
</div>
<button id="minimizeBtn" class="buttonReduce"><i class="fas fa-window-minimize"></i></button>
<button id="closeBtn" class="buttonClose"><i class="fas fa-times"></i></button>
</header>
<div class="content">
<div class="box">
<span id="music_img"><img class="thumbnail" src="../common/Mediamodifier-Design.svg"></span>
<span id="music_title" class="title">Aucun titre joué</span>
<div class="online-light"><i style="margin-right: 2px;" class="fas fa-user-friends"></i> <span id="online">0</span></div>
</div>
<div class="controller-box">
<div class="playbar">
<button id="backward" class="secondary"><i class="fas fa-step-backward"></i></button>
<button id="play" class="primary"><i class="fas fa-play"></i></button>
<button id="forward" class="secondary"><i class="fas fa-step-forward"></i></button>
</div>
<div class="bbar">
<button id="search" class="third"><i class="fa fa-search"></i></button>
<span id="exitSpan" class="exit"></span>
<button id="list" class="third"><i class="fa fa-list-ol"></i></button>
</div>
</div>
<div class="box">
<div>
<span id="logo"><img class="logo" src="../../src/logo.png"></span>
<span id="username"></span>
</div>
<button id="signout" class="signout"><i class="fas fa-sign-out"></i></button>
</div>
</div>
<dialog id="listDialog" class="menu">
<div class="menuheader">
<p class="listHeader"><i style="margin-right: 3px" class="fa fa-list-ol"></i> Liste de lecture</p>
<div>
<button class="buttonClose" id="listClear"><i class="fas fa-trash"></i></button>
<button class="buttonClose" id="listClose"><i class="fas fa-times"></i></button>
</div>
</div>
<div id="listContent">
</div>
</dialog>
<dialog id="searchDialog" class="menu">
<div class="menuheader">
<p class="listHeader"><i style="margin-right: 3px" class="fa fa-search"></i> Rechercher</p>
<button class="buttonClose" id="searchClose"><i class="fas fa-times"></i></button>
</div>
<input id="searchBar" class="finder" type="text" placeholder="Nom ou lien">
<div id="searchContent">
</div>
</dialog>
<div class="infoVersion">
<p >Submanager - Version <span id="version"></span></p>
<p >Fait avec 💖 par Raphix</p>
</div>
<script src="../common/bundle.js"></script>
<script src="app.js"></script>
</body>
</html>

243
templates/app/app.js Normal file
View File

@ -0,0 +1,243 @@
const {ipcRenderer} = require("electron");
const ipc = ipcRenderer;
const fs = require("fs")
const packageJson = require("../../package.json")
const logo = document.getElementById("logo")
const username = document.getElementById("username")
const signout = document.getElementById("signout")
const onlineNumber = document.getElementById("online")
const closeBtn = document.getElementById("closeBtn");
const minimizeBtn = document.getElementById("minimizeBtn");
const musicTitle = document.getElementById("music_title")
const musicURL = document.getElementById("music_img")
const exitSpan = document.getElementById("exitSpan")
const list = document.getElementById("list")
const listDialog = document.getElementById("listDialog")
const listClose = document.getElementById("listClose")
const listClear = document.getElementById("listClear")
const listcontent = document.getElementById("listContent")
const search = document.getElementById("search")
const searchBar = document.getElementById("searchBar")
const searchDialog = document.getElementById("searchDialog")
const searchClose = document.getElementById("searchClose")
const searchcontent = document.getElementById("searchContent")
listClear.addEventListener("click", () => {
ipc.send("listClear")
})
searchBar.addEventListener("change", () => {
ipc.send("findReq", searchBar.value)
})
ipc.on("findResult", (ev, list) => {
if(list.tracks != null) {
const data = list.tracks
var contentToPush = new Array()
for(var title of data) {
contentToPush.push(' <div class="song"> <img class="thumbnail" src="' + title.thumbnail + '"><div class="titleSong"> <p class="searchTitle">' + title.title + '</p></div> <button id="' + data.indexOf(title) + '_add" class="buttonReduce"><i class="fa fa-plus"></i></button> </div>')
}
if(contentToPush.join("") == "") {
searchcontent.innerHTML = '<p class="error">Aucun morceau trouvé !</p>'
} else {
searchcontent.innerHTML = contentToPush.join("")
}
for(var title of data) {
const titleBtn = document.getElementById(data.indexOf(title)+ "_add")
titleBtn.addEventListener("click", () => {
searchDialog.close()
searchcontent.innerHTML = ""
searchBar.value = ""
ipc.send("addQueue", data[titleBtn.id.replace("_add", "")].uri)
})
}
} else {
searchcontent.innerHTML = '<p class="error">Aucun morceau trouvé !</p>'
}
})
list.addEventListener("click", () => {
listDialog.showModal()
})
listClose.addEventListener("click", () => {
listDialog.close()
})
search.addEventListener("click", () => {
searchDialog.showModal()
})
searchClose.addEventListener("click", () => {
searchDialog.close()
})
const backward = document.getElementById("backward")
const play = document.getElementById("play")
const forward = document.getElementById("forward")
ipc.send("askUpdateState")
document.getElementById("version").innerHTML = packageJson.version
closeBtn.addEventListener("click", () => {
ipc.send("close");
});
minimizeBtn.addEventListener("click", () => {
ipc.send("minimize")
})
play.addEventListener("click" ,() => {
ipc.send("play")
console.log("PLAY")
})
backward.addEventListener("click" ,() => {
ipc.send("backward")
console.log("BACKWARD")
})
forward.addEventListener("click" ,() => {
ipc.send("forward")
console.log("FORWARD")
})
ipc.on("actualize", (ev, data) => {
console.log(data)
onlineNumber.innerHTML = data.onlineNumber
if(data.playing == 1) {
play.innerHTML = '<i style="width: 25px; height: 25px" class="fas fa-pause"></i>'
} else {
play.innerHTML = '<i style="width: 25px; height: 25px" class="fas fa-play"></i>'
}
if(data.isOnline == true) {
exitSpan.innerHTML = ' <button id="exit" class="third-leave"><i class="fa fa-phone-slash"></i></button>'
const exit = document.getElementById("exit")
exit.addEventListener("click", () => {
ipc.send("exitBot")
})
} else {
exitSpan.innerHTML = ""
}
if(data.queue != null) {
var contentToPush = new Array()
for(var title of data.queue) {
console.log(data.queue.indexOf(title) + " - " + title.title)
contentToPush.push(' <div class="song"> <img class="thumbnail" src="' + title.thumbnail + '"><div class="titleSong"> <p class="listTitle">' + title.title + '</p></div> <button id="' + data.queue.indexOf(title) + '_delete" class="buttonClose"><i class="fa fa-trash"></i></button> </div>')
}
if(contentToPush.join("") == "") {
listcontent.innerHTML = '<p class="error">Aucun morceau dans la liste de lecture !</p>'
} else {
listcontent.innerHTML = contentToPush.join("")
}
for(var title of data.queue) {
console.log(data.queue.indexOf(title) + " - " + title.title)
const titleBtn = document.getElementById(data.queue.indexOf(title)+ "_delete")
titleBtn.addEventListener("click", () => {
ipc.send("deleteQueue", titleBtn.id.replace("_delete", ""))
})
}
} else {
listcontent.innerHTML = '<p class="error">Aucun morceau dans la liste de lecture !</p>'
}
if(data.current == null) {
musicURL.innerHTML = '<img class="thumbnail" src="../common/Mediamodifier-Design.svg">'
musicTitle.innerHTML = "Aucun titre joué"
} else {
musicURL.innerHTML = '<img class="thumbnail" src="' + data.current.thumbnail + '">'
musicTitle.innerHTML = data.current.title
}
})
ipc.on("updateData", (ev, data) => {
username.innerHTML = data.username
logo.innerHTML = "<img class='logo' src='https://cdn.discordapp.com/avatars/" + data.id + "/" + data.avatar + ".png'>"
})
signout.addEventListener("click", () => {
ipc.send("signout")
})

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="1080" height="1080" viewBox="0 0 1080 1080" xml:space="preserve">
<desc>Created with Fabric.js 5.2.4</desc>
<defs>
</defs>
<g transform="matrix(1 0 0 1 540 540)" id="62b31009-58bd-4583-b2ee-2de1a88a2294" >
<rect style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(255,255,255); fill-rule: nonzero; opacity: 1; visibility: hidden;" vector-effect="non-scaling-stroke" x="-540" y="-540" rx="0" ry="0" width="1080" height="1080" />
</g>
<g transform="matrix(1 0 0 1 540 540)" id="35f6f108-8527-4064-90d7-62893c6938d3" >
</g>
<g transform="matrix(28.93 0 0 28.84 605.98 607.54)" id="cb89d947-dfe9-4413-8d9c-111793543295" >
<circle style="stroke: rgb(0,0,0); stroke-width: 0; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(0,0,0); fill-rule: nonzero; opacity: 1;" vector-effect="non-scaling-stroke" cx="0" cy="0" r="35" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

File diff suppressed because one or more lines are too long

101
templates/common/common.css Normal file
View File

@ -0,0 +1,101 @@
@import url('https://fonts.googleapis.com/css2?family=Open+Sans&display=swap');
body {
background-color: #92bcea !important;
font-family: 'Open Sans', sans-serif !important;
}
.top-title {
display: flex;
font-size: medium;
vertical-align: center;
justify-content: center;
-webkit-user-select: none;
-webkit-app-region: drag;
width: 100%;
padding: 5% !important;
}
.top-logo {
width: 15%;
}
.buttonClose {
background-color: transparent;
border: none;
border-radius: 15px;
cursor: pointer;
transition: all 0.3s ease 0s;
font-family: 'noto Sans', sans-serif;
font-weight: 500;
font-size: 15px;
color: white;
text-decoration: none;
-webkit-app-region: no-drag;
margin: 5px;
outline: none;
}
.buttonClose:hover {
color: red;
}
.buttonClose:active {
color: rgb(255, 255, 255);
}
.buttonReduce {
background-color: transparent;
border: none;
border-radius: 15px;
cursor: pointer;
transition: all 0.3s ease 0s;
font-family: 'noto Sans', sans-serif;
font-weight: 500;
font-size: 13px;
color: white;
text-decoration: none;
-webkit-app-region: no-drag;
margin: 5px;
outline: none;
}
.buttonReduce:hover {
color: rgb(46, 196, 255);
}
.buttonReduce:active {
color: rgb(255, 255, 255);
}
header {
display: flex;
}
.content {
padding: 5%;
}

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
<svg width="800px" height="800px" viewBox="0 -28.5 256 256" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMidYMid">
<g>
<path d="M216.856339,16.5966031 C200.285002,8.84328665 182.566144,3.2084988 164.041564,0 C161.766523,4.11318106 159.108624,9.64549908 157.276099,14.0464379 C137.583995,11.0849896 118.072967,11.0849896 98.7430163,14.0464379 C96.9108417,9.64549908 94.1925838,4.11318106 91.8971895,0 C73.3526068,3.2084988 55.6133949,8.86399117 39.0420583,16.6376612 C5.61752293,67.146514 -3.4433191,116.400813 1.08711069,164.955721 C23.2560196,181.510915 44.7403634,191.567697 65.8621325,198.148576 C71.0772151,190.971126 75.7283628,183.341335 79.7352139,175.300261 C72.104019,172.400575 64.7949724,168.822202 57.8887866,164.667963 C59.7209612,163.310589 61.5131304,161.891452 63.2445898,160.431257 C105.36741,180.133187 151.134928,180.133187 192.754523,160.431257 C194.506336,161.891452 196.298154,163.310589 198.110326,164.667963 C191.183787,168.842556 183.854737,172.420929 176.223542,175.320965 C180.230393,183.341335 184.861538,190.991831 190.096624,198.16893 C211.238746,191.588051 232.743023,181.531619 254.911949,164.955721 C260.227747,108.668201 245.831087,59.8662432 216.856339,16.5966031 Z M85.4738752,135.09489 C72.8290281,135.09489 62.4592217,123.290155 62.4592217,108.914901 C62.4592217,94.5396472 72.607595,82.7145587 85.4738752,82.7145587 C98.3405064,82.7145587 108.709962,94.5189427 108.488529,108.914901 C108.508531,123.290155 98.3405064,135.09489 85.4738752,135.09489 Z M170.525237,135.09489 C157.88039,135.09489 147.510584,123.290155 147.510584,108.914901 C147.510584,94.5396472 157.658606,82.7145587 170.525237,82.7145587 C183.391518,82.7145587 193.761324,94.5189427 193.539891,108.914901 C193.539891,123.290155 183.391518,135.09489 170.525237,135.09489 Z" fill="#5865F2" fill-rule="nonzero">
</path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
<svg width="800px" height="800px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<path fill="#ffffff" d="M12.9 3.1c1.3 1.2 2.1 3 2.1 4.9 0 3.9-3.1 7-7 7s-7-3.1-7-7c0-1.9 0.8-3.7 2.1-4.9l-0.8-0.8c-1.4 1.5-2.3 3.5-2.3 5.7 0 4.4 3.6 8 8 8s8-3.6 8-8c0-2.2-0.9-4.2-2.3-5.7l-0.8 0.8z"></path>
</svg>

After

Width:  |  Height:  |  Size: 579 B

View File

@ -5,16 +5,15 @@
border: solid;
border-radius: 15px;
padding: 2%;
border-color: rgb(46, 196, 255);
border-color: #afb3f7;
color: white;
transition: all 0.2s ease 0s;
}
.buttonTryAgain:hover {
color: black;
background-color: rgb(46, 196, 255);
box-shadow: 2px 2px 5px rgb(46, 196, 255);
background-color: #afb3f7;
box-shadow: 2px 2px 5px #afb3f7;
}
.buttonTryAgain:active {
@ -22,10 +21,6 @@
background-color: transparent;
}
.top-title {
padding: 5% !important;
}
.box {
@ -33,11 +28,11 @@
text-align: center;
display: flex;
flex-direction: column;
background-color: #36374c;
background-color: rgb(122, 147, 172);
padding: 10%;
color: white;
border-radius: 15px;
box-shadow: 2px 2px 5px #36374c ;
box-shadow: 2px 2px 5px rgb(122, 147, 172) ;
-webkit-user-select: none;
user-select: none;
@ -76,6 +71,6 @@
.infoSpan {
color: white;
color: rgb(40, 40, 40);
font-size: 12px;
}

View File

@ -11,8 +11,7 @@
<body>
<header>
<div class="top-title">
<img class="top-logo rounded" src="../../src/logo.png" alt="Logo">
<img class="top-title-image rounded" src="../../src/title.png" alt="Logo">
<h1><img class="top-logo rounded" src="../../src/logo.png" alt="Logo"> Subsonics</h1>
</div>
<button id="minimizeBtn" class="buttonReduce"><i class="fas fa-window-minimize"></i></button>
<button id="closeBtn" class="buttonClose"><i class="fas fa-times"></i></button>

View File

@ -12,12 +12,8 @@ const minimizeBtn = document.getElementById("minimizeBtn")
document.getElementById("version").innerHTML = packageJson.version
ipc.on("needRetry", () => {
ipc.send("retryLogin")
})
ipc.send("stateOfConnection")
ipc.send("retryLogin")
closeBtn.addEventListener("click", () => {
@ -34,10 +30,9 @@ minimizeBtn.addEventListener("click", () => {
ipc.on("connectSuccess", () => {
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>'
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>'
const discordconnect = document.getElementById("discord-connect")
const discorSpan = document.getElementById("discord-span")
const discordLogoSpan = document.getElementById("discordLogoSpan")
discordconnect.addEventListener("click", () => {
@ -48,25 +43,6 @@ ipc.on("connectSuccess", () => {
ipc.on("discordFailed", () => {
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")
})
})

View File

@ -1,87 +0,0 @@
.top-title {
padding: 5% !important;
}
.box {
text-align: center;
display: flex;
flex-direction: column;
background-color: #36374c;
padding: 10%;
color: white;
border-radius: 15px;
box-shadow: 2px 2px 5px #36374c ;
-webkit-user-select: none;
user-select: none;
align-items: center
}
.loading {
width: 30%;
height: 30%;
filter: invert(1)
}
.loadingRot {
-webkit-animation: rotating 1s linear infinite;
animation: rotating 1s linear infinite;
text-align: center;
;
}
.loadingSpan {
font-size: 20vw;
}
.infoSpan {
color: white;
font-size: 12px;
}
@-webkit-keyframes rotating {
from{
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
to{
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
.buttonTryAgain {
font-family: 'Open Sans', sans-serif !important;
background-color: transparent;
border: solid;
border-radius: 15px;
padding: 2%;
border-color: rgb(46, 196, 255);
color: white;
transition: all 0.2s ease 0s;
}
.buttonTryAgain:hover {
color: black;
background-color: rgb(46, 196, 255);
box-shadow: 2px 2px 5px rgb(46, 196, 255);
}
.buttonTryAgain:active {
background-color: transparent;
}

View File

@ -1,36 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Submanager - Login</title>
<link rel="stylesheet" href="../common/common.css">
<link rel="stylesheet" href="update.css">
</head>
<body>
<header>
<div class="top-title">
<img class="top-logo rounded" src="../../src/logo.png" alt="Logo">
<img class="top-title-image rounded" src="../../src/title.png" alt="Logo">
</div>
</header>
<div id="content">
<div class="content">
<div class="box">
<p>Mise à jour de l'application</p>
<span id="loadingSpan" class="loadingSpan"><img class="loading" src="../common/mettre-a-jour.png"></span>
<br>
<p id="infoSpan" class="infoSpan">Veuillez patienter pendant que l'application se met à jour !</p>
<span class="infoSpan"><p>Submanager - Version : <span id="version"></span></p></span>
<span id="load"><img style="width: 5%; height: 5%;" class="loadingRot" src="../common/spinner-third-svgrepo-com.svg"></span>
</div>
</div>
</div>
<script src="../common/bundle.js"></script>
<script src="update.js"></script>
</body>
</html>

View File

@ -1,29 +0,0 @@
const {ipcRenderer} = require("electron");
const packageJson = require("../../package.json")
const ipc = ipcRenderer;
const fs = require("fs")
const loadingSpan = document.getElementById("loadingSpan")
const infoSpan = document.getElementById("infoSpan")
const load = document.getElementById("load")
document.getElementById("version").innerHTML = packageJson.version
ipc.on("error", () => {
loadingSpan.innerHTML = "<i class='fa fa-times'></i>"
load.innerHTML = "<button style='padding: 10%;' class='buttonTryAgain' id='close'>Fermer</button>"
infoSpan.innerHTML = 'Une erreur est apparue lors de la mise à jour, fermez puis relancez !'
const close = document.getElementById("close")
close.addEventListener("click", () => {
ipc.send("close")
})
})

View File

@ -1,150 +0,0 @@
const log = require("./sub-log")
const { BrowserWindow, app, ipcMain } = require("electron")
const https = require('https');
const fs = require('fs');
const fse = require('fs-extra');
const BWin = BrowserWindow
const path = require("path")
const decompress = require('decompress');
function getSettings() {
var settings = {}
settings.canaldev = null
if(fs.existsSync(__dirname + path.sep + "settings.json")){
settings = JSON.parse(fs.readFileSync(__dirname + path.sep + "settings.json"))
}
return settings
}
module.exports.checkUpdate = () => {
var settings = getSettings()
log.update("Verification des mises a jour ... Processing !")
fetch("https://git.raphix.fr/subsonics/manager/raw/branch/main/package.json").catch(err => catchError(err)).then(resp => resp.json()).then(resp => checkUpdateProcessing(resp))
}
function checkUpdateProcessing(serverPackage) {
const clientPackage = require("./package")
if(serverPackage.version.replace(".", "") > clientPackage.version.replace(".", "")) {
log.update("Verification des mises a jour ... Finish !")
log.update("Mise a jour disponible ! Nouvelle version : " + serverPackage.version + " - Client : " + clientPackage.version + " - Git : " + serverPackage.version)
selfUpdate()
} else {
log.update("Verification des mises a jour ... Finish !")
log.update("Cette version est la derniere version ! - Client : " + clientPackage.version + " - Git : " + serverPackage.version)
}
}
function selfUpdate() {
var settings = getSettings()
const win = BWin.getFocusedWindow()
var link = "https://git.raphix.fr/subsonics/manager/archive/main.tar.gz"
win.loadFile("templates/update/update.html")
ipcMain.on("close", () => {
app.quit()
})
log.update("Telechargement de la mise a jour ... Processing !")
if(fs.existsSync(__dirname + path.sep + "update.tar.gz")) {
fs.rmSync(__dirname + path.sep + "update.tar.gz")
}
const updatePack = fs.createWriteStream(__dirname + path.sep + "update.tar.gz");
const request = https.get(link, function(response) {
response.pipe(updatePack);
// after download completed close filestream
updatePack.on("finish", () => {
updatePack.close();
log.update("Telechargement de la mise a jour ... Finish !")
install(__dirname + path.sep + "update.tar.gz")
});
updatePack.on("error", (err) => {
log.update("Erreur lors du telechargement de la mise a jour !")
updatePack.close();
console.log(err)
})
});
}
module.exports.update = () => {
selfUpdate()
}
function install(filename) {
log.update("Extraction de la mise a jour ... Processing !")
decompress(filename, __dirname).then(files => {
log.update("Extraction de la mise a jour ... Finish !")
log.update("Installation de la mise a jour ... Processing !")
fse.copy(__dirname + path.sep + "manager", __dirname, { overwrite: true }, () => {
fs.rm(filename, () => {
fs.rm(__dirname + path.sep + "manager", { recursive: true, force: true }, (err) => {
if(err) {
console.log(err)
}
log.update("Installation de la mise a jour ... Finish !")
log.update("Redemarrage de l'application.")
app.relaunch()
app.exit()
})
})
})
}).catch(err => catchError(err, true));
}
function catchError(err, inUp) {
log.update("Erreur lors de la verification des mises a jour !")
log.update(err)
if(inUp == true) {
win.webContents.send("error")
}
}