update module to newer and more aligned to template structure

This commit is contained in:
2025-01-14 11:42:29 +01:00
parent c7eccd3571
commit 9dc24f2d7b
13 changed files with 169 additions and 147 deletions

View File

@@ -1,51 +1,49 @@
export function updateActions() {
let actions = {}
actions['startNewTimer'] = {
name: 'Start New Timer',
options: [
{
type: 'textinput',
label: 'Description',
id: 'description',
default: '',
export default function (self) {
self.setActionDefinitions({
startNewTimer: {
name: 'Start New Timer',
options: [
{
type: 'textinput',
label: 'Description',
id: 'description',
default: '',
},
{
type: 'dropdown',
label: 'Project',
id: 'project',
default: '0',
choices: self.projects,
},
],
callback: ({ options }) => {
self.startTimer(options.project, options.description)
},
{
type: 'dropdown',
label: 'Project',
id: 'project',
default: '0',
choices: this.projects,
},
getCurrentTimer: {
name: 'Get Current Timer',
options: [],
callback: (action) => {
self.getCurrentTimer()
},
],
callback: ({ options }) => {
this.startTimer(options.project, options.description)
},
}
actions['getCurrentTimer'] = {
name: 'Get Current Timer',
options: [],
callback: (action) => {
this.getCurrentTimer()
stopCurrentTimer: {
name: 'Stop Current Timer',
options: [],
callback: (action) => {
self.stopTimer()
},
},
}
actions['stopCurrentTimer'] = {
name: 'Stop Current Timer',
options: [],
callback: (action) => {
this.stopTimer()
refreshProjects: {
name: 'Refresh Project List',
options: [],
callback: (action) => {
self.getWorkspace()
},
},
}
actions['refreshProjects'] = {
name: 'Refresh Project List',
options: [],
callback: (action) => {
this.getWorkspace()
},
}
this.setActionDefinitions(actions)
})
}