Improved Performance and Layout of Vue Applications, enhanced caching aswell as using less code

This commit is contained in:
Luca Haid
2024-05-10 23:01:19 +02:00
parent 18ee289509
commit c2e5796661
34 changed files with 2281 additions and 1139 deletions
@@ -24,7 +24,20 @@ class VoiceCallHistoryController extends mfBaseController {
}
protected function indexAction(): void {
$this->layout()->setTemplate("VoiceCallHistory/Index");
$JSGlobals = ["BASE_URL" => self::getUrl("Domain"),
"DASHBOARD_URL" => self::getUrl("Dashboard"),
"MFAPPNAME" => MFAPPNAME_SLUG,
"PAGE_TITLE" => "Voice Call History",
"PATH" => [
["text" => MFAPPNAME_SLUG, "href" => self::getUrl("Dashboard")],
["text" => "Voice Call History", "href" => self::getUrl("VoiceCallHistory")]
],
"VOICE_CALL_HISTORY_API_URL" => self::getUrl("VoiceCallHistory/api"),
];
$this->layout()->set("vueViewName", "VoiceCallHistory");
$this->layout()->set("JSGlobals", $JSGlobals);
$this->layout()->setTemplate("VueViews/Vue");
}
protected function apiAction() {
@@ -73,6 +86,11 @@ class VoiceCallHistoryController extends mfBaseController {
$page = $json['pagination']['page'] ?? 1;
$perPage = $json['pagination']['per_page'] ?? 10;
if (isset($filters['start']['from']) && isset($filters['start']['to']) && is_numeric($filters['start']['to'])) {
$filters['start']['from'] += 7200;
$filters['start']['to'] += 7200;
}
$calls = VoiceCallHistoryModel::getVoiceCallHistory($filters, $perPage, $perPage * $page - $perPage, $order);
$filtered_available = VoiceCallHistoryModel::countVoiceCallHistory($filters);
$totalRows = VoiceCallHistoryModel::countVoiceCallHistory([]);