Commit Graph

32 Commits

Author SHA1 Message Date
Shubham Dhama b26c38bc47 analytics: Make stats of all realms accessible to server admins.
In this commit:
Two new URLs are added, to make all realms accessible for server
admins. One is for the stats page itself and another for getting
chart data i.e. chart data API requests.
For the above two new URLs corresponding two view functions are
added.
2018-04-18 11:06:50 -07:00
Greg Price e78158bcc3 activity: Refactor code for getting chart data.
This simply refactored the repetitive code for getting stats chart
data.
(commit message tweaked by shubhamdhama)
2018-04-17 17:58:01 -07:00
Tim Abbott 65c4a43a82 lint: Fix errors with stats.js with new eslint.
This (for ... in) syntax we shouldn't be using anyway, but this at
least fixes the worst aspect of it.
2018-04-06 12:42:19 -07:00
Utkarsh Patil 10149b75cc stats: Add per-graph loading indicator
This commit ensures that size of each graph is the same before and
after the data is loaded. It also adds a loading indicator to each
graph until the data is loaded.

Fixes https://github.com/zulip/zulip/issues/6490
2017-12-13 14:44:28 -06:00
Tim Abbott 2bc14d256f lint: Ban two spaces after comma in JS code.
We exclude the frontend tests, mostly because the lint rule isn't that
precise, and the test code has some sample user input that's a bit
funny.
2017-10-18 10:22:18 -07:00
derAnfaenger ad5bc4b06c js: Use shorthand $() instead of $(document).ready(). 2017-10-05 10:10:37 -07:00
Nalin Bhardwaj 73de273726 stats: Remove hourly data from messages sent over time.
Fixes #6564.
2017-10-01 22:10:43 -07:00
Umair Khan 95fe984de5 i18n: Do not concatenate i18n strings.
We should use variables in i18n strings to give proper context to the
translators. If the pattern is this:

```
i18n.t("Count " + count + " items")
```

Then it will be captured like this:

```
{"Count" + count + "items": ""}
```

Which is not good for the translators.
2017-09-06 07:01:43 -07:00
Tim Abbott f67326bb81 css: Rename 'Humbug' font to Source Sans Pro.
That's what the font is actually called, and should help future Zulip
developers save time trying to figure out what's up and why our font
is unrelated to the "Humbug" font on the Internet.
2017-08-28 16:16:08 -07:00
Brock Whittaker ac4ac63353 Change from deprecated $.parseJSON to JSON.parse.
The jQuery function `parseJSON` is now deprecated so we should push to
switch to native `JSON.parse` since all browsers support it.
2017-07-27 14:16:57 -07:00
Vishnu Ks 32fddf9a8b analytics: Add translation tags to stats.js. 2017-07-16 16:20:20 -07:00
Brock Whittaker 626c5ef55e analytics: Restyle and refactor /stats page.
This completes a major redesign of the /stats page.
2017-07-07 18:22:32 -07:00
Rishi Gupta a75af36039 stats: Change sort order of client labels to match default view. 2017-05-09 11:32:35 -07:00
Rishi Gupta cf90fed418 stats: Remove users_today from Active Users.
It's technically the number of users yesterday. Also, "number of active
users today" suggests something like daily actives today, whereas this graph
currently shows 2-week actives.
2017-04-28 16:15:07 -07:00
Italo Batista d77d7dc493 analytics: Add a 'me' option for messages_sent_over_time.
With some tweaked by Rishi Gupta.

Fixes #3630.
2017-04-17 22:18:24 -07:00
Archana BS a6b5b03122 stats: Change time ranges for bar graph and pie chart.
- Change templates/analytics/stats.html to use 'Last
  Week', 'Last Month', 'Last Year' time ranges instead
  of 'Last 10 days', 'Last 30 days'.
- Change static/styles/stats.css to not set background
  color for default time option, for messages sent by
  client and message by recipient type.
- Change static/js/stats/stats.js to show only available
  time range options, and set background color for the
  default. The default is Last Month if it exists, and
  otherwise All Time.

Fixes: #3856
2017-03-07 17:25:58 -08:00
Raghav Jajodia d52e08a25c analytics: Add a "Last updated" to the bottom of the stats page.
Fixes #3857.
2017-03-07 16:02:27 -08:00
Rishi Gupta 68a7f91022 stats: Add a fixed display order to summary charts.
API: Adds a "display_order" to the response, which is a suggested order of
importance for the clients or recipient types respectively.

frontend: Changes messages_sent_by_{client,recipient_type} to use a fixed
order for any given user.
2017-02-10 14:41:18 -08:00
Rishi Gupta cf3ae2eafe stats: Turn messages_sent_by_client into a bar chart.
Also includes a number of changes to messages_sent_by_recipient_type that
were convenient to do at the same time, since the two charts share a lot of
code.
2017-02-10 14:41:18 -08:00
Rishi Gupta e01f80bf93 stats.js: Move creation of pie traces into the populate functions.
In preparation for turning messages_sent_by_client into a bar chart.
This removes the "pie-specific" pieces from the functions used by
messages_sent_by_{client,type}.
2017-02-10 14:41:18 -08:00
Rishi Gupta ce89c64f43 stats.js: Move name_map computation to the backend. 2017-02-10 14:41:18 -08:00
Rishi Gupta 8ad7c96382 stats.js: Refactor trace variable to not be list of trace. 2017-02-10 14:41:18 -08:00
Rishi Gupta 677b9e1ec6 stats: Preserve visibility of traces when changing aggregations.
In messages_sent_over_time. Previously, every aggregation kept its own state
regarding which of {Humans, Bots} was showing.
2017-02-07 21:31:34 -08:00
Rishi Gupta 22df58289f stats.js: Fix round_to_percentages when percentage is 100.
Fixes bug introduced in 9901128.
2017-02-07 21:31:34 -08:00
Rishi Gupta 18508ca02c stats.js: Clean up code for the number of users chart. 2017-02-07 18:55:35 -08:00
Rishi Gupta ac42ad0322 stats.js: Replace font and button colors with variables. 2017-02-07 18:55:35 -08:00
Rishi Gupta 5f2c70c61f stats.js: Refactor code for the two pie charts.
Also fixes a bug where we didn't probably update the labels when clicking on
the Me/Everyone/10/30/Cumulative buttons.
2017-02-07 18:55:35 -08:00
Rishi Gupta 9901128b33 stats.js: Change how we set the precision for percentages close to 100%. 2017-02-07 18:55:35 -08:00
Rishi Gupta 5f7cb9db16 stats.js: Reorder code to match the order of the charts on /stats. 2017-02-07 18:55:35 -08:00
Rishi Gupta 796ac7bfe6 stats.js: Remove the throw_error helper function. 2017-02-07 18:55:35 -08:00
Rishi Gupta e0cb009f1b analytics: Refactor and clean up messages_sent_over_time. 2017-02-07 15:35:43 -08:00
Rishi Gupta 3c692684a0 analytics: Move stats.js out of portico/.
stats.js is a logged-in view.
2017-02-07 15:35:43 -08:00