|
@@ -55,9 +55,10 @@
|
|
|
|
|
|
<flow-manager
|
|
|
ref="flowManager"
|
|
|
+ :activity="activity"
|
|
|
:registry="registry"
|
|
|
@funcsPanelToggle="funcsActive=!funcsActive"
|
|
|
- @nodeInspect="nodeInspect(...arguments)"
|
|
|
+ @nodeInspect="nodeInspectStart(...arguments)"
|
|
|
|
|
|
width="100%"
|
|
|
height="100%"/>
|
|
@@ -69,7 +70,7 @@
|
|
|
<!-- Node inspector -->
|
|
|
<!-- Move this to a different place -->
|
|
|
<!-- And rename it to inspector -->
|
|
|
- <hx-modal class="flow-modal" v-if="nodeInspectTarget" @close="nodeInspectTarget=null">
|
|
|
+ <hx-modal class="flow-modal" v-if="nodeInspect" @close="nodeInspect=null">
|
|
|
<div slot="header">Node inspector:</div>
|
|
|
<div slot="body" class="flow-modal__body">
|
|
|
<div class="flow-modal__info">
|
|
@@ -79,12 +80,13 @@
|
|
|
style="pointer-events:none"
|
|
|
ref="modalPreviewNode"
|
|
|
transform="translate(150,100)"
|
|
|
- :id="nodeInspectTarget.id"
|
|
|
+ :id="nodeInspect.id"
|
|
|
:match="{}"
|
|
|
- :label="nodeInspectTarget.label"
|
|
|
- :inputs= "registry[nodeInspectTarget.src].inputs"
|
|
|
- :output= "registry[nodeInspectTarget.src].output"
|
|
|
- :nodeStyle= "registry[nodeInspectTarget.src].style"
|
|
|
+ :label="nodeInspect.label"
|
|
|
+ :inputs= "registry[nodeInspect.src].inputs"
|
|
|
+ :output= "registry[nodeInspect.src].output"
|
|
|
+ :activity: "activity[node.id]"
|
|
|
+ :nodeStyle= "registry[nodeInspect.src].style"
|
|
|
/></flow-panzoom>
|
|
|
</svg>
|
|
|
<div class="flow-modal__sockets-properties">
|
|
@@ -92,10 +94,10 @@
|
|
|
<div class="property">Bogus description</div>
|
|
|
<label>Help</label>
|
|
|
<div class="property">Connect to input a thing and goes to output another thing</div>
|
|
|
- <div class="flow-modal__params" v-if="nodeInspectTarget.prop" @keydown.enter="nodeInspectTarget=null">
|
|
|
- <div class="flow-modal__param" v-for="(v,k) in nodeInspectTarget.prop">
|
|
|
+ <div class="flow-modal__params" v-if="nodeInspect.prop" @keydown.enter="nodeInspect=null">
|
|
|
+ <div class="flow-modal__param" v-for="(v,k) in nodeInspect.prop">
|
|
|
<label>{{ k }}</label>
|
|
|
- <input type="text" v-model="nodeInspectTarget.prop[k]">
|
|
|
+ <input type="text" v-model="nodeInspect.prop[k]">
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -104,14 +106,14 @@
|
|
|
<input
|
|
|
ref="modalInput"
|
|
|
type="text"
|
|
|
- v-model="nodeInspectTarget.label"
|
|
|
- @keydown.esc="nodeInspectTarget=null"
|
|
|
- @keydown.enter="nodeInspectTarget=null"
|
|
|
+ v-model="nodeInspect.label"
|
|
|
+ @keydown.esc="nodeInspect=null"
|
|
|
+ @keydown.enter="nodeInspect=null"
|
|
|
>
|
|
|
</div>
|
|
|
<div slot="footer">
|
|
|
- <button class="primary-invert" @click="nodeProcess(nodeInspectTarget)">Run</button>
|
|
|
- <button @click="nodeInspectTarget=false">OK</button>
|
|
|
+ <button class="primary-invert" @click="nodeProcess(nodeInspect)">Run</button>
|
|
|
+ <button @click="nodeInspect=false">OK</button>
|
|
|
</div>
|
|
|
</hx-modal>
|
|
|
|
|
@@ -162,6 +164,7 @@ export default {
|
|
|
data () {
|
|
|
return {
|
|
|
registry: JSON.parse(JSON.stringify(defRegistry)),
|
|
|
+ activity: {},
|
|
|
|
|
|
/* {
|
|
|
// Fixed default stuff
|
|
@@ -186,7 +189,7 @@ export default {
|
|
|
'lineGraph': { group: 'Visualization', inputs: ['[]float32', '[]float32'], style: {'color': '#9a9'} }
|
|
|
}, */
|
|
|
|
|
|
- nodeInspectTarget: false,
|
|
|
+ nodeInspect: false,
|
|
|
|
|
|
funcsSize: '250px',
|
|
|
funcsActive: true,
|
|
@@ -196,14 +199,14 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
- nodeInspectTarget: {
|
|
|
+ nodeInspect: {
|
|
|
handler (val, oldVal) {
|
|
|
if (!val === null && !oldVal) { return }
|
|
|
if (!val) {
|
|
|
this.$refs.flowManager.sendDocumentUpdate()
|
|
|
return
|
|
|
}
|
|
|
- this.$refs.flowManager.sendFlowEvent('nodeUpdate', [this.nodeInspectTarget])
|
|
|
+ this.$refs.flowManager.sendFlowEvent('nodeUpdate', [this.nodeInspect])
|
|
|
},
|
|
|
deep: true
|
|
|
}
|
|
@@ -219,6 +222,10 @@ export default {
|
|
|
this.$flowService.on('registry', (v) => {
|
|
|
this.registry = Object.assign({}, defRegistry, v.data)
|
|
|
})
|
|
|
+ this.$flowService.on('nodeActivity', (v) => {
|
|
|
+ this.activity = v.data || {}
|
|
|
+ })
|
|
|
+
|
|
|
// Connected
|
|
|
this.$flowService.connected(() => {
|
|
|
// Make this in a service
|
|
@@ -230,8 +237,8 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
methods: {
|
|
|
- nodeInspect (node) { // node
|
|
|
- this.nodeInspectTarget = node
|
|
|
+ nodeInspectStart (node) { // node
|
|
|
+ this.nodeInspect = node
|
|
|
this.$nextTick(() => {
|
|
|
if (!this.$refs.modalInput) return
|
|
|
this.$refs.modalInput.setSelectionRange(0, this.$refs.modalInput.value.length)
|