Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit ee76b8a

Browse files
committed
WIP: new spam tab for Discourse AI
1 parent 625fd06 commit ee76b8a

File tree

8 files changed

+46
-0
lines changed

8 files changed

+46
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { service } from "@ember/service";
2+
import { ajax } from "discourse/lib/ajax";
3+
import DiscourseRoute from "discourse/routes/discourse";
4+
5+
export default class DiscourseAiSpamRoute extends DiscourseRoute {
6+
@service store;
7+
8+
model() {
9+
return ajax("/admin/plugins/discourse-ai/ai-spam.json");
10+
}
11+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<AiSpam @model={{this.model}} />
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# frozen_string_literal: true
2+
3+
module DiscourseAi
4+
module Admin
5+
class AiSpamController < ::Admin::AdminController
6+
requires_plugin "discourse-ai"
7+
8+
def show
9+
render json: { work: "in progress" }
10+
end
11+
12+
end
13+
end
14+
end

assets/javascripts/discourse/admin-discourse-ai-plugin-route-map.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export default {
1818
this.route("new");
1919
this.route("show", { path: "/:id" });
2020
});
21+
this.route("discourse-ai-spam", { path: "ai-spam" });
2122
this.route("discourse-ai-usage", { path: "ai-usage" });
2223
},
2324
};
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import Component from "@glimmer/component";
2+
3+
export default class AiSpam extends Component {
4+
get tbd() {
5+
return "To be done";
6+
}
7+
8+
<template>
9+
{{this.tbd}}
10+
</template>
11+
}

assets/javascripts/initializers/admin-plugin-configuration-nav.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ export default {
2424
label: "discourse_ai.tools.short_title",
2525
route: "adminPlugins.show.discourse-ai-tools",
2626
},
27+
{
28+
label: "discourse_ai.spam.short_title",
29+
route: "adminPlugins.show.discourse-ai-spam",
30+
},
2731
{
2832
label: "discourse_ai.usage.short_title",
2933
route: "adminPlugins.show.discourse-ai-usage",

config/locales/client.en.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ en:
126126
modals:
127127
select_option: "Select an option..."
128128

129+
spam:
130+
short_title: "Spam"
131+
129132
usage:
130133
short_title: "Usage"
131134
summary: "Summary"

config/routes.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
to: "discourse_ai/admin/rag_document_fragments#indexing_status_check"
8080

8181
get "/ai-usage", to: "discourse_ai/admin/ai_usage#show"
82+
get "/ai-spam", to: "discourse_ai/admin/ai_spam#show"
8283

8384
resources :ai_llms,
8485
only: %i[index create show update destroy],

0 commit comments

Comments
 (0)