Skip to content

Commit 9c6cae2

Browse files
committed
Removed favorites, improved export CSV, more components
Merged ModulesList to VersionList
1 parent 4f94dc4 commit 9c6cae2

18 files changed

+712
-720
lines changed

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lazy-admin",
3-
"version": "0.4.5",
3+
"version": "0.4.6",
44
"description": "GUI for PowerShell scripts to simplify day to day IT tasks.",
55
"productName": "Lazy Admin",
66
"cordovaId": "eu.houby-studio.lazy-admin",
@@ -15,6 +15,7 @@
1515
"dependencies": {
1616
"@quasar/extras": "^1.9.4",
1717
"axios": "^0.19.2",
18+
"csv": "^5.3.2",
1819
"electron-log": "^4.1.1",
1920
"electron-updater": "^4.3.1",
2021
"lodash": "^4.17.19",
@@ -50,4 +51,4 @@
5051
"browserslist": [
5152
"last 1 version, not dead, ie >= 11"
5253
]
53-
}
54+
}

src/boot/components.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
// import components
22
import WindowTitlebar from 'components/WindowTitlebar.vue'
33
import SettingsItems from 'components/SettingsItems.vue'
4-
import ModulesList from 'components/ModulesList.vue'
54
import VersionList from 'components/VersionList.vue'
5+
import HistoryDrawer from 'components/HistoryDrawer.vue'
6+
import HelpDialog from 'components/HelpDialog.vue'
7+
import ProgressDialog from 'components/ProgressDialog.vue'
8+
import ResultsDialog from 'components/ResultsDialog.vue'
69

710
// add components to Vue
811
export default async ({ Vue }) => {
912
Vue.component('WindowTitlebar', WindowTitlebar)
1013
Vue.component('SettingsItems', SettingsItems)
11-
Vue.component('ModulesList', ModulesList)
1214
Vue.component('VersionList', VersionList)
15+
Vue.component('HistoryDrawer', HistoryDrawer)
16+
Vue.component('HelpDialog', HelpDialog)
17+
Vue.component('ProgressDialog', ProgressDialog)
18+
Vue.component('ResultsDialog', ResultsDialog)
1319
}

src/components/HelpDialog.vue

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<template>
2+
<q-dialog
3+
v-model="localValue"
4+
@show="loadHelpDiag"
5+
@hide="externalHelpFile = ''"
6+
transition-show="scale"
7+
transition-hide="scale"
8+
full-width
9+
full-height
10+
>
11+
<q-card class="full-width">
12+
<q-card-section>
13+
<div class="text-h6">
14+
<q-icon :name="currentCommand.icon ? currentCommand.icon : 'mdi-powershell'"></q-icon> {{ currentCommand.commandName }} - {{ $t('help') }}
15+
</div>
16+
</q-card-section>
17+
<q-card-section>
18+
<div>
19+
<q-markdown
20+
:src="externalHelpFile"
21+
no-line-numbers
22+
/>
23+
</div>
24+
</q-card-section>
25+
<floating-actions />
26+
</q-card>
27+
</q-dialog>
28+
</template>
29+
30+
<script>
31+
import FloatingActions from 'components/partials/FloatingActions'
32+
33+
export default {
34+
components: { 'floating-actions': FloatingActions },
35+
props: {
36+
value: { required: true, type: Boolean },
37+
currentCommand: { required: true, type: Object }
38+
},
39+
data () {
40+
return {
41+
externalHelpFile: ''
42+
}
43+
},
44+
computed: {
45+
localValue: {
46+
get () {
47+
return this.value
48+
},
49+
set (val) {
50+
this.$emit('input', val)
51+
}
52+
}
53+
},
54+
methods: {
55+
loadHelpDiag () {
56+
this.externalHelpFile = this.$t('loadingHelp')
57+
if (this.currentCommand.help) {
58+
let helpUrl = this.currentCommand.help[this.language] ? this.currentCommand.help[this.language] : this.currentCommand.help.default
59+
this.$utils.downloadDefinitions(helpUrl, (err, result) => {
60+
if (err) {
61+
this.externalHelpFile = this.$t('externalHelpNotFound', { helpUrl: helpUrl })
62+
return
63+
}
64+
this.externalHelpFile = result.data
65+
})
66+
} else {
67+
let description = this.currentCommand.description ? this.currentCommand.description[this.language] ? this.currentCommand.description[this.language] : this.currentCommand.description.default : this.$t('noDescription')
68+
this.externalHelpFile = this.$t('noExternalHelp', { description: description })
69+
}
70+
}
71+
}
72+
}
73+
</script>

