27 lines
776 B
JavaScript
27 lines
776 B
JavaScript
|
import { PLUGIN_NAV_MODE_TOP } from "discourse/lib/admin-plugin-config-nav";
|
||
|
import { withPluginApi } from "discourse/lib/plugin-api";
|
||
|
|
||
|
export default {
|
||
|
name: "discourse-ai-admin-plugin-configuration-nav",
|
||
|
|
||
|
initialize(container) {
|
||
|
const currentUser = container.lookup("service:current-user");
|
||
|
if (!currentUser || !currentUser.admin) {
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
withPluginApi("1.1.0", (api) => {
|
||
|
api.addAdminPluginConfigurationNav("discourse-ai", PLUGIN_NAV_MODE_TOP, [
|
||
|
{
|
||
|
label: "admin.plugins.change_settings_short",
|
||
|
route: "adminPlugins.show.settings",
|
||
|
},
|
||
|
{
|
||
|
label: "discourse_ai.ai_persona.short_title",
|
||
|
route: "adminPlugins.show.discourse-ai.ai-personas",
|
||
|
},
|
||
|
]);
|
||
|
});
|
||
|
},
|
||
|
};
|