Skip to content

Commit

Permalink
reporting feature wip
Browse files Browse the repository at this point in the history
  • Loading branch information
sadnub committed Jul 28, 2022
1 parent a944bc5 commit dd77093
Show file tree
Hide file tree
Showing 5 changed files with 875 additions and 0 deletions.
41 changes: 41 additions & 0 deletions src/api/reporting.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import axios from "axios";

const baseUrl = "/reporting";

// client endpoints
export async function fetchReportTemplates() {
const { data } = await axios.get(`${baseUrl}/templates/`);
return data;
}

export async function fetchReportTemplate(id) {
const { data } = await axios.get(`${baseUrl}/templates/${id}/`);
return data;
}

export async function saveReportTemplate(payload) {
const { data } = await axios.post(`${baseUrl}/templates/`, payload);
return data;
}

export async function editReportTemplate(id, payload) {
const { data } = await axios.put(`${baseUrl}/templates/${id}/`, payload);
return data;
}

export async function removeReportTemplate(id, params = {}) {
const { data } = await axios.delete(`${baseUrl}/templates/${id}/`, {
params: params,
});
return data;
}

export async function runReport(id, payload) {
const { data } = await axios.post(`${baseUrl}/templates/${id}/run/`, payload);
return data;
}

export async function runReportPreview(payload) {
const { data } = await axios.post(`${baseUrl}/templates/preview/`, payload);
return data;
}
10 changes: 10 additions & 0 deletions src/components/FileBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@
<q-item clickable v-close-popup @click="showPermissionsManager">
<q-item-section>Permissions Manager</q-item-section>
</q-item>
<!-- reports manager -->
<q-item clickable v-close-popup @click="showReportsManager">
<q-item-section>Reports Manager</q-item-section>
</q-item>
<!-- admin manager -->
<q-item clickable v-close-popup @click="showAdminManager = true">
<q-item-section>User Administration</q-item-section>
Expand Down Expand Up @@ -233,6 +237,7 @@ import DeploymentTable from "@/components/clients/DeploymentTable.vue";
import ServerMaintenance from "@/components/modals/core/ServerMaintenance.vue";
import CodeSign from "@/components/modals/coresettings/CodeSign.vue";
import PermissionsManager from "@/components/accounts/PermissionsManager.vue";
import ReportsManager from "@/components/reporting/ReportsManager";
export default {
name: "FileBar",
Expand Down Expand Up @@ -396,6 +401,11 @@ export default {
component: DeploymentTable,
});
},
showReportsManager() {
this.$q.dialog({
component: ReportsManager,
});
},
},
};
</script>
Loading

0 comments on commit dd77093

Please sign in to comment.