sdetweil / MMM-Config

testing
31 stars 3 forks source link

add support for modules that support multiple instances running at once #2

Closed sdetweil closed 3 years ago

sdetweil commented 3 years ago

MMM-Carousel and MMM-Pages support other modules w multiple instances running. also MMM-FaceReco-dnn

mykle1 commented 3 years ago

You gotta love a guy that writes his own issues.

Brilliant piece of work, bro.

sdetweil commented 3 years ago

so,when there are multiple 'modules' of the same name in config.js, there is a 'list', that will be in order, top down on the first discovery, and maintained from then on. how should they be labeled? see below (each not expanded to not take up too much form room at the start) once u expand it, then if all the lists of modules use the same 'list entry'.. it might be hard to figure out where u are.... but it seems dumb to put the module name in the list entries too

will need to use that same label in the positioning section under the module header...

Screenshot at 2021-05-19 08-52-56

with module name Screenshot at 2021-05-19 08-58-23 Screenshot at 2021-05-19 08-58-36 Screenshot at 2021-05-19 08-58-44 Screenshot at 2021-05-19 08-58-57

lavolp3 commented 3 years ago

Would it be possible to have the user decide? E.g. have them give the module an own id?

{
  module: MyCovid19,
  id: 'Covid19-Page1',
  position: 'top_left',
  config: {
  }
},
{
  module: MyCovid19,
  id: 'Covid19-Page2',
  position: 'top_left',
  config: {
  }
},

A fallback in case of no given id would then be your 2nd suggestion 'MyCovid19 list entry 1'

sdetweil commented 3 years ago

@lavolp3 I had considered that, but if its just decorative, then that wouldn't be a problem. ( I would keep the numerical order under the covers)

sdetweil commented 3 years ago

I have just pushed the 1st pass at multi-module from a user perspective..

can't submit the form,

git pull git fetch git checkout multi-module npm install

there is a file to list modules that can be multiples

modules_list.txt

one module name per line

@lavolp3 this implements the 'label' field , which the user can change to anything they want. default is 'instance n' where n is the order of appearance, 1 = first, etc there is a tab in the positioning section to match if u edit the label, it changes the tab label

this label will be persistent

if all the instances are disabled, then the module shows as disabled, otherwise enabled...

i thought of some tricky half/half shading or hatched text for partial.. later

due to the CSS rules, the instance header currently shows as dark grey.. got to figure that out..

1 known issue..

if u add or delete an instance, the tab below in positions doesn't delete or add..

sdetweil commented 3 years ago

pushed latest, form generation supporting multiple instances... still no saving yet still known issue

sdetweil commented 3 years ago

1 known issue.. resolved

if u add or delete an instance, the tab below in positions DOES add or delete.

sdetweil commented 3 years ago

promoted as only version