powa-team / powa

PostgreSQL Workload Analyzer
http://powa.readthedocs.io/
PostgreSQL License
778 stars 57 forks source link

Add a demo mode #5

Closed marco44 closed 10 years ago

marco44 commented 10 years ago

It should force the date on all views. Configuration should be something like this:

demo { enabled: 1, base_timestamp : '2014-04-01 12:34:56' }

Should be documented only inside the code. Maybe a wrapper function aroud localtime ?

marco44 commented 10 years ago

Following the internal discussion, maybe if demo is enabled, deactivate the verification that the user is super-user, to make it work with lower privileges ?

rjuju commented 10 years ago

For now, there's no check in the UI that the specified user is super-user, permissions must be granted on the database side. As long as the connected user is allowed to query the powa_* tables the UI will be functional. Otherwise, no data will be displayed.

I'll add a real check that the logged-in user is a super-user (in non demo mode).

rjuju commented 10 years ago

Everything done in commit 61bf9d9048378ae575702b06be15003fb482047a.

Enabling the "demo_mode" only require adding a "base_timestamp" key in the config hash. It has to be compatible with default moment.js parsing "moment(string)" (see http://momentjs.com/docs/#/parsing/string/).