Skip to content

Commit

Permalink
Sorting menu and scripts array, export language
Browse files Browse the repository at this point in the history
  • Loading branch information
megastary committed Sep 10, 2020
1 parent 5eef989 commit 31e9904
Show file tree
Hide file tree
Showing 5 changed files with 149 additions and 131 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lazy-admin",
"version": "0.6.0",
"version": "0.6.1",
"description": "GUI for PowerShell scripts to simplify day to day IT tasks.",
"productName": "Lazy Admin",
"cordovaId": "eu.houby-studio.lazy-admin",
Expand All @@ -20,7 +20,7 @@
"electron-updater": "^4.3.1",
"lodash": "^4.17.19",
"node-powershell": "^4.0.0",
"quasar": "^1.13.1",
"quasar": "^1.13.2",
"regedit": "^3.0.3",
"vue-clipboard2": "^0.3.1",
"vue-i18n": "^8.0.0",
Expand Down Expand Up @@ -51,4 +51,4 @@
"browserslist": [
"last 1 version, not dead, ie >= 11"
]
}
}
2 changes: 1 addition & 1 deletion scripts-definitions/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Script definitions
# Scripts definitions

This folder contains sample definitions, serving as example for how you should setup your definitions for application.

Expand Down
13 changes: 12 additions & 1 deletion src/layouts/FullLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,9 @@
<div class="col-xs-12 col-sm-6 col-md-3">
<div class="text-h6">
<q-btn
@click="debugGetLanguageJson"
color="primary"
label="-"
label="Get language JSON"
style="width: 90%"
class="q-mb-sm"
no-wrap
Expand Down Expand Up @@ -429,6 +430,7 @@
</template>

<script>
import { exportFile } from 'quasar'
import { mapGetters } from 'vuex'
const { app, globalShortcut } = require('electron').remote
const { shell } = require('electron')
Expand Down Expand Up @@ -748,6 +750,15 @@ export default {
this.$i18n.setLocaleMessage(language, this.customLanguage[language])
})
})
},
debugGetLanguageJson () {
console.log('DEBUG function: Exporting English i18n strings to JSON.')
exportFile(
`en-us.json`,
JSON.stringify(this.$i18n.messages['en-us']),
'application/json'
)
}
},
created: function () {
Expand Down
4 changes: 2 additions & 2 deletions src/store/lazystore/getters.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ export function getScriptsArray (state) {
try {
return Object.entries(state.definitions)
.filter(([key, value]) => state.scripts_filter.includes(key))
.sort(([key, value], [key2, value2]) => (key > key2) ? 1 : -1)
.map(function ([key, value]) { return value.definition })
.flat(1)
.sort()
} catch {
console.error('Cannot build scripts entries.')
}
Expand All @@ -123,7 +123,7 @@ export function getMenuEntries (state) {
version: value.version,
icon: value.icon ? value.icon : 'mdi-powershell'
}
})
}).sort((a, b) => (a.displayName > b.displayName) ? 1 : -1)
} catch {
console.error('Cannot build menu entries.')
}
Expand Down
Loading

0 comments on commit 31e9904

Please sign in to comment.