Version 2.1.0 - Modification graphique

This commit is contained in:
Raphael 2024-04-15 20:49:55 +02:00
parent 203af461fd
commit 9eb6f97589
12 changed files with 127 additions and 92 deletions

View File

@ -0,0 +1,22 @@
name: Subsonics Deployment
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Update and upgrade server
run: |
ssh raphix@raphix.fr sudo apt update -y
ssh raphix@raphix.fr sudo apt upgrade -y
- name: Run deployment script
run: ssh raphix@raphix.fr sudo -S -u gitlab-ci /home/gitlab-ci/subsonics_deploy.sh

20
Jenkinsfile vendored
View File

@ -1,20 +0,0 @@
pipeline {
agent any
stages {
stage('[Subsonics] - Déploiement') {
steps {
script {
echo "[Subsonics-Deploy] - Deploy Stage"
sh "ssh raphix@raphix.fr sudo apt update -y"
sh "ssh raphix@raphix.fr sudo apt upgrade -y"
sh "ssh raphix@raphix.fr sudo -S -u gitlab-ci /home/gitlab-ci/subsonics_deploy.sh"
}
}
}
}
}

View File

@ -334,7 +334,8 @@
"token": "0adeb1bf-c4a9-4d39-b40c-bc844cd50f2d", "token": "0adeb1bf-c4a9-4d39-b40c-bc844cd50f2d",
"picture": "/userspictures/172437570905571328.png", "picture": "/userspictures/172437570905571328.png",
"admin": false, "admin": false,
"banned": false "banned": false,
"oobe": true
}, },
{ {
"auth": { "auth": {
@ -482,7 +483,8 @@
"0a0b75f3-6a42-4ccf-92f9-d992a63545a4", "0a0b75f3-6a42-4ccf-92f9-d992a63545a4",
"419a246f-e7b3-4aa4-9fa0-816dffc22a19", "419a246f-e7b3-4aa4-9fa0-816dffc22a19",
"471c4c81-b8bc-42e7-af1a-d33df30cff2b", "471c4c81-b8bc-42e7-af1a-d33df30cff2b",
"b21fb001-4e6c-4530-81c4-07db0d1ef14d" "b21fb001-4e6c-4530-81c4-07db0d1ef14d",
"7cc6807b-616e-4686-bfb2-f0b65dfae896"
], ],
"picture": "/userspictures/486943594893017119.png", "picture": "/userspictures/486943594893017119.png",
"banned": false, "banned": false,

View File

@ -1,7 +1,7 @@
{ {
"name": "subsonics-web", "name": "subsonics-web",
"author": "Raphix", "author": "Raphix",
"version": "2.0.4", "version": "2.1.0",
"nodemonConfig": { "nodemonConfig": {
"ext": "js, html", "ext": "js, html",
"ignore": [ "ignore": [

View File

@ -239,6 +239,11 @@ function IOConnection(io) {
}) })
GetRequest("CALL_CONNECTED_USER", () => {
AlwaysRequest("ALL_CONNECTED_USER", usersOnline)
GetAnswer("CALL_CONNECTED_USER", "OK")
})
GetRequest('MUSIC_STATE', () => { GetRequest('MUSIC_STATE', () => {
const data = subplayer.updateMusicState() const data = subplayer.updateMusicState()

View File

@ -1,3 +1,5 @@
var actualView = null
function getID(id) { function getID(id) {
return document.getElementById(id); return document.getElementById(id);
} }

View File

@ -1,8 +1,7 @@
const userImg = getID("user-img") const userImg = getID("user-img")
const userName = getID("user-name") const userName = getID("user-name")
const userId = getID("user-id") const userId = getID("user-id")
const website_list = document.getElementById("ousers-list")
const website_list_number = document.getElementById("ousers-number")
AlwaysRequest("UPDATE_SELF", () => { AlwaysRequest("UPDATE_SELF", () => {
initUser() initUser()
@ -21,26 +20,6 @@ function initUser() {
}) })
} }
AlwaysRequest("ALL_CONNECTED_USER", (data) => {
const userToPush = new Array()
for(var user of data) {
const userC = new User({
picture: user.picture,
name: user.global_name,
id: user.username
})
userToPush.push(userC.generateHTML())
}
website_list.innerHTML = userToPush.join("")
website_list_number.innerHTML = userToPush.length
})
const modalError = new ModalComponent({ const modalError = new ModalComponent({
title: "Erreur", title: "Erreur",

View File

@ -146,7 +146,7 @@ class PlaylistComponent {
tileList.push(tile) tileList.push(tile)
playlist.addEventListener("click", () => { playlist.addEventListener("click", () => {
actualView = "playlist"
loadPlaylist(this.id, this.self) loadPlaylist(this.id, this.self)
}) })

View File

@ -1,3 +1,4 @@
function loadSettingsView(isAdmin) { function loadSettingsView(isAdmin) {
const stContent = getID("st-content") const stContent = getID("st-content")
@ -13,6 +14,7 @@ function loadSettingsView(isAdmin) {
stNodes.classList.remove("selected") stNodes.classList.remove("selected")
stLogs.classList.remove("selected") stLogs.classList.remove("selected")
loadUsersView() loadUsersView()
}) })
stNodes.addEventListener("click", () => { stNodes.addEventListener("click", () => {
@ -21,6 +23,7 @@ function loadSettingsView(isAdmin) {
stNodes.classList.add("selected") stNodes.classList.add("selected")
stLogs.classList.remove("selected") stLogs.classList.remove("selected")
loadNodesView() loadNodesView()
}) })
stLogs.addEventListener("click", () => { stLogs.addEventListener("click", () => {
@ -29,6 +32,7 @@ function loadSettingsView(isAdmin) {
stNodes.classList.remove("selected") stNodes.classList.remove("selected")
stLogs.classList.add("selected") stLogs.classList.add("selected")
loadLogsView() loadLogsView()
}) })
stReport.addEventListener("click", () => { stReport.addEventListener("click", () => {
@ -37,21 +41,24 @@ function loadSettingsView(isAdmin) {
stNodes.classList.remove("selected") stNodes.classList.remove("selected")
stLogs.classList.remove("selected") stLogs.classList.remove("selected")
loadReportView() loadReportView()
}) })
} }
loadReportView() loadReportView()
} }
function loadReportView() { function loadReportView() {
actualView = "report"
const stContent = getID("st-content") const stContent = getID("st-content")
stContent.innerHTML = ` stContent.innerHTML = `
<div class="st-contain">
<div class="st-report"> <div class="st-report">
<h1 style=" <h1 style="
align-self: start; align-self: start;
@ -72,10 +79,23 @@ function loadReportView() {
">Le tutoriel est une suite de panneaux pour vous aider à utiliser l'interface du bot. Si vous avez des difficultés à utiliser le bot, vous pouvez lancer l'OOBE pour vous aider à comprendre comment l'utiliser. Vous pouvez aussi le lancer pour le fun !</h5> ">Le tutoriel est une suite de panneaux pour vous aider à utiliser l'interface du bot. Si vous avez des difficultés à utiliser le bot, vous pouvez lancer l'OOBE pour vous aider à comprendre comment l'utiliser. Vous pouvez aussi le lancer pour le fun !</h5>
<button id='oobe-launch' class="report-send"><i class="fa-solid fa-up-right-from-square"></i> Lancer le tutoriel</button> <button id='oobe-launch' class="report-send"><i class="fa-solid fa-up-right-from-square"></i> Lancer le tutoriel</button>
<br>
<br>
<h1 style="
align-self: start;
">Utilisateurs en ligne (<span id="ousers-number"></span>)</h1>
<br>
<div id="ousers-list" class="ousers-list">
</div>
</div>
</div> </div>
` `
get("CALL_CONNECTED_USER")
const reportSend = getID("report-send") const reportSend = getID("report-send")
const oobeLaunch = getID("oobe-launch") const oobeLaunch = getID("oobe-launch")
@ -121,7 +141,7 @@ function loadReportView() {
} }
function loadUsersView() { function loadUsersView() {
actualView = "users"
const stContent = getID("st-content") const stContent = getID("st-content")
stContent.innerHTML = ` stContent.innerHTML = `
@ -161,7 +181,7 @@ function loadUsersView() {
} }
function loadNodesView() { function loadNodesView() {
actualView = "nodes"
const stContent = getID("st-content") const stContent = getID("st-content")
stContent.innerHTML = ` stContent.innerHTML = `
@ -244,7 +264,7 @@ function loadNodesView() {
} }
function loadLogsView() { function loadLogsView() {
actualView = "logs"
const stContent = getID("st-content") const stContent = getID("st-content")
stContent.innerHTML = ` stContent.innerHTML = `
@ -454,3 +474,29 @@ class UserSetting {
} }
} }
AlwaysRequest("ALL_CONNECTED_USER", (data) => {
if(actualView == "report") {
const website_list = document.getElementById("ousers-list")
const website_list_number = document.getElementById("ousers-number")
const userToPush = new Array()
for(var user of data) {
const userC = new User({
picture: user.picture,
name: user.global_name,
id: user.username
})
userToPush.push(userC.generateHTML())
}
website_list.innerHTML = userToPush.join("")
website_list_number.innerHTML = userToPush.length
}
})

View File

@ -16,6 +16,7 @@ function loadSearch() {
</div> </div>
</div> </div>
`) `)
actualView = "search"
loadSearchView() loadSearchView()
} }
@ -54,6 +55,8 @@ function loadSettings() {
} }
@ -70,6 +73,7 @@ tileList.push(settings_icon)
search_btn.addEventListener("click", () => { search_btn.addEventListener("click", () => {
loadSearch() loadSearch()
}) })
settings_btn.addEventListener("click", () => { settings_btn.addEventListener("click", () => {

View File

@ -396,7 +396,7 @@ button:hover {
padding: 20px; padding: 20px;
justify-content: space-around; justify-content: space-around;
align-items: flex-start; align-items: flex-start;
border-radius: 10px; border-radius: 5px;
background: #2F2F2F; background: #2F2F2F;
} }
@ -420,7 +420,7 @@ button:hover {
.homeselector_icon { .homeselector_icon {
border: 2px solid #ffffff; border: 2px solid #ffffff;
border-radius: 10px; border-radius: 5px;
font-size: 23px; font-size: 23px;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
@ -447,7 +447,7 @@ button:hover {
gap: 20px; gap: 20px;
flex: 1 0 0; flex: 1 0 0;
align-self: stretch; align-self: stretch;
border-radius: 10px; border-radius: 5px;
background: #2F2F2F; background: #2F2F2F;
} }
@ -520,7 +520,7 @@ button:hover {
flex: 1 0 0; flex: 1 0 0;
align-self: stretch; align-self: stretch;
padding: 20px; padding: 20px;
border-radius: 10px; border-radius: 5px;
background: rgba(217, 217, 217, 0.30); background: rgba(217, 217, 217, 0.30);
} }
@ -542,18 +542,7 @@ button:hover {
/*Online Users */ /*Online Users */
.ousers {
display: flex;
padding: 20px;
flex-direction: column;
align-items: flex-start;
gap: 10px;
align-self: stretch;
border-radius: 10px;
height: 30%;
background: rgba(217, 217, 217, 0.30);
}
.ousers-list { .ousers-list {
@ -599,7 +588,7 @@ button:hover {
flex: 1; flex: 1;
min-height: 0; min-height: 0;
align-self: stretch; align-self: stretch;
border-radius: 10px; border-radius: 5px;
background: rgba(217, 217, 217, 0.30); background: rgba(217, 217, 217, 0.30);
} }
@ -641,7 +630,7 @@ button:hover {
overflow-y: auto; overflow-y: auto;
flex: 1; flex: 1;
padding-right: 10px; padding-right: 12px;
gap: 10px; gap: 10px;
width: 100%; width: 100%;
position: relative; position: relative;
@ -1064,7 +1053,7 @@ button:hover {
.playlist-add { .playlist-add {
background-color: #545454; background-color: #545454;
padding: 5px; padding: 5px;
border-radius: 10px; border-radius: 5px;
cursor: pointer; cursor: pointer;
transition: 0.2s; transition: 0.2s;
font-size: 14px; font-size: 14px;
@ -1108,7 +1097,7 @@ button:hover {
border: 2px solid #ffffff; border: 2px solid #ffffff;
border-radius: 10px; border-radius: 5px;
font-size: 20px; font-size: 20px;
width: 56px; width: 56px;
height: 56px; height: 56px;
@ -1127,7 +1116,7 @@ button:hover {
overflow-y: auto; overflow-y: auto;
flex: 1; flex: 1;
padding-right: 10px; padding-right: 12px;
gap: 10px; gap: 10px;
width: 100%; width: 100%;
position: relative; position: relative;
@ -1152,6 +1141,8 @@ button:hover {
align-self: stretch; align-self: stretch;
flex: 1; flex: 1;
} }
.st-content { .st-content {
@ -1187,11 +1178,19 @@ button:hover {
} }
.st-contain {
position: relative;
overflow: auto;
flex: 1;
}
.st-report { .st-report {
gap: 10px; gap: 10px;
align-self: stretch; align-self: stretch;
border-radius: 10px; border-radius: 5px;
position: absolute;
@ -1454,7 +1453,7 @@ button:hover {
align-items: flex-start; align-items: flex-start;
align-self: stretch; align-self: stretch;
padding: 20px; padding: 20px;
border-radius: 10px; border-radius: 5px;
background: rgba(217, 217, 217, 0.30); background: rgba(217, 217, 217, 0.30);
width: 30%; width: 30%;
@ -1491,7 +1490,7 @@ button:hover {
align-items: flex-start; align-items: flex-start;
align-self: stretch; align-self: stretch;
padding: 20px; padding: 20px;
border-radius: 10px; border-radius: 5px;
background: #2F2F2F; background: #2F2F2F;
width: 30%; width: 30%;
} }
@ -1503,7 +1502,7 @@ button:hover {
align-items: flex-start; align-items: flex-start;
align-self: stretch; align-self: stretch;
padding: 20px; padding: 20px;
border-radius: 10px; border-radius: 5px;
background: #2F2F2F; background: #2F2F2F;
} }
@ -1551,7 +1550,7 @@ button:hover {
.oobe-search { .oobe-search {
background: #2d2d2d; background: #2d2d2d;
padding: 20px; padding: 20px;
border-radius: 10px; border-radius: 5px;
} }
@ -1607,15 +1606,20 @@ input[type="range"] {
} }
/*Scrollbar */ /*Scrollbar */
::-webkit-scrollbar { ::-webkit-scrollbar {
width: 10px; width: 5px;
margin-right: 20px; margin-right: 20px;
} }
::-webkit-scrollbar-track { ::-webkit-scrollbar-track {
border-radius: 12px; border-radius: 12px;
} }
::-webkit-scrollbar-thumb { ::-webkit-scrollbar-thumb {
background: #ffffff3f;
border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
background: #ffffffa8; background: #ffffffa8;
border-radius: 10px;
} }
@ -1626,7 +1630,7 @@ input[type="range"] {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
width: 150px; width: 150px;
border-radius: 10px; border-radius: 5px;
z-index: 3; z-index: 3;
height: auto; height: auto;
} }
@ -1676,7 +1680,7 @@ input[type="range"] {
padding: 20px; padding: 20px;
box-shadow: 4px 5px 12px 5px rgba(0,0,0,0.6); box-shadow: 4px 5px 12px 5px rgba(0,0,0,0.6);
width: 50%; width: 50%;
border-radius: 10px; border-radius: 5px;
color: #FFF; color: #FFF;
} }

View File

@ -58,16 +58,7 @@
</div> </div>
<div class="view-other"> <div class="view-other">
<div class="ousers">
<div class="wintitle">
<p>Utilisateurs en ligne (<span id="ousers-number"></span>)</p>
<i class="fa fa-users"></i>
</div>
<div id="ousers-list" class="ousers-list">
</div>
</div>
<div class="list"> <div class="list">
<div class="wintitle"> <div class="wintitle">
<p >Liste de lecture</p> <p >Liste de lecture</p>