Change node: change icon based of context storage

If you have multiple context types setup in your settings.js like this:

     	contextStorage: {
 			memory     : { module: "memory" },
			default    : { module: "localfilesystem" }

when you go to a change node you will see this
Screen Shot 2020-06-16 at 9.43.04 AM

It would nice if the icon was not displayed for those stored in memory only.

I'm curious to know what is the reasoning for this request? Memory is a context storage as well even if it's not persistent.

I's possible (granted not a good idea) to have two storage types with the same name. In that case you coudn't tell them apart. But more than that say you called them storage1 and storage2, it wouldn't be easy to tell which went to which storage. I just think it would be easier at a quick glance to tell the diffrence.

It always was the plan to have different icons for the stores... just never quite happened. So yes, we should make sure it isn't forgotten again.

I did look thru the Font Awesome (4.7) icons and didn't find one that jumped out at me to represent 'memory' or I would have mentoned it. That's why I suggest leaving it blank when it is 'memory'

There is always fa-microchip ?

2 Likes

The more general point is that anyone could write a context storage plugin. So in theory each may want to provide its own icon. That's where it becomes a bit more involved then just hardcoding a pair of icons for the context stores we happen to provide.

would it be practical to set the icon by the user as a module config setting, which would overwrite the default icon?

 contextStorage: {
      default: "memoryOnly",
    memoryOnly: { module: 'memory',
          config: {
                  icon: fa-microchip
                  }, 
         },
          file: { module: 'localfilesystem',
          config: {
                  icon: fa-hdd-o
                  flushInterval: '300'
                  },
          },
    },
2 Likes