imbrianj / switchBoard

Control of Internet connected devices within a given network via web interface.
MIT License
201 stars 53 forks source link

Settings page prototype #52

Closed andresn closed 8 years ago

andresn commented 8 years ago

@imbrianj just a very rough prototype / proof of concept to get the conversation started / see what you think. Especially, in terms of a proper home for something like this etc. There's also a save button at the very end of the markup not seen in the screencast, the console log you see in the screencast [1] would be the hook to write the new config to the file system. Also, make sure you scroll down to the very bottom of the screencast if you're on your laptop so you can see how the object mutates.

[1] http://screencast.com/t/B4a8Wtd4nuu

imbrianj commented 8 years ago

I think, for the final implementation, I'd like to have a new device controller called "config" that has it's own static vars that elaborate on the config file properties - making the easy config simply a layer on top of the standard config. For the actual interface and dynamically generating, that can all easily be done in it's own parser method. It'd be tedious, but not too hard. Once this config is saved, I'll need to find a way to update the config object without restarting the whole server.

For the config property types, it'll take the fields that are available for each controller and build out their types - such as IP, port, path, username, password, etc - and build out the form fields as appropriate. There should (hopefully) only be a handful of field types.

I'll likely close this PR without merge - but use your work as a prototype.

imbrianj commented 8 years ago

Other things that'll be a pain (but can be deferred): app config (since they can be pretty complicated, depending on what they do) and multi-devices (if you have two or more samsung TVs).

imbrianj commented 8 years ago

Closing this out. I'll take some of these ideas and get them integrated into a proper device controller. I'll leave it as "in development" - so shouldn't be used (may not even include it in the config), but start getting code in the right places to move things along. I prefer having baby steps in Master unless it's some whacky rewrite - but that's mostly because it's really just me working on it.

andresn commented 8 years ago

Wrt your pain points, what do you mean by "app config"? Wrt multi-device support, you bring up a great point, it might be worth starting to think about having each device config turn into a device object with a unique key, that can copy / extend a template configuration for any given device. This object itself could then communicate how it wishes to be seen / rendered as HTML? Just food for thought for now.