src/components/HistoryDrawer.vue

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
<template>
2+
<q-drawer
3+
v-model="localValue"
4+
:width="historyWidth"
5+
@hide="$emit('hide-drawer')"
6+
side="right"
7+
behavior="desktop"
8+
overlay
9+
>
10+
<div class="row fit">
11+
<div class="col">
12+
<q-table
13+
:data="history"
14+
:columns="historyColumns"
15+
:pagination.sync="historyPagination"
16+
:dense="denseTable"
17+
:filter="searchHistory"
18+
row-key="index"
19+
wrap-cells
20+
hide-bottom
21+
hide-header
22+
>
23+
<!-- Template showing command date -->
24+
<template v-slot:body-cell-date="props">
25+
<q-td
26+
:props="props"
27+
class="text-no-wrap"
28+
auto-width
29+
>
30+
{{ props.value}}
31+
</q-td>
32+
</template>
33+
<!-- Template showing workflow steps -->
34+
<template v-slot:body-cell-steps="props">
35+
<q-td
36+
:props="props"
37+
class="text-no-wrap"
38+
auto-width
39+
>
40+
{{ props.row.currentWorkflowIndex +1 }}/{{ props.row.currentCommandMaster.workflow ? props.row.currentCommandMaster.workflow.length + 1 : 1 }}
41+
</q-td>
42+
</template>
43+
<!-- Template showing friendly command name and 'Cmdlet' which gets executed -->
44+
<template v-slot:body-cell-commandName="props">
45+
<q-td :props="props">
46+
<div>
47+
{{ props.row.currentCommandMaster.friendlyName ? props.row.currentCommandMaster.friendlyName[language] ? props.row.currentCommandMaster.friendlyName[language] : props.row.currentCommandMaster.friendlyName.default : '' }}
48+
</div>
49+
<div>
50+
{{ props.row.currentCommandMaster.commandName }}
51+
</div>
52+
</q-td>
53+
</template>
54+
<!-- Template showing results button -->
55+
<template v-slot:body-cell-results="props">
56+
<q-td
57+
:props="props"
58+
auto-width
59+
>
60+
<q-btn
61+
@click="$emit('show-results-dialog', props.row)"
62+
flat
63+
>{{ $t('results') }}</q-btn>
64+
</q-td>
65+
</template>
66+
<!-- Template showing execute button -->
67+
<template v-slot:body-cell-execute="props">
68+
<q-td
69+
:props="props"
70+
auto-width
71+
>
72+
<q-btn
73+
:disable="loginSkipped && props.row.currentCommandMaster.usesLoginObjects"
74+
@click="$emit('show-command-dialog', props.row)"
75+
flat
76+
>{{ $t('repeat') }}</q-btn>
77+
</q-td>
78+
</template>
79+
</q-table>
80+
</div>
81+
</div>
82+
</q-drawer>
83+
</template>
84+
85+
<script>
86+
import { date } from 'quasar'
87+
import { mapGetters } from 'vuex'
88+
89+
export default {
90+
props: {
91+
value: { required: true, type: Boolean } // historyVisible
92+
},
93+
data () {
94+
return {
95+
historyPagination: { rowsPerPage: 0 },
96+
historyColumns: [
97+
{ name: 'date', label: 'Date', field: row => date.formatDate(row.date, 'YYYY-MM-DD HH:mm:ss'), classes: 'gt-xs' },
98+
{ name: 'steps', label: 'Steps', field: row => row.currentCommandMaster.workflow ? 'workflow' : 'basic' },
99+
{ name: 'commandName', label: 'Command Name', align: 'left', field: row => row.currentCommandMaster.commandName, classes: 'text-no-wrap' },
100+
{ name: 'friendlyName', label: 'Friendly Name', field: row => row.currentCommandMaster.friendlyName ? row.currentCommandMaster.friendlyName[(this.$i18n.locale)] ? row.currentCommandMaster.friendlyName[(this.$i18n.locale)] : row.currentCommandMaster.friendlyName['default'] : '', classes: 'hidden' },
101+
{ name: 'spacer', label: 'Spacer' },
102+
{ name: 'results', label: 'results' },
103+
{ name: 'execute', label: 'Execute' }
104+
]
105+
}
106+
},
107+
computed: {
108+
...mapGetters('lazystore', ['getLanguage', 'getSearchHistory', 'getHistory', 'getDenseTable', 'getLoginSkipped']),
109+
language: function () {
110+
return this.getLanguage
111+
},
112+
searchHistory: function () {
113+
return this.getSearchHistory
114+
},
115+
history: function () {
116+
return this.getHistory
117+
},
118+
denseTable: function () {
119+
return this.getDenseTable
120+
},
121+
loginSkipped: function () {
122+
return this.getLoginSkipped
123+
},
124+
historyWidth: function () {
125+
return this.$q.screen.width
126+
},
127+
localValue: {
128+
get () {
129+
return this.value
130+
},
131+
set (val) {
132+
this.$emit('input', val)
133+
}
134+
}
135+
}
136+
}
137+
</script>

src/components/ModulesList.vue

Lines changed: 0 additions & 42 deletions
This file was deleted.

src/components/ProgressDialog.vue

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<template>
2+
<q-dialog
3+
v-model="localValue"
4+
transition-show="slide-up"
5+
transition-hide="slide-down"
6+
position="bottom"
7+
full-width
8+
>
9+
<q-card
10+
class="full-width"
11+
ref="progressCard"
12+
>
13+
<q-card-section>
14+
<q-markdown
15+
:src="progress"
16+
ref="progressCode"
17+
/>
18+
</q-card-section>
19+
</q-card>
20+
</q-dialog>
21+
</template>
22+
23+
<script>
24+
export default {
25+
props: {
26+
value: { required: true, type: Boolean },
27+
progress: { required: true, type: String }
28+
},
29+
computed: {
30+
localValue: {
31+
get () {
32+
return this.value
33+
},
34+
set (val) {
35+
this.$emit('input', val)
36+
}
37+
}
38+
},
39+
methods: {
40+
scrollDown () {
41+
setTimeout(() => {
42+
try {
43+
this.$refs.progressCard.$el.scrollTo(0, this.$refs.progressCode.$el.clientHeight)
44+
} catch { }
45+
}, 100)
46+
}
47+
}
48+
}
49+
</script>

0 commit comments

Comments
 (0)