Skip to content

Commit

Permalink
Merge pull request #69 from Miorey/migration/vue3-add-vue3-package
Browse files Browse the repository at this point in the history
Migration/vue3 add vue3 package
  • Loading branch information
Miorey authored Feb 27, 2024
2 parents 6655c07 + c41f163 commit 2e7dffe
Show file tree
Hide file tree
Showing 10 changed files with 2,195 additions and 1,150 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

strategy:
matrix:
node-version: [14.x]
node-version: [18.x]

steps:
- uses: actions/checkout@v2
Expand Down
3,267 changes: 2,138 additions & 1,129 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"sound-play": "^1.1.0",
"unzipper": "^0.10.11",
"vue": "^2.7.14",
"vue-i18n": "^8.28.2",
"vuetify": "^2.6.14"
},
"devDependencies": {
Expand All @@ -33,7 +34,7 @@
"@vue/cli-plugin-babel": "^5.0.8",
"@vue/cli-plugin-eslint": "^5.0.8",
"@vue/cli-service": "^5.0.8",
"electron": "^28.1.3",
"electron": "^29.0.1",
"electron-devtools-installer": "^3.1.0",
"eslint": "^7.32.0",
"eslint-plugin-vue": "^8.7.1",
Expand Down
2 changes: 1 addition & 1 deletion src/components/AddonOptions.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div>
<span class="display-1 text_wow_style section_title">{{ `lbl_addons` }}</span>
<span class="display-1 text_wow_style section_title">{{ $t(`lbl_addons`) }}</span>
<div class="addons_list">

<div v-for="item in getAddons()" :key="item.id">
Expand Down
11 changes: 6 additions & 5 deletions src/components/FooterAction.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<template>
<div>
<v-btn :disabled="patchManager.downloadInProgress" class="pt-6 pb-6 mr-3" @click="downloadFtp(true)">
{{ `repair` }}
{{ $t(`repair`) }}
</v-btn>
<v-btn :disabled="patchManager.downloadInProgress" class="pt-6 pb-6 mr-3" v-if="canPlay" @click="play">
{{ `play` }}
{{ $t(`play`) }}
</v-btn>
<v-btn :disabled="patchManager.downloadInProgress" v-else class="pt-6 pb-6 mr-5" @click="downloadFtp(false)">
{{ `download` }}
{{ $t(`download`) }}
</v-btn>
</div>
</template>
Expand Down Expand Up @@ -57,6 +57,7 @@ export default {
}
},
async mounted() {
this.$i18n.locale = config.conf?.default_language;
if(Array.isArray(patchManager.selectedPatches)) {
this.canPlay = this.isUpToDate();
}
Expand Down Expand Up @@ -228,12 +229,12 @@ export default {
.on(`close`, () => {
console.log(`Extraction complete`);
this.canPlay = this.isUpToDate();
fs.unlinkSync(this.getBaseFolder(addonsToDownload[key].targetPath));
})
.on(`error`, (err) => {
console.error(`Error during extraction`, err);
this.canPlay = this.isUpToDate();
});
fs.unlinkSync(this.getBaseFolder(addonsToDownload[key].targetPath));
}
doneSize += await connPromise.connSize(addonsToDownload[key].sourcePath);
await EventBus.$emit(`event_total_percent`, doneSize/totalSize*100);
Expand Down Expand Up @@ -309,7 +310,7 @@ export default {
const nIntervId = setInterval(() => { EventBus.$emit(`event_file_percent`, stream.bytesRead/size*100); }, 100);
const dirPath = targetPath.substr(0, targetPath.lastIndexOf(`\\`)) || targetPath.substr(0, targetPath.lastIndexOf(`/`));
createDirIfNotExists(dirPath);
console.info(`Put file in ${targetPath}`);
console.info(`Put file in 1 ${targetPath}`);
stream.pipe(fs.createWriteStream(targetPath));
await streamPromise.once(`close`);
clearInterval(nIntervId);
Expand Down
2 changes: 1 addition & 1 deletion src/components/GameOptions.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div>
<span class="display-1 text_wow_style section_title">{{ `lbl_game_options` }}</span>
<span class="display-1 text_wow_style section_title">{{ $t(`lbl_game_options`) }}</span>
<div v-for="item in getPatchList()" :key="item.id">
<input
:disabled="patchManager.downloadInProgress"
Expand Down
8 changes: 4 additions & 4 deletions src/components/MainContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
right
background-color="transparent"
>
<v-tab>{{ `lbl_game_options` }}</v-tab>
<v-tab>{{ `lbl_addons` }}</v-tab>
<v-tab>{{ $t(`lbl_game_options`) }}</v-tab>
<v-tab>{{ $t(`lbl_addons`) }}</v-tab>
</v-tabs>
<v-tabs-items v-model="tab" id="download_options">
<v-tab-item key="{{ `lbl_game_options` }}">
<v-tab-item key="{{ $t(`lbl_game_options`) }}">

<game-options></game-options>
</v-tab-item>
<v-tab-item key="{{ `lbl_addons` }}">
<v-tab-item key="{{ $t(`lbl_addons`) }}">
<addon-options></addon-options>
</v-tab-item>
</v-tabs-items>
Expand Down
10 changes: 5 additions & 5 deletions src/components/PageLoader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
<v-overlay :value="isLoaded">
<v-card v-if="isLoaded">
<v-card-title>
{{ `page_loading` }}
{{ $t(`page_loading`) }}
</v-card-title>
<v-card-text>
{{`warning_message`}}
{{ $t(`warning_message`) }}
<ul>
<li>
{{ `warn_storage` }} {{ (loaded.storage)?`ok`:`...` }}
{{ $t(`warn_storage`) }} {{ (loaded.storage)?`ok`:`...` }}
</li>
<li>
{{ `warn_ftp` }} {{ (loaded.ftp_cli)?`ok`:`...` }}
{{ $t(`warn_ftp`) }} {{ (loaded.ftp_cli)?`ok`:`...` }}
</li>
<li>
{{ `patches` }} {{ (loaded.patches)?`ok`:`...` }}
{{ $t(`patches`) }} {{ (loaded.patches)?`ok`:`...` }}
</li>
</ul>
</v-card-text>
Expand Down
28 changes: 28 additions & 0 deletions src/dictionary.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
export const dictionary = {
enUS: {
download: `Update`,
download_launcher: `Launcher Update`,
lbl_game_options: `Game Options`,
lbl_addons: `Addons`,
repair: `Repair`,
play: `Play`,
page_loading: `Loading in progress`,
warning_message: `If after one minute the resources are not loaded please restart`,
warn_storage: `Local data`,
warn_ftp: `Remote data`,
app_error: `An unexpected error happened, please contact a Game Master.`
},
frFR: {
download: `Mettre à jour`,
download_launcher: `Mettre à jour le Launcher`,
lbl_game_options: `Options du jeu`,
lbl_addons: `Addons`,
repair: `Réparer`,
play: `Jouer`,
page_loading: `Chargement en cours`,
warning_message: `Si après une minute les ressources ne sont pas chargées veuillez redémarrer`,
warn_storage: `Données locales`,
warn_ftp: `Données distantes`,
app_error: `Une erreur inattendue s'est produite, merci de contacter un Maître du jeu.`
}
};
12 changes: 9 additions & 3 deletions src/main.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
import Vue from 'vue';
import vuetify from './plugins/vuetify';
import VueI18n from 'vue-i18n';
import {dictionary} from './dictionary';

try {

Vue.use(VueI18n);
// eslint-disable-next-line @typescript-eslint/no-var-requires
const App = require(`./App.vue`).default;
Vue.config.productionTip = false;

// eslint-disable-next-line @typescript-eslint/no-var-requires

const i18n = new VueI18n({
locale: `enUS`,
messages: dictionary
});
Vue.config.errorHandler = function(err, vm, info) {
console.error(`Vue Launcher Error: ${err.toString()}\nInfo: ${info}`);
alert(`APP ERROR`);
};

new Vue({
i18n,
vuetify,
render: h => h(App)
}).$mount(`#app`);
Expand Down

0 comments on commit 2e7dffe

Please sign in to comment.