Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
Amadeus
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Wiki
Wiki externe
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Déploiement
Releases
Registre de paquets
Registre de conteneur
Registre de modèles
Opération
Environnements
Modules Terraform
Surveillance
Incidents
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
Données d'analyse CI/CD
Données d'analyse du dépôt
Expériences du modèle
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
bakaclub
Amadeus
Validations
ae9a8010
Vérifiée
Valider
ae9a8010
rédigé
4 years ago
par
Kubat
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
INSTANCE: Fixing the interface, for the moment
parent
3238dc44
Aucune branche associée trouvée
Aucune étiquette associée trouvée
2 requêtes de fusion
!3
Dev kubat
,
!2
Base interface and system
Modifications
4
Masquer les modifications d'espaces
En ligne
Côte à côte
Affichage de
4 fichiers modifiés
common/db.js
+50
-0
50 ajouts, 0 suppression
common/db.js
instance/main.js
+35
-6
35 ajouts, 6 suppressions
instance/main.js
main.js
+9
-1
9 ajouts, 1 suppression
main.js
style/css/instance.css
+8
-12
8 ajouts, 12 suppressions
style/css/instance.css
avec
102 ajouts
et
19 suppressions
common/db.js
+
50
−
0
Voir le fichier @
ae9a8010
...
@@ -25,6 +25,17 @@ var sqlite3 = require.main.require('sqlite3').verbose();
...
@@ -25,6 +25,17 @@ var sqlite3 = require.main.require('sqlite3').verbose();
* </code>
* </code>
*/
*/
/* The queue table is defined as follows:
*
* <code>
* CREATE TABLE IF NOT EXISTS queue
* ( position INTEGER PRIMARY KEY AUTOINCREMENT CHECK(position > 0)
* , kara_id INTEGER REFERENCES kara
* , priority INTEGER NOT NULL DEFAULT 1 CHECK(priority > 0 AND priority < 6)
* );
* </code>
*/
class
KaraDatabase
{
class
KaraDatabase
{
/* The constructor
/* The constructor
...
@@ -102,6 +113,45 @@ class KaraDatabase {
...
@@ -102,6 +113,45 @@ class KaraDatabase {
return
__getRecords
(
this
.
m_db
);
return
__getRecords
(
this
.
m_db
);
}
}
/* List all the next karas in the queue.
* - first: Integer => the first kara to consider being in the queue (the
* current one, starts ad 0)
* - count: Integer => the number of karas of the queue to load.
* => a promize, callback with [(id: Int, string, cat, type, language,
* author, title, source, position: Int)] */
queue
(
first
,
count
)
{
var
__ret
=
[];
let
__sqlQuery
=
`WITH content AS (
SELECT kara.id AS id, string,
category AS cat,
(song_type || song_number) AS type,
language, author_name AS author,
song_name AS title, source_name AS source,
position
FROM queue
JOIN kara ON kara_id = kara.id
WHERE position >=
${
first
}
AND position <=
${
count
+
first
}
GROUP BY position ORDER BY position ASC, priority DESC)
SELECT id, string, position, cat, type, language, author, source, title
FROM content;`
function
__getRecords
(
db
)
{
return
new
Promise
(
resolv
=>
{
db
.
all
(
__sqlQuery
,
[],
(
err
,
rows
)
=>
{
if
(
err
)
{
logger
.
error
(
err
);
throw
err
;
}
rows
.
forEach
((
row
)
=>
{
__ret
.
push
(
row
);
});
resolv
(
__ret
);
});
});
};
return
__getRecords
(
this
.
m_db
);
}
}
}
module
.
exports
=
KaraDatabase
;
module
.
exports
=
KaraDatabase
;
Ce diff est replié.
Cliquez pour l'agrandir.
instance/main.js
+
35
−
6
Voir le fichier @
ae9a8010
...
@@ -9,6 +9,7 @@ const buttonList = [
...
@@ -9,6 +9,7 @@ const buttonList = [
[
"
sleft
"
,
`<i class="fas fa-database"></i>`
,
"
selectDatabase
"
,
"
Database search
"
],
[
"
sleft
"
,
`<i class="fas fa-database"></i>`
,
"
selectDatabase
"
,
"
Database search
"
],
[
"
sleft
"
,
`<i class="fas fa-list"></i>`
,
"
selectPlaylist
"
,
"
Playlist search
"
],
[
"
sleft
"
,
`<i class="fas fa-list"></i>`
,
"
selectPlaylist
"
,
"
Playlist search
"
],
[
"
sleft
"
,
`<i class="fas fa-bookmark"></i>`
,
"
selectPool
"
,
"
Pool search
"
],
[
"
sleft
"
,
`<i class="fas fa-bookmark"></i>`
,
"
selectPool
"
,
"
Pool search
"
],
[
"
right
"
,
`<i class="fas fa-sync-alt"></i>`
,
"
reloadQueue
"
,
"
Reload the queue
"
],
[
"
right
"
,
`<i class="fas fa-window-close"></i>`
,
"
closeButton
"
,
"
Quit Lektor-App
"
],
[
"
right
"
,
`<i class="fas fa-window-close"></i>`
,
"
closeButton
"
,
"
Quit Lektor-App
"
],
];
];
...
@@ -27,7 +28,11 @@ window.onload = () => {
...
@@ -27,7 +28,11 @@ window.onload = () => {
ipcRenderer
.
send
(
"
cmd-stop
"
,
null
);
ipcRenderer
.
send
(
"
cmd-stop
"
,
null
);
});
});
document
.
getElementById
(
"
reloadDb
"
).
addEventListener
(
"
click
"
,
()
=>
{
document
.
getElementById
(
"
reloadDb
"
).
addEventListener
(
"
click
"
,
()
=>
{
ipcRenderer
.
send
(
"
reload-db-request
"
,
document
.
getElementById
(
"
buttonPanelListLeft
"
).
innerHTML
);
ipcRenderer
.
send
(
"
reload-db-request
"
,
null
);
ipcRenderer
.
send
(
"
reload-queue-request
"
,
null
);
});
document
.
getElementById
(
"
reloadQueue
"
).
addEventListener
(
"
click
"
,
()
=>
{
ipcRenderer
.
send
(
"
reload-queue-request
"
,
null
);
});
});
logger
.
debug
(
"
Window loaded
"
);
logger
.
debug
(
"
Window loaded
"
);
...
@@ -66,18 +71,19 @@ function createButtonList(list) {
...
@@ -66,18 +71,19 @@ function createButtonList(list) {
${
renderHtmlRight
}
`
;
${
renderHtmlRight
}
`
;
}
}
/* Create the left panel */
ipcRenderer
.
on
(
"
reload-db-responce
"
,
(
event
,
arg
)
=>
{
ipcRenderer
.
on
(
"
reload-db-responce
"
,
(
event
,
arg
)
=>
{
var
karaList
=
""
;
var
karaList
=
""
;
logger
.
debug
(
`Web page got reload-db`
);
logger
.
debug
(
`Web page got reload-db`
);
arg
.
forEach
(
kara
=>
{
arg
.
forEach
(
kara
=>
{
karaList
+=
karaList
+=
`<div class="card p-2 bd-highlight shadow-none d-flex flex-row bd-highlight mb-3 border border-info karaCard">
`<div class="card p-2 bd-highlight shadow-none d-flex flex-row bd-highlight mb-3 border border-info karaCard">
<span class="karaElement text-uppercase p-2 bd-highlight badge badge-
success
"><b>
${
kara
.
language
}
</b></span>
<span class="karaElement text-uppercase p-2 bd-highlight badge badge-
light
"><b>
${
kara
.
language
}
</b></span>
<span class="karaElement text-uppercase p-2 bd-highlight badge badge-light"><b>
${
kara
.
cat
}
</b></span>
<span class="karaElement text-uppercase p-2 bd-highlight badge badge-light"><b>
${
kara
.
cat
}
</b></span>
<span class="karaElement text-uppercase p-2 bd-highlight badge badge-
info
"><b>
${
kara
.
type
}
</b></span>
<span class="karaElement text-uppercase p-2 bd-highlight badge badge-
light
"><b>
${
kara
.
type
}
</b></span>
<div class="p-2 bd-highlight mr-auto">
${
kara
.
source
}
<br>
${
kara
.
title
}
<i>[
${
kara
.
author
}
]</i></div>
<div class="
karaElement
p-2 bd-highlight mr-auto">
<b>
${
kara
.
source
}
<br>
${
kara
.
title
}
</b>
<i>[
${
kara
.
author
}
]</i></div>
<div class="p-2 bd-highlight">
<div class="
karaElement
p-2 bd-highlight">
<div class="d-flex flex-row bd-highlight mb-3 btn-group
" role="g
roup"
sty
le="
vertical-align: middle;
">
<div class="d-flex flex-row bd-highlight mb-3 btn-group
karaActionBtnG
roup"
ro
le="
group
">
<button class="btn btn-outline-light karaActionBtn"><i class="fas fa-plus"></i></button>
<button class="btn btn-outline-light karaActionBtn"><i class="fas fa-plus"></i></button>
<button class="btn btn-outline-light karaActionBtn"><i class="fas fa-level-up-alt"></i></button>
<button class="btn btn-outline-light karaActionBtn"><i class="fas fa-level-up-alt"></i></button>
</div>
</div>
...
@@ -86,3 +92,26 @@ ipcRenderer.on("reload-db-responce", (event, arg) => {
...
@@ -86,3 +92,26 @@ ipcRenderer.on("reload-db-responce", (event, arg) => {
});
});
document
.
getElementById
(
"
panelLeft
"
).
innerHTML
=
karaList
;
document
.
getElementById
(
"
panelLeft
"
).
innerHTML
=
karaList
;
});
});
/* Create the right panel: the queue */
ipcRenderer
.
on
(
"
reload-queue-responce
"
,
(
event
,
arg
)
=>
{
var
karaList
=
""
;
logger
.
debug
(
`Web page got reload-queue`
);
arg
.
forEach
(
kara
=>
{
karaList
+=
`<div class="card p-2 bd-highlight shadow-none d-flex flex-row bd-highlight mb-3 border border-info karaCard">
<span class="karaElement text-uppercase p-2 bd-highlight badge badge-light"><b>
${
kara
.
language
}
</b></span>
<span class="karaElement text-uppercase p-2 bd-highlight badge badge-light"><b>
${
kara
.
cat
}
</b></span>
<span class="karaElement text-uppercase p-2 bd-highlight badge badge-light"><b>
${
kara
.
type
}
</b></span>
<div class="karaElement p-2 bd-highlight mr-auto"><b>
${
kara
.
source
}
<br>
${
kara
.
title
}
</b> <i>[
${
kara
.
author
}
]</i></div>
<span class="karaElement p-3 bd-highlight"><b>
${
kara
.
position
}
</b></span>
<div class="karaElement p-2 bd-highlight">
<div class="d-flex flex-row bd-highlight mb-3 btn-group karaActionBtnGroup" role="group">
<button class="btn btn-outline-light karaActionBtn"><i class="fas fa-minus"></i></button>
<button class="btn btn-outline-light karaActionBtn"><i class="fas fa-play"></i></button>
</div>
</div>
</div>`
;
});
document
.
getElementById
(
"
panelRight
"
).
innerHTML
=
karaList
;
});
Ce diff est replié.
Cliquez pour l'agrandir.
main.js
+
9
−
1
Voir le fichier @
ae9a8010
...
@@ -95,8 +95,16 @@ ipcMain.on("cmd-stop", (event, arg) => {
...
@@ -95,8 +95,16 @@ ipcMain.on("cmd-stop", (event, arg) => {
/* Fill the pannel with the content of the DB.
/* Fill the pannel with the content of the DB.
* The `arg` is the HTML object of the pannel */
* The `arg` is the HTML object of the pannel */
ipcMain
.
on
(
"
reload-db-request
"
,
(
event
,
arg
)
=>
{
ipcMain
.
on
(
"
reload-db-request
"
,
(
event
,
arg
)
=>
{
logger
.
info
(
"
Reloading the
left panel with all the DB
"
);
logger
.
info
(
"
Reloading the
DB content
"
);
myDb
.
all
().
then
(
karas
=>
{
myDb
.
all
().
then
(
karas
=>
{
event
.
reply
(
"
reload-db-responce
"
,
karas
);
event
.
reply
(
"
reload-db-responce
"
,
karas
);
});
});
});
});
/* Send the queue to the webpage when asked to */
ipcMain
.
on
(
"
reload-queue-request
"
,
(
event
,
arg
)
=>
{
logger
.
info
(
"
Reloading next karas in queue
"
);
myDb
.
queue
(
0
,
100
).
then
(
karas
=>
{
event
.
reply
(
"
reload-queue-responce
"
,
karas
);
});
});
Ce diff est replié.
Cliquez pour l'agrandir.
style/css/instance.css
+
8
−
12
Voir le fichier @
ae9a8010
...
@@ -9,17 +9,6 @@ body {
...
@@ -9,17 +9,6 @@ body {
overflow
:
hidden
;
overflow
:
hidden
;
height
:
100vh
;
height
:
100vh
;
font-family
:
"LTFinneganCustom"
;
font-family
:
"LTFinneganCustom"
;
/*
-webkit-tap-highlight-color: rgba(0, 0, 0, 0) !important;
-webkit-tap-highlight-color: transparent !important;
-webkip-transition: none !important;
-webkit-touch-callout: none !important;
-webkit-user-select: none !important;
-khtml-user-select: none !important;
-moz-user-select: none !important;
-ms-user-select: none !important;
user-select: none !important;
*/
}
}
a
{
a
{
...
@@ -74,7 +63,8 @@ button {
...
@@ -74,7 +63,8 @@ button {
}
}
.karaCard
{
.karaCard
{
border
:
0px
;
padding-top
:
0px
!important
;
padding-bottom
:
0px
!important
;
margin
:
0px
!important
;
margin
:
0px
!important
;
}
}
...
@@ -85,6 +75,12 @@ button {
...
@@ -85,6 +75,12 @@ button {
margin-right
:
2px
;
margin-right
:
2px
;
}
}
.karaActionBtnGroup
{
margin
:
13%
;
margin-right
:
8px
;
margin-left
:
8px
;
}
.karaActionBtn
{
.karaActionBtn
{
margin
:
auto
;
margin
:
auto
;
margin-left
:
0px
;
margin-left
:
0px
;
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter