learningequality / ka-lite

KA Lite: lightweight web server for serving core Khan Academy content (videos and exercises) without needing internet connectivity
https://learningequality.org/ka-lite/
Other
456 stars 304 forks source link

About / diagnose page #5452

Closed benjaoming closed 7 years ago

benjaoming commented 7 years ago

Summary

Let's create a very simple page for the Admin login which displays a link in the user drop down, "About".

Page should display:

Output from diagnose:

KA LITE VERSION:      0.17.1b1
PYTHON:               2.7.12 (default, Nov 19 2016, 06:48:10) 
                      [GCC 5.4.0 20160609]
PLATFORM:             Linux-4.4.0-72-generic-x86_64-with-Ubuntu-16.04-xenial
SERVER STATUS:        Stopped
INSTALLED IN:         /usr/local/lib/python2.7/site-packages/ka-lite
CONTENT ROOT:         /home/kalite/.kalite/content
CONTENT SIZE:         0 bytes
USER DATABASE:        /home/kalite/.kalite/database/data.sqlite
DEVICE NAME:          testvm
DEVICE ID:            12312321312312312312312312312312
DEVICE REGISTERED:    True
SYNCED:               2017-04-14 23:25:34.138159
SYNC RESULT:          OK
ZONE ID:              12312321312312312312312312312312
benjaoming commented 7 years ago

Suggestion to NOT login protect this page:

Normal users should not see links to this page, but it could be valuable for an admin or dev to be able to display the page as debug information regardless of the user logged in.

benjaoming commented 7 years ago

We have been discussing that the data from cli.diagnose takes a lot of processing to calculate depending on how many video files it's counting for storage stats.

So we need an AJAX callback and an API endpoint.

Re: DM from @mrpau-eugene

Or if I maybe I didn’t quite understand what you said, maybe you were talking about making an ajax call or something?

Yes, that's what I meant :) The async part is because the browser can render the page and then have Backbone + handlebars logic render the About page.

There's not a super reason to make it async on the backend... the About page won't be displayed by lots of users at the same time so blocking the main HTTP process isn't a problem I think.

benjaoming commented 7 years ago

Fixed in #5475 :)