feat: Interface to validate response_source (#8894)
- This PR adds a UI to validate the response source quality quickly. It also helps to test with sample questions and update responses in the database when missing. Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
This commit is contained in:
@@ -1 +1,28 @@
|
||||
import 'chart.js';
|
||||
import Vue from 'vue';
|
||||
import VueDOMPurifyHTML from 'vue-dompurify-html';
|
||||
Vue.use(VueDOMPurifyHTML);
|
||||
|
||||
const PlaygroundIndex = () =>
|
||||
import('../superadmin_pages/views/playground/Index.vue');
|
||||
|
||||
const ComponentMapping = {
|
||||
PlaygroundIndex: PlaygroundIndex,
|
||||
};
|
||||
|
||||
const renderComponent = (componentName, props) => {
|
||||
Vue.component(componentName, ComponentMapping[componentName]);
|
||||
new Vue({
|
||||
data: { props: props },
|
||||
template: `<${componentName} :component-data="props"/>`,
|
||||
}).$mount('#app');
|
||||
};
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const element = document.getElementById('app');
|
||||
if (element) {
|
||||
const componentName = element.dataset.componentName;
|
||||
const props = JSON.parse(element.dataset.props);
|
||||
renderComponent(componentName, props);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user