Skip to content

Commit

Permalink
[dbviewer] Remove assistant drawer
Browse files Browse the repository at this point in the history
  • Loading branch information
widatama committed Jan 30, 2025
1 parent 67610b6 commit 57d4031
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 22 deletions.
16 changes: 1 addition & 15 deletions plugins/dbviewer/frontend/public/javascripts/countly.views.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*global countlyGlobal, store, hljs, countlyDBviewer, app, countlyCommon, CV, countlyVue, CountlyHelpers, _, countlyAuth, countlyPlugins*/
/*global countlyGlobal, store, hljs, countlyDBviewer, app, countlyCommon, CV, countlyVue, CountlyHelpers, _, countlyAuth*/

(function() {

Expand Down Expand Up @@ -394,13 +394,7 @@

var DBViewerMain = countlyVue.views.create({
template: CV.T("/dbviewer/templates/main.html"),
mixins: [
countlyVue.container.dataMixin({assistantPromptDrawer: 'ai-assistants/prompt-drawer'}),
countlyVue.mixins.hasDrawers("ai-assistant-prompt"),
],
data: function() {
var aiAssistantConfig = countlyPlugins.getConfigsData()['ai-assistants'];

return {
dynamicTab: (this.$route.params && this.$route.params.db) || "countly",
db: (this.$route.params && this.$route.params.db) || null,
Expand All @@ -409,17 +403,9 @@
apps: [],
collections: {},
index: (this.$route.params && this.$route.params.index) || null,
assistantPromptDrawerSettings: {
assistant_id: aiAssistantConfig ? aiAssistantConfig.assistantId_queryBuilder : '',
buildEndpoint: '/ai-assistants/build-query',
title: CV.i18n('cohorts.assistant.title'),
},
};
},
methods: {
onAssistantClick: function() {
this.openDrawer('ai-assistant-prompt', {});
},
prepareTabs: function(dbs) {
for (var i = 0; i < dbs.length; i++) {
this.tabs.push({
Expand Down
7 changes: 0 additions & 7 deletions plugins/dbviewer/frontend/public/templates/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
<cly-header
:title="i18n('dbviewer.title')"
>
<template v-slot:header-right>
<div class="bu-level-item">
<el-button @click="onAssistantClick" v-if="assistantPromptDrawer && assistantPromptDrawer.length > 0" type="success" size="small">AI Assistant</el-button>
</div>
</template>
<template v-slot:header-tabs>
<cly-dynamic-tabs
v-model="dynamicTab"
Expand All @@ -24,6 +19,4 @@
</cly-dynamic-tabs>
</template>
</cly-header>
<component v-if="assistantPromptDrawer && assistantPromptDrawer.length > 0" :is="assistantPromptDrawer[0].component" :settings="assistantPromptDrawerSettings" :controls="drawers['ai-assistant-prompt']">
</component>
</div>

0 comments on commit 57d4031

Please sign in to comment.