2020-12-01 12:31:26 -06:00
|
|
|
import EmberObject from "@ember/object";
|
2020-05-13 15:23:41 -05:00
|
|
|
import I18n from "I18n";
|
2018-06-15 10:03:24 -05:00
|
|
|
import { ajax } from "discourse/lib/ajax";
|
2020-12-01 12:31:26 -06:00
|
|
|
import discourseComputed from "discourse-common/utils/decorators";
|
2019-04-26 05:16:21 -05:00
|
|
|
|
2019-11-08 13:13:35 -06:00
|
|
|
const ScreenedUrl = EmberObject.extend({
|
2019-11-07 15:38:28 -06:00
|
|
|
@discourseComputed("action")
|
2019-04-26 05:16:21 -05:00
|
|
|
actionName(action) {
|
|
|
|
return I18n.t("admin.logs.screened_actions." + action);
|
2020-09-04 06:42:47 -05:00
|
|
|
},
|
2013-08-15 09:48:30 -05:00
|
|
|
});
|
|
|
|
|
2015-11-20 19:27:06 -06:00
|
|
|
ScreenedUrl.reopenClass({
|
2021-11-13 07:01:55 -06:00
|
|
|
findAll() {
|
2020-09-04 06:42:47 -05:00
|
|
|
return ajax("/admin/logs/screened_urls.json").then(function (
|
|
|
|
screened_urls
|
|
|
|
) {
|
|
|
|
return screened_urls.map(function (b) {
|
2015-11-20 19:27:06 -06:00
|
|
|
return ScreenedUrl.create(b);
|
2013-08-15 09:48:30 -05:00
|
|
|
});
|
|
|
|
});
|
2020-09-04 06:42:47 -05:00
|
|
|
},
|
2013-08-15 09:48:30 -05:00
|
|
|
});
|
2015-11-20 19:27:06 -06:00
|
|
|
|
|
|
|
export default ScreenedUrl;
|