Fixed Bug in View when no or a single voice call is active
This commit is contained in:
@@ -42,7 +42,7 @@ include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/header.php")
|
||||
<tt-page-title :title="window['TT_CONFIG']['PAGE_TITLE']" :path="window['TT_CONFIG']['PATH']"></tt-page-title>
|
||||
|
||||
<tt-table :fetch-url="window['TT_CONFIG']['VOICE_CALL_ACTIVE_API_URL'] + '?do=getActiveCalls'" :config="VoiceCallActiveTableConfig"
|
||||
small ssr ref="table">
|
||||
small ref="table">
|
||||
|
||||
<template v-slot:top-buttons>
|
||||
<button type="button" class="btn btn-primary" @click="refresh" data-toggle="tooltip" data-placement="bottom" title="Refreshing too often will run into API-Rate limits and will cause errors.">
|
||||
|
||||
@@ -54,8 +54,10 @@ class VoiceCallActiveController extends mfBaseController {
|
||||
}
|
||||
|
||||
private function getActiveCalls(): array {
|
||||
$activeCalls = $this->kolmisoftMore->getActiveCalls();
|
||||
|
||||
return [
|
||||
"rows" => array_reverse($this->kolmisoftMore->getActiveCalls())
|
||||
"rows" => is_null($activeCalls) ? [] : (is_object($activeCalls) ? [$activeCalls] : $activeCalls),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -235,7 +235,7 @@ Vue.component('tt-table', {
|
||||
this.pagination = {
|
||||
page: page++,
|
||||
per_page: this.pagination?.per_page ? parseInt(this.pagination.per_page) : 10,
|
||||
total_rows: this.rawRows.length,
|
||||
total_rows: this.rawRows.length || 0,
|
||||
total_pages: this.rawRows.length / this.pagination?.per_page,
|
||||
filtered_available: this.rawRows.length
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user