discourse/app/assets/javascripts/admin/models/admin-dashboard.js.es6
Sam 6332d5040d UX: switch dashboard to be the new dashboard
Also:
- add pageviews
- add problems and version sections
2018-05-14 13:07:59 +10:00

25 lines
578 B
JavaScript

import { ajax } from 'discourse/lib/ajax';
const AdminDashboard = Discourse.Model.extend({});
AdminDashboard.reopenClass({
/**
Fetch all dashboard data. This can be an expensive request when the cached data
has expired and the server must collect the data again.
@method find
@return {jqXHR} a jQuery Promise object
**/
find: function() {
return ajax("/admin/dashboard.json").then(function(json) {
var model = AdminDashboard.create(json);
model.set('loaded', true);
return model;
});
},
});
export default AdminDashboard;