@flowfuse/nr-assistant 0.1.2-72f7066-202407151302.0 → 0.1.2-91d5229-202407160719.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/index.html +14 -5
- package/package.json +1 -1
- package/resources/assistant-button.svg +5 -0
package/README.md
CHANGED
|
@@ -25,7 +25,7 @@ The capabilities it adds to Node-RED can be found in Node-RED editor on the main
|
|
|
25
25
|
{
|
|
26
26
|
"flowforge": {
|
|
27
27
|
"assistant": {
|
|
28
|
-
"enabled": true
|
|
28
|
+
"enabled": true,
|
|
29
29
|
"url": "https://", // URL of the AI service
|
|
30
30
|
"token": "", // API token for the AI service
|
|
31
31
|
"requestTimeout": 60000 // Timeout value for the AI service request
|
package/index.html
CHANGED
|
@@ -354,13 +354,22 @@
|
|
|
354
354
|
// const flowBuilderTitle = 'FlowFuse Flow Assistant'
|
|
355
355
|
// RED.actions.add('ff:nr-assistant-flow-builder', showFlowBuilderPrompt, { label: flowBuilderTitle })
|
|
356
356
|
|
|
357
|
-
|
|
358
|
-
const
|
|
359
|
-
|
|
360
|
-
|
|
357
|
+
const toolbarMenuButton = $('<li><a id="red-ui-header-button-ff-ai" class="button" href="#"></a></li>')
|
|
358
|
+
const toolbarMenuButtonAnchor = toolbarMenuButton.find('a')
|
|
359
|
+
toolbarMenuButtonAnchor.css('mask-image', 'url("/resources/@flowfuse/nr-assistant/assistant-button.svg")')
|
|
360
|
+
toolbarMenuButtonAnchor.css('mask-repeat', 'no-repeat')
|
|
361
|
+
toolbarMenuButtonAnchor.css('mask-position', 'center')
|
|
362
|
+
toolbarMenuButtonAnchor.css('background-color', 'currentColor')
|
|
363
|
+
const deployButtonLi = $('#red-ui-header-button-deploy').closest('li')
|
|
364
|
+
if (deployButtonLi.length) {
|
|
365
|
+
deployButtonLi.before(toolbarMenuButton) // add the button before the deploy button
|
|
366
|
+
} else {
|
|
367
|
+
toolbarMenuButton.prependTo('.red-ui-header-toolbar') // add the button leftmost of the toolbar
|
|
368
|
+
}
|
|
369
|
+
toolbarMenuButtonAnchor.on('click', function (e) {
|
|
361
370
|
RED.actions.invoke('ff:nr-assistant-function-builder')
|
|
362
371
|
})
|
|
363
|
-
RED.popover.tooltip(
|
|
372
|
+
RED.popover.tooltip(toolbarMenuButtonAnchor, 'FlowFuse Assistant')
|
|
364
373
|
assistantInitialised = true
|
|
365
374
|
}
|
|
366
375
|
|
package/package.json
CHANGED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg width="30" height="30" viewBox="0 0 30 30" style="" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M26.9949 12.5515C26.5792 12.5515 26.2437 12.8871 26.2437 13.3028V19.6387H19.6674C18.4903 19.6437 17.4836 20.4751 17.3734 21.6321C16.5019 21.5219 15.971 21.2815 15.5903 20.9309C15.1396 20.5202 14.834 19.9342 14.4584 19.253C14.0828 18.5719 13.622 17.7905 12.7805 17.2145C12.1044 16.7487 11.1026 16.5183 9.93062 16.4582V16.0525C9.93062 14.7954 8.95394 13.7836 7.69678 13.7836H1.81166V4.82323C1.81166 4.12703 2.37764 3.55605 3.07884 3.55605H16.7624C17.1781 3.55605 17.5137 3.22047 17.5137 2.80476C17.5137 2.38904 17.1781 2.05347 16.7624 2.05347H3.07884C1.55122 2.05347 0.309082 3.2956 0.309082 4.82323V26.7209C0.309082 28.2485 1.55122 29.4906 3.07884 29.4906H24.9815C26.5091 29.4906 27.7512 28.2485 27.7512 26.7209V13.2978C27.7512 12.8821 27.4157 12.5465 27 12.5465L26.9949 12.5515ZM18.9311 21.8425C18.9311 21.4167 19.2466 21.0661 19.6724 21.0661H26.2437V24.7775H19.6724C19.2466 24.7775 18.9311 24.497 18.9311 24.0713V21.8425ZM7.69678 15.3563C8.12251 15.3563 8.46811 15.6268 8.46811 16.0525V18.2864C8.46811 18.7071 8.12251 18.9976 7.70179 18.9976H1.81166V15.3563H7.69678ZM24.9765 27.988H3.07884C2.38265 27.988 1.81166 27.4221 1.81166 26.7209V20.5603H7.70179C8.95394 20.5603 9.93062 19.5335 9.93062 18.2814V17.9909C10.8171 18.0409 11.5033 18.2062 11.904 18.4817C12.4199 18.8373 12.7455 19.3482 13.1011 19.9943C13.4316 20.5953 13.8023 21.3016 14.4233 21.9226H14.4283C14.4885 21.9977 14.9893 22.5437 15.6505 22.8542C16.2765 23.1547 17.3283 23.2198 17.3283 23.2198V24.0663C17.3283 25.3235 18.4152 26.3402 19.6674 26.3402H26.2437V26.7209C26.2437 27.4171 25.6777 27.988 24.9765 27.988Z" fill="var(--red-ui-header-menu-color)"></path>
|
|
3
|
+
<path d="M29.5043 4.97859L27.1402 4.10208C26.4691 3.85666 25.9432 3.32575 25.6978 2.6596L24.8213 0.295539C24.676 -0.100141 24.115 -0.100141 23.9698 0.295539L23.0933 2.6596C22.8479 3.33076 22.317 3.85666 21.6508 4.10208L19.2868 4.97859C18.8911 5.12384 18.8911 5.6848 19.2868 5.83005L21.6508 6.70656C22.322 6.95198 22.8479 7.48289 23.0933 8.14904L23.9698 10.5131C24.115 10.9088 24.676 10.9088 24.8213 10.5131L25.6978 8.14904C25.9432 7.47788 26.4741 6.95198 27.1402 6.70656L29.5043 5.83005C29.9 5.6848 29.9 5.12384 29.5043 4.97859Z" style="fill: var(--red-ui-header-menu-color);"></path>
|
|
4
|
+
<path d="M16.6822 11.2944L17.8643 11.7302C18.1998 11.8554 18.4603 12.1158 18.5855 12.4514L19.0213 13.6334C19.0964 13.8338 19.3719 13.8338 19.447 13.6334L19.8827 12.4514C20.008 12.1158 20.2684 11.8554 20.604 11.7302L21.786 11.2944C21.9864 11.2193 21.9864 10.9438 21.786 10.8687L20.604 10.4329C20.2684 10.3077 20.008 10.0473 19.8827 9.71168L19.447 8.52965C19.3719 8.32931 19.0914 8.32931 19.0213 8.52965L18.5855 9.71168C18.4603 10.0473 18.1998 10.3077 17.8643 10.4329L16.6822 10.8687C16.4819 10.9438 16.4819 11.2193 16.6822 11.2944Z" style="fill: var(--red-ui-header-menu-color);"></path>
|
|
5
|
+
</svg>
|