mirror of
https://github.com/AltarikMC/Launcher
synced 2024-11-22 06:19:50 +01:00
Change discord link, Fix indent in js render files
This commit is contained in:
parent
daa9af1435
commit
769120fd97
@ -1,32 +1,32 @@
|
|||||||
const vue = require('vue/dist/vue.cjs.js')
|
const vue = require('vue/dist/vue.cjs.js')
|
||||||
app = vue.createApp({
|
app = vue.createApp({
|
||||||
data() {
|
data () {
|
||||||
return {
|
return {
|
||||||
displayFullscreen: "block",
|
displayFullscreen: 'block',
|
||||||
fullscreenText: "Recherche de mise à jour...",
|
fullscreenText: 'Recherche de mise à jour...',
|
||||||
downloadLink: null
|
downloadLink: null
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
mounted () {
|
||||||
|
this.sendCheckingUpdate()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
sendCheckingUpdate () {
|
||||||
|
ipcRenderer.send('checking-update')
|
||||||
},
|
},
|
||||||
mounted() {
|
openLinkExternal () {
|
||||||
this.sendCheckingUpdate()
|
shell.openExternal(this.downloadLink)
|
||||||
},
|
}
|
||||||
methods: {
|
}
|
||||||
sendCheckingUpdate() {
|
})
|
||||||
ipcRenderer.send("checking-update");
|
|
||||||
},
|
|
||||||
openLinkExternal() {
|
|
||||||
shell.openExternal(this.downloadLink)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
let root = app.mount("#vue");
|
const root = app.mount('#vue')
|
||||||
|
|
||||||
ipcRenderer.on("update-available", (event, arg) => {
|
ipcRenderer.on('update-available', (event, arg) => {
|
||||||
root.fullscreenText = "Mise à jour disponible, téléchargement..."
|
root.fullscreenText = 'Mise à jour disponible, téléchargement...'
|
||||||
});
|
})
|
||||||
|
|
||||||
ipcRenderer.on("please-download-update", (event, args) => {
|
ipcRenderer.on('please-download-update', (event, args) => {
|
||||||
root.fullscreenText = `Veuillez télécharger la mise à jour en cliquant sur le lien suivant :`
|
root.fullscreenText = 'Veuillez télécharger la mise à jour en cliquant sur le lien suivant :'
|
||||||
root.downloadLink = `${args.url}`
|
root.downloadLink = `${args.url}`
|
||||||
})
|
})
|
||||||
|
@ -3,176 +3,175 @@ const totalMem = os.totalmem() / (1.049 * Math.pow(10, 6))
|
|||||||
const vue = require('vue/dist/vue.cjs.js')
|
const vue = require('vue/dist/vue.cjs.js')
|
||||||
|
|
||||||
app = vue.createApp({
|
app = vue.createApp({
|
||||||
data() {
|
data () {
|
||||||
return {
|
return {
|
||||||
minMemValue: localStorage.getItem("minMem") != null ? localStorage.getItem("minMem") : 1024 ,
|
minMemValue: localStorage.getItem('minMem') != null ? localStorage.getItem('minMem') : 1024,
|
||||||
maxMemValue: localStorage.getItem("maxMem") != null ? localStorage.getItem("maxMem") : 2048,
|
maxMemValue: localStorage.getItem('maxMem') != null ? localStorage.getItem('maxMem') : 2048,
|
||||||
memStep: 128,
|
memStep: 128,
|
||||||
memMax: totalMem,
|
memMax: totalMem,
|
||||||
invalidateButtonText: "Supprimer et retélécharger les bibliothèques",
|
invalidateButtonText: 'Supprimer et retélécharger les bibliothèques',
|
||||||
invalidateButtonDisabled: false,
|
invalidateButtonDisabled: false,
|
||||||
displayFullscreen: "none",
|
displayFullscreen: 'none',
|
||||||
displaySettings: "none",
|
displaySettings: 'none',
|
||||||
displayCredits: "none",
|
displayCredits: 'none',
|
||||||
nick: "Chargement",
|
nick: 'Chargement',
|
||||||
launchBtnText: "Selectionnez un chapitre",
|
launchBtnText: 'Selectionnez un chapitre',
|
||||||
launchBtnDisable: true,
|
launchBtnDisable: true,
|
||||||
launchBtnHidden: false,
|
launchBtnHidden: false,
|
||||||
loadingMessageHidden: true,
|
loadingMessageHidden: true,
|
||||||
loadingMessageText: "Téléchargement de Minecraft en cours...",
|
loadingMessageText: 'Téléchargement de Minecraft en cours...',
|
||||||
fullprogressbarHidden: true,
|
fullprogressbarHidden: true,
|
||||||
progressbarWidth: 0,
|
progressbarWidth: 0,
|
||||||
sidebarContent: "<hr><p>Chargement en cours</p>",
|
sidebarContent: '<hr><p>Chargement en cours</p>',
|
||||||
modsInformations: [],
|
modsInformations: [],
|
||||||
modsInformationsLoaded: true,
|
modsInformationsLoaded: true,
|
||||||
selectedChapter: -1,
|
selectedChapter: -1,
|
||||||
gameLaunching: false
|
gameLaunching: false
|
||||||
}
|
|
||||||
|
|
||||||
},
|
|
||||||
mounted () {
|
|
||||||
iziToast.settings({
|
|
||||||
close: false,
|
|
||||||
closeOnClick: true,
|
|
||||||
timeout: 5000,
|
|
||||||
position: 'topRight',
|
|
||||||
resetOnHover: true,
|
|
||||||
})
|
|
||||||
setInterval(() => {
|
|
||||||
ipcRenderer.send("pageReady")
|
|
||||||
}, 500)
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
invalidateData () {
|
|
||||||
this.invalidateButtonDisabled = true
|
|
||||||
this.invalidateButtonText = "Opération en cours"
|
|
||||||
this.showInfo("Opération en cours", "Suppression des données du jeu en cours")
|
|
||||||
ipcRenderer.send('invalidateData')
|
|
||||||
},
|
|
||||||
launchBtnClick () {
|
|
||||||
this.launchBtnHidden = true
|
|
||||||
this.fullprogressbarHidden = false
|
|
||||||
this.loadingMessageHidden = false
|
|
||||||
if(Number(this.minMemValue) <= Number(this.maxMemValue)){
|
|
||||||
ipcRenderer.send('launch', {
|
|
||||||
minMem: this.minMemValue + "M",
|
|
||||||
maxMem: this.maxMemValue + "M",
|
|
||||||
chapter: this.selectedChapter
|
|
||||||
})
|
|
||||||
this.launchBtnDisable = true
|
|
||||||
localStorage.setItem("minMem", this.minMemValue)
|
|
||||||
localStorage.setItem("maxMem", this.maxMemValue)
|
|
||||||
this.gameLaunching = true
|
|
||||||
} else {
|
|
||||||
this.showError("Erreur de lancement", "La mémoire minimale doit être inférieure ou égale à la mémoire maximale.")
|
|
||||||
}
|
|
||||||
},
|
|
||||||
changeSelectedChapter(index) {
|
|
||||||
this.selectedChapter = parseInt(index)
|
|
||||||
root.launchBtnText = "JOUER"
|
|
||||||
root.launchBtnDisable = false
|
|
||||||
},
|
|
||||||
disconnectBtn () {
|
|
||||||
ipcRenderer.send('disconnect')
|
|
||||||
},
|
|
||||||
options () {
|
|
||||||
if(!this.gameLaunching) {
|
|
||||||
this.displayFullscreen = "block"
|
|
||||||
this.displaySettings = "block"
|
|
||||||
this.displayCredits = "none"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
discord() {
|
|
||||||
shell.openExternal("https://discord.gg/b923tMhmRE")
|
|
||||||
},
|
|
||||||
web() {
|
|
||||||
shell.openExternal("https://altarik.fr")
|
|
||||||
},
|
|
||||||
closeFullscreen () {
|
|
||||||
this.displayFullscreen = "none"
|
|
||||||
this.displaySettings = "none"
|
|
||||||
this.displayCredits = "none"
|
|
||||||
},
|
|
||||||
credits() {
|
|
||||||
this.displayFullscreen = "block"
|
|
||||||
this.displaySettings = "none"
|
|
||||||
this.displayCredits = "block"
|
|
||||||
},
|
|
||||||
updateModsInformations(content) {
|
|
||||||
this.modsInformations = content
|
|
||||||
},
|
|
||||||
getModsInformations() {
|
|
||||||
return this.modsInformations
|
|
||||||
},
|
|
||||||
showInfo(title, body) {
|
|
||||||
iziToast.info({
|
|
||||||
title: title,
|
|
||||||
message: body,
|
|
||||||
color: 'blue'
|
|
||||||
})
|
|
||||||
},
|
|
||||||
showError(title, body) {
|
|
||||||
iziToast.error({
|
|
||||||
title: title,
|
|
||||||
message: body,
|
|
||||||
color: 'red',
|
|
||||||
})
|
|
||||||
},
|
|
||||||
showWarning(title, body) {
|
|
||||||
iziToast.warning({
|
|
||||||
title: title,
|
|
||||||
message: body,
|
|
||||||
color: 'yellow'
|
|
||||||
})
|
|
||||||
},
|
|
||||||
showSuccess(title, body) {
|
|
||||||
iziToast.success({
|
|
||||||
title: title,
|
|
||||||
message: body,
|
|
||||||
color: 'green'
|
|
||||||
})
|
|
||||||
},
|
|
||||||
isSelected(index) {
|
|
||||||
return this.selectedChapter === index
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
mounted () {
|
||||||
|
iziToast.settings({
|
||||||
|
close: false,
|
||||||
|
closeOnClick: true,
|
||||||
|
timeout: 5000,
|
||||||
|
position: 'topRight',
|
||||||
|
resetOnHover: true
|
||||||
|
})
|
||||||
|
setInterval(() => {
|
||||||
|
ipcRenderer.send('pageReady')
|
||||||
|
}, 500)
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
invalidateData () {
|
||||||
|
this.invalidateButtonDisabled = true
|
||||||
|
this.invalidateButtonText = 'Opération en cours'
|
||||||
|
this.showInfo('Opération en cours', 'Suppression des données du jeu en cours')
|
||||||
|
ipcRenderer.send('invalidateData')
|
||||||
|
},
|
||||||
|
launchBtnClick () {
|
||||||
|
this.launchBtnHidden = true
|
||||||
|
this.fullprogressbarHidden = false
|
||||||
|
this.loadingMessageHidden = false
|
||||||
|
if (Number(this.minMemValue) <= Number(this.maxMemValue)) {
|
||||||
|
ipcRenderer.send('launch', {
|
||||||
|
minMem: this.minMemValue + 'M',
|
||||||
|
maxMem: this.maxMemValue + 'M',
|
||||||
|
chapter: this.selectedChapter
|
||||||
|
})
|
||||||
|
this.launchBtnDisable = true
|
||||||
|
localStorage.setItem('minMem', this.minMemValue)
|
||||||
|
localStorage.setItem('maxMem', this.maxMemValue)
|
||||||
|
this.gameLaunching = true
|
||||||
|
} else {
|
||||||
|
this.showError('Erreur de lancement', 'La mémoire minimale doit être inférieure ou égale à la mémoire maximale.')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
changeSelectedChapter (index) {
|
||||||
|
this.selectedChapter = parseInt(index)
|
||||||
|
root.launchBtnText = 'JOUER'
|
||||||
|
root.launchBtnDisable = false
|
||||||
|
},
|
||||||
|
disconnectBtn () {
|
||||||
|
ipcRenderer.send('disconnect')
|
||||||
|
},
|
||||||
|
options () {
|
||||||
|
if (!this.gameLaunching) {
|
||||||
|
this.displayFullscreen = 'block'
|
||||||
|
this.displaySettings = 'block'
|
||||||
|
this.displayCredits = 'none'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
discord () {
|
||||||
|
shell.openExternal('https://discord.gg/p3EnE6Jumg')
|
||||||
|
},
|
||||||
|
web () {
|
||||||
|
shell.openExternal('https://altarik.fr')
|
||||||
|
},
|
||||||
|
closeFullscreen () {
|
||||||
|
this.displayFullscreen = 'none'
|
||||||
|
this.displaySettings = 'none'
|
||||||
|
this.displayCredits = 'none'
|
||||||
|
},
|
||||||
|
credits () {
|
||||||
|
this.displayFullscreen = 'block'
|
||||||
|
this.displaySettings = 'none'
|
||||||
|
this.displayCredits = 'block'
|
||||||
|
},
|
||||||
|
updateModsInformations (content) {
|
||||||
|
this.modsInformations = content
|
||||||
|
},
|
||||||
|
getModsInformations () {
|
||||||
|
return this.modsInformations
|
||||||
|
},
|
||||||
|
showInfo (title, body) {
|
||||||
|
iziToast.info({
|
||||||
|
title,
|
||||||
|
message: body,
|
||||||
|
color: 'blue'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
showError (title, body) {
|
||||||
|
iziToast.error({
|
||||||
|
title,
|
||||||
|
message: body,
|
||||||
|
color: 'red'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
showWarning (title, body) {
|
||||||
|
iziToast.warning({
|
||||||
|
title,
|
||||||
|
message: body,
|
||||||
|
color: 'yellow'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
showSuccess (title, body) {
|
||||||
|
iziToast.success({
|
||||||
|
title,
|
||||||
|
message: body,
|
||||||
|
color: 'green'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
isSelected (index) {
|
||||||
|
return this.selectedChapter === index
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
let root = app.mount("#vue")
|
const root = app.mount('#vue')
|
||||||
|
|
||||||
ipcRenderer.on("invalidated", () => {
|
ipcRenderer.on('invalidated', () => {
|
||||||
root.invalidateButtonDisabled = false
|
root.invalidateButtonDisabled = false
|
||||||
root.invalidateButtonText = "Supprimer et retélécharger les bibliothèques"
|
root.invalidateButtonText = 'Supprimer et retélécharger les bibliothèques'
|
||||||
root.showSuccess("Opération terminée", "Les données du jeu ont été supprimé avec succès")
|
root.showSuccess('Opération terminée', 'Les données du jeu ont été supprimé avec succès')
|
||||||
})
|
})
|
||||||
|
|
||||||
ipcRenderer.on("progress", (e, args) => {
|
ipcRenderer.on('progress', (e, args) => {
|
||||||
root.progressbarWidth = (args.task / Math.max(args.total, args.task)) * 100
|
root.progressbarWidth = (args.task / Math.max(args.total, args.task)) * 100
|
||||||
root.loadingMessageText = "Téléchargement de " + args.type + ": " + args.task + " sur " + Math.max(args.total, args.task)
|
root.loadingMessageText = 'Téléchargement de ' + args.type + ': ' + args.task + ' sur ' + Math.max(args.total, args.task)
|
||||||
})
|
})
|
||||||
|
|
||||||
ipcRenderer.on("close", (_e, _args) => {
|
ipcRenderer.on('close', (_e, _args) => {
|
||||||
root.launchBtnHidden = false
|
root.launchBtnHidden = false
|
||||||
root.fullprogressbarHidden = true
|
root.fullprogressbarHidden = true
|
||||||
root.loadingMessageHidden = true
|
root.loadingMessageHidden = true
|
||||||
root.loadingMessageText = "Chargement de Minecraft en cours..."
|
root.loadingMessageText = 'Chargement de Minecraft en cours...'
|
||||||
root.progressbarWidth = 0
|
root.progressbarWidth = 0
|
||||||
root.launchBtnDisable = false
|
root.launchBtnDisable = false
|
||||||
root.gameLaunching = false
|
root.gameLaunching = false
|
||||||
})
|
})
|
||||||
|
|
||||||
ipcRenderer.on('launch', (_e, _args) => {
|
ipcRenderer.on('launch', (_e, _args) => {
|
||||||
root.fullprogressbarHidden = true
|
root.fullprogressbarHidden = true
|
||||||
root.loadingMessageHidden = true
|
root.loadingMessageHidden = true
|
||||||
})
|
})
|
||||||
|
|
||||||
ipcRenderer.on("modsInformations", (_e, args) => {
|
ipcRenderer.on('modsInformations', (_e, args) => {
|
||||||
if(args === null) {
|
if (args === null) {
|
||||||
root.modsInformationsLoaded = false
|
root.modsInformationsLoaded = false
|
||||||
} else {
|
} else {
|
||||||
root.modsInformationsLoaded = true
|
root.modsInformationsLoaded = true
|
||||||
}
|
}
|
||||||
root.updateModsInformations(args)
|
root.updateModsInformations(args)
|
||||||
})
|
})
|
||||||
|
|
||||||
ipcRenderer.on("nick", (_e, args) => root.nick = args.name)
|
ipcRenderer.on('nick', (_e, args) => root.nick = args.name)
|
||||||
|
@ -1,89 +1,87 @@
|
|||||||
const vue = require('vue/dist/vue.cjs.js')
|
const vue = require('vue/dist/vue.cjs.js')
|
||||||
app = vue.createApp({
|
app = vue.createApp({
|
||||||
data() {
|
data () {
|
||||||
return {
|
return {
|
||||||
login: "Connexion",
|
login: 'Connexion',
|
||||||
email: "Email",
|
email: 'Email',
|
||||||
password: "Mot de passe",
|
password: 'Mot de passe',
|
||||||
send_credentials: "Se connecter",
|
send_credentials: 'Se connecter',
|
||||||
microsoft_button: "Connexion avec un compte Microsoft",
|
microsoft_button: 'Connexion avec un compte Microsoft'
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
iziToast.settings({
|
|
||||||
close: false,
|
|
||||||
closeOnClick: true,
|
|
||||||
timeout: 5000,
|
|
||||||
position: 'topRight',
|
|
||||||
resetOnHover: true,
|
|
||||||
})
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
formSubmit (e) {
|
|
||||||
e.preventDefault()
|
|
||||||
if(!microsoftButton.disabled) {
|
|
||||||
form.disabled = true
|
|
||||||
if(user.value) {
|
|
||||||
ipcRenderer.send("login", {
|
|
||||||
user: user.value,
|
|
||||||
pass: password.value
|
|
||||||
})
|
|
||||||
}else{
|
|
||||||
this.showWarning("Erreur de connexion", "Veuillez entrer des identifiants")
|
|
||||||
form.disabled = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
microsoftButton(e) {
|
|
||||||
e.preventDefault()
|
|
||||||
if(!form.disabled) {
|
|
||||||
microsoftButton.disabled = true
|
|
||||||
form.disabled = true
|
|
||||||
ipcRenderer.send("microsoft-login")
|
|
||||||
}
|
|
||||||
},
|
|
||||||
showInfo(title, body) {
|
|
||||||
iziToast.info({
|
|
||||||
title: title,
|
|
||||||
message: body,
|
|
||||||
color: 'blue'
|
|
||||||
})
|
|
||||||
},
|
|
||||||
showError(title, body) {
|
|
||||||
iziToast.error({
|
|
||||||
title: title,
|
|
||||||
message: body,
|
|
||||||
color: 'red',
|
|
||||||
})
|
|
||||||
},
|
|
||||||
showWarning(title, body) {
|
|
||||||
iziToast.warning({
|
|
||||||
title: title,
|
|
||||||
message: body,
|
|
||||||
color: 'yellow'
|
|
||||||
})
|
|
||||||
},
|
|
||||||
showSuccess(title, body) {
|
|
||||||
iziToast.success({
|
|
||||||
title: title,
|
|
||||||
message: body,
|
|
||||||
color: 'green'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
},
|
||||||
|
mounted () {
|
||||||
|
iziToast.settings({
|
||||||
|
close: false,
|
||||||
|
closeOnClick: true,
|
||||||
|
timeout: 5000,
|
||||||
|
position: 'topRight',
|
||||||
|
resetOnHover: true
|
||||||
|
})
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
formSubmit (e) {
|
||||||
|
e.preventDefault()
|
||||||
|
if (!microsoftButton.disabled) {
|
||||||
|
form.disabled = true
|
||||||
|
if (user.value) {
|
||||||
|
ipcRenderer.send('login', {
|
||||||
|
user: user.value,
|
||||||
|
pass: password.value
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.showWarning('Erreur de connexion', 'Veuillez entrer des identifiants')
|
||||||
|
form.disabled = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
microsoftButton (e) {
|
||||||
|
e.preventDefault()
|
||||||
|
if (!form.disabled) {
|
||||||
|
microsoftButton.disabled = true
|
||||||
|
form.disabled = true
|
||||||
|
ipcRenderer.send('microsoft-login')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
showInfo (title, body) {
|
||||||
|
iziToast.info({
|
||||||
|
title,
|
||||||
|
message: body,
|
||||||
|
color: 'blue'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
showError (title, body) {
|
||||||
|
iziToast.error({
|
||||||
|
title,
|
||||||
|
message: body,
|
||||||
|
color: 'red'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
showWarning (title, body) {
|
||||||
|
iziToast.warning({
|
||||||
|
title,
|
||||||
|
message: body,
|
||||||
|
color: 'yellow'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
showSuccess (title, body) {
|
||||||
|
iziToast.success({
|
||||||
|
title,
|
||||||
|
message: body,
|
||||||
|
color: 'green'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
app.mount("#vue");
|
app.mount('#vue')
|
||||||
|
|
||||||
// theirs const are declared after vue cause vue modify them when declaring new vue instance
|
// theirs const are declared after vue cause vue modify them when declaring new vue instance
|
||||||
const form = document.querySelector('#login-form')
|
const form = document.querySelector('#login-form')
|
||||||
const user = document.querySelector('#nickname')
|
const user = document.querySelector('#nickname')
|
||||||
const password = document.querySelector('#password')
|
const password = document.querySelector('#password')
|
||||||
const microsoftButton = document.querySelector("#microsoft-button")
|
const microsoftButton = document.querySelector('#microsoft-button')
|
||||||
|
|
||||||
|
ipcRenderer.on('loginError', () => {
|
||||||
|
form.disabled = false
|
||||||
ipcRenderer.on("loginError", () => {
|
microsoftButton.disabled = false
|
||||||
form.disabled = false
|
|
||||||
microsoftButton.disabled = false
|
|
||||||
})
|
})
|
||||||
|
@ -1,29 +1,29 @@
|
|||||||
'use strict';
|
'use strict'
|
||||||
const { ipcRenderer, shell } = require('electron');
|
const { ipcRenderer, shell } = require('electron')
|
||||||
let app;
|
let app
|
||||||
window.addEventListener("DOMContentLoaded", () => {
|
window.addEventListener('DOMContentLoaded', () => {
|
||||||
const minimizeButton = document.getElementById("minimize-btn")
|
const minimizeButton = document.getElementById('minimize-btn')
|
||||||
const closeButton = document.getElementById("close-btn")
|
const closeButton = document.getElementById('close-btn')
|
||||||
|
|
||||||
minimizeButton.addEventListener("click", () => ipcRenderer.send('minimizeWindow'))
|
minimizeButton.addEventListener('click', () => ipcRenderer.send('minimizeWindow'))
|
||||||
|
|
||||||
closeButton.addEventListener("click", () => ipcRenderer.send('closeWindow'))
|
closeButton.addEventListener('click', () => ipcRenderer.send('closeWindow'))
|
||||||
})
|
})
|
||||||
|
|
||||||
ipcRenderer.on('notification', (_e, args) => {
|
ipcRenderer.on('notification', (_e, args) => {
|
||||||
app.notificationTitle = args.title
|
app.notificationTitle = args.title
|
||||||
app.notificationMessage = args.body
|
app.notificationMessage = args.body
|
||||||
switch(args.class) {
|
switch (args.class) {
|
||||||
case "success":
|
case 'success':
|
||||||
app._component.methods.showSuccess(args.title, args.body)
|
app._component.methods.showSuccess(args.title, args.body)
|
||||||
break;
|
break
|
||||||
case "warning":
|
case 'warning':
|
||||||
app._component.methods.showWarning(args.title, args.body)
|
app._component.methods.showWarning(args.title, args.body)
|
||||||
break;
|
break
|
||||||
case "error":
|
case 'error':
|
||||||
app._component.methods.showError(args.title, args.body)
|
app._component.methods.showError(args.title, args.body)
|
||||||
break;
|
break
|
||||||
case "info":default:
|
case 'info':default:
|
||||||
app._component.methods.showInfo(args.title, args.body)
|
app._component.methods.showInfo(args.title, args.body)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user