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
4fd1b7f3
Vérifiée
Valider
4fd1b7f3
rédigé
4 years ago
par
Kubat
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
INSTANCE: Reload database with shortcut
parent
2b77117a
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
2
Masquer les modifications d'espaces
En ligne
Côte à côte
Affichage de
2 fichiers modifiés
instance/main.js
+6
-16
6 ajouts, 16 suppressions
instance/main.js
main.js
+25
-11
25 ajouts, 11 suppressions
main.js
avec
31 ajouts
et
27 suppressions
instance/main.js
+
6
−
16
Voir le fichier @
4fd1b7f3
...
@@ -8,11 +8,8 @@ const buttonList = [
...
@@ -8,11 +8,8 @@ const buttonList = [
[
"
right
"
,
"
Quit LektorApp
"
,
"
closeButton
"
],
[
"
right
"
,
"
Quit LektorApp
"
,
"
closeButton
"
],
];
];
const
karaJSON
=
require
(
'
../test/dummyKara.json
'
);
window
.
onload
=
()
=>
{
window
.
onload
=
()
=>
{
createButtonList
(
buttonList
);
createButtonList
(
buttonList
);
// karaList(karaJSON);
document
.
getElementById
(
"
closeButton
"
).
addEventListener
(
'
click
'
,
()
=>
{
document
.
getElementById
(
"
closeButton
"
).
addEventListener
(
'
click
'
,
()
=>
{
ipcRenderer
.
send
(
'
close-app
'
)
ipcRenderer
.
send
(
'
close-app
'
)
...
@@ -32,6 +29,7 @@ window.onload = () => {
...
@@ -32,6 +29,7 @@ window.onload = () => {
logger
.
debug
(
"
Window loaded
"
);
logger
.
debug
(
"
Window loaded
"
);
};
};
/* Create the button list */
function
createButtonList
(
list
)
{
function
createButtonList
(
list
)
{
var
renderHtmlLeft
=
""
;
var
renderHtmlLeft
=
""
;
var
renderHtmlRight
=
""
;
var
renderHtmlRight
=
""
;
...
@@ -54,19 +52,11 @@ function createButtonList(list) {
...
@@ -54,19 +52,11 @@ function createButtonList(list) {
}
}
ipcRenderer
.
on
(
"
reload-db-responce
"
,
(
event
,
arg
)
=>
{
ipcRenderer
.
on
(
"
reload-db-responce
"
,
(
event
,
arg
)
=>
{
logger
.
debug
(
`Web page got reload-db`
);
document
.
getElementById
(
"
panelLeft
"
).
innerHTML
=
arg
;
});
function
karaList
(
karas
)
{
var
karaList
=
""
;
var
karaList
=
""
;
var
playingList
=
""
;
logger
.
debug
(
`Web page got reload-db`
);
karas
.
forEach
(
(
kara
)
=>
{
arg
.
forEach
(
kara
=>
{
if
(
kara
.
author_name
===
"
Sting
"
)
{
karaList
+=
`<div class="card shadow" style="margin: 5px; border-radius: 10px; margin: 20px 0px 20px 0px;">
playingList
+=
'
<div class="card shadow" style="margin: 5px; border-radius: 10px; margin: 20px 0px 20px 0px;"><div class="card-body">
'
+
kara
.
source_name
+
'
-
'
+
kara
.
song_name
+
'
</div></div>
'
;
<div class="card-body">
${
kara
.
string
}
</div></div>`
;
}
karaList
+=
'
<div class="card shadow" style="margin: 5px; border-radius: 10px; margin: 20px 0px 20px 0px;"><div class="card-body">
'
+
kara
.
source_name
+
'
-
'
+
kara
.
song_name
+
'
</div></div>
'
;
});
});
document
.
getElementById
(
"
panelLeft
"
).
innerHTML
=
karaList
;
document
.
getElementById
(
"
panelLeft
"
).
innerHTML
=
karaList
;
document
.
getElementById
(
"
panelRight
"
).
innerHTML
=
playingList
;
});
}
Ce diff est replié.
Cliquez pour l'agrandir.
main.js
+
25
−
11
Voir le fichier @
4fd1b7f3
const
logger
=
require
.
main
.
require
(
'
./common/logger.js
'
);
const
logger
=
require
.
main
.
require
(
'
./common/logger.js
'
);
const
electron
=
require
(
'
electron
'
)
const
electron
=
require
(
'
electron
'
);
const
{
app
,
BrowserWindow
}
=
require
(
'
electron
'
)
const
{
app
,
BrowserWindow
}
=
require
(
'
electron
'
);
const
{
ipcMain
}
=
require
(
'
electron
'
)
const
{
globalShortcut
}
=
require
(
'
electron
'
);
const
{
ipcMain
}
=
require
(
'
electron
'
);
const
{
fork
,
spawn
}
=
require
(
'
child_process
'
);
const
{
fork
,
spawn
}
=
require
(
'
child_process
'
);
const
fs
=
require
(
"
fs
"
);
const
fs
=
require
(
"
fs
"
);
const
db
=
require
.
main
.
require
(
"
./common/db.js
"
);
const
db
=
require
.
main
.
require
(
"
./common/db.js
"
);
...
@@ -28,13 +29,13 @@ function createInstanceWindow () {
...
@@ -28,13 +29,13 @@ function createInstanceWindow () {
width
:
1280
,
width
:
1280
,
height
:
720
,
height
:
720
,
frame
:
false
,
frame
:
false
,
menuBarVisible
:
true
,
webPreferences
:
{
webPreferences
:
{
nodeIntegration
:
true
nodeIntegration
:
true
}
}
})
})
;
win
.
loadFile
(
'
instance/index.html
'
);
win
.
loadFile
(
'
instance/index.html
'
);
// win.webContents.openDevTools();
}
}
/******************************
/******************************
...
@@ -58,6 +59,24 @@ app.on('ready', () => {
...
@@ -58,6 +59,24 @@ app.on('ready', () => {
logger
.
info
(
"
Main window is ready
"
);
logger
.
info
(
"
Main window is ready
"
);
createInstanceWindow
();
createInstanceWindow
();
client
=
fork
(
'
client/main.js
'
);
client
=
fork
(
'
client/main.js
'
);
globalShortcut
.
register
(
'
CommandOrControl+D
'
,
()
=>
{
var
win
=
BrowserWindow
.
getFocusedWindow
();
if
(
win
===
null
)
{
return
;
}
logger
.
info
(
"
Reloading DB
"
);
let
contents
=
win
.
webContents
;
myDb
.
all
().
then
(
karas
=>
{
contents
.
send
(
"
reload-db-responce
"
,
karas
);
});
});
globalShortcut
.
register
(
'
F12
'
,
()
=>
{
var
focused
=
BrowserWindow
.
getFocusedWindow
();
if
(
focused
)
{
focused
.
webContents
.
openDevTools
();
}
});
});
});
/*********************************
/*********************************
...
@@ -76,11 +95,6 @@ ipcMain.on("cmd-stop", (event, arg) => {
...
@@ -76,11 +95,6 @@ ipcMain.on("cmd-stop", (event, arg) => {
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 left panel with all the DB
"
);
myDb
.
all
().
then
(
karas
=>
{
myDb
.
all
().
then
(
karas
=>
{
var
karaList
=
""
;
event
.
reply
(
"
reload-db-responce
"
,
karas
);
karas
.
forEach
(
kara
=>
{
karaList
+=
`<div class="card shadow" style="margin: 5px; border-radius: 10px; margin: 20px 0px 20px 0px;">
<div class="card-body">
${
kara
.
string
}
</div></div>`
;
});
event
.
reply
(
"
reload-db-responce
"
,
karaList
);
});
});
});
});
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