mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-07-09 15:43:28 +00:00
22 lines
702 B
JavaScript
22 lines
702 B
JavaScript
|
import { apiInitializer } from "discourse/lib/api";
|
||
|
|
||
|
export default apiInitializer("1.15.0", (api) => {
|
||
|
const settings = api.container.lookup("service:site-settings");
|
||
|
|
||
|
if (settings.ai_sentiment_enabled) {
|
||
|
api.addAdminSidebarSectionLink("reports", {
|
||
|
name: "sentiment_overview",
|
||
|
href: "/admin/dashboard/sentiment#sentiment-heading",
|
||
|
label: "discourse_ai.sentiments.sidebar.overview",
|
||
|
icon: "chart-column",
|
||
|
});
|
||
|
api.addAdminSidebarSectionLink("reports", {
|
||
|
name: "sentiment_analysis",
|
||
|
route: "adminReports.show",
|
||
|
routeModels: ["sentiment_analysis"],
|
||
|
label: "discourse_ai.sentiments.sidebar.analysis",
|
||
|
icon: "chart-pie",
|
||
|
});
|
||
|
}
|
||
|
});
|