Add basic tables and graphs for viewing things like uploads over time, new users over time, comments over time, etc. Located at https://betabooru.donmai.us/reports. The graphing uses Apache ECharts: https://echarts.apache.org/en/index.html.
21 lines
489 B
JavaScript
21 lines
489 B
JavaScript
let CurrentUser = {};
|
|
|
|
CurrentUser.data = function(key) {
|
|
return $("body").data(`current-user-${key}`);
|
|
};
|
|
|
|
CurrentUser.update = function(settings) {
|
|
return $.ajax(`/users/${CurrentUser.data("id")}.json`, {
|
|
method: "PUT",
|
|
data: { user: settings }
|
|
});
|
|
};
|
|
|
|
CurrentUser.darkMode = function() {
|
|
let theme = CurrentUser.data("theme");
|
|
|
|
return theme === "dark" || (theme === "auto" && window.matchMedia("(prefers-color-scheme: dark)").matches);
|
|
};
|
|
|
|
export default CurrentUser;
|