How can i save changes in palette after page refresh?

I have created a button in palette to disable node and disabled it using api method PUT.but after page refresh node automatically enabled .Does anyone know how to deploy this node so i can disable it after page refresh also

Can you share a bit more detail of what you're doing?

For examples, what URL are you sending the put to?

Have you compared the request you are sending with the one the editor sends when you click the disable button for a module in the Palette Editor dialog?

Why do you want a separate button for this?

hiii ... I have put button in palette(that left sidebar) not in palette editor , I am sending request
url: 'nodes/node-red-contrib-example-github-case' like this and i am doing this because I want this deploy button functionality for palette also so i can save changes in palette after page refresh .

And what response do you get from that request? Does it cause the node to get disabled?

What does the Node-RED log show?

The disabled state is held in the runtime. if you have properly disabled it, then reloading the editor won't cause it to be enabled again.

it gives status code :200 in network tab it also removes from palette ,the problem is it will appear after page refreshing, so may i know how to save this change ?

You aren't answering all of my questions each time, so it is hard to help.

What does the Node-RED log show?

Can you test disabling the node via the palette manager, then reload the editor. Does it stay disabled in that case?

In a normal system, you do not need to do anything after making the PUT call to disable the node. The runtime stores in its runtime settings file (~/.node-red/.config.nodes.json) the disabled state of each node. Check that file is being updated properly.

Where is this Node-Red log ? Yes I have disabled it through palette manager it will stay disabled. I was taling about only left sidebar(palette) not through palette manager(settings). I was trying to disable in left sidebar . Also it gives popup "lower-case node disabled" but after refresh page it still there.

Stop node red and start it again in a terminal. Then it will show the log.

If it works when you use the palette manager to disable the node, but not when you use your own code, then your code isn't doing it properly.

It is very hard to say what you are doing wrong with so little detail. All I can see is look at the node-red log, look at the request the Palette Manager makes use the browser's dev tools and try to spot any differences.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.