discourse/app/assets/javascripts/admin/components/watched-word-uploader.js.es6

26 lines
630 B
Plaintext
Raw Normal View History

import computed from "ember-addons/ember-computed-decorators";
import UploadMixin from "discourse/mixins/upload";
export default Em.Component.extend(UploadMixin, {
2018-06-15 23:03:24 +08:00
type: "csv",
classNames: "watched-words-uploader",
uploadUrl: "/admin/logs/watched_words/upload",
addDisabled: Em.computed.alias("uploading"),
validateUploadedFilesOptions() {
return { csvOnly: true };
},
2018-06-15 23:03:24 +08:00
@computed("actionKey")
data(actionKey) {
return { action_key: actionKey };
},
uploadDone() {
if (this) {
bootbox.alert(I18n.t("admin.watched_words.form.upload_successful"));
this.sendAction("done");
}
}
});