Compare commits
31 Commits
2.0
...
lastversio
Author | SHA1 | Date | |
---|---|---|---|
8653740ea9 | |||
fa38043a23 | |||
fe2688d6b6 | |||
738020b16f | |||
3e89e43d6b | |||
8f52c1549a | |||
601cf636cb | |||
0d7a77a3bd | |||
d03014cd42 | |||
d5d1226f8a | |||
5d601785fd | |||
152e4f8995 | |||
d47152c7c9 | |||
634a6e2b7b | |||
1bb292d1c2 | |||
b7b6846c0e | |||
4af63ae4bd | |||
411a2785bc | |||
af6041af0c | |||
e130e2c761 | |||
5523e94cff | |||
93f793bd95 | |||
bc37d7811f | |||
733aa33b2a | |||
ca6922c84a | |||
832e81decf | |||
856db533ad | |||
df7d47d920 | |||
59eb33dc94 | |||
3d38fea6c5 | |||
8701ea5d4a |
193
README.md
193
README.md
@ -1,2 +1,193 @@
|
||||
# manager
|
||||
<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>
|
||||
|
||||
|
||||
|
||||
|
||||
-->
|
230
infoupdate.html
Normal file
230
infoupdate.html
Normal file
@ -0,0 +1,230 @@
|
||||
<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>
|
||||
|
||||
|
||||
|
||||
|
||||
-->
|
76
main.js
76
main.js
@ -3,9 +3,8 @@ const path = require("path")
|
||||
const fs = require("fs")
|
||||
const ipc = ipcMain
|
||||
const { io } = require("socket.io-client");
|
||||
const log = require("./sublog");
|
||||
const { platform } = require("os");
|
||||
|
||||
const log = require("./sub-log");
|
||||
const updater = require("./updatetools")
|
||||
|
||||
// [Function] Main Window Function
|
||||
// BUILDER "build": "
|
||||
@ -31,7 +30,14 @@ async function createWindow() {
|
||||
|
||||
})
|
||||
|
||||
if(process.env.DEV != "true") {
|
||||
|
||||
updater.checkUpdate()
|
||||
|
||||
} else {
|
||||
|
||||
log.update("Desactivation des mises a jour -> DEV MOD ENABLE")
|
||||
}
|
||||
|
||||
await win.loadFile("templates/login/login.html")
|
||||
|
||||
@ -95,7 +101,9 @@ async function createWindow() {
|
||||
|
||||
|
||||
} else {
|
||||
fs.rmSync( __dirname + path.sep + "settings.json")
|
||||
const settings = require( __dirname + path.sep + "settings.json")
|
||||
settings["token"] = null;
|
||||
fs.writeFile(__dirname + path.sep + "settings.json", JSON.stringify(settings, null, 2), () => {})
|
||||
win.webContents.send("connectFailed")
|
||||
|
||||
}
|
||||
@ -167,12 +175,16 @@ async function createWindow() {
|
||||
})
|
||||
|
||||
socket.on("successLogin", (token) => {
|
||||
const settings = {}
|
||||
|
||||
if(!fs.existsSync(__dirname + path.sep + "settings.json")) {
|
||||
|
||||
fs.writeFileSync(__dirname + path.sep + "settings.json")
|
||||
}
|
||||
|
||||
const settings = require(__dirname + path.sep + "settings.json")
|
||||
|
||||
settings["token"] = token
|
||||
|
||||
|
||||
|
||||
|
||||
fs.writeFile(__dirname + path.sep + "settings.json", JSON.stringify(settings, null, 2), (err) => {
|
||||
|
||||
log.client("Saving token in settings !")
|
||||
@ -253,6 +265,13 @@ async function createWindow() {
|
||||
|
||||
})
|
||||
|
||||
ipc.on("moveQueue", (ev, identifier) => {
|
||||
const settings = require( __dirname + path.sep + "settings.json")
|
||||
log.client("Control : Move queue Bot Requsted !")
|
||||
socket.emit("moveQueue", settings.token, identifier)
|
||||
|
||||
})
|
||||
|
||||
ipc.on("findReq", (ev, value) => {
|
||||
const settings = require( __dirname + path.sep + "settings.json")
|
||||
log.client("Control : Find search Bot Requsted !")
|
||||
@ -299,15 +318,44 @@ async function createWindow() {
|
||||
|
||||
if(fs.statSync(__dirname + path.sep + "settings.json")) {
|
||||
|
||||
fs.rmSync(__dirname + path.sep + "settings.json")
|
||||
const settings = require( __dirname + path.sep + "settings.json")
|
||||
settings["token"] = null;
|
||||
fs.writeFile(__dirname + path.sep + "settings.json", JSON.stringify(settings, null, 2), () => {})
|
||||
|
||||
}
|
||||
|
||||
|
||||
win.loadFile("template/login/login.html")
|
||||
socket.disconnect()
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
ipc.on("report", (ev, report) => {
|
||||
|
||||
const settings = require( __dirname + path.sep + "settings.json")
|
||||
log.client("Report : Envoi d'un rapport !")
|
||||
report["version"] = require("./package.json").version
|
||||
socket.emit("report", settings.token, report)
|
||||
})
|
||||
|
||||
socket.on("reportAns", (ans) => {
|
||||
|
||||
win.webContents.send("reportForm", ans)
|
||||
})
|
||||
|
||||
ipc.on("forceUpdate", () => {
|
||||
|
||||
if(process.env.DEV != "true") {
|
||||
|
||||
updater.update()
|
||||
} else {
|
||||
|
||||
log.update("ABORT : MODE DEV ENABLE")
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
if (process.defaultApp) {
|
||||
if (process.argv.length >= 2) {
|
||||
@ -328,7 +376,7 @@ async function createWindow() {
|
||||
|
||||
ipc.on("askUpdateState", () => {
|
||||
|
||||
askUpdateState()
|
||||
askUpdateState()
|
||||
})
|
||||
|
||||
async function askUpdateState() {
|
||||
@ -360,7 +408,7 @@ app.on("open-url", (ev, url) => {
|
||||
|
||||
app.whenReady().then(() => {
|
||||
|
||||
const icon = nativeImage.createFromPath('src/logo.png')
|
||||
const icon = nativeImage.createFromPath(__dirname + path.sep + 'src' + path.sep + "logo.ico")
|
||||
tray = new Tray(icon)
|
||||
|
||||
|
||||
@ -373,8 +421,10 @@ app.whenReady().then(() => {
|
||||
|
||||
//[Operation] - Check settings
|
||||
|
||||
createWindow()
|
||||
log.client("Submanager - Version : " + require("./package.json").version + " - Raphix")
|
||||
log.client("Starting Application")
|
||||
createWindow()
|
||||
|
||||
|
||||
app.on('activate', () => {
|
||||
|
||||
|
961
package-lock.json
generated
961
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
11
package.json
11
package.json
@ -1,13 +1,12 @@
|
||||
{
|
||||
"name": "subsonics-manager",
|
||||
"version": "2.0.0",
|
||||
"version": "2.3.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)'"
|
||||
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@ -17,13 +16,13 @@
|
||||
"author": "Raphix",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"decompress": "^4.2.1",
|
||||
"fs-extra": "^11.1.1",
|
||||
"socket.io-client": "^4.6.1"
|
||||
|
||||
},
|
||||
"devDependencies": {
|
||||
"electron": "^24.1.2",
|
||||
"electron-packager": "^17.1.1"
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
"dev": true
|
||||
}
|
||||
|
BIN
src/title.png
Normal file
BIN
src/title.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
BIN
src/title.png~
Normal file
BIN
src/title.png~
Normal file
Binary file not shown.
After Width: | Height: | Size: 18 KiB |
88
sub-log.js
Normal file
88
sub-log.js
Normal file
@ -0,0 +1,88 @@
|
||||
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
76
sublog.js
@ -1,76 +0,0 @@
|
||||
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)
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
.logo {
|
||||
|
||||
width: 15%;
|
||||
width: 20%;
|
||||
border-radius: 100%;
|
||||
margin-right: 5px;
|
||||
}
|
||||
@ -11,7 +11,7 @@
|
||||
padding: 5%;
|
||||
color: white;
|
||||
border-radius: 15px;
|
||||
background-color: rgb(38, 37, 37);
|
||||
background-color: #36374c;
|
||||
font-size: 12px;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
@ -20,6 +20,20 @@
|
||||
|
||||
}
|
||||
|
||||
.titlebox {
|
||||
|
||||
display: flex;
|
||||
color: white;
|
||||
border-radius: 15px;
|
||||
background-color: #36374c;
|
||||
font-size: 12px;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
|
||||
.exitNotShow {
|
||||
|
||||
display: none;
|
||||
@ -58,13 +72,17 @@
|
||||
padding: 5%;
|
||||
color: white;
|
||||
border-radius: 15px;
|
||||
background-color: rgb(38, 37, 37);
|
||||
background-color: #36374c;
|
||||
font-size: 12px;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.searchTitle {
|
||||
margin: 0;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.signout {
|
||||
|
||||
@ -154,32 +172,63 @@
|
||||
color: white;
|
||||
}
|
||||
|
||||
.bug {
|
||||
|
||||
font-family: 'Open Sans', sans-serif !important;
|
||||
background-color: transparent;
|
||||
border: solid;
|
||||
border-radius: 15px;
|
||||
padding: 2%;
|
||||
border-color: rgb(255, 46, 46);
|
||||
color: white;
|
||||
transition: all 0.2s ease 0s;
|
||||
}
|
||||
|
||||
.bug:hover {
|
||||
|
||||
|
||||
background-color: rgb(255, 46, 46);
|
||||
box-shadow: 2px 2px 5px rgb(255, 46, 46);
|
||||
}
|
||||
|
||||
.bug:active {
|
||||
|
||||
background-color: transparent;
|
||||
|
||||
}
|
||||
|
||||
.stLine {
|
||||
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
text-align: start;
|
||||
align-items: center;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.stPct {
|
||||
|
||||
text-align: center;
|
||||
text-align:end;
|
||||
padding-left: 3%;
|
||||
|
||||
}
|
||||
|
||||
|
||||
.stLine p {
|
||||
|
||||
width: 100px;
|
||||
margin: 0;
|
||||
margin-right: 2%;
|
||||
}
|
||||
|
||||
.online-light {
|
||||
|
||||
border-radius: 15%;
|
||||
background-color: rgb(55, 255, 37);
|
||||
background-color: #7a258d;
|
||||
padding: 2%;
|
||||
color: black;
|
||||
color: white;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
vertical-align: center;
|
||||
@ -201,12 +250,24 @@
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.title {
|
||||
|
||||
word-break: keep-all;
|
||||
.showPicture {
|
||||
|
||||
margin-bottom: 10px;
|
||||
width: 140px;
|
||||
height: 110px;
|
||||
}
|
||||
|
||||
|
||||
.title {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.title p {
|
||||
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
|
||||
.grised {
|
||||
|
||||
filter : invert(50%);
|
||||
@ -226,7 +287,8 @@
|
||||
}
|
||||
.bbar {
|
||||
width: 100%;
|
||||
padding: 10%;
|
||||
padding: 2%;
|
||||
padding-top: 10%;
|
||||
display: flex;
|
||||
display: flex;
|
||||
text-align: center;
|
||||
@ -293,21 +355,26 @@ input[type=range] {
|
||||
|
||||
}
|
||||
|
||||
.patchInfo {
|
||||
|
||||
padding: 5%;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.secondary {
|
||||
|
||||
background-color: #171A21;
|
||||
background-color: #7a258d;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 100%;
|
||||
font-size: 30px;
|
||||
padding: 2%;
|
||||
padding-right: 7%;
|
||||
padding-left: 7%;
|
||||
font-size: 20px;
|
||||
padding: 1%;
|
||||
padding-right: 4.5%;
|
||||
padding-left: 4.5%;
|
||||
transition: all 0.2s ease 0s;
|
||||
border: solid;
|
||||
border-width: 5px;
|
||||
border-color: #171A21 ;
|
||||
border-color: #7a258d ;
|
||||
}
|
||||
|
||||
.secondary:active {
|
||||
@ -318,13 +385,13 @@ input[type=range] {
|
||||
.primary {
|
||||
|
||||
background-color: white ;
|
||||
color: #171A21;
|
||||
color: #7a258d;
|
||||
border: none;
|
||||
border-radius: 100%;
|
||||
font-size: 35px;
|
||||
padding: 5%;
|
||||
padding-right: 10%;
|
||||
padding-left: 10%;
|
||||
font-size: 20px;
|
||||
padding: 1%;
|
||||
padding-right: 2%;
|
||||
padding-left: 2%;
|
||||
transition: all 0.2s ease 0s;
|
||||
border: solid;
|
||||
border-width: 5px;
|
||||
@ -383,14 +450,11 @@ input[type=range] {
|
||||
|
||||
}
|
||||
|
||||
#listContent {
|
||||
|
||||
padding: 5%;
|
||||
}
|
||||
|
||||
.infoVersion {
|
||||
|
||||
color: rgb(31, 30, 30);
|
||||
|
||||
color: rgb(255, 255, 255);
|
||||
text-align: center;
|
||||
font-size: 10px;
|
||||
|
||||
@ -402,7 +466,22 @@ input[type=range] {
|
||||
padding: 5%;
|
||||
color: white;
|
||||
border-radius: 15px;
|
||||
background-color: rgb(61, 61, 61);
|
||||
background-color: #464862;
|
||||
font-size: 12px;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
|
||||
}
|
||||
|
||||
.favmenu {
|
||||
|
||||
border: none;
|
||||
padding-top: 5%;
|
||||
padding-bottom: 5%;
|
||||
color: white;
|
||||
border-radius: 15px;
|
||||
background-color: #464862;
|
||||
font-size: 12px;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
@ -462,9 +541,56 @@ input[type=range] {
|
||||
margin: 0;
|
||||
vertical-align: middle;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
padding-left: 5%;
|
||||
padding-right: 5%;
|
||||
padding-top: 2%;
|
||||
padding-bottom: 2%;
|
||||
justify-content: space-between;
|
||||
transition: 0.2s;
|
||||
cursor: pointer;
|
||||
-webkit-user-select: none;
|
||||
|
||||
}
|
||||
|
||||
.ressong {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
margin: 0;
|
||||
margin-bottom: 5px;
|
||||
vertical-align: middle;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
#listDialog {
|
||||
padding: 0 !important;
|
||||
padding-bottom: 5% !important;
|
||||
}
|
||||
|
||||
#listDialog .menuheader {
|
||||
|
||||
padding: 5%;
|
||||
}
|
||||
|
||||
#listContent {
|
||||
|
||||
padding-top: 5%;
|
||||
padding-bottom: 5%;
|
||||
}
|
||||
|
||||
|
||||
.song:hover {
|
||||
|
||||
background-color: #7a258d ;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
.titleSong {
|
||||
|
||||
width: 100%;
|
||||
@ -497,4 +623,76 @@ input[type=range] {
|
||||
.cp {
|
||||
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.devversion {
|
||||
|
||||
height: 10px;
|
||||
width: 100%;
|
||||
background-color: rgb(99, 3, 3);
|
||||
color: white;
|
||||
font-size: 10px;
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
transition: 0.5s;
|
||||
|
||||
}
|
||||
|
||||
.devversion:hover {
|
||||
position: absolute;
|
||||
content: initial;
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.devversion .dp {
|
||||
|
||||
display: none;
|
||||
|
||||
}
|
||||
|
||||
.devversion:hover .dp {
|
||||
display: initial;
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
bottom: -9px;
|
||||
right: 25%;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.sendChos {
|
||||
|
||||
width: 100%;
|
||||
margin-bottom: 5px;
|
||||
margin-top: 5px;
|
||||
border-color: #1c1c1c;
|
||||
border-radius: 15px;
|
||||
border-width: 2px;
|
||||
background-color: transparent;
|
||||
color: white;
|
||||
padding: 2%;
|
||||
}
|
||||
|
||||
.sendChos option {
|
||||
|
||||
background-color:rgb(61, 61, 61);
|
||||
|
||||
}
|
||||
|
||||
.sendText {
|
||||
|
||||
margin-top: 5px;
|
||||
width: 100%;
|
||||
height: 100px;
|
||||
padding: 5%;
|
||||
border-radius: 5px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.send {
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
@ -11,21 +11,18 @@
|
||||
<body>
|
||||
<header>
|
||||
<div class="top-title">
|
||||
<h1><img class="top-logo rounded" src="../../src/logo.png" alt="Logo"> Subsonics</h1>
|
||||
<img class="top-logo rounded" src="../../src/logo.png" alt="Logo">
|
||||
<img class="top-title-image rounded" src="../../src/title.png" alt="Logo">
|
||||
</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">
|
||||
<span id="music_img"><img class="showPicture" src="../common/Mediamodifier-Design.svg"></span>
|
||||
<span id="music_title" class="title"><p>Aucun titre joué</p></span>
|
||||
<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>
|
||||
@ -34,6 +31,7 @@
|
||||
<div class="bbar">
|
||||
<button id="search" class="third"><i class="fa fa-search"></i></button>
|
||||
<button id="loop" class="third"><i class="fa fa-retweet"></i></button>
|
||||
<button id="fav" class="third"><i class="fa fa-star"></i></button>
|
||||
<span id="exitSpan" class="exit"></span>
|
||||
<button id="list" class="list third"><i class="fa fa-list-ol"><p class="number" id="listNumber"></p></i></button>
|
||||
</div>
|
||||
@ -48,12 +46,26 @@
|
||||
<span id="username"></span>
|
||||
</div>
|
||||
<div class="act">
|
||||
<button id="patchnote" class="settings"><i class="fas fa-sticky-note"></i></button>
|
||||
<button id="settings" class="settings"><i class="fas fa-gear"></i></button>
|
||||
<button id="signout" class="signout"><i class="fas fa-sign-out"></i></button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<dialog id="favDialog" class="favmenu">
|
||||
<div class="menuheader">
|
||||
<p class="listHeader"><i style="margin-right: 3px" class="fa fa-star"></i> Favoris</p>
|
||||
<div>
|
||||
<button class="buttonClose" id="favClear"><i class="fas fa-trash"></i></button>
|
||||
<button class="buttonClose" id="favClose"><i class="fas fa-times"></i></button>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div id="favContent">
|
||||
</div>
|
||||
</dialog>
|
||||
<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>
|
||||
@ -74,7 +86,7 @@
|
||||
|
||||
</div>
|
||||
<input id="searchBar" class="finder" type="text" placeholder="Nom ou lien">
|
||||
<div id="searchContent">
|
||||
<div class="searchContent" id="searchContent">
|
||||
|
||||
</div>
|
||||
</dialog>
|
||||
@ -84,21 +96,85 @@
|
||||
<button class="buttonClose" id="stClose"><i class="fas fa-times"></i></button>
|
||||
</div>
|
||||
<div class="stLine">
|
||||
<p>Volume :</p>
|
||||
<p>Volume</p>
|
||||
<input type="range" id="volCursor">
|
||||
<p class="stPct" id="volPct">0%</p>
|
||||
</div>
|
||||
<div class="stLine">
|
||||
<p>Actions :</p>
|
||||
<button id="restart" class="restart"><i class="fas fa-power-off"></i> Redémarrer</button>
|
||||
<p>Redémarrer le bot :</p>
|
||||
<button id="restart" class="bug"><i class="fas fa-power-off"></i> Redémarrer</button>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="stLine">
|
||||
<p>Bug / Suggestion :</p>
|
||||
<button id="bug" class="restart"><i class="fas fa-paper-plane"></i> Envoyer</button>
|
||||
</div>
|
||||
<div class="stLine">
|
||||
<p>Forcer la mise à jour :</p>
|
||||
<button id="upd" class="restart"><i class="fas fa-download"></i> Mettre à jour</button>
|
||||
</div>
|
||||
<div class="stLine">
|
||||
<p>Canal de mise à jour :</p>
|
||||
<div style="display: flex; flex-direction: row;">
|
||||
<div style="display: flex; flex-direction: row;">
|
||||
<input type="radio" id="cStable">
|
||||
<p style="margin-right: 20px;">Stable</p>
|
||||
</div>
|
||||
<div style="display: flex; flex-direction: row; ">
|
||||
<input type="radio" id="cDev">
|
||||
<p>Dev</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: flex; justify-content: space-between; margin-top: 50px;">
|
||||
<div class="infoVersion">
|
||||
|
||||
<p class="cp">Version <span id="version"></span></p>
|
||||
<p style="margin: 0;">Réalisé par Raphix</p>
|
||||
</div>
|
||||
<div class="online-light">
|
||||
<i style="margin-right: 2px;" class="fas fa-user-friends"></i>
|
||||
<span id="online">0</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</dialog>
|
||||
<div class="infoVersion">
|
||||
<p class="cp">Submanager - Version <span id="version"></span></p>
|
||||
<p style="margin: 0;">Fait avec 💖 par Raphix</p>
|
||||
</div>
|
||||
<dialog id="updDialog" class="menu">
|
||||
<div class="menuheader">
|
||||
<p class="listHeader"><i style="margin-right: 3px" class="fas fa-download"></i> Forcer la mise à jour</p>
|
||||
<button class="buttonClose" id="updClose"><i class="fas fa-times"></i></button>
|
||||
</div>
|
||||
<div class="updContent">
|
||||
<p style="color: yellow;"><i class="fas fa-warning"></i> Attention, forcer une mise à jour peut aider à réinstaller l'application. Avant de faire cela, demander à Raphix.</p>
|
||||
<span id="updSpan"></span>
|
||||
|
||||
</div>
|
||||
</dialog>
|
||||
<dialog id="patchDialog" class="menu">
|
||||
<div class="menuheader">
|
||||
<p class="listHeader"><i style="margin-right: 3px" class="fas fa-sticky-note"></i> Patch Note</p>
|
||||
<button class="buttonClose" id="patchClose"><i class="fas fa-times"></i></button>
|
||||
</div>
|
||||
<span class="patchInfo" id="patchInfo">
|
||||
|
||||
</span>
|
||||
</dialog>
|
||||
<dialog id="sendDialog" class="menu">
|
||||
<div class="menuheader">
|
||||
<p class="listHeader"><i style="margin-right: 3px" class="fas fa-paper-plane"></i> Bug / Suggestion</p>
|
||||
<button class="buttonClose" id="sendClose"><i class="fas fa-times"></i></button>
|
||||
</div>
|
||||
<span class="send" id="sendContent">
|
||||
<select class="sendChos" id="sendChos">
|
||||
<option>Bug</option>
|
||||
<option>Suggestion</option>
|
||||
</select>
|
||||
<textarea class="sendText" id="sendText" placeholder="Descrpition"></textarea>
|
||||
<span id="sendInfo" class="sendInfo"></span>
|
||||
<button id="sendSend" class="restart"><i class="fas fa-paper-plane"></i> Envoyez</button>
|
||||
</span>
|
||||
</dialog>
|
||||
|
||||
<span class="devversion" id="devversion"></span>
|
||||
|
||||
|
||||
<script src="../common/bundle.js"></script>
|
||||
|
@ -1,7 +1,7 @@
|
||||
const {ipcRenderer} = require("electron");
|
||||
const ipc = ipcRenderer;
|
||||
const fs = require("fs")
|
||||
const packageJson = require("../../package.json")
|
||||
const packageJson = require(__dirname.replace("templates" + require("path").sep + "app", "") + "package.json")
|
||||
|
||||
const logo = document.getElementById("logo")
|
||||
const username = document.getElementById("username")
|
||||
@ -33,10 +33,152 @@ const stDialog = document.getElementById("stDialog")
|
||||
const settings = document.getElementById("settings")
|
||||
const stClose = document.getElementById("stClose")
|
||||
|
||||
const patchDialog = document.getElementById("patchDialog")
|
||||
const patchnote = document.getElementById("patchnote")
|
||||
const patchClose = document.getElementById("patchClose")
|
||||
const patchInfo = document.getElementById("patchInfo")
|
||||
|
||||
const sendDialog = document.getElementById("sendDialog")
|
||||
const send = document.getElementById("bug")
|
||||
const sendClose = document.getElementById("sendClose")
|
||||
const sendContent = document.getElementById("sendContent")
|
||||
const sendInfo = document.getElementById("sendInfo")
|
||||
const sendSend = document.getElementById("sendSend")
|
||||
const sendText = document.getElementById("sendText")
|
||||
const sendChos = document.getElementById("sendChos")
|
||||
|
||||
|
||||
const volCursor = document.getElementById("volCursor")
|
||||
const volPct = document.getElementById("volPct")
|
||||
const restart = document.getElementById("restart")
|
||||
|
||||
const updDialog = document.getElementById("updDialog")
|
||||
const upd = document.getElementById("upd")
|
||||
const updClose = document.getElementById("updClose")
|
||||
const updSpan = document.getElementById("updSpan")
|
||||
|
||||
|
||||
const favDialog = document.getElementById("favDialog")
|
||||
const fav = document.getElementById("fav")
|
||||
const favClose = document.getElementById("favClose")
|
||||
const favClear = document.getElementById("favClear")
|
||||
const favContent = document.getElementById("favContent")
|
||||
|
||||
const cStable = document.getElementById("cStable")
|
||||
const cDev = document.getElementById("cDev")
|
||||
|
||||
|
||||
|
||||
cDev.addEventListener("change", () => {
|
||||
|
||||
const settings = getSettings()
|
||||
settings["canaldev"] = true
|
||||
saveSettings(settings)
|
||||
cStable.checked = false
|
||||
cDev.checked = true
|
||||
|
||||
|
||||
|
||||
})
|
||||
|
||||
cStable.addEventListener("change", () => {
|
||||
|
||||
const settings = getSettings()
|
||||
settings["canaldev"] = false
|
||||
saveSettings(settings)
|
||||
cDev.checked = false
|
||||
cStable.checked = true
|
||||
|
||||
|
||||
})
|
||||
|
||||
|
||||
fav.addEventListener("click", () => {
|
||||
|
||||
favDialog.showModal()
|
||||
|
||||
showFavoris()
|
||||
|
||||
})
|
||||
|
||||
favClear.addEventListener("click", () => {
|
||||
|
||||
const settings = getSettings()
|
||||
settings.favoris = []
|
||||
|
||||
saveSettings(settings)
|
||||
showFavoris()
|
||||
})
|
||||
|
||||
function showFavoris() {
|
||||
|
||||
const settings = getSettings()
|
||||
|
||||
var contentToPush = new Array()
|
||||
|
||||
for(var title of settings.favoris) {
|
||||
|
||||
contentToPush.push('<div class="song"> <img class="thumbnail" src="' + title.thumbnail + '"><div class="titleSong"> <p class="listTitle">' + title.title + '</p></div> <button style="margin : 0;" id="' + settings.favoris.indexOf(title) + '_fadd" class="buttonReduce"><i class="fa fa-plus"></i></button> <button id="' + settings.favoris.indexOf(title) + '_fdelete" class="buttonClose"><i class="fa fa-trash"></i></button> </div></div>')
|
||||
}
|
||||
|
||||
if(contentToPush.join("") == "") {
|
||||
|
||||
|
||||
favContent.innerHTML = '<p class="error">Aucun morceau dans les favoris !</p>'
|
||||
|
||||
} else {
|
||||
|
||||
favContent.innerHTML = contentToPush.join("")
|
||||
}
|
||||
|
||||
for(var title of settings.favoris) {
|
||||
|
||||
const titleBtn = document.getElementById(settings.favoris.indexOf(title) + "_fdelete")
|
||||
const addBtn = document.getElementById(settings.favoris.indexOf(title) + "_fadd")
|
||||
|
||||
addBtn.addEventListener("click", () => {
|
||||
|
||||
ipc.send("addQueue", settings.favoris[addBtn.id.replace("_fadd", "")].uri)
|
||||
favDialog.close()
|
||||
|
||||
})
|
||||
|
||||
titleBtn.addEventListener("click", () => {
|
||||
|
||||
settings.favoris.splice(titleBtn.id.replace("_fdelete", ""), 1)
|
||||
saveSettings(settings)
|
||||
showFavoris()
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
favClose.addEventListener("click", () => {
|
||||
|
||||
favDialog.close()
|
||||
})
|
||||
|
||||
|
||||
upd.addEventListener("click", () => {
|
||||
|
||||
updDialog.showModal()
|
||||
updSpan.innerHTML = ""
|
||||
setTimeout(() => {
|
||||
updSpan.innerHTML = '<button style="margin-left: 25%;" id="updYes" class="bug"><i class="fas fa-warning"></i> Mettre à jour</button>'
|
||||
const updYes = document.getElementById("updYes")
|
||||
updYes.addEventListener("click", () => {
|
||||
ipc.send("forceUpdate")
|
||||
|
||||
})
|
||||
}, 2000)
|
||||
|
||||
})
|
||||
|
||||
updClose.addEventListener("click", () => {
|
||||
|
||||
updDialog.close()
|
||||
})
|
||||
|
||||
restart.addEventListener("click", () => {
|
||||
|
||||
stDialog.close()
|
||||
@ -44,15 +186,61 @@ restart.addEventListener("click", () => {
|
||||
|
||||
})
|
||||
|
||||
if(packageJson.dev == true) {
|
||||
|
||||
document.getElementById("devversion").innerHTML = "<p class='dp'>Cette version est expérimentale.<br> En cas de bug, <a style='cursor: pointer;text-decoration: underline;' id='bugD'>cliquez ici </a> </p>"
|
||||
const sendB = document.getElementById("bugD")
|
||||
|
||||
sendB.addEventListener("click", () => {
|
||||
|
||||
|
||||
sendInfo.innerHTML = ""
|
||||
sendText.value = ""
|
||||
sendChos.value = "Bug"
|
||||
sendDialog.showModal()
|
||||
|
||||
|
||||
})
|
||||
|
||||
} else {
|
||||
document.getElementById("devversion").innerHTML = ""
|
||||
document.getElementById("devversion").classList.remove("devversion")
|
||||
}
|
||||
|
||||
var durationAll = 0
|
||||
var durationProgress = 0
|
||||
var isPlaying = false
|
||||
|
||||
|
||||
patchnote.addEventListener("click", () => {
|
||||
|
||||
patchDialog.showModal()
|
||||
const data = fs.readFileSync(__dirname + require("path").sep + "../../infoupdate.html")
|
||||
patchInfo.innerHTML = data
|
||||
|
||||
})
|
||||
|
||||
patchClose.addEventListener("click", () => {
|
||||
|
||||
patchDialog.close()
|
||||
})
|
||||
|
||||
settings.addEventListener("click", () => {
|
||||
|
||||
stDialog.showModal()
|
||||
const Csettings = getSettings()
|
||||
|
||||
if(Csettings.canaldev == true) {
|
||||
|
||||
cStable.checked = false
|
||||
cDev.checked = true
|
||||
|
||||
} else {
|
||||
|
||||
cDev.checked = false
|
||||
cStable.checked = true
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
@ -61,6 +249,52 @@ stClose.addEventListener("click", () => {
|
||||
stDialog.close()
|
||||
})
|
||||
|
||||
send.addEventListener("click", () => {
|
||||
|
||||
sendInfo.innerHTML = ""
|
||||
sendText.value = ""
|
||||
sendChos.value = "Bug"
|
||||
sendDialog.showModal()
|
||||
|
||||
})
|
||||
|
||||
sendClose.addEventListener("click", () => {
|
||||
|
||||
sendDialog.close()
|
||||
})
|
||||
|
||||
sendSend.addEventListener("click", () => {
|
||||
|
||||
sendInfo.innerHTML = ""
|
||||
|
||||
if(sendText.value == "") {
|
||||
|
||||
sendInfo.innerHTML = '<p style="text-align: center; color: red;">Le formulaire n\'a pas été rempli correctement !</p>'
|
||||
} else {
|
||||
|
||||
const report = {
|
||||
"type":sendChos.value,
|
||||
"text": sendText.value
|
||||
|
||||
}
|
||||
|
||||
ipc.send("report", report)
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
ipc.on("reportForm", (ev, ans) => {
|
||||
if(ans == true) {
|
||||
sendInfo.innerHTML = '<p style="text-align: center;">Le formulaire a été envoyé !</p>'
|
||||
|
||||
} else {
|
||||
|
||||
sendInfo.innerHTML = '<p style="text-align: center; color: red;">Erreur lors de l\'envoi du formulaire !</p>'
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
durationBar.value = 0
|
||||
listNumber.classList.add("exitNotShow")
|
||||
|
||||
@ -186,7 +420,7 @@ ipc.on("findResult", (ev, list) => {
|
||||
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>')
|
||||
contentToPush.push(' <div class="ressong"> <img class="thumbnail" src="' + title.thumbnail + '"><div class="titleSong"> <p class="searchTitle">' + title.title + '</p></div><button id="' + data.indexOf(title) + '_sfav" class="buttonFav"><i class="fa fa-star"></i></button> <button id="' + data.indexOf(title) + '_sadd" class="buttonReduce"><i class="fa fa-plus"></i></button></div>')
|
||||
}
|
||||
|
||||
if(contentToPush.join("") == "") {
|
||||
@ -202,13 +436,51 @@ ipc.on("findResult", (ev, list) => {
|
||||
|
||||
|
||||
|
||||
const titleBtn = document.getElementById(data.indexOf(title)+ "_add")
|
||||
const titleBtn = document.getElementById(data.indexOf(title)+ "_sadd")
|
||||
|
||||
const favBtn = document.getElementById(data.indexOf(title)+ "_sfav")
|
||||
|
||||
titleBtn.addEventListener("click", () => {
|
||||
searchDialog.close()
|
||||
searchcontent.innerHTML = ""
|
||||
searchBar.value = ""
|
||||
ipc.send("addQueue", data[titleBtn.id.replace("_add", "")].uri)
|
||||
ipc.send("addQueue", data[titleBtn.id.replace("_sadd", "")].uri)
|
||||
})
|
||||
|
||||
favBtn.addEventListener("click", () => {
|
||||
|
||||
const settings = getSettings()
|
||||
|
||||
if(settings.favoris == null) {
|
||||
|
||||
settings["favoris"] = []
|
||||
|
||||
|
||||
}
|
||||
|
||||
var check = false
|
||||
|
||||
for(var song of settings.favoris) {
|
||||
|
||||
|
||||
if(song.uri == data[favBtn.id.replace("_sfav", "")].uri) {
|
||||
|
||||
check = true
|
||||
}
|
||||
}
|
||||
|
||||
if(check == false) {
|
||||
|
||||
settings.favoris.push(data[favBtn.id.replace("_sfav", "")])
|
||||
} else {
|
||||
|
||||
console.log("ALREADY ADDED")
|
||||
}
|
||||
|
||||
saveSettings(settings)
|
||||
|
||||
searchDialog.close()
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
@ -221,6 +493,22 @@ ipc.on("findResult", (ev, list) => {
|
||||
|
||||
})
|
||||
|
||||
const path = require("path");
|
||||
const { off } = require("process");
|
||||
const { copySync } = require("fs-extra");
|
||||
|
||||
function getSettings() {
|
||||
|
||||
return require("../../settings.json")
|
||||
|
||||
}
|
||||
|
||||
function saveSettings(doc) {
|
||||
|
||||
fs.writeFileSync(__dirname.replace("templates" + path.sep + "app", "settings.json"), JSON.stringify(doc, null, 2))
|
||||
|
||||
}
|
||||
|
||||
list.addEventListener("click", () => {
|
||||
|
||||
listDialog.showModal()
|
||||
@ -236,6 +524,8 @@ listClose.addEventListener("click", () => {
|
||||
search.addEventListener("click", () => {
|
||||
|
||||
searchDialog.showModal()
|
||||
searchcontent.innerHTML = ""
|
||||
searchBar.value = ""
|
||||
|
||||
})
|
||||
|
||||
@ -305,12 +595,15 @@ ipc.on("actualize", (ev, data) => {
|
||||
|
||||
if(data.volume) {
|
||||
volCursor.step = 1
|
||||
volCursor.max = 100
|
||||
volCursor.max = 200
|
||||
volCursor.value = Math.trunc(data.volume / 10)
|
||||
volPct.innerHTML = Math.trunc(data.volume / 10) + "%"
|
||||
|
||||
} else {
|
||||
|
||||
volCursor.disabled = true
|
||||
volCursor.classList.add("grised")
|
||||
volCursor.value = 0
|
||||
volPct.innerHTML = "0%"
|
||||
}
|
||||
|
||||
@ -358,7 +651,7 @@ ipc.on("actualize", (ev, data) => {
|
||||
queueNum += 1
|
||||
console.log(queueNum)
|
||||
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>')
|
||||
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) + '_lmove" class="buttonReduce"><i class="fa fa-arrow-up"></i></button> <button id="' + data.queue.indexOf(title) + '_ldelete" class="buttonClose"><i class="fa fa-trash"></i></button> </div></div>')
|
||||
}
|
||||
|
||||
if(contentToPush.join("") == "") {
|
||||
@ -376,11 +669,18 @@ ipc.on("actualize", (ev, data) => {
|
||||
|
||||
console.log(data.queue.indexOf(title) + " - " + title.title)
|
||||
|
||||
const titleBtn = document.getElementById(data.queue.indexOf(title)+ "_delete")
|
||||
const titleBtn = document.getElementById(data.queue.indexOf(title)+ "_ldelete")
|
||||
const moveBtn = document.getElementById(data.queue.indexOf(title)+ "_lmove")
|
||||
|
||||
titleBtn.addEventListener("click", () => {
|
||||
|
||||
ipc.send("deleteQueue", titleBtn.id.replace("_delete", ""))
|
||||
ipc.send("deleteQueue", titleBtn.id.replace("_ldelete", ""))
|
||||
})
|
||||
|
||||
moveBtn.addEventListener("click", () => {
|
||||
|
||||
ipc.send("moveQueue", moveBtn.id.replace("_lmove", ""))
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
@ -393,12 +693,12 @@ ipc.on("actualize", (ev, data) => {
|
||||
|
||||
if(data.current == null) {
|
||||
|
||||
musicURL.innerHTML = '<img class="thumbnail" src="../common/Mediamodifier-Design.svg">'
|
||||
musicTitle.innerHTML = "Aucun titre joué"
|
||||
musicURL.innerHTML = '<img class="showPicture" src="../common/Mediamodifier-Design.svg">'
|
||||
musicTitle.innerHTML = "<p>Aucun titre joué</p>"
|
||||
} else {
|
||||
setTime()
|
||||
musicURL.innerHTML = '<img class="thumbnail" src="' + data.current.thumbnail + '">'
|
||||
musicTitle.innerHTML = data.current.title
|
||||
musicURL.innerHTML = '<img class="showPicture" src="' + data.current.thumbnail + '">'
|
||||
musicTitle.innerHTML = "<p>" + data.current.title + "</p>"
|
||||
}
|
||||
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
body {
|
||||
|
||||
background-color: #92bcea !important;
|
||||
background-color: #302144 !important;
|
||||
font-family: 'Open Sans', sans-serif !important;
|
||||
|
||||
}
|
||||
@ -19,16 +19,20 @@ body {
|
||||
width: 100%;
|
||||
padding: 5% !important;
|
||||
padding-bottom: 0% !important;
|
||||
color: white;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
|
||||
.top-logo {
|
||||
|
||||
width: 15%;
|
||||
|
||||
|
||||
margin-left: 20px;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
.buttonClose {
|
||||
|
||||
background-color: transparent;
|
||||
@ -48,6 +52,15 @@ body {
|
||||
|
||||
}
|
||||
|
||||
.top-title-image {
|
||||
|
||||
width: 80%;
|
||||
margin-top: 6px;
|
||||
margin-right: 20px;
|
||||
margin-left: 4px;
|
||||
|
||||
}
|
||||
|
||||
.buttonClose:hover {
|
||||
|
||||
color: red;
|
||||
@ -98,4 +111,34 @@ header {
|
||||
padding: 5%;
|
||||
padding-top: 0;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.buttonFav {
|
||||
|
||||
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: 0;
|
||||
outline: none;
|
||||
|
||||
|
||||
}
|
||||
|
||||
.buttonFav:hover {
|
||||
|
||||
color: rgb(242, 255, 53);
|
||||
}
|
||||
|
||||
.buttonFav:active {
|
||||
|
||||
color: rgb(255, 255, 255);
|
||||
}
|
||||
|
||||
|
BIN
templates/common/mettre-a-jour.png
Normal file
BIN
templates/common/mettre-a-jour.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 17 KiB |
@ -33,11 +33,11 @@
|
||||
text-align: center;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background-color: rgb(38, 37, 37);
|
||||
background-color: #36374c;
|
||||
padding: 10%;
|
||||
color: white;
|
||||
border-radius: 15px;
|
||||
box-shadow: 2px 2px 5px rgb(38, 37, 37) ;
|
||||
box-shadow: 2px 2px 5px #36374c ;
|
||||
-webkit-user-select: none;
|
||||
user-select: none;
|
||||
|
||||
|
@ -11,7 +11,8 @@
|
||||
<body>
|
||||
<header>
|
||||
<div class="top-title">
|
||||
<h1><img class="top-logo rounded" src="../../src/logo.png" alt="Logo"> Subsonics</h1>
|
||||
<img class="top-logo rounded" src="../../src/logo.png" alt="Logo">
|
||||
<img class="top-title-image rounded" src="../../src/title.png" alt="Logo">
|
||||
</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>
|
||||
|
87
templates/update/update.css
Normal file
87
templates/update/update.css
Normal file
@ -0,0 +1,87 @@
|
||||
|
||||
|
||||
.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;
|
||||
}
|
36
templates/update/update.html
Normal file
36
templates/update/update.html
Normal file
@ -0,0 +1,36 @@
|
||||
<!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>
|
29
templates/update/update.js
Normal file
29
templates/update/update.js
Normal file
@ -0,0 +1,29 @@
|
||||
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")
|
||||
})
|
||||
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
|
158
updatetools.js
Normal file
158
updatetools.js
Normal file
@ -0,0 +1,158 @@
|
||||
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 !")
|
||||
|
||||
if(settings.canaldev == true) {
|
||||
fetch("https://git.raphix.fr/subsonics/manager/raw/branch/main/package.json").catch(err => catchError(err)).then(resp => resp.json()).then(resp => checkUpdateProcessing(resp))
|
||||
|
||||
} else {
|
||||
|
||||
fetch("https://git.raphix.fr/subsonics/manager/raw/branch/stable/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/stable.tar.gz"
|
||||
|
||||
if(settings.canaldev == true) {
|
||||
|
||||
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")
|
||||
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user