Skip to content

Commit

Permalink
chore(slow-query-report): Use Dialog component instead of renderDialog
Browse files Browse the repository at this point in the history
  • Loading branch information
tanmoysrt committed Jan 3, 2025
1 parent 26205eb commit 6039bdc
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 11 deletions.
31 changes: 21 additions & 10 deletions dashboard/src2/components/site/performance/SiteSlowQueries.vue
Original file line number Diff line number Diff line change
@@ -1,38 +1,49 @@
<template>
<div>
<PerformanceReport
v-if="siteVersion !== 'Version 14'"
title="Slow Queries"
:site="name"
:reportOptions="slowQueriesOptions"
/>
<div v-else class="m-5 space-y-4">
<AlertBanner
title="Performance Tuning coming soon for Version 15"
type="info"
/>
</div>
<SiteSlowQueryDialog
v-if="show"
v-model="show"
:query="selectedQuery"
:duration="selectedQueryDuration"
/>
</div>
</template>

<script>
import { defineAsyncComponent, h } from 'vue';
import AlertBanner from '../../AlertBanner.vue';
import PerformanceReport from './PerformanceReport.vue';
import { renderDialog } from '../../../utils/components';
import SiteSlowQueryDialog from './SiteSlowQueryDialog.vue';
export default {
props: ['name', 'siteVersion'],
components: {
PerformanceReport,
AlertBanner
AlertBanner,
SiteSlowQueryDialog
},
data() {
return {
show: false,
selectedQuery: '',
selectedQueryDuration: 0
};
},
computed: {
slowQueriesOptions() {
return {
experimental: true,
documentation: 'https://frappecloud.com/docs/performance-tuning',
data: () => this.$resources.slowQueries.data.data,
onRowClick: row => {
this.selectedQuery = row.query;
this.selectedQueryDuration = row.duration;
this.show = true;
},
emptyStateMessage: 'No slow queries found',
columns: [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<Dialog
:options="{
title: 'Normalized Slow Query',
title: 'Normalized Query',
size: '2xl'
}"
v-model="show"
Expand Down

0 comments on commit 6039bdc

Please sign in to comment.