Skip to content

Commit 31e9904

Browse files
committed
Sorting menu and scripts array, export language
1 parent 5eef989 commit 31e9904

File tree

5 files changed

+149
-131
lines changed

5 files changed

+149
-131
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lazy-admin",
3-
"version": "0.6.0",
3+
"version": "0.6.1",
44
"description": "GUI for PowerShell scripts to simplify day to day IT tasks.",
55
"productName": "Lazy Admin",
66
"cordovaId": "eu.houby-studio.lazy-admin",
@@ -20,7 +20,7 @@
2020
"electron-updater": "^4.3.1",
2121
"lodash": "^4.17.19",
2222
"node-powershell": "^4.0.0",
23-
"quasar": "^1.13.1",
23+
"quasar": "^1.13.2",
2424
"regedit": "^3.0.3",
2525
"vue-clipboard2": "^0.3.1",
2626
"vue-i18n": "^8.0.0",
@@ -51,4 +51,4 @@
5151
"browserslist": [
5252
"last 1 version, not dead, ie >= 11"
5353
]
54-
}
54+
}

scripts-definitions/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Script definitions
1+
# Scripts definitions
22

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

src/layouts/FullLayout.vue

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,8 +375,9 @@
375375
<div class="col-xs-12 col-sm-6 col-md-3">
376376
<div class="text-h6">
377377
<q-btn
378+
@click="debugGetLanguageJson"
378379
color="primary"
379-
label="-"
380+
label="Get language JSON"
380381
style="width: 90%"
381382
class="q-mb-sm"
382383
no-wrap
@@ -429,6 +430,7 @@
429430
</template>
430431

431432
<script>
433+
import { exportFile } from 'quasar'
432434
import { mapGetters } from 'vuex'
433435
const { app, globalShortcut } = require('electron').remote
434436
const { shell } = require('electron')
@@ -748,6 +750,15 @@ export default {
748750
this.$i18n.setLocaleMessage(language, this.customLanguage[language])
749751
})
750752
})
753+
},
754+
755+
debugGetLanguageJson () {
756+
console.log('DEBUG function: Exporting English i18n strings to JSON.')
757+
exportFile(
758+
`en-us.json`,
759+
JSON.stringify(this.$i18n.messages['en-us']),
760+
'application/json'
761+
)
751762
}
752763
},
753764
created: function () {

src/store/lazystore/getters.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ export function getScriptsArray (state) {
103103
try {
104104
return Object.entries(state.definitions)
105105
.filter(([key, value]) => state.scripts_filter.includes(key))
106+
.sort(([key, value], [key2, value2]) => (key > key2) ? 1 : -1)
106107
.map(function ([key, value]) { return value.definition })
107108
.flat(1)
108-
.sort()
109109
} catch {
110110
console.error('Cannot build scripts entries.')
111111
}
@@ -123,7 +123,7 @@ export function getMenuEntries (state) {
123123
version: value.version,
124124
icon: value.icon ? value.icon : 'mdi-powershell'
125125
}
126-
})
126+
}).sort((a, b) => (a.displayName > b.displayName) ? 1 : -1)
127127
} catch {
128128
console.error('Cannot build menu entries.')
129129
}

0 commit comments

Comments
 (0)