Files
SuhailandGitHub c632136ce9 feat: performance reports (#2165)
* feat: performance reports

* fix: sort option

* fix: path of component

* fix: sort in request logs

* fix(SiteBinaryLogs): filters

* fix(SIteDeadlockReport): filters

* fix: open plan change dialog when required

* chore: remove unneeded code

* chore: remove unneeded code

* chore: hide deadlock reports for now

* fix: use date and datetime filter from frappe-ui

* refactor: use `Report` component

* fix(ProcessList): remove user column since it'll be the same

* fix: revert unintended changes

* chore: rename `Report` to `PerformanceReport`

due to conflict with report from old src
2024-09-20 17:31:52 +05:30

65 lines
1.4 KiB
Vue

<template>
<div class="m-5">
<div class="flex items-center space-x-4">
<Button @click="goBack" icon="arrow-left" label="Go Back" />
<h2 class="font-semibold">{{ title }}</h2>
</div>
<div v-if="$site.doc?.current_plan?.monitor_access" class="mt-5">
<ObjectList :options="reportOptions" />
</div>
<div class="flex justify-center" v-else>
<span class="mt-16 p-2 text-base text-gray-800">
Your plan doesn't support this feature. Please
<span class="cursor-pointer underline" @click="showPlanChangeDialog"
>upgrade your plan</span
>
.
</span>
</div>
</div>
</template>
<script>
import { getCachedDocumentResource } from 'frappe-ui';
import { defineAsyncComponent, h } from 'vue';
import { renderDialog } from '../../../utils/components';
import ObjectList from '../../ObjectList.vue';
export default {
name: 'PerformanceReport',
props: {
title: {
type: String,
required: true
},
site: {
type: String,
required: true
},
reportOptions: {
type: Object,
required: true
}
},
components: {
ObjectList
},
computed: {
$site() {
return getCachedDocumentResource('Site', this.site);
}
},
methods: {
showPlanChangeDialog() {
const SitePlansDialog = defineAsyncComponent(() =>
import('../../ManageSitePlansDialog.vue')
);
renderDialog(h(SitePlansDialog, { site: this.site }));
},
goBack() {
this.$router.go(-1);
}
}
};
</script>