Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Major web interface rehaul #489

Merged
merged 78 commits into from
Mar 18, 2015
Merged

Major web interface rehaul #489

merged 78 commits into from
Mar 18, 2015

Conversation

hollie
Copy link
Owner

@hollie hollie commented Mar 15, 2015

Rehaul of the web interface. Let's make it look like it's 2015!

You can test out the web interface by setting the following in your ini file:

html_alias2_ia5=<ia7 directory>
In order to call the header routine from none server-side include pages, header needs to be in code.
I left the images here right now, these can be converted to buttons later, but I thought maybe Audrey users would prefer that these not change?
XML work can likely be expanded for use on many web functions.
Remove BrowseMisterHouse page, it is not needed.

Move all JS code to ia7_utils, create more JS for listing categories
New routine returns all print log messages that have occurred since time.

Added support to JSON and XML servers to serve print_log messages
It works, and seems to work well.  This is pretty cool.
The commit describing the line when added state:

```
Fix to make JSOn vars return without $, %, @ or &
Fix to call vars by name e.g. Time_Now instead of $Time_Now
```

This line seems way overbroad to fix the issue described.  The line was replacing percent signs within voice commands, resulting in an invalid voice command.

Commenting out the line seems to have no effect on any other aspect of the code.  calling json(vars) produces variable names without any $ signs, similarly calling json(subs) does not produce any & signs.
Move large global replacement so that it affects keys not values.  Allows for values to contain protected entities such as in a voice command (e.g. 20%)
I didn't realize a JSON server existed in MH.  JSON has less overhead and is generally easier to deal with.
Attempt to move as much as possible into JavaScript
Similar to a frame concept that was used in ia5.

Partially necessary if we want to have a breadcrumb like navigation.

Makes adding new pages a little easier since only need to program the <div></div> content and not a whole page.
krkeegan and others added 12 commits August 18, 2014 19:53
In the prior schema the same data could appear in different locations depending on the request made.

For example, the same object may have been listed under objects->myobject and groups->main->myobject

This rewrite attempts to restrict data to a single location.  Objects always appear under the object path.

The goal was to start migrating towards a RESTful design.

Certain special paths exist for listing a list of unique values.  These include groups, categories, and types.

There was no code inside MH that relied on the JSON server, so this change should not cause drastic problems.  I apologize to those users who have user_code specifically relying on the old schema.
The prior code was returning both the new lines and the most recent previous line.
Get type is a simple function that returns the object type.  Object types will serve an important function in the next web interface.

Get type is included in the Generic Item package, but a few packages do not inherit from Generic Item, so they need their own functions.
Seemed out of place as a perl file in the web directory.

In the future, user can add (likely with the help of the interace) their own collections.json file in their user data directory to overide or change the collections.
Changed the JSON Schema so that data is not duplicated in multiple locations.  This make parsing on the front end side much easier.

Use the new collections.json file

Move Categories and Types into the object path.  Make "fake" objects for each category and type.  Again this makes parsing on the frontend much easier.

Condense all variables to reside within vars path.

Add parents and members fields to objects

Store JSON complete JSON data on the frontend

Perform various fixes and changes.
Idle times are only reported by seconds, so we need to round the current and requested time to seconds in order to avoid detecting mulitple idendical changes in the first 0-second.
Insert Rough UI for sortable interface

Move sort logic into its own function so that it can be reused.
…PUT Requests

Using the /SUB?json() url is both confusing, unfriendly to developers, and would require lots of JSON specific code to be incorporated into the http_server

Add a number of global variables to HTTP server, allows for processing of HTTP vars by subroutines in other packages.  Could help simplify the http server
It Works!

At the moment, the only thing we are prepared to handle is Sort_Order.

Although other methods can likely be added very easily too, including 'set'
- added print_speaklog* routines to mh, json & xml servers
- layout fixes
- added in advanced/simple functionality
- some random bugfixes
@hollie hollie added this to the Next stable 3.2 milestone Mar 15, 2015
@hollie
Copy link
Owner Author

hollie commented Mar 15, 2015

Just a basic question: would there be a way to give certain objects a 'nice' name to be displayed in the web interface?

The iphone interface has this (you could call $object->set_label("Nice name")).

@hollie
Copy link
Owner Author

hollie commented Mar 15, 2015

I currently have no time to submit a patch, but I notice the link to the wiki still points to the wikispace wiki. Something that needs fixing (and that is possibly not only for ia7).

@hplato
Copy link
Collaborator

hplato commented Mar 18, 2015

Yes, you can give things nice names using the set_label command.

@hplato
Copy link
Collaborator

hplato commented Mar 18, 2015

I'll fix the wiki link, and add instructions on how to use the interface

@hollie
Copy link
Owner Author

hollie commented Mar 18, 2015

Hey @hplato

thanks for the feedback and the fix. Would it be OK for you to already merge this version into master?

@hplato
Copy link
Collaborator

hplato commented Mar 18, 2015

yes is there anything I need to do?

On Mar 18, 2015, at 12:55 AM, Lieven Hollevoet notifications@github.com wrote:

Hey @hplato https://github.com/hplato
thanks for the feedback and the fix. Would it be OK for you to already merge this version into master?


Reply to this email directly or view it on GitHub #489 (comment).

hollie added a commit that referenced this pull request Mar 18, 2015
Major web interface rehaul
@hollie hollie merged commit 3653573 into hollie:master Mar 18, 2015
@hollie
Copy link
Owner Author

hollie commented Mar 18, 2015

No, merge is done. If you add other commits to this branch they should show up here for further merging.

Regards!
Lieven.

@hplato
Copy link
Collaborator

hplato commented Mar 18, 2015

Sounds good. Thanks Lieven.

Sent from my mobile device.

On Mar 18, 2015, at 1:41 PM, Lieven Hollevoet notifications@github.com wrote:

No, merge is done. If you add other commits to this branch they should show up here for further merging.

Regards!
Lieven.


Reply to this email directly or view it on GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants