2017-02-18 01:56:23 -07:00
|
|
|
'use strict';
|
2017-02-17 21:55:19 -07:00
|
|
|
|
2014-10-08 15:36:47 -04:00
|
|
|
|
2021-12-06 14:31:35 -05:00
|
|
|
define('admin/dashboard', [
|
|
|
|
|
'Chart', 'translator', 'benchpress', 'bootbox', 'alerts',
|
|
|
|
|
], function (Chart, translator, Benchpress, bootbox, alerts) {
|
2021-11-16 16:24:17 -05:00
|
|
|
const Admin = {};
|
|
|
|
|
const intervals = {
|
2016-12-08 17:17:24 -07:00
|
|
|
rooms: false,
|
2017-02-17 19:31:21 -07:00
|
|
|
graphs: false,
|
2016-12-08 17:17:24 -07:00
|
|
|
};
|
2021-10-12 17:26:18 +03:00
|
|
|
let isMobile = false;
|
2021-11-16 16:24:17 -05:00
|
|
|
const graphData = {
|
2016-12-08 17:17:24 -07:00
|
|
|
rooms: {},
|
2017-02-17 19:31:21 -07:00
|
|
|
traffic: {},
|
2016-12-08 17:17:24 -07:00
|
|
|
};
|
2021-11-16 16:24:17 -05:00
|
|
|
const currentGraph = {
|
2016-12-08 17:17:24 -07:00
|
|
|
units: 'hours',
|
2017-02-17 19:31:21 -07:00
|
|
|
until: undefined,
|
2016-12-08 17:17:24 -07:00
|
|
|
};
|
2014-10-08 15:36:47 -04:00
|
|
|
|
2021-10-12 17:26:18 +03:00
|
|
|
const DEFAULTS = {
|
2015-07-08 16:35:59 -04:00
|
|
|
roomInterval: 10000,
|
|
|
|
|
graphInterval: 15000,
|
2017-02-17 19:31:21 -07:00
|
|
|
realtimeInterval: 1500,
|
2015-07-08 16:35:59 -04:00
|
|
|
};
|
2017-02-18 01:27:46 -07:00
|
|
|
|
2021-11-16 16:24:17 -05:00
|
|
|
const usedTopicColors = [];
|
2017-02-18 18:55:33 -07:00
|
|
|
|
2017-02-18 15:05:36 -07:00
|
|
|
$(window).on('action:ajaxify.start', function () {
|
2016-03-09 21:36:20 +02:00
|
|
|
clearInterval(intervals.rooms);
|
|
|
|
|
clearInterval(intervals.graphs);
|
|
|
|
|
|
|
|
|
|
intervals.rooms = null;
|
|
|
|
|
intervals.graphs = null;
|
|
|
|
|
graphData.rooms = null;
|
|
|
|
|
graphData.traffic = null;
|
|
|
|
|
usedTopicColors.length = 0;
|
|
|
|
|
});
|
2014-10-08 15:36:47 -04:00
|
|
|
|
2016-10-13 11:43:39 +02:00
|
|
|
Admin.init = function () {
|
2014-10-08 15:36:47 -04:00
|
|
|
app.enterRoom('admin');
|
|
|
|
|
|
2014-10-17 23:14:17 -04:00
|
|
|
isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
2014-10-08 15:36:47 -04:00
|
|
|
|
2015-07-08 16:35:59 -04:00
|
|
|
setupRealtimeButton();
|
2017-03-13 20:20:41 -07:00
|
|
|
setupGraphs(function () {
|
|
|
|
|
socket.emit('admin.rooms.getAll', Admin.updateRoomUsage);
|
|
|
|
|
initiateDashboard();
|
|
|
|
|
});
|
2018-04-09 11:50:30 -04:00
|
|
|
setupFullscreen();
|
2014-10-08 15:36:47 -04:00
|
|
|
};
|
|
|
|
|
|
2016-10-13 11:43:39 +02:00
|
|
|
Admin.updateRoomUsage = function (err, data) {
|
2014-10-08 15:36:47 -04:00
|
|
|
if (err) {
|
2021-12-06 14:31:35 -05:00
|
|
|
return alerts.error(err);
|
2014-10-08 15:36:47 -04:00
|
|
|
}
|
|
|
|
|
|
2015-07-08 16:54:39 -04:00
|
|
|
if (JSON.stringify(graphData.rooms) === JSON.stringify(data)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
graphData.rooms = data;
|
|
|
|
|
|
Bootstrap5 (#10894)
* chore: up deps
* chore: up composer
* fix(deps): bump 2factor to v7
* chore: up harmony
* chore: up harmony
* fix: missing await
* feat: allow middlewares to pass in template values via res.locals
* feat: buildAccountData middleware automatically added ot all account routes
* fix: properly allow values in res.locals.templateValues to be added to the template data
* refactor: user/blocks
* refactor(accounts): categories and consent
* feat: automatically 404 if exposeUid or exposeGroupName come up empty
* refactor: remove calls to getUserDataByUserSlug for most account routes, since it is populated via middleware now
* fix: allow exposeUid and exposeGroupName to work with slugs with mixed capitalization
* fix: move reputation removal check to accountHelpers method
* test: skip i18n tests if ref branch when present is not develop
* fix(deps): bump theme versions
* fix(deps): bump ntfy and 2factor
* chore: up harmony
* fix: add missing return
* fix: #11191, only focus on search input on md environments and up
* feat: allow file uploads on mobile chat
closes https://github.com/NodeBB/NodeBB/issues/11217
* chore: up themes
* chore: add lang string
* fix(deps): bump ntfy to 1.0.15
* refactor: use new if/each syntax
* chore: up composer
* fix: regression from user helper refactor
* chore: up harmony
* chore: up composer
* chore: up harmony
* chore: up harmony
* chore: up harmony
* chore: fix composer version
* feat: add increment helper
* chore: up harmony
* fix: #11228 no timestamps in future :hourglass:
* chore: up harmony
* check config.theme as well
fire action:posts.loaded after processing dom
* chore: up harmony
* chore: up harmony
* chore: up harmony
* chore: up themes
* chore: up harmony
* remove extra class
* refactor: move these to core from harmony
* chore: up widgets
* chore: up widgets
* height auto
* fix: closes #11238
* dont focus inputs, annoying on mobile
* fix: dont focus twice, only focus on chat input on desktop
dont wrap widget footer in row
* chore: up harmony
* chore: up harmony
* update chat window
* chore: up themes
* fix cache buster for skins
* chat fixes
* chore: up harmony
* chore: up composer
* refactor: change hook logs to debug
* fix: scroll to post right after adding to dom
* fix: hash scrolling and highlighting correct post
* test: re-enable read API schema tests
* fix: add back schema changes for 179faa2270f2ad955dcc4a7b04755acce59e6ffd and c3920ccb10d8ead2dcd9914bb1784bed3f6adfd4
* fix: schema changes from 488f0978a4aa1ca1e4d2a1f2e8c7ef7a681f2f27
* fix: schema changes for f4cf482a874701ce80c0f306c49d8788cec66f87
* fix: schema update for be6bbabd0e2551fbe9571dcf3ee40ad721764543
* fix: schema changes for 69c96078ea78ee2c45885a90a6f6a59f9042a33c
* fix: schema changes for d1364c313021e48a879a818b24947e1457c062f7
* fix: schema changes for 84ff1152f7552dd866e25a90972d970b9861107e
* fix: schema changes for b860c2605c209e0650ef98f4c80d842ea23a51ce
* fix: schema changes for 23cb67a1126481848fac39aafd1e253441e76d7f
* fix: schema changes for b916e42f400dac8aa51670b15e439f87f0eb8939
* fix: schema change for a9bbb586fcb3a1c61b5fb69052236e78cdf7d743
* fix: schema changes for 4b738c8cd36c936a1dbe2bb900c694bf6c5520ec
* fix: schema changes for 58b5781cea9acb129e6604a82ab5a5bfc0d8394d
* fix: schema changes for 794bf01b21709c4be06584d576d706b3d6342057
* fix: schema changes for 80ea12c1c1963f5b39fb64841e4f3c8da3c87af2, e368feef51e0766f119c9710fb4db8f64724725c, and 52ead114bec961c62fa2eb0786540e229f6e4873
* fix: composer-default object in config?
* fix: schema changes for 9acdc6808c070555352951c651921df181b10993 and 093093420027999df3c67bf0ea6024f6dbf81d2d
* fix: schema changes for c0a52924f1f7ef8caeaacda67363ac269b56042c
* fix: schema change for aba420a3f3b774e949c2539c73f3dc0e1ae79a38, move loggedInUser to optional props
* fix: schema changes for 8c67031609da30d788561459f8bb76e9a69253de
* fix: schema changes for 27e53b42f3ce48fa61d3754375715cd41ffe808d
* fix: schema changes for 28359665187b0a3b9ec6226dca1234ebdbd725a5
* fix: breaking test for email confirmation API call
* fix: schema changes for refactored search page
* fix: schema changes for user object
* fix: schema changes for 9f531f957e08eabb4bae844ddd67bde14d9b59f0
* fix: schema changes for c4042c70decd628e5b880bd109515b47e4e16164 and 23175110a29640e6fa052db1079bfedb34a61055
* fix: schema changes for 9b3616b10392e247974eb0c1e6225a1582bf6c69
* fix: schema changes for 5afd5de07d42fd33f039a6f85ded3b4992200e5a
* fix: schema change for 1d7baf12171cffbd3af8914bef4e6297d1160d49
* fix: schema changes for 57bfb37c55a839662144e684875003ab52315ecc and be6bbabd0e2551fbe9571dcf3ee40ad721764543
* fix: schema changes for 6e86b4afa20d662af8b9f1c07518df2d8c258105 and 3efad2e13b7319eb9a1f4fda7af047be43ebc11f and 68f66223e73a72f378f193c83a9b5546bede2cda
* fix: allowing optional qs prop in pagination keys (not sure why this didn't break before)
* fix: re-login on email change
* fix: schema changes for c926358d734a2fa410de87f4e4a91744215fc14a
* fix: schema changes for 388a8270c9882892bad5c8141f65da8d59eac0fd
* fix: schema change for 2658bcc821c22e137a6eeb9bb74098856a642eaf
* fix: no need to call account middlewares for chats routes
* fix: schema changes for 71743affc3e58dc85d4ffa15ce043d4d9ddd3d67
* fix: final schema changes
* test: support for anyOf and oneOf
* fix: check thumb
* dont scroll to top on back press
* remove group log
* fix: add top margin to merged and deleted alerts
* chore: up widgets
* fix: improve fix-lists mixin
* chore: up harmony/composer
* feat: allow hiding quicksearch results during search
* dont record searches made by composer
* chore: up 54
* chore: up spam be gone
* feat: add prev/next page and page count into mobile paginator
* chore: up harmony
* chore: up harmony
* use old style for IS
* fix: hide entire toolbar row if no posts or not singlePost
* fix: updated messaging for post-queue template, #11206
* fix: btn-sm on post queue back button
* fix: bump harmony, closes #11206
* fix: remove unused alert module import
* fix: bump harmony
* fix: bump harmony
* chore: up harmony
* refactor: IS scrolltop
* fix: update users:search-user-for-chat source string
* feat: support for mark-read toggle on chats dropdown and recent chats list
* feat: api v3 calls to mark chat read/unread
* feat: send event:chats.mark socket event on mark read or unread
* refactor: allow frontend to mark chats as unread, use new API v3 routes instead of socket calls, better frontend event handling
* docs: openapi schema updates for chat marking
* fix: allow unread state toggling in chats dropdown too
* fix: issue where repeated openings of the chats dropdown would continually add events for mark-read/unread
* fix: debug log
* refactor: move userSearch filter to a module
* feat(routes): allow remounting /categories (#11230)
* feat: send flags count to frontend on flags list page
* refactor: filter form client-side js to extract out some logic
* fix: applyFilters to not take any arguments, update selectedCids in updateButton instead of onHidden
* fix: use userFilter module for assignee, reporterId, targetUid
* fix(openapi): schema changes for updated flags page
* fix: dont allow adding duplicates to userFilter
* use same var
* remove log
* fix: closes #11282
* feat: lang key for x-topics
* chore: up harmony
* chore: up emoji
* chore: up harmony
* fix: update userFilter to allow new option `selectedBlock`
* fix: wrong block name passed to userFilter
* fix: https://github.com/NodeBB/NodeBB/issues/11283
* fix: chats, allow multiple dropdowns like in harmony
* chore: up harmony
* refactor: flag note adding/editing, closes #11285
* fix: remove old prepareEdit logic
* chore: add caveat about hacky code block in userFilter module
* fix: placeholders for userFilter module
* refactor: navigator so it works with multiple thumbs/navigators
* chore: up harmony
* fix: closes #11287, destroy quick reply autocomplete
on navigation
* fix: filter disabled categories on user categories page count
* chore: up harmony
* docs: update openapi spec to include info about passing in timestamps for topic creation, removing timestamp as valid request param for topic replying
* fix: send back null values on ACP search dashboard for startDate and endDate if not expicitly passed in, fix tests
* fix: tweak table order in ACP dash searches
* fix: only invoke navigator click drag on left mouse button
* feat: add back unread indicator to navigator
* clear bookmark on mark unread
* fix: navigator crash on ajaxify
* better thumb top calculation
* fix: reset user bookmark when topic is marked unread
* Revert "fix: reset user bookmark when topic is marked unread"
This reverts commit 9bcd85c2c6848c3d325d32027261809da6e11c9e.
* fix: update unread indicator on scroll, add unread count
* chore: bump harmony
* fix: crash on navigator unread update when backing out of a topic
* fix: closes #11183
* fix: update topics:recent zset when rescheduling a topic
* fix: dupe quote button, increase delay, hide immediately on empty selection
* fix: navigator not showing up on first load
* refactor: remove glance
assorted fixes to navigator
dont reduce remaning count if user scrolls down and up quickly
only call topic.navigatorCallback when index changes
* more sanity checks for bookmark
dont allow setting bookmark higher than topic postcount
* closes #11218, :train:
* Revert "fix: update topics:recent zset when rescheduling a topic"
This reverts commit 737973cca9e94b6cb3867492a09e1e0b1af391d5.
* fix: #11306, show proper error if queued post doesn't exist
was showing no-privileges if someone else accepted the post
* https://github.com/NodeBB/NodeBB/issues/11307
dont use li
* chore: up harmony
* chore: bump version string
* fix: copy paste fail
* feat: closes #7382, tag filtering
add client side support for filtering by tags on /category, /recent and /unread
* chore: up harmony
* chore: up harmony
* Revert "fix: add back req.query fallback for backwards compatibility" [breaking]
This reverts commit cf6cc2c454dc35c330393c62ee8ce67b42d8eefb.
This commit is no longer required as passing in a CSRF token via query parameter is no longer supported as of NodeBB v3.x
This is a breaking change.
* fix: pass csrf token in form data, re: NodeBB/NodeBB#11309
* chore: up deps
* fix: tests, use x-csrf-token query param removed
* test: fix csrf_token
* lint: remove unused
* feat: add itemprop="image" to avatar helper
* fix: get chat upload button in chat modal
* breaking: remove deprecated socket.io methods
* test: update messaging tests to not use sockets
* fix: parent post links
* fix: prevent post tooltip if mouse leaves before data/tpl is loaded
* chore: up harmony
* chore: up harmony
* chore: up harmony
* chore: up harmony
* fix: nested replies indices
* fix(deps): bump 2factor
* feat: add loggedIn user to all api routes
* chore: up themes
* refactor: audit admin v3 write api routes as per #11321
* refactor: audit category v3 write api routes as per #11321 [breaking]
docs: fix open api spec for #11321
* refactor: audit chat v3 write api routes as per #11321
* refactor: audit files v3 write api routes as per #11321
* refactor: audit flags v3 write api routes as per #11321
* refactor: audit posts v3 write api routes as per #11321
* refactor: audit topics v3 write api routes as per #11321
* refactor: audit users v3 write api routes as per #11321
* fix: lang string
* remove min height
* fix: empty topic/labels taking up space
* fix: tag filtering when changing filter to watched topics
or changing popular time limit to month
* chore: up harmony
* fix: closes #11354, show no post error if queued post already accepted/rejected
* test: #11354
* test: #11354
* fix(deps): bump 2factor
* fix: #11357 clear cache on thumb remove
* fix: thumb remove on windows, closes #11357
* test: openapi for thumbs
* test: fix openapi
---------
Co-authored-by: Julian Lam <julian@nodebb.org>
Co-authored-by: Opliko <opliko.reg@protonmail.com>
2023-03-17 11:58:31 -04:00
|
|
|
const html = '<div class="text-center float-start">' +
|
2018-11-28 20:29:43 -07:00
|
|
|
'<span class="formatted-number">' + data.onlineRegisteredCount + '</span>' +
|
2023-05-31 11:54:48 -04:00
|
|
|
'<div class="stat text-nowrap">[[admin/dashboard:active-users.users]]</div>' +
|
2018-11-28 20:29:43 -07:00
|
|
|
'</div>' +
|
Bootstrap5 (#10894)
* chore: up deps
* chore: up composer
* fix(deps): bump 2factor to v7
* chore: up harmony
* chore: up harmony
* fix: missing await
* feat: allow middlewares to pass in template values via res.locals
* feat: buildAccountData middleware automatically added ot all account routes
* fix: properly allow values in res.locals.templateValues to be added to the template data
* refactor: user/blocks
* refactor(accounts): categories and consent
* feat: automatically 404 if exposeUid or exposeGroupName come up empty
* refactor: remove calls to getUserDataByUserSlug for most account routes, since it is populated via middleware now
* fix: allow exposeUid and exposeGroupName to work with slugs with mixed capitalization
* fix: move reputation removal check to accountHelpers method
* test: skip i18n tests if ref branch when present is not develop
* fix(deps): bump theme versions
* fix(deps): bump ntfy and 2factor
* chore: up harmony
* fix: add missing return
* fix: #11191, only focus on search input on md environments and up
* feat: allow file uploads on mobile chat
closes https://github.com/NodeBB/NodeBB/issues/11217
* chore: up themes
* chore: add lang string
* fix(deps): bump ntfy to 1.0.15
* refactor: use new if/each syntax
* chore: up composer
* fix: regression from user helper refactor
* chore: up harmony
* chore: up composer
* chore: up harmony
* chore: up harmony
* chore: up harmony
* chore: fix composer version
* feat: add increment helper
* chore: up harmony
* fix: #11228 no timestamps in future :hourglass:
* chore: up harmony
* check config.theme as well
fire action:posts.loaded after processing dom
* chore: up harmony
* chore: up harmony
* chore: up harmony
* chore: up themes
* chore: up harmony
* remove extra class
* refactor: move these to core from harmony
* chore: up widgets
* chore: up widgets
* height auto
* fix: closes #11238
* dont focus inputs, annoying on mobile
* fix: dont focus twice, only focus on chat input on desktop
dont wrap widget footer in row
* chore: up harmony
* chore: up harmony
* update chat window
* chore: up themes
* fix cache buster for skins
* chat fixes
* chore: up harmony
* chore: up composer
* refactor: change hook logs to debug
* fix: scroll to post right after adding to dom
* fix: hash scrolling and highlighting correct post
* test: re-enable read API schema tests
* fix: add back schema changes for 179faa2270f2ad955dcc4a7b04755acce59e6ffd and c3920ccb10d8ead2dcd9914bb1784bed3f6adfd4
* fix: schema changes from 488f0978a4aa1ca1e4d2a1f2e8c7ef7a681f2f27
* fix: schema changes for f4cf482a874701ce80c0f306c49d8788cec66f87
* fix: schema update for be6bbabd0e2551fbe9571dcf3ee40ad721764543
* fix: schema changes for 69c96078ea78ee2c45885a90a6f6a59f9042a33c
* fix: schema changes for d1364c313021e48a879a818b24947e1457c062f7
* fix: schema changes for 84ff1152f7552dd866e25a90972d970b9861107e
* fix: schema changes for b860c2605c209e0650ef98f4c80d842ea23a51ce
* fix: schema changes for 23cb67a1126481848fac39aafd1e253441e76d7f
* fix: schema changes for b916e42f400dac8aa51670b15e439f87f0eb8939
* fix: schema change for a9bbb586fcb3a1c61b5fb69052236e78cdf7d743
* fix: schema changes for 4b738c8cd36c936a1dbe2bb900c694bf6c5520ec
* fix: schema changes for 58b5781cea9acb129e6604a82ab5a5bfc0d8394d
* fix: schema changes for 794bf01b21709c4be06584d576d706b3d6342057
* fix: schema changes for 80ea12c1c1963f5b39fb64841e4f3c8da3c87af2, e368feef51e0766f119c9710fb4db8f64724725c, and 52ead114bec961c62fa2eb0786540e229f6e4873
* fix: composer-default object in config?
* fix: schema changes for 9acdc6808c070555352951c651921df181b10993 and 093093420027999df3c67bf0ea6024f6dbf81d2d
* fix: schema changes for c0a52924f1f7ef8caeaacda67363ac269b56042c
* fix: schema change for aba420a3f3b774e949c2539c73f3dc0e1ae79a38, move loggedInUser to optional props
* fix: schema changes for 8c67031609da30d788561459f8bb76e9a69253de
* fix: schema changes for 27e53b42f3ce48fa61d3754375715cd41ffe808d
* fix: schema changes for 28359665187b0a3b9ec6226dca1234ebdbd725a5
* fix: breaking test for email confirmation API call
* fix: schema changes for refactored search page
* fix: schema changes for user object
* fix: schema changes for 9f531f957e08eabb4bae844ddd67bde14d9b59f0
* fix: schema changes for c4042c70decd628e5b880bd109515b47e4e16164 and 23175110a29640e6fa052db1079bfedb34a61055
* fix: schema changes for 9b3616b10392e247974eb0c1e6225a1582bf6c69
* fix: schema changes for 5afd5de07d42fd33f039a6f85ded3b4992200e5a
* fix: schema change for 1d7baf12171cffbd3af8914bef4e6297d1160d49
* fix: schema changes for 57bfb37c55a839662144e684875003ab52315ecc and be6bbabd0e2551fbe9571dcf3ee40ad721764543
* fix: schema changes for 6e86b4afa20d662af8b9f1c07518df2d8c258105 and 3efad2e13b7319eb9a1f4fda7af047be43ebc11f and 68f66223e73a72f378f193c83a9b5546bede2cda
* fix: allowing optional qs prop in pagination keys (not sure why this didn't break before)
* fix: re-login on email change
* fix: schema changes for c926358d734a2fa410de87f4e4a91744215fc14a
* fix: schema changes for 388a8270c9882892bad5c8141f65da8d59eac0fd
* fix: schema change for 2658bcc821c22e137a6eeb9bb74098856a642eaf
* fix: no need to call account middlewares for chats routes
* fix: schema changes for 71743affc3e58dc85d4ffa15ce043d4d9ddd3d67
* fix: final schema changes
* test: support for anyOf and oneOf
* fix: check thumb
* dont scroll to top on back press
* remove group log
* fix: add top margin to merged and deleted alerts
* chore: up widgets
* fix: improve fix-lists mixin
* chore: up harmony/composer
* feat: allow hiding quicksearch results during search
* dont record searches made by composer
* chore: up 54
* chore: up spam be gone
* feat: add prev/next page and page count into mobile paginator
* chore: up harmony
* chore: up harmony
* use old style for IS
* fix: hide entire toolbar row if no posts or not singlePost
* fix: updated messaging for post-queue template, #11206
* fix: btn-sm on post queue back button
* fix: bump harmony, closes #11206
* fix: remove unused alert module import
* fix: bump harmony
* fix: bump harmony
* chore: up harmony
* refactor: IS scrolltop
* fix: update users:search-user-for-chat source string
* feat: support for mark-read toggle on chats dropdown and recent chats list
* feat: api v3 calls to mark chat read/unread
* feat: send event:chats.mark socket event on mark read or unread
* refactor: allow frontend to mark chats as unread, use new API v3 routes instead of socket calls, better frontend event handling
* docs: openapi schema updates for chat marking
* fix: allow unread state toggling in chats dropdown too
* fix: issue where repeated openings of the chats dropdown would continually add events for mark-read/unread
* fix: debug log
* refactor: move userSearch filter to a module
* feat(routes): allow remounting /categories (#11230)
* feat: send flags count to frontend on flags list page
* refactor: filter form client-side js to extract out some logic
* fix: applyFilters to not take any arguments, update selectedCids in updateButton instead of onHidden
* fix: use userFilter module for assignee, reporterId, targetUid
* fix(openapi): schema changes for updated flags page
* fix: dont allow adding duplicates to userFilter
* use same var
* remove log
* fix: closes #11282
* feat: lang key for x-topics
* chore: up harmony
* chore: up emoji
* chore: up harmony
* fix: update userFilter to allow new option `selectedBlock`
* fix: wrong block name passed to userFilter
* fix: https://github.com/NodeBB/NodeBB/issues/11283
* fix: chats, allow multiple dropdowns like in harmony
* chore: up harmony
* refactor: flag note adding/editing, closes #11285
* fix: remove old prepareEdit logic
* chore: add caveat about hacky code block in userFilter module
* fix: placeholders for userFilter module
* refactor: navigator so it works with multiple thumbs/navigators
* chore: up harmony
* fix: closes #11287, destroy quick reply autocomplete
on navigation
* fix: filter disabled categories on user categories page count
* chore: up harmony
* docs: update openapi spec to include info about passing in timestamps for topic creation, removing timestamp as valid request param for topic replying
* fix: send back null values on ACP search dashboard for startDate and endDate if not expicitly passed in, fix tests
* fix: tweak table order in ACP dash searches
* fix: only invoke navigator click drag on left mouse button
* feat: add back unread indicator to navigator
* clear bookmark on mark unread
* fix: navigator crash on ajaxify
* better thumb top calculation
* fix: reset user bookmark when topic is marked unread
* Revert "fix: reset user bookmark when topic is marked unread"
This reverts commit 9bcd85c2c6848c3d325d32027261809da6e11c9e.
* fix: update unread indicator on scroll, add unread count
* chore: bump harmony
* fix: crash on navigator unread update when backing out of a topic
* fix: closes #11183
* fix: update topics:recent zset when rescheduling a topic
* fix: dupe quote button, increase delay, hide immediately on empty selection
* fix: navigator not showing up on first load
* refactor: remove glance
assorted fixes to navigator
dont reduce remaning count if user scrolls down and up quickly
only call topic.navigatorCallback when index changes
* more sanity checks for bookmark
dont allow setting bookmark higher than topic postcount
* closes #11218, :train:
* Revert "fix: update topics:recent zset when rescheduling a topic"
This reverts commit 737973cca9e94b6cb3867492a09e1e0b1af391d5.
* fix: #11306, show proper error if queued post doesn't exist
was showing no-privileges if someone else accepted the post
* https://github.com/NodeBB/NodeBB/issues/11307
dont use li
* chore: up harmony
* chore: bump version string
* fix: copy paste fail
* feat: closes #7382, tag filtering
add client side support for filtering by tags on /category, /recent and /unread
* chore: up harmony
* chore: up harmony
* Revert "fix: add back req.query fallback for backwards compatibility" [breaking]
This reverts commit cf6cc2c454dc35c330393c62ee8ce67b42d8eefb.
This commit is no longer required as passing in a CSRF token via query parameter is no longer supported as of NodeBB v3.x
This is a breaking change.
* fix: pass csrf token in form data, re: NodeBB/NodeBB#11309
* chore: up deps
* fix: tests, use x-csrf-token query param removed
* test: fix csrf_token
* lint: remove unused
* feat: add itemprop="image" to avatar helper
* fix: get chat upload button in chat modal
* breaking: remove deprecated socket.io methods
* test: update messaging tests to not use sockets
* fix: parent post links
* fix: prevent post tooltip if mouse leaves before data/tpl is loaded
* chore: up harmony
* chore: up harmony
* chore: up harmony
* chore: up harmony
* fix: nested replies indices
* fix(deps): bump 2factor
* feat: add loggedIn user to all api routes
* chore: up themes
* refactor: audit admin v3 write api routes as per #11321
* refactor: audit category v3 write api routes as per #11321 [breaking]
docs: fix open api spec for #11321
* refactor: audit chat v3 write api routes as per #11321
* refactor: audit files v3 write api routes as per #11321
* refactor: audit flags v3 write api routes as per #11321
* refactor: audit posts v3 write api routes as per #11321
* refactor: audit topics v3 write api routes as per #11321
* refactor: audit users v3 write api routes as per #11321
* fix: lang string
* remove min height
* fix: empty topic/labels taking up space
* fix: tag filtering when changing filter to watched topics
or changing popular time limit to month
* chore: up harmony
* fix: closes #11354, show no post error if queued post already accepted/rejected
* test: #11354
* test: #11354
* fix(deps): bump 2factor
* fix: #11357 clear cache on thumb remove
* fix: thumb remove on windows, closes #11357
* test: openapi for thumbs
* test: fix openapi
---------
Co-authored-by: Julian Lam <julian@nodebb.org>
Co-authored-by: Opliko <opliko.reg@protonmail.com>
2023-03-17 11:58:31 -04:00
|
|
|
'<div class="text-center float-start">' +
|
2018-11-28 20:29:43 -07:00
|
|
|
'<span class="formatted-number">' + data.onlineGuestCount + '</span>' +
|
2023-05-31 11:54:48 -04:00
|
|
|
'<div class="stat text-nowrap">[[admin/dashboard:active-users.guests]]</div>' +
|
2018-11-28 20:29:43 -07:00
|
|
|
'</div>' +
|
Bootstrap5 (#10894)
* chore: up deps
* chore: up composer
* fix(deps): bump 2factor to v7
* chore: up harmony
* chore: up harmony
* fix: missing await
* feat: allow middlewares to pass in template values via res.locals
* feat: buildAccountData middleware automatically added ot all account routes
* fix: properly allow values in res.locals.templateValues to be added to the template data
* refactor: user/blocks
* refactor(accounts): categories and consent
* feat: automatically 404 if exposeUid or exposeGroupName come up empty
* refactor: remove calls to getUserDataByUserSlug for most account routes, since it is populated via middleware now
* fix: allow exposeUid and exposeGroupName to work with slugs with mixed capitalization
* fix: move reputation removal check to accountHelpers method
* test: skip i18n tests if ref branch when present is not develop
* fix(deps): bump theme versions
* fix(deps): bump ntfy and 2factor
* chore: up harmony
* fix: add missing return
* fix: #11191, only focus on search input on md environments and up
* feat: allow file uploads on mobile chat
closes https://github.com/NodeBB/NodeBB/issues/11217
* chore: up themes
* chore: add lang string
* fix(deps): bump ntfy to 1.0.15
* refactor: use new if/each syntax
* chore: up composer
* fix: regression from user helper refactor
* chore: up harmony
* chore: up composer
* chore: up harmony
* chore: up harmony
* chore: up harmony
* chore: fix composer version
* feat: add increment helper
* chore: up harmony
* fix: #11228 no timestamps in future :hourglass:
* chore: up harmony
* check config.theme as well
fire action:posts.loaded after processing dom
* chore: up harmony
* chore: up harmony
* chore: up harmony
* chore: up themes
* chore: up harmony
* remove extra class
* refactor: move these to core from harmony
* chore: up widgets
* chore: up widgets
* height auto
* fix: closes #11238
* dont focus inputs, annoying on mobile
* fix: dont focus twice, only focus on chat input on desktop
dont wrap widget footer in row
* chore: up harmony
* chore: up harmony
* update chat window
* chore: up themes
* fix cache buster for skins
* chat fixes
* chore: up harmony
* chore: up composer
* refactor: change hook logs to debug
* fix: scroll to post right after adding to dom
* fix: hash scrolling and highlighting correct post
* test: re-enable read API schema tests
* fix: add back schema changes for 179faa2270f2ad955dcc4a7b04755acce59e6ffd and c3920ccb10d8ead2dcd9914bb1784bed3f6adfd4
* fix: schema changes from 488f0978a4aa1ca1e4d2a1f2e8c7ef7a681f2f27
* fix: schema changes for f4cf482a874701ce80c0f306c49d8788cec66f87
* fix: schema update for be6bbabd0e2551fbe9571dcf3ee40ad721764543
* fix: schema changes for 69c96078ea78ee2c45885a90a6f6a59f9042a33c
* fix: schema changes for d1364c313021e48a879a818b24947e1457c062f7
* fix: schema changes for 84ff1152f7552dd866e25a90972d970b9861107e
* fix: schema changes for b860c2605c209e0650ef98f4c80d842ea23a51ce
* fix: schema changes for 23cb67a1126481848fac39aafd1e253441e76d7f
* fix: schema changes for b916e42f400dac8aa51670b15e439f87f0eb8939
* fix: schema change for a9bbb586fcb3a1c61b5fb69052236e78cdf7d743
* fix: schema changes for 4b738c8cd36c936a1dbe2bb900c694bf6c5520ec
* fix: schema changes for 58b5781cea9acb129e6604a82ab5a5bfc0d8394d
* fix: schema changes for 794bf01b21709c4be06584d576d706b3d6342057
* fix: schema changes for 80ea12c1c1963f5b39fb64841e4f3c8da3c87af2, e368feef51e0766f119c9710fb4db8f64724725c, and 52ead114bec961c62fa2eb0786540e229f6e4873
* fix: composer-default object in config?
* fix: schema changes for 9acdc6808c070555352951c651921df181b10993 and 093093420027999df3c67bf0ea6024f6dbf81d2d
* fix: schema changes for c0a52924f1f7ef8caeaacda67363ac269b56042c
* fix: schema change for aba420a3f3b774e949c2539c73f3dc0e1ae79a38, move loggedInUser to optional props
* fix: schema changes for 8c67031609da30d788561459f8bb76e9a69253de
* fix: schema changes for 27e53b42f3ce48fa61d3754375715cd41ffe808d
* fix: schema changes for 28359665187b0a3b9ec6226dca1234ebdbd725a5
* fix: breaking test for email confirmation API call
* fix: schema changes for refactored search page
* fix: schema changes for user object
* fix: schema changes for 9f531f957e08eabb4bae844ddd67bde14d9b59f0
* fix: schema changes for c4042c70decd628e5b880bd109515b47e4e16164 and 23175110a29640e6fa052db1079bfedb34a61055
* fix: schema changes for 9b3616b10392e247974eb0c1e6225a1582bf6c69
* fix: schema changes for 5afd5de07d42fd33f039a6f85ded3b4992200e5a
* fix: schema change for 1d7baf12171cffbd3af8914bef4e6297d1160d49
* fix: schema changes for 57bfb37c55a839662144e684875003ab52315ecc and be6bbabd0e2551fbe9571dcf3ee40ad721764543
* fix: schema changes for 6e86b4afa20d662af8b9f1c07518df2d8c258105 and 3efad2e13b7319eb9a1f4fda7af047be43ebc11f and 68f66223e73a72f378f193c83a9b5546bede2cda
* fix: allowing optional qs prop in pagination keys (not sure why this didn't break before)
* fix: re-login on email change
* fix: schema changes for c926358d734a2fa410de87f4e4a91744215fc14a
* fix: schema changes for 388a8270c9882892bad5c8141f65da8d59eac0fd
* fix: schema change for 2658bcc821c22e137a6eeb9bb74098856a642eaf
* fix: no need to call account middlewares for chats routes
* fix: schema changes for 71743affc3e58dc85d4ffa15ce043d4d9ddd3d67
* fix: final schema changes
* test: support for anyOf and oneOf
* fix: check thumb
* dont scroll to top on back press
* remove group log
* fix: add top margin to merged and deleted alerts
* chore: up widgets
* fix: improve fix-lists mixin
* chore: up harmony/composer
* feat: allow hiding quicksearch results during search
* dont record searches made by composer
* chore: up 54
* chore: up spam be gone
* feat: add prev/next page and page count into mobile paginator
* chore: up harmony
* chore: up harmony
* use old style for IS
* fix: hide entire toolbar row if no posts or not singlePost
* fix: updated messaging for post-queue template, #11206
* fix: btn-sm on post queue back button
* fix: bump harmony, closes #11206
* fix: remove unused alert module import
* fix: bump harmony
* fix: bump harmony
* chore: up harmony
* refactor: IS scrolltop
* fix: update users:search-user-for-chat source string
* feat: support for mark-read toggle on chats dropdown and recent chats list
* feat: api v3 calls to mark chat read/unread
* feat: send event:chats.mark socket event on mark read or unread
* refactor: allow frontend to mark chats as unread, use new API v3 routes instead of socket calls, better frontend event handling
* docs: openapi schema updates for chat marking
* fix: allow unread state toggling in chats dropdown too
* fix: issue where repeated openings of the chats dropdown would continually add events for mark-read/unread
* fix: debug log
* refactor: move userSearch filter to a module
* feat(routes): allow remounting /categories (#11230)
* feat: send flags count to frontend on flags list page
* refactor: filter form client-side js to extract out some logic
* fix: applyFilters to not take any arguments, update selectedCids in updateButton instead of onHidden
* fix: use userFilter module for assignee, reporterId, targetUid
* fix(openapi): schema changes for updated flags page
* fix: dont allow adding duplicates to userFilter
* use same var
* remove log
* fix: closes #11282
* feat: lang key for x-topics
* chore: up harmony
* chore: up emoji
* chore: up harmony
* fix: update userFilter to allow new option `selectedBlock`
* fix: wrong block name passed to userFilter
* fix: https://github.com/NodeBB/NodeBB/issues/11283
* fix: chats, allow multiple dropdowns like in harmony
* chore: up harmony
* refactor: flag note adding/editing, closes #11285
* fix: remove old prepareEdit logic
* chore: add caveat about hacky code block in userFilter module
* fix: placeholders for userFilter module
* refactor: navigator so it works with multiple thumbs/navigators
* chore: up harmony
* fix: closes #11287, destroy quick reply autocomplete
on navigation
* fix: filter disabled categories on user categories page count
* chore: up harmony
* docs: update openapi spec to include info about passing in timestamps for topic creation, removing timestamp as valid request param for topic replying
* fix: send back null values on ACP search dashboard for startDate and endDate if not expicitly passed in, fix tests
* fix: tweak table order in ACP dash searches
* fix: only invoke navigator click drag on left mouse button
* feat: add back unread indicator to navigator
* clear bookmark on mark unread
* fix: navigator crash on ajaxify
* better thumb top calculation
* fix: reset user bookmark when topic is marked unread
* Revert "fix: reset user bookmark when topic is marked unread"
This reverts commit 9bcd85c2c6848c3d325d32027261809da6e11c9e.
* fix: update unread indicator on scroll, add unread count
* chore: bump harmony
* fix: crash on navigator unread update when backing out of a topic
* fix: closes #11183
* fix: update topics:recent zset when rescheduling a topic
* fix: dupe quote button, increase delay, hide immediately on empty selection
* fix: navigator not showing up on first load
* refactor: remove glance
assorted fixes to navigator
dont reduce remaning count if user scrolls down and up quickly
only call topic.navigatorCallback when index changes
* more sanity checks for bookmark
dont allow setting bookmark higher than topic postcount
* closes #11218, :train:
* Revert "fix: update topics:recent zset when rescheduling a topic"
This reverts commit 737973cca9e94b6cb3867492a09e1e0b1af391d5.
* fix: #11306, show proper error if queued post doesn't exist
was showing no-privileges if someone else accepted the post
* https://github.com/NodeBB/NodeBB/issues/11307
dont use li
* chore: up harmony
* chore: bump version string
* fix: copy paste fail
* feat: closes #7382, tag filtering
add client side support for filtering by tags on /category, /recent and /unread
* chore: up harmony
* chore: up harmony
* Revert "fix: add back req.query fallback for backwards compatibility" [breaking]
This reverts commit cf6cc2c454dc35c330393c62ee8ce67b42d8eefb.
This commit is no longer required as passing in a CSRF token via query parameter is no longer supported as of NodeBB v3.x
This is a breaking change.
* fix: pass csrf token in form data, re: NodeBB/NodeBB#11309
* chore: up deps
* fix: tests, use x-csrf-token query param removed
* test: fix csrf_token
* lint: remove unused
* feat: add itemprop="image" to avatar helper
* fix: get chat upload button in chat modal
* breaking: remove deprecated socket.io methods
* test: update messaging tests to not use sockets
* fix: parent post links
* fix: prevent post tooltip if mouse leaves before data/tpl is loaded
* chore: up harmony
* chore: up harmony
* chore: up harmony
* chore: up harmony
* fix: nested replies indices
* fix(deps): bump 2factor
* feat: add loggedIn user to all api routes
* chore: up themes
* refactor: audit admin v3 write api routes as per #11321
* refactor: audit category v3 write api routes as per #11321 [breaking]
docs: fix open api spec for #11321
* refactor: audit chat v3 write api routes as per #11321
* refactor: audit files v3 write api routes as per #11321
* refactor: audit flags v3 write api routes as per #11321
* refactor: audit posts v3 write api routes as per #11321
* refactor: audit topics v3 write api routes as per #11321
* refactor: audit users v3 write api routes as per #11321
* fix: lang string
* remove min height
* fix: empty topic/labels taking up space
* fix: tag filtering when changing filter to watched topics
or changing popular time limit to month
* chore: up harmony
* fix: closes #11354, show no post error if queued post already accepted/rejected
* test: #11354
* test: #11354
* fix(deps): bump 2factor
* fix: #11357 clear cache on thumb remove
* fix: thumb remove on windows, closes #11357
* test: openapi for thumbs
* test: fix openapi
---------
Co-authored-by: Julian Lam <julian@nodebb.org>
Co-authored-by: Opliko <opliko.reg@protonmail.com>
2023-03-17 11:58:31 -04:00
|
|
|
'<div class="text-center float-start">' +
|
2018-11-28 20:29:43 -07:00
|
|
|
'<span class="formatted-number">' + (data.onlineRegisteredCount + data.onlineGuestCount) + '</span>' +
|
2023-05-31 11:54:48 -04:00
|
|
|
'<div class="stat text-nowrap">[[admin/dashboard:active-users.total]]</div>' +
|
2018-11-28 20:29:43 -07:00
|
|
|
'</div>' +
|
Bootstrap5 (#10894)
* chore: up deps
* chore: up composer
* fix(deps): bump 2factor to v7
* chore: up harmony
* chore: up harmony
* fix: missing await
* feat: allow middlewares to pass in template values via res.locals
* feat: buildAccountData middleware automatically added ot all account routes
* fix: properly allow values in res.locals.templateValues to be added to the template data
* refactor: user/blocks
* refactor(accounts): categories and consent
* feat: automatically 404 if exposeUid or exposeGroupName come up empty
* refactor: remove calls to getUserDataByUserSlug for most account routes, since it is populated via middleware now
* fix: allow exposeUid and exposeGroupName to work with slugs with mixed capitalization
* fix: move reputation removal check to accountHelpers method
* test: skip i18n tests if ref branch when present is not develop
* fix(deps): bump theme versions
* fix(deps): bump ntfy and 2factor
* chore: up harmony
* fix: add missing return
* fix: #11191, only focus on search input on md environments and up
* feat: allow file uploads on mobile chat
closes https://github.com/NodeBB/NodeBB/issues/11217
* chore: up themes
* chore: add lang string
* fix(deps): bump ntfy to 1.0.15
* refactor: use new if/each syntax
* chore: up composer
* fix: regression from user helper refactor
* chore: up harmony
* chore: up composer
* chore: up harmony
* chore: up harmony
* chore: up harmony
* chore: fix composer version
* feat: add increment helper
* chore: up harmony
* fix: #11228 no timestamps in future :hourglass:
* chore: up harmony
* check config.theme as well
fire action:posts.loaded after processing dom
* chore: up harmony
* chore: up harmony
* chore: up harmony
* chore: up themes
* chore: up harmony
* remove extra class
* refactor: move these to core from harmony
* chore: up widgets
* chore: up widgets
* height auto
* fix: closes #11238
* dont focus inputs, annoying on mobile
* fix: dont focus twice, only focus on chat input on desktop
dont wrap widget footer in row
* chore: up harmony
* chore: up harmony
* update chat window
* chore: up themes
* fix cache buster for skins
* chat fixes
* chore: up harmony
* chore: up composer
* refactor: change hook logs to debug
* fix: scroll to post right after adding to dom
* fix: hash scrolling and highlighting correct post
* test: re-enable read API schema tests
* fix: add back schema changes for 179faa2270f2ad955dcc4a7b04755acce59e6ffd and c3920ccb10d8ead2dcd9914bb1784bed3f6adfd4
* fix: schema changes from 488f0978a4aa1ca1e4d2a1f2e8c7ef7a681f2f27
* fix: schema changes for f4cf482a874701ce80c0f306c49d8788cec66f87
* fix: schema update for be6bbabd0e2551fbe9571dcf3ee40ad721764543
* fix: schema changes for 69c96078ea78ee2c45885a90a6f6a59f9042a33c
* fix: schema changes for d1364c313021e48a879a818b24947e1457c062f7
* fix: schema changes for 84ff1152f7552dd866e25a90972d970b9861107e
* fix: schema changes for b860c2605c209e0650ef98f4c80d842ea23a51ce
* fix: schema changes for 23cb67a1126481848fac39aafd1e253441e76d7f
* fix: schema changes for b916e42f400dac8aa51670b15e439f87f0eb8939
* fix: schema change for a9bbb586fcb3a1c61b5fb69052236e78cdf7d743
* fix: schema changes for 4b738c8cd36c936a1dbe2bb900c694bf6c5520ec
* fix: schema changes for 58b5781cea9acb129e6604a82ab5a5bfc0d8394d
* fix: schema changes for 794bf01b21709c4be06584d576d706b3d6342057
* fix: schema changes for 80ea12c1c1963f5b39fb64841e4f3c8da3c87af2, e368feef51e0766f119c9710fb4db8f64724725c, and 52ead114bec961c62fa2eb0786540e229f6e4873
* fix: composer-default object in config?
* fix: schema changes for 9acdc6808c070555352951c651921df181b10993 and 093093420027999df3c67bf0ea6024f6dbf81d2d
* fix: schema changes for c0a52924f1f7ef8caeaacda67363ac269b56042c
* fix: schema change for aba420a3f3b774e949c2539c73f3dc0e1ae79a38, move loggedInUser to optional props
* fix: schema changes for 8c67031609da30d788561459f8bb76e9a69253de
* fix: schema changes for 27e53b42f3ce48fa61d3754375715cd41ffe808d
* fix: schema changes for 28359665187b0a3b9ec6226dca1234ebdbd725a5
* fix: breaking test for email confirmation API call
* fix: schema changes for refactored search page
* fix: schema changes for user object
* fix: schema changes for 9f531f957e08eabb4bae844ddd67bde14d9b59f0
* fix: schema changes for c4042c70decd628e5b880bd109515b47e4e16164 and 23175110a29640e6fa052db1079bfedb34a61055
* fix: schema changes for 9b3616b10392e247974eb0c1e6225a1582bf6c69
* fix: schema changes for 5afd5de07d42fd33f039a6f85ded3b4992200e5a
* fix: schema change for 1d7baf12171cffbd3af8914bef4e6297d1160d49
* fix: schema changes for 57bfb37c55a839662144e684875003ab52315ecc and be6bbabd0e2551fbe9571dcf3ee40ad721764543
* fix: schema changes for 6e86b4afa20d662af8b9f1c07518df2d8c258105 and 3efad2e13b7319eb9a1f4fda7af047be43ebc11f and 68f66223e73a72f378f193c83a9b5546bede2cda
* fix: allowing optional qs prop in pagination keys (not sure why this didn't break before)
* fix: re-login on email change
* fix: schema changes for c926358d734a2fa410de87f4e4a91744215fc14a
* fix: schema changes for 388a8270c9882892bad5c8141f65da8d59eac0fd
* fix: schema change for 2658bcc821c22e137a6eeb9bb74098856a642eaf
* fix: no need to call account middlewares for chats routes
* fix: schema changes for 71743affc3e58dc85d4ffa15ce043d4d9ddd3d67
* fix: final schema changes
* test: support for anyOf and oneOf
* fix: check thumb
* dont scroll to top on back press
* remove group log
* fix: add top margin to merged and deleted alerts
* chore: up widgets
* fix: improve fix-lists mixin
* chore: up harmony/composer
* feat: allow hiding quicksearch results during search
* dont record searches made by composer
* chore: up 54
* chore: up spam be gone
* feat: add prev/next page and page count into mobile paginator
* chore: up harmony
* chore: up harmony
* use old style for IS
* fix: hide entire toolbar row if no posts or not singlePost
* fix: updated messaging for post-queue template, #11206
* fix: btn-sm on post queue back button
* fix: bump harmony, closes #11206
* fix: remove unused alert module import
* fix: bump harmony
* fix: bump harmony
* chore: up harmony
* refactor: IS scrolltop
* fix: update users:search-user-for-chat source string
* feat: support for mark-read toggle on chats dropdown and recent chats list
* feat: api v3 calls to mark chat read/unread
* feat: send event:chats.mark socket event on mark read or unread
* refactor: allow frontend to mark chats as unread, use new API v3 routes instead of socket calls, better frontend event handling
* docs: openapi schema updates for chat marking
* fix: allow unread state toggling in chats dropdown too
* fix: issue where repeated openings of the chats dropdown would continually add events for mark-read/unread
* fix: debug log
* refactor: move userSearch filter to a module
* feat(routes): allow remounting /categories (#11230)
* feat: send flags count to frontend on flags list page
* refactor: filter form client-side js to extract out some logic
* fix: applyFilters to not take any arguments, update selectedCids in updateButton instead of onHidden
* fix: use userFilter module for assignee, reporterId, targetUid
* fix(openapi): schema changes for updated flags page
* fix: dont allow adding duplicates to userFilter
* use same var
* remove log
* fix: closes #11282
* feat: lang key for x-topics
* chore: up harmony
* chore: up emoji
* chore: up harmony
* fix: update userFilter to allow new option `selectedBlock`
* fix: wrong block name passed to userFilter
* fix: https://github.com/NodeBB/NodeBB/issues/11283
* fix: chats, allow multiple dropdowns like in harmony
* chore: up harmony
* refactor: flag note adding/editing, closes #11285
* fix: remove old prepareEdit logic
* chore: add caveat about hacky code block in userFilter module
* fix: placeholders for userFilter module
* refactor: navigator so it works with multiple thumbs/navigators
* chore: up harmony
* fix: closes #11287, destroy quick reply autocomplete
on navigation
* fix: filter disabled categories on user categories page count
* chore: up harmony
* docs: update openapi spec to include info about passing in timestamps for topic creation, removing timestamp as valid request param for topic replying
* fix: send back null values on ACP search dashboard for startDate and endDate if not expicitly passed in, fix tests
* fix: tweak table order in ACP dash searches
* fix: only invoke navigator click drag on left mouse button
* feat: add back unread indicator to navigator
* clear bookmark on mark unread
* fix: navigator crash on ajaxify
* better thumb top calculation
* fix: reset user bookmark when topic is marked unread
* Revert "fix: reset user bookmark when topic is marked unread"
This reverts commit 9bcd85c2c6848c3d325d32027261809da6e11c9e.
* fix: update unread indicator on scroll, add unread count
* chore: bump harmony
* fix: crash on navigator unread update when backing out of a topic
* fix: closes #11183
* fix: update topics:recent zset when rescheduling a topic
* fix: dupe quote button, increase delay, hide immediately on empty selection
* fix: navigator not showing up on first load
* refactor: remove glance
assorted fixes to navigator
dont reduce remaning count if user scrolls down and up quickly
only call topic.navigatorCallback when index changes
* more sanity checks for bookmark
dont allow setting bookmark higher than topic postcount
* closes #11218, :train:
* Revert "fix: update topics:recent zset when rescheduling a topic"
This reverts commit 737973cca9e94b6cb3867492a09e1e0b1af391d5.
* fix: #11306, show proper error if queued post doesn't exist
was showing no-privileges if someone else accepted the post
* https://github.com/NodeBB/NodeBB/issues/11307
dont use li
* chore: up harmony
* chore: bump version string
* fix: copy paste fail
* feat: closes #7382, tag filtering
add client side support for filtering by tags on /category, /recent and /unread
* chore: up harmony
* chore: up harmony
* Revert "fix: add back req.query fallback for backwards compatibility" [breaking]
This reverts commit cf6cc2c454dc35c330393c62ee8ce67b42d8eefb.
This commit is no longer required as passing in a CSRF token via query parameter is no longer supported as of NodeBB v3.x
This is a breaking change.
* fix: pass csrf token in form data, re: NodeBB/NodeBB#11309
* chore: up deps
* fix: tests, use x-csrf-token query param removed
* test: fix csrf_token
* lint: remove unused
* feat: add itemprop="image" to avatar helper
* fix: get chat upload button in chat modal
* breaking: remove deprecated socket.io methods
* test: update messaging tests to not use sockets
* fix: parent post links
* fix: prevent post tooltip if mouse leaves before data/tpl is loaded
* chore: up harmony
* chore: up harmony
* chore: up harmony
* chore: up harmony
* fix: nested replies indices
* fix(deps): bump 2factor
* feat: add loggedIn user to all api routes
* chore: up themes
* refactor: audit admin v3 write api routes as per #11321
* refactor: audit category v3 write api routes as per #11321 [breaking]
docs: fix open api spec for #11321
* refactor: audit chat v3 write api routes as per #11321
* refactor: audit files v3 write api routes as per #11321
* refactor: audit flags v3 write api routes as per #11321
* refactor: audit posts v3 write api routes as per #11321
* refactor: audit topics v3 write api routes as per #11321
* refactor: audit users v3 write api routes as per #11321
* fix: lang string
* remove min height
* fix: empty topic/labels taking up space
* fix: tag filtering when changing filter to watched topics
or changing popular time limit to month
* chore: up harmony
* fix: closes #11354, show no post error if queued post already accepted/rejected
* test: #11354
* test: #11354
* fix(deps): bump 2factor
* fix: #11357 clear cache on thumb remove
* fix: thumb remove on windows, closes #11357
* test: openapi for thumbs
* test: fix openapi
---------
Co-authored-by: Julian Lam <julian@nodebb.org>
Co-authored-by: Opliko <opliko.reg@protonmail.com>
2023-03-17 11:58:31 -04:00
|
|
|
'<div class="text-center float-start">' +
|
2018-11-28 20:29:43 -07:00
|
|
|
'<span class="formatted-number">' + data.socketCount + '</span>' +
|
2023-05-31 11:54:48 -04:00
|
|
|
'<div class="stat text-nowrap">[[admin/dashboard:active-users.connections]]</div>' +
|
2018-11-28 20:29:43 -07:00
|
|
|
'</div>';
|
2014-10-08 15:36:47 -04:00
|
|
|
|
|
|
|
|
updateRegisteredGraph(data.onlineRegisteredCount, data.onlineGuestCount);
|
2015-03-26 16:32:17 -04:00
|
|
|
updatePresenceGraph(data.users);
|
2017-10-18 14:49:42 -04:00
|
|
|
updateTopicsGraph(data.topTenTopics);
|
2014-10-08 15:36:47 -04:00
|
|
|
|
2016-12-10 20:01:18 -07:00
|
|
|
$('#active-users').translateHtml(html);
|
2014-10-08 15:36:47 -04:00
|
|
|
};
|
|
|
|
|
|
2021-10-12 17:26:18 +03:00
|
|
|
const graphs = {
|
2014-10-08 15:36:47 -04:00
|
|
|
traffic: null,
|
|
|
|
|
registered: null,
|
|
|
|
|
presence: null,
|
2017-02-17 19:31:21 -07:00
|
|
|
topics: null,
|
2014-10-08 15:36:47 -04:00
|
|
|
};
|
|
|
|
|
|
2021-10-12 17:26:18 +03:00
|
|
|
const topicColors = ['#bf616a', '#5B90BF', '#d08770', '#ebcb8b', '#a3be8c', '#96b5b4', '#8fa1b3', '#b48ead', '#ab7967', '#46BFBD'];
|
2014-10-08 15:36:47 -04:00
|
|
|
|
2017-02-18 18:55:33 -07:00
|
|
|
/* eslint-disable */
|
2014-10-08 15:36:47 -04:00
|
|
|
// from chartjs.org
|
|
|
|
|
function lighten(col, amt) {
|
2021-10-12 17:26:18 +03:00
|
|
|
let usePound = false;
|
2014-10-08 15:36:47 -04:00
|
|
|
|
2017-02-18 14:36:16 -07:00
|
|
|
if (col[0] === '#') {
|
2014-10-08 15:36:47 -04:00
|
|
|
col = col.slice(1);
|
|
|
|
|
usePound = true;
|
|
|
|
|
}
|
|
|
|
|
|
2021-10-12 17:26:18 +03:00
|
|
|
const num = parseInt(col, 16);
|
2014-10-08 15:36:47 -04:00
|
|
|
|
2021-10-12 17:26:18 +03:00
|
|
|
let r = (num >> 16) + amt;
|
2014-10-08 15:36:47 -04:00
|
|
|
|
|
|
|
|
if (r > 255) r = 255;
|
2017-02-18 01:52:56 -07:00
|
|
|
else if (r < 0) r = 0;
|
2014-10-08 15:36:47 -04:00
|
|
|
|
2021-10-12 17:26:18 +03:00
|
|
|
let b = ((num >> 8) & 0x00FF) + amt;
|
2014-10-08 15:36:47 -04:00
|
|
|
|
|
|
|
|
if (b > 255) b = 255;
|
2017-02-18 01:52:56 -07:00
|
|
|
else if (b < 0) b = 0;
|
2014-10-08 15:36:47 -04:00
|
|
|
|
2021-10-12 17:26:18 +03:00
|
|
|
let g = (num & 0x0000FF) + amt;
|
2014-10-08 15:36:47 -04:00
|
|
|
|
|
|
|
|
if (g > 255) g = 255;
|
|
|
|
|
else if (g < 0) g = 0;
|
|
|
|
|
|
2017-02-18 01:56:23 -07:00
|
|
|
return (usePound ? '#' : '') + (g | (b << 8) | (r << 16)).toString(16);
|
2014-10-08 15:36:47 -04:00
|
|
|
}
|
2017-02-18 18:55:33 -07:00
|
|
|
/* eslint-enable */
|
2014-10-08 15:36:47 -04:00
|
|
|
|
2017-03-13 20:20:41 -07:00
|
|
|
function setupGraphs(callback) {
|
|
|
|
|
callback = callback || function () {};
|
2021-10-12 17:26:18 +03:00
|
|
|
const trafficCanvas = document.getElementById('analytics-traffic');
|
|
|
|
|
const registeredCanvas = document.getElementById('analytics-registered');
|
|
|
|
|
const presenceCanvas = document.getElementById('analytics-presence');
|
|
|
|
|
const topicsCanvas = document.getElementById('analytics-topics');
|
|
|
|
|
const trafficCtx = trafficCanvas.getContext('2d');
|
|
|
|
|
const registeredCtx = registeredCanvas.getContext('2d');
|
|
|
|
|
const presenceCtx = presenceCanvas.getContext('2d');
|
|
|
|
|
const topicsCtx = topicsCanvas.getContext('2d');
|
|
|
|
|
const trafficLabels = utils.getHoursArray();
|
2014-10-08 15:36:47 -04:00
|
|
|
|
|
|
|
|
if (isMobile) {
|
2016-08-09 07:54:58 -07:00
|
|
|
Chart.defaults.global.tooltips.enabled = false;
|
2014-10-08 15:36:47 -04:00
|
|
|
}
|
|
|
|
|
|
2021-10-12 17:26:18 +03:00
|
|
|
const t = translator.Translator.create();
|
2016-12-08 17:17:24 -07:00
|
|
|
Promise.all([
|
2020-05-29 09:59:22 -04:00
|
|
|
t.translateKey('admin/dashboard:graphs.page-views', []),
|
|
|
|
|
t.translateKey('admin/dashboard:graphs.page-views-registered', []),
|
|
|
|
|
t.translateKey('admin/dashboard:graphs.page-views-guest', []),
|
|
|
|
|
t.translateKey('admin/dashboard:graphs.page-views-bot', []),
|
|
|
|
|
t.translateKey('admin/dashboard:graphs.unique-visitors', []),
|
|
|
|
|
t.translateKey('admin/dashboard:graphs.registered-users', []),
|
2021-10-25 16:26:50 -04:00
|
|
|
t.translateKey('admin/dashboard:graphs.guest-users', []),
|
2020-05-29 09:59:22 -04:00
|
|
|
t.translateKey('admin/dashboard:on-categories', []),
|
|
|
|
|
t.translateKey('admin/dashboard:reading-posts', []),
|
|
|
|
|
t.translateKey('admin/dashboard:browsing-topics', []),
|
|
|
|
|
t.translateKey('admin/dashboard:recent', []),
|
|
|
|
|
t.translateKey('admin/dashboard:unread', []),
|
2016-12-08 17:17:24 -07:00
|
|
|
]).then(function (translations) {
|
2021-10-12 17:26:18 +03:00
|
|
|
const data = {
|
2016-12-08 17:17:24 -07:00
|
|
|
labels: trafficLabels,
|
|
|
|
|
datasets: [
|
|
|
|
|
{
|
|
|
|
|
label: translations[0],
|
2017-02-18 01:56:23 -07:00
|
|
|
backgroundColor: 'rgba(220,220,220,0.2)',
|
|
|
|
|
borderColor: 'rgba(220,220,220,1)',
|
|
|
|
|
pointBackgroundColor: 'rgba(220,220,220,1)',
|
|
|
|
|
pointHoverBackgroundColor: '#fff',
|
|
|
|
|
pointBorderColor: '#fff',
|
|
|
|
|
pointHoverBorderColor: 'rgba(220,220,220,1)',
|
2017-02-18 01:31:47 -07:00
|
|
|
data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
2016-12-08 17:17:24 -07:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: translations[1],
|
2018-10-24 11:55:44 -04:00
|
|
|
backgroundColor: '#ab464233',
|
2018-10-24 11:39:40 -04:00
|
|
|
borderColor: '#ab4642',
|
|
|
|
|
pointBackgroundColor: '#ab4642',
|
2018-10-24 12:12:17 -04:00
|
|
|
pointHoverBackgroundColor: '#ab4642',
|
2018-10-24 11:24:37 -04:00
|
|
|
pointBorderColor: '#fff',
|
2018-10-24 11:39:40 -04:00
|
|
|
pointHoverBorderColor: '#ab4642',
|
2018-10-24 11:24:37 -04:00
|
|
|
data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: translations[2],
|
2018-10-24 11:55:44 -04:00
|
|
|
backgroundColor: '#ba8baf33',
|
2018-10-24 11:39:40 -04:00
|
|
|
borderColor: '#ba8baf',
|
|
|
|
|
pointBackgroundColor: '#ba8baf',
|
2018-10-24 12:12:17 -04:00
|
|
|
pointHoverBackgroundColor: '#ba8baf',
|
2018-10-24 11:24:37 -04:00
|
|
|
pointBorderColor: '#fff',
|
2018-10-24 11:39:40 -04:00
|
|
|
pointHoverBorderColor: '#ba8baf',
|
2018-10-24 11:24:37 -04:00
|
|
|
data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: translations[3],
|
2018-10-24 11:55:44 -04:00
|
|
|
backgroundColor: '#f7ca8833',
|
2018-10-24 11:39:40 -04:00
|
|
|
borderColor: '#f7ca88',
|
|
|
|
|
pointBackgroundColor: '#f7ca88',
|
2018-10-24 12:12:17 -04:00
|
|
|
pointHoverBackgroundColor: '#f7ca88',
|
2018-10-24 11:24:37 -04:00
|
|
|
pointBorderColor: '#fff',
|
2018-10-24 11:39:40 -04:00
|
|
|
pointHoverBorderColor: '#f7ca88',
|
2018-10-24 11:24:37 -04:00
|
|
|
data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: translations[4],
|
2017-02-18 01:56:23 -07:00
|
|
|
backgroundColor: 'rgba(151,187,205,0.2)',
|
|
|
|
|
borderColor: 'rgba(151,187,205,1)',
|
|
|
|
|
pointBackgroundColor: 'rgba(151,187,205,1)',
|
2017-09-14 15:57:15 -04:00
|
|
|
pointHoverBackgroundColor: 'rgba(151,187,205,1)',
|
2017-02-18 01:56:23 -07:00
|
|
|
pointBorderColor: '#fff',
|
|
|
|
|
pointHoverBorderColor: 'rgba(151,187,205,1)',
|
2017-02-18 01:31:47 -07:00
|
|
|
data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
2017-02-17 19:31:21 -07:00
|
|
|
},
|
|
|
|
|
],
|
2016-12-08 17:17:24 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
trafficCanvas.width = $(trafficCanvas).parent().width();
|
2018-01-08 13:20:56 -05:00
|
|
|
|
|
|
|
|
data.datasets[0].yAxisID = 'left-y-axis';
|
2018-10-24 11:46:39 -04:00
|
|
|
data.datasets[1].yAxisID = 'left-y-axis';
|
|
|
|
|
data.datasets[2].yAxisID = 'left-y-axis';
|
|
|
|
|
data.datasets[3].yAxisID = 'left-y-axis';
|
|
|
|
|
data.datasets[4].yAxisID = 'right-y-axis';
|
2018-01-08 13:20:56 -05:00
|
|
|
|
2016-12-08 17:17:24 -07:00
|
|
|
graphs.traffic = new Chart(trafficCtx, {
|
|
|
|
|
type: 'line',
|
|
|
|
|
data: data,
|
|
|
|
|
options: {
|
|
|
|
|
responsive: true,
|
|
|
|
|
legend: {
|
2018-10-24 12:51:14 -04:00
|
|
|
display: true,
|
2016-12-08 17:17:24 -07:00
|
|
|
},
|
|
|
|
|
scales: {
|
|
|
|
|
yAxes: [{
|
2018-01-08 13:20:56 -05:00
|
|
|
id: 'left-y-axis',
|
|
|
|
|
ticks: {
|
|
|
|
|
beginAtZero: true,
|
2020-04-14 10:15:54 -04:00
|
|
|
precision: 0,
|
2018-01-08 13:20:56 -05:00
|
|
|
},
|
|
|
|
|
type: 'linear',
|
|
|
|
|
position: 'left',
|
2018-03-07 12:26:26 -05:00
|
|
|
scaleLabel: {
|
|
|
|
|
display: true,
|
|
|
|
|
labelString: translations[0],
|
|
|
|
|
},
|
2018-01-08 13:20:56 -05:00
|
|
|
}, {
|
|
|
|
|
id: 'right-y-axis',
|
2016-12-08 17:17:24 -07:00
|
|
|
ticks: {
|
2017-02-17 19:31:21 -07:00
|
|
|
beginAtZero: true,
|
2018-01-08 13:20:56 -05:00
|
|
|
suggestedMax: 10,
|
2020-04-14 10:15:54 -04:00
|
|
|
precision: 0,
|
2017-02-17 19:31:21 -07:00
|
|
|
},
|
2018-01-08 13:20:56 -05:00
|
|
|
type: 'linear',
|
|
|
|
|
position: 'right',
|
2018-03-07 12:26:26 -05:00
|
|
|
scaleLabel: {
|
|
|
|
|
display: true,
|
2018-10-24 11:24:37 -04:00
|
|
|
labelString: translations[4],
|
2018-03-07 12:26:26 -05:00
|
|
|
},
|
2017-02-17 19:31:21 -07:00
|
|
|
}],
|
|
|
|
|
},
|
2017-08-02 16:17:24 -04:00
|
|
|
tooltips: {
|
|
|
|
|
mode: 'x',
|
|
|
|
|
},
|
2017-02-17 19:31:21 -07:00
|
|
|
},
|
2016-12-08 17:17:24 -07:00
|
|
|
});
|
2017-02-18 01:27:46 -07:00
|
|
|
|
2016-12-08 17:17:24 -07:00
|
|
|
graphs.registered = new Chart(registeredCtx, {
|
|
|
|
|
type: 'doughnut',
|
|
|
|
|
data: {
|
2018-10-24 17:32:22 -04:00
|
|
|
labels: translations.slice(5, 7),
|
2016-12-08 17:17:24 -07:00
|
|
|
datasets: [{
|
|
|
|
|
data: [1, 1],
|
2017-02-18 01:56:23 -07:00
|
|
|
backgroundColor: ['#F7464A', '#46BFBD'],
|
|
|
|
|
hoverBackgroundColor: ['#FF5A5E', '#5AD3D1'],
|
2017-02-17 19:31:21 -07:00
|
|
|
}],
|
2016-12-08 17:17:24 -07:00
|
|
|
},
|
|
|
|
|
options: {
|
|
|
|
|
responsive: true,
|
|
|
|
|
legend: {
|
2017-02-17 19:31:21 -07:00
|
|
|
display: false,
|
|
|
|
|
},
|
|
|
|
|
},
|
2016-12-08 17:17:24 -07:00
|
|
|
});
|
2014-10-08 15:36:47 -04:00
|
|
|
|
2016-12-08 17:17:24 -07:00
|
|
|
graphs.presence = new Chart(presenceCtx, {
|
|
|
|
|
type: 'doughnut',
|
|
|
|
|
data: {
|
2018-10-24 17:32:22 -04:00
|
|
|
labels: translations.slice(7, 12),
|
2016-12-08 17:17:24 -07:00
|
|
|
datasets: [{
|
|
|
|
|
data: [1, 1, 1, 1, 1],
|
2017-02-18 01:56:23 -07:00
|
|
|
backgroundColor: ['#F7464A', '#46BFBD', '#FDB45C', '#949FB1', '#9FB194'],
|
|
|
|
|
hoverBackgroundColor: ['#FF5A5E', '#5AD3D1', '#FFC870', '#A8B3C5', '#A8B3C5'],
|
2017-02-17 19:31:21 -07:00
|
|
|
}],
|
2016-12-08 17:17:24 -07:00
|
|
|
},
|
|
|
|
|
options: {
|
|
|
|
|
responsive: true,
|
|
|
|
|
legend: {
|
2017-02-17 19:31:21 -07:00
|
|
|
display: false,
|
|
|
|
|
},
|
|
|
|
|
},
|
2016-12-08 17:17:24 -07:00
|
|
|
});
|
2017-02-18 01:27:46 -07:00
|
|
|
|
2016-12-08 17:17:24 -07:00
|
|
|
graphs.topics = new Chart(topicsCtx, {
|
|
|
|
|
type: 'doughnut',
|
|
|
|
|
data: {
|
|
|
|
|
labels: [],
|
|
|
|
|
datasets: [{
|
|
|
|
|
data: [],
|
|
|
|
|
backgroundColor: [],
|
2017-02-17 19:31:21 -07:00
|
|
|
hoverBackgroundColor: [],
|
|
|
|
|
}],
|
2016-12-08 17:17:24 -07:00
|
|
|
},
|
|
|
|
|
options: {
|
|
|
|
|
responsive: true,
|
|
|
|
|
legend: {
|
2017-02-17 19:31:21 -07:00
|
|
|
display: false,
|
|
|
|
|
},
|
|
|
|
|
},
|
2016-12-08 17:17:24 -07:00
|
|
|
});
|
2014-10-08 15:36:47 -04:00
|
|
|
|
2016-12-08 17:17:24 -07:00
|
|
|
updateTrafficGraph();
|
2014-10-08 15:36:47 -04:00
|
|
|
|
2016-12-08 17:17:24 -07:00
|
|
|
$(window).on('resize', adjustPieCharts);
|
|
|
|
|
adjustPieCharts();
|
2015-11-25 14:22:32 -05:00
|
|
|
|
2017-05-11 11:41:28 -04:00
|
|
|
$('[data-action="updateGraph"]:not([data-units="custom"])').on('click', function () {
|
2021-10-12 17:26:18 +03:00
|
|
|
let until = new Date();
|
|
|
|
|
const amount = $(this).attr('data-amount');
|
2017-05-24 21:18:23 -04:00
|
|
|
if ($(this).attr('data-units') === 'days') {
|
|
|
|
|
until.setHours(0, 0, 0, 0);
|
|
|
|
|
}
|
2017-05-11 16:53:30 -04:00
|
|
|
until = until.getTime();
|
|
|
|
|
updateTrafficGraph($(this).attr('data-units'), until, amount);
|
2017-05-11 11:41:28 -04:00
|
|
|
|
|
|
|
|
require(['translator'], function (translator) {
|
2020-05-29 09:59:22 -04:00
|
|
|
translator.translate('[[admin/dashboard:page-views-custom]]', function (translated) {
|
2017-05-11 11:41:28 -04:00
|
|
|
$('[data-action="updateGraph"][data-units="custom"]').text(translated);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
2018-04-10 15:17:08 -04:00
|
|
|
|
2017-05-11 11:41:28 -04:00
|
|
|
$('[data-action="updateGraph"][data-units="custom"]').on('click', function () {
|
2021-10-12 17:26:18 +03:00
|
|
|
const targetEl = $(this);
|
2017-05-11 11:41:28 -04:00
|
|
|
|
2020-11-08 06:17:49 -07:00
|
|
|
Benchpress.render('admin/partials/pageviews-range-select', {}).then(function (html) {
|
2021-10-12 17:26:18 +03:00
|
|
|
const modal = bootbox.dialog({
|
2020-05-29 09:59:22 -04:00
|
|
|
title: '[[admin/dashboard:page-views-custom]]',
|
2017-05-11 11:41:28 -04:00
|
|
|
message: html,
|
|
|
|
|
buttons: {
|
|
|
|
|
submit: {
|
|
|
|
|
label: '[[global:search]]',
|
|
|
|
|
className: 'btn-primary',
|
|
|
|
|
callback: submit,
|
|
|
|
|
},
|
|
|
|
|
},
|
2018-04-10 15:17:08 -04:00
|
|
|
}).on('shown.bs.modal', function () {
|
2021-10-12 17:26:18 +03:00
|
|
|
const date = new Date();
|
2022-03-31 19:49:56 +02:00
|
|
|
const today = date.toISOString().slice(0, 10);
|
2018-04-10 15:17:08 -04:00
|
|
|
date.setDate(date.getDate() - 1);
|
2022-03-31 19:49:56 +02:00
|
|
|
const yesterday = date.toISOString().slice(0, 10);
|
2018-04-10 15:17:08 -04:00
|
|
|
|
|
|
|
|
modal.find('#startRange').val(targetEl.attr('data-startRange') || yesterday);
|
|
|
|
|
modal.find('#endRange').val(targetEl.attr('data-endRange') || today);
|
2017-05-11 11:41:28 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
function submit() {
|
|
|
|
|
// NEED TO ADD VALIDATION HERE FOR YYYY-MM-DD
|
2021-10-12 17:26:18 +03:00
|
|
|
const formData = modal.find('form').serializeObject();
|
|
|
|
|
const validRegexp = /\d{4}-\d{2}-\d{2}/;
|
2017-05-11 11:41:28 -04:00
|
|
|
|
|
|
|
|
// Input validation
|
|
|
|
|
if (!formData.startRange && !formData.endRange) {
|
|
|
|
|
// No range? Assume last 30 days
|
|
|
|
|
updateTrafficGraph('days');
|
|
|
|
|
return;
|
|
|
|
|
} else if (!validRegexp.test(formData.startRange) || !validRegexp.test(formData.endRange)) {
|
|
|
|
|
// Invalid Input
|
|
|
|
|
modal.find('.alert-danger').removeClass('hidden');
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2021-10-12 17:26:18 +03:00
|
|
|
let until = new Date(formData.endRange);
|
2017-05-11 11:41:28 -04:00
|
|
|
until.setDate(until.getDate() + 1);
|
|
|
|
|
until = until.getTime();
|
2021-10-12 17:26:18 +03:00
|
|
|
const amount = (until - new Date(formData.startRange).getTime()) / (1000 * 60 * 60 * 24);
|
2017-05-11 11:41:28 -04:00
|
|
|
|
|
|
|
|
updateTrafficGraph('days', until, amount);
|
|
|
|
|
|
|
|
|
|
// Update "custom range" label
|
2018-04-10 15:17:08 -04:00
|
|
|
targetEl.attr('data-startRange', formData.startRange);
|
|
|
|
|
targetEl.attr('data-endRange', formData.endRange);
|
2017-05-11 11:41:28 -04:00
|
|
|
targetEl.html(formData.startRange + ' – ' + formData.endRange);
|
|
|
|
|
}
|
|
|
|
|
});
|
2016-12-08 17:17:24 -07:00
|
|
|
});
|
2017-01-12 14:22:30 -05:00
|
|
|
|
2017-03-13 20:20:41 -07:00
|
|
|
callback();
|
2015-11-25 14:48:32 -05:00
|
|
|
});
|
2014-10-08 15:36:47 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function adjustPieCharts() {
|
2016-10-13 11:43:39 +02:00
|
|
|
$('.pie-chart.legend-up').each(function () {
|
2021-10-12 17:26:18 +03:00
|
|
|
const $this = $(this);
|
2014-10-08 15:36:47 -04:00
|
|
|
|
|
|
|
|
if ($this.width() < 320) {
|
|
|
|
|
$this.addClass('compact');
|
|
|
|
|
} else {
|
|
|
|
|
$this.removeClass('compact');
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2017-05-11 11:41:28 -04:00
|
|
|
function updateTrafficGraph(units, until, amount) {
|
|
|
|
|
// until and amount are optional
|
|
|
|
|
|
2014-10-19 16:13:10 -04:00
|
|
|
if (!app.isFocused) {
|
2014-10-08 15:36:47 -04:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2015-11-25 14:22:32 -05:00
|
|
|
socket.emit('admin.analytics.get', {
|
|
|
|
|
graph: 'traffic',
|
2015-11-25 14:48:32 -05:00
|
|
|
units: units || 'hours',
|
2017-02-17 19:31:21 -07:00
|
|
|
until: until,
|
2017-05-11 11:41:28 -04:00
|
|
|
amount: amount,
|
2015-11-25 14:22:32 -05:00
|
|
|
}, function (err, data) {
|
2016-08-16 19:46:59 +02:00
|
|
|
if (err) {
|
2021-12-06 14:31:35 -05:00
|
|
|
return alerts.error(err);
|
2016-08-16 19:46:59 +02:00
|
|
|
}
|
2015-07-08 16:54:39 -04:00
|
|
|
if (JSON.stringify(graphData.traffic) === JSON.stringify(data)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
graphData.traffic = data;
|
|
|
|
|
|
2015-11-25 14:22:32 -05:00
|
|
|
if (units === 'days') {
|
2017-05-11 11:41:28 -04:00
|
|
|
graphs.traffic.data.xLabels = utils.getDaysArray(until, amount);
|
2015-11-25 14:22:32 -05:00
|
|
|
} else {
|
2016-07-29 19:31:48 +00:00
|
|
|
graphs.traffic.data.xLabels = utils.getHoursArray();
|
2015-11-25 16:44:52 -05:00
|
|
|
|
2017-05-11 16:53:30 -04:00
|
|
|
$('#pageViewsThirty').html(data.summary.thirty);
|
|
|
|
|
$('#pageViewsSeven').html(data.summary.seven);
|
2015-11-25 16:44:52 -05:00
|
|
|
$('#pageViewsPastDay').html(data.pastDay);
|
2017-05-11 16:53:30 -04:00
|
|
|
utils.addCommasToNumbers($('#pageViewsThirty'));
|
|
|
|
|
utils.addCommasToNumbers($('#pageViewsSeven'));
|
2015-11-25 16:44:52 -05:00
|
|
|
utils.addCommasToNumbers($('#pageViewsPastDay'));
|
2014-10-08 15:36:47 -04:00
|
|
|
}
|
|
|
|
|
|
2016-07-29 19:31:48 +00:00
|
|
|
graphs.traffic.data.datasets[0].data = data.pageviews;
|
2018-10-24 11:24:37 -04:00
|
|
|
graphs.traffic.data.datasets[1].data = data.pageviewsRegistered;
|
2018-10-24 11:34:57 -04:00
|
|
|
graphs.traffic.data.datasets[2].data = data.pageviewsGuest;
|
|
|
|
|
graphs.traffic.data.datasets[3].data = data.pageviewsBot;
|
2018-10-24 11:24:37 -04:00
|
|
|
graphs.traffic.data.datasets[4].data = data.uniqueVisitors;
|
2016-07-29 19:31:48 +00:00
|
|
|
graphs.traffic.data.labels = graphs.traffic.data.xLabels;
|
2014-10-08 15:36:47 -04:00
|
|
|
|
|
|
|
|
graphs.traffic.update();
|
2015-11-25 14:48:32 -05:00
|
|
|
currentGraph.units = units;
|
|
|
|
|
currentGraph.until = until;
|
2017-05-11 11:41:28 -04:00
|
|
|
currentGraph.amount = amount;
|
2019-06-28 14:59:55 -04:00
|
|
|
|
|
|
|
|
// Update the View as JSON button url
|
2021-10-12 17:26:18 +03:00
|
|
|
const apiEl = $('#view-as-json');
|
|
|
|
|
const newHref = $.param({
|
2020-01-04 10:34:20 -05:00
|
|
|
units: units || 'hours',
|
2019-06-28 14:59:55 -04:00
|
|
|
until: until,
|
|
|
|
|
count: amount,
|
|
|
|
|
});
|
|
|
|
|
apiEl.attr('href', config.relative_path + '/api/admin/analytics?' + newHref);
|
2014-10-08 15:36:47 -04:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2021-10-25 16:26:50 -04:00
|
|
|
function updateRegisteredGraph(registered, guest) {
|
2018-11-18 16:03:31 -05:00
|
|
|
$('#analytics-legend .registered').parent().find('.count').text(registered);
|
2021-10-25 16:26:50 -04:00
|
|
|
$('#analytics-legend .guest').parent().find('.count').text(guest);
|
2016-07-29 19:31:48 +00:00
|
|
|
graphs.registered.data.datasets[0].data[0] = registered;
|
2021-10-25 16:26:50 -04:00
|
|
|
graphs.registered.data.datasets[0].data[1] = guest;
|
2014-10-08 15:36:47 -04:00
|
|
|
graphs.registered.update();
|
|
|
|
|
}
|
|
|
|
|
|
2015-03-26 16:32:17 -04:00
|
|
|
function updatePresenceGraph(users) {
|
2018-11-18 16:03:31 -05:00
|
|
|
$('#analytics-presence-legend .on-categories').parent().find('.count').text(users.categories);
|
|
|
|
|
$('#analytics-presence-legend .reading-posts').parent().find('.count').text(users.topics);
|
|
|
|
|
$('#analytics-presence-legend .browsing-topics').parent().find('.count').text(users.category);
|
|
|
|
|
$('#analytics-presence-legend .recent').parent().find('.count').text(users.recent);
|
|
|
|
|
$('#analytics-presence-legend .unread').parent().find('.count').text(users.unread);
|
2016-07-29 19:31:48 +00:00
|
|
|
graphs.presence.data.datasets[0].data[0] = users.categories;
|
|
|
|
|
graphs.presence.data.datasets[0].data[1] = users.topics;
|
|
|
|
|
graphs.presence.data.datasets[0].data[2] = users.category;
|
|
|
|
|
graphs.presence.data.datasets[0].data[3] = users.recent;
|
|
|
|
|
graphs.presence.data.datasets[0].data[4] = users.unread;
|
2015-03-26 16:32:17 -04:00
|
|
|
|
2014-10-08 15:36:47 -04:00
|
|
|
graphs.presence.update();
|
|
|
|
|
}
|
2017-02-18 01:27:46 -07:00
|
|
|
|
2014-10-08 15:36:47 -04:00
|
|
|
function updateTopicsGraph(topics) {
|
2017-10-18 14:49:42 -04:00
|
|
|
if (!topics.length) {
|
2020-11-30 14:02:07 -05:00
|
|
|
translator.translate('[[admin/dashboard:no-users-browsing]]', function (translated) {
|
|
|
|
|
topics = [{
|
|
|
|
|
title: translated,
|
|
|
|
|
count: 1,
|
|
|
|
|
}];
|
|
|
|
|
updateTopicsGraph(topics);
|
|
|
|
|
});
|
|
|
|
|
return;
|
2014-10-08 15:36:47 -04:00
|
|
|
}
|
|
|
|
|
|
2016-07-29 19:31:48 +00:00
|
|
|
graphs.topics.data.labels = [];
|
|
|
|
|
graphs.topics.data.datasets[0].data = [];
|
|
|
|
|
graphs.topics.data.datasets[0].backgroundColor = [];
|
|
|
|
|
graphs.topics.data.datasets[0].hoverBackgroundColor = [];
|
2017-02-18 01:27:46 -07:00
|
|
|
|
2017-10-18 14:49:42 -04:00
|
|
|
topics.forEach(function (topic, i) {
|
|
|
|
|
graphs.topics.data.labels.push(topic.title);
|
|
|
|
|
graphs.topics.data.datasets[0].data.push(topic.count);
|
2016-07-29 19:31:48 +00:00
|
|
|
graphs.topics.data.datasets[0].backgroundColor.push(topicColors[i]);
|
|
|
|
|
graphs.topics.data.datasets[0].hoverBackgroundColor.push(lighten(topicColors[i], 10));
|
2017-10-18 14:49:42 -04:00
|
|
|
});
|
2017-02-18 01:27:46 -07:00
|
|
|
|
2014-10-08 15:36:47 -04:00
|
|
|
function buildTopicsLegend() {
|
2021-10-12 17:26:18 +03:00
|
|
|
let html = '';
|
2020-09-06 22:12:53 -04:00
|
|
|
topics.forEach(function (t, i) {
|
2021-10-12 17:26:18 +03:00
|
|
|
const link = t.tid ? '<a title="' + t.title + '"href="' + config.relative_path + '/topic/' + t.tid + '" target="_blank"> ' + t.title + '</a>' : t.title;
|
2021-11-16 16:24:17 -05:00
|
|
|
const label = t.count === '0' ? t.title : link;
|
2017-02-18 01:27:46 -07:00
|
|
|
|
2018-11-28 20:29:43 -07:00
|
|
|
html += '<li>' +
|
|
|
|
|
'<div style="background-color: ' + topicColors[i] + ';"></div>' +
|
2020-09-06 22:12:53 -04:00
|
|
|
'<span> (' + t.count + ') ' + label + '</span>' +
|
2018-11-28 20:29:43 -07:00
|
|
|
'</li>';
|
2017-10-18 14:49:42 -04:00
|
|
|
});
|
2021-03-15 23:24:16 -04:00
|
|
|
$('#topics-legend').translateHtml(html);
|
2014-10-08 15:36:47 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
buildTopicsLegend();
|
|
|
|
|
graphs.topics.update();
|
|
|
|
|
}
|
|
|
|
|
|
2015-07-08 16:35:59 -04:00
|
|
|
function setupRealtimeButton() {
|
2016-10-13 11:43:39 +02:00
|
|
|
$('#toggle-realtime .fa').on('click', function () {
|
2021-10-12 17:26:18 +03:00
|
|
|
const $this = $(this);
|
2015-07-08 16:35:59 -04:00
|
|
|
if ($this.hasClass('fa-toggle-on')) {
|
|
|
|
|
$this.removeClass('fa-toggle-on').addClass('fa-toggle-off');
|
|
|
|
|
$this.parent().find('strong').html('OFF');
|
|
|
|
|
initiateDashboard(false);
|
|
|
|
|
} else {
|
|
|
|
|
$this.removeClass('fa-toggle-off').addClass('fa-toggle-on');
|
|
|
|
|
$this.parent().find('strong').html('ON');
|
|
|
|
|
initiateDashboard(true);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function initiateDashboard(realtime) {
|
|
|
|
|
clearInterval(intervals.rooms);
|
|
|
|
|
clearInterval(intervals.graphs);
|
|
|
|
|
|
2016-10-13 11:43:39 +02:00
|
|
|
intervals.rooms = setInterval(function () {
|
2020-09-06 21:51:45 -04:00
|
|
|
if (app.isFocused && socket.connected) {
|
2015-11-04 17:43:43 -05:00
|
|
|
socket.emit('admin.rooms.getAll', Admin.updateRoomUsage);
|
2015-07-08 16:35:59 -04:00
|
|
|
}
|
|
|
|
|
}, realtime ? DEFAULTS.realtimeInterval : DEFAULTS.roomInterval);
|
|
|
|
|
|
2016-10-13 11:43:39 +02:00
|
|
|
intervals.graphs = setInterval(function () {
|
2017-05-11 11:41:28 -04:00
|
|
|
updateTrafficGraph(currentGraph.units, currentGraph.until, currentGraph.amount);
|
2015-11-25 14:48:32 -05:00
|
|
|
}, realtime ? DEFAULTS.realtimeInterval : DEFAULTS.graphInterval);
|
2015-07-08 16:35:59 -04:00
|
|
|
}
|
|
|
|
|
|
2018-04-09 11:50:30 -04:00
|
|
|
function setupFullscreen() {
|
2021-10-12 17:26:18 +03:00
|
|
|
const container = document.getElementById('analytics-panel');
|
|
|
|
|
const $container = $(container);
|
2023-06-27 10:49:36 -04:00
|
|
|
const btn = $container.find('#expand-analytics');
|
2021-10-12 17:26:18 +03:00
|
|
|
let fsMethod;
|
|
|
|
|
let exitMethod;
|
2018-04-09 11:50:30 -04:00
|
|
|
|
|
|
|
|
if (container.requestFullscreen) {
|
|
|
|
|
fsMethod = 'requestFullscreen';
|
|
|
|
|
exitMethod = 'exitFullscreen';
|
|
|
|
|
} else if (container.mozRequestFullScreen) {
|
|
|
|
|
fsMethod = 'mozRequestFullScreen';
|
|
|
|
|
exitMethod = 'mozCancelFullScreen';
|
|
|
|
|
} else if (container.webkitRequestFullscreen) {
|
|
|
|
|
fsMethod = 'webkitRequestFullscreen';
|
|
|
|
|
exitMethod = 'webkitCancelFullScreen';
|
|
|
|
|
} else if (container.msRequestFullscreen) {
|
|
|
|
|
fsMethod = 'msRequestFullscreen';
|
|
|
|
|
exitMethod = 'msCancelFullScreen';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (fsMethod) {
|
|
|
|
|
btn.on('click', function () {
|
|
|
|
|
if ($container.hasClass('fullscreen')) {
|
|
|
|
|
document[exitMethod]();
|
|
|
|
|
$container.removeClass('fullscreen');
|
|
|
|
|
} else {
|
|
|
|
|
container[fsMethod]();
|
|
|
|
|
$container.addClass('fullscreen');
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-10-08 15:36:47 -04:00
|
|
|
return Admin;
|
2016-07-29 12:55:59 -07:00
|
|
|
});
|