|
|
|
@ -18,8 +18,9 @@
|
|
|
|
|
<div class="field-group">
|
|
|
|
|
<label class="field-label">
|
|
|
|
|
name*
|
|
|
|
|
<input type="text" class="field-text" name="name" value="{ state.current.name ? state.current.name : '' }" />
|
|
|
|
|
<input type="text" class="field-text" name="name" value={ state.current.name } />
|
|
|
|
|
</label>
|
|
|
|
|
<field-error name="name"></field-error>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- command -->
|
|
|
|
@ -27,7 +28,7 @@
|
|
|
|
|
<label class="field-label">
|
|
|
|
|
command*
|
|
|
|
|
<div class="field-input-group">
|
|
|
|
|
<input class="field-text" type="text" name="command" value="{ state.current.command ? state.current.command : '' }" />
|
|
|
|
|
<input class="field-text" type="text" name="command" value="{ state.current.command }" />
|
|
|
|
|
<button class="button button--hover-icon-contrast m-bottom-0" type="button" onclick={ (event) => { handleOpenCommand(event) }}>
|
|
|
|
|
<svg class="icon">
|
|
|
|
|
<use xlink:href="symbol-defs.svg#icon-folder" />
|
|
|
|
@ -52,7 +53,7 @@
|
|
|
|
|
<div class="field-group">
|
|
|
|
|
<label class="field-label">
|
|
|
|
|
description
|
|
|
|
|
<textarea class="field-text" name="description" value="{ state.current.description ? state.current.description : '' }"></textarea>
|
|
|
|
|
<textarea class="field-text" name="description" value="{ state.current.description }"></textarea>
|
|
|
|
|
</label>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
@ -124,6 +125,12 @@
|
|
|
|
|
|
|
|
|
|
...sidebarMixin, // adding basic funtion for sidebar
|
|
|
|
|
|
|
|
|
|
state: {
|
|
|
|
|
open: false, // if sidebar is open
|
|
|
|
|
loading: false, // if loading is shown
|
|
|
|
|
current: false
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
@ -133,15 +140,17 @@
|
|
|
|
|
// adding event for open sidebar
|
|
|
|
|
formStore.on('open', (id) => {
|
|
|
|
|
|
|
|
|
|
this.reset()
|
|
|
|
|
tagsStore.trigger('update', [])
|
|
|
|
|
|
|
|
|
|
this.state.current = false
|
|
|
|
|
this.state.open = true
|
|
|
|
|
|
|
|
|
|
// if id is send, load apps from pouchdb
|
|
|
|
|
if (id) {
|
|
|
|
|
appsStore.getOne(id)
|
|
|
|
|
} else {
|
|
|
|
|
this.update()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.state.open = true
|
|
|
|
|
this.update()
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
// creating formValidator
|
|
|
|
@ -228,6 +237,7 @@
|
|
|
|
|
handleSuccess(event, data) {
|
|
|
|
|
event.preventDefault()
|
|
|
|
|
|
|
|
|
|
this.state.current = data
|
|
|
|
|
this.state.loading = true
|
|
|
|
|
this.update()
|
|
|
|
|
|
|
|
|
@ -297,18 +307,6 @@
|
|
|
|
|
*/
|
|
|
|
|
toImage(media) {
|
|
|
|
|
return 'data:image/png;base64,' + media
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* reset data of current form
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
reset() {
|
|
|
|
|
this.state.current = {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
tagsStore.trigger('update', [])
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|