Skip to content

Commit

Permalink
fix(ui): current action null in nodes manager (#2406)
Browse files Browse the repository at this point in the history
* fix(ui): current action null in nodes manager

* fix(ui): prevent to stop running action when opening nodes manager

* fix: disable inputs when an inclusion is running

* fix: add hint to node naming step

* fix: show current stop action
  • Loading branch information
robertsLando committed May 5, 2022
1 parent 6ee5154 commit 30c28e0
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 12 deletions.
6 changes: 3 additions & 3 deletions src/components/ControlPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
/>
</v-container>

<DialogAddRemove
<DialogNodesManager
v-model="addRemoveShowDialog"
:socket="socket"
@close="onAddRemoveClose"
Expand All @@ -119,7 +119,7 @@
import ConfigApis from '@/apis/ConfigApis'
import { mapGetters, mapMutations } from 'vuex'
import DialogAddRemove from '@/components/dialogs/DialogAddRemove'
import DialogNodesManager from '@/components/dialogs/DialogNodesManager'
import DialogAdvanced from '@/components/dialogs/DialogAdvanced'
import NodesTable from '@/components/nodes-table'
import { Settings } from '@/modules/Settings'
Expand All @@ -134,7 +134,7 @@ export default {
},
components: {
NodesTable,
DialogAddRemove,
DialogNodesManager,
DialogAdvanced,
StatisticsCard,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@
v-model="s.values.action"
mandatory
>
<v-radio :value="0">
<v-radio
:disabled="state === 'start'"
:value="0"
>
<template v-slot:label>
<div class="option">
<v-icon
Expand All @@ -70,7 +73,10 @@
</div>
</template>
</v-radio>
<v-radio :value="1">
<v-radio
:disabled="state === 'start'"
:value="1"
>
<template v-slot:label>
<div class="option">
<v-icon
Expand All @@ -86,7 +92,10 @@
</div>
</template>
</v-radio>
<v-radio :value="2">
<v-radio
:disabled="state === 'start'"
:value="2"
>
<template v-slot:label>
<div class="option">
<v-icon
Expand Down Expand Up @@ -119,7 +128,7 @@
color="error"
@click="stopAction"
>
Stop
Stop running {{ currentAction }}
</v-btn>
</v-card-actions>
</v-card-text>
Expand Down Expand Up @@ -152,6 +161,11 @@
lazy-validation
@submit.prevent
>
<p>
Auto assign a name/location to this
node when it is added. Leave empty
to ignore
</p>
<v-text-field
label="Name"
persistent-hint
Expand Down Expand Up @@ -315,7 +329,7 @@
color="error"
@click="stopAction"
>
Stop
Stop running {{ currentAction }}
</v-btn>
</v-card-actions>
</v-card-text>
Expand Down Expand Up @@ -724,7 +738,10 @@ export default {
},
controllerStatus(status) {
if (status && status.indexOf('clusion') > 0) {
if (this.state === 'new') return // ignore initial status
// it could be inclusion is started by the driver, in that case get the current action
this.currentAction = /inclusion/i.test(status)
? 'Inclusion'
: 'Exclusion'
// inclusion/exclusion started, start the countdown timer
if (status.indexOf('started') > 0) {
Expand Down Expand Up @@ -1005,9 +1022,7 @@ export default {
this.pushStep('action')
// stop any running inclusion/exclusion
if (this.state === 'start') {
this.stopAction()
} else {
if (this.state !== 'start') {
this.stopped = false
this.currentAction = null
}
Expand Down

0 comments on commit 30c28e0

Please sign in to comment.