2018-06-15 23:03:24 +08:00
|
|
|
import { ajax } from "discourse/lib/ajax";
|
2013-03-30 03:48:26 +08:00
|
|
|
|
2015-11-21 09:27:06 +08:00
|
|
|
const AdminDashboard = Discourse.Model.extend({});
|
2013-03-30 03:48:26 +08:00
|
|
|
|
2015-11-21 09:27:06 +08:00
|
|
|
AdminDashboard.reopenClass({
|
2013-03-30 03:48:26 +08:00
|
|
|
/**
|
|
|
|
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
|
|
|
|
**/
|
2013-03-15 06:26:12 +08:00
|
|
|
find: function() {
|
2016-07-01 01:55:44 +08:00
|
|
|
return ajax("/admin/dashboard.json").then(function(json) {
|
2015-11-21 09:27:06 +08:00
|
|
|
var model = AdminDashboard.create(json);
|
2018-06-15 23:03:24 +08:00
|
|
|
model.set("loaded", true);
|
2013-04-04 04:06:55 +08:00
|
|
|
return model;
|
2013-03-15 06:26:12 +08:00
|
|
|
});
|
2018-06-15 23:03:24 +08:00
|
|
|
}
|
2013-03-21 23:24:05 +08:00
|
|
|
});
|
2015-11-21 09:27:06 +08:00
|
|
|
|
|
|
|
export default AdminDashboard;
|