Skip to content

Commit

Permalink
fixes #6
Browse files Browse the repository at this point in the history
  • Loading branch information
sarfraznawaz2005 committed Feb 11, 2020
1 parent 236037e commit 82d9309
Show file tree
Hide file tree
Showing 13 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -23,7 +23,7 @@
}
],
"require": {
"php": ">=7.0",
"php": ">=7.3",
"illuminate/support": "~5|~6",
"consoletvs/charts": "6.*",
"balping/json-raw-encoder": "^1.0"
Expand Down
2 changes: 1 addition & 1 deletion src/Charts/CommandsTimeChart.php
Expand Up @@ -74,7 +74,7 @@ protected function setData(MeterModel $model)
if (isset($item->content['time'])) {
$this->data[(string)$item->created_at] = [
'x' => $item->content['command'],
'y' => $item->content['time'],
'y' => (int)$item->content['time'],
];
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Charts/ConnectionsChart.php
Expand Up @@ -57,7 +57,7 @@ protected function setOptions()
protected function setData(MeterModel $model)
{
foreach ($model->type(Type::CONNECTIONS)->filtered()->orderBy('id', 'asc')->get() as $item) {
$this->data[(string)$item->created_at] = $item->content['count'];
$this->data[(string)$item->created_at] = (int)$item->content['count'];
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Charts/CpuChart.php
Expand Up @@ -57,7 +57,7 @@ protected function setOptions()
protected function setData(MeterModel $model)
{
foreach ($model->type(Type::CPU)->filtered()->orderBy('id', 'asc')->get() as $item) {
$this->data[(string)$item->created_at] = $item->content['percent'];
$this->data[(string)$item->created_at] = (int)$item->content['percent'];
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Charts/DiskSpaceChart.php
Expand Up @@ -57,7 +57,7 @@ protected function setOptions()
protected function setData(MeterModel $model)
{
foreach ($model->type(Type::DISK)->filtered()->orderBy('id', 'asc')->get() as $item) {
$this->data[(string)$item->created_at] = $item->content['percent'];
$this->data[(string)$item->created_at] = (int)$item->content['percent'];
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Charts/EventsTimeChart.php
Expand Up @@ -74,7 +74,7 @@ protected function setData(MeterModel $model)
if (isset($item->content['time'])) {
$this->data[(string)$item->created_at] = [
'x' => $item->content['name'],
'y' => $item->content['time'],
'y' => (int)$item->content['time'],
];
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Charts/QueriesTimeChart.php
Expand Up @@ -75,7 +75,7 @@ protected function setData(MeterModel $model)
if (isset($item->content['time'])) {
$this->data[(string)$item->created_at] = [
'x' => Str::limit($item->content['sql'], 120),
'y' => $item->content['time'],
'y' => (int)$item->content['time'],
];
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Charts/RequestMemoryChart.php
Expand Up @@ -74,7 +74,7 @@ protected function setData(MeterModel $model)
if (isset($item->content['memory'])) {
$this->data[(string)$item->created_at] = [
'x' => $item->content['uri'],
'y' => $item->content['memory'],
'y' => (int)$item->content['memory'],
];
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Charts/RequestTimeChart.php
Expand Up @@ -74,7 +74,7 @@ protected function setData(MeterModel $model)
if (isset($item->content['duration'])) {
$this->data[(string)$item->created_at] = [
'x' => $item->content['uri'],
'y' => $item->content['duration'],
'y' => (int)$item->content['duration'],
];
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Charts/SchedulesTimeChart.php
Expand Up @@ -87,7 +87,7 @@ protected function setData(MeterModel $model)
if (isset($item->content['time'])) {
$this->data[(string)$item->created_at] = [
'x' => $item->content['command'],
'y' => $item->content['time'],
'y' => (int)$item->content['time'],
];;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Charts/ServerMemoryChart.php
Expand Up @@ -57,7 +57,7 @@ protected function setOptions()
protected function setData(MeterModel $model)
{
foreach ($model->type(Type::MEMORY)->filtered()->orderBy('id', 'asc')->get() as $item) {
$this->data[(string)$item->created_at] = $item->content['percent'];
$this->data[(string)$item->created_at] = (int)$item->content['percent'];
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/Config/config.php
Expand Up @@ -101,28 +101,28 @@

// monitors average CPU usage
Sarfraznawaz2005\Meter\Monitors\CpuMonitor::class => [
'enabled' => env('METER_CPU_MONITOR', true),
'enabled' => env('METER_CPU_MONITOR', false),
'graph_type' => env('METER_CPU_GRAPH_TYPE', 'bar'), // bar, line
'show_on_dashboard' => env('METER_CPU_ON_DASHBOARD', true)
],

// monitors disk space usage
Sarfraznawaz2005\Meter\Monitors\DiskSpaceMonitor::class => [
'enabled' => env('METER_DISK_MONITOR', true),
'enabled' => env('METER_DISK_MONITOR', false),
'graph_type' => env('METER_DISK_GRAPH_TYPE', 'bar'), // bar, line
'show_on_dashboard' => env('METER_DISK_ON_DASHBOARD', true)
],

// monitors server memory usage
Sarfraznawaz2005\Meter\Monitors\MemoryMonitor::class => [
'enabled' => env('METER_MEMORY_MONITOR', true),
'enabled' => env('METER_MEMORY_MONITOR', false),
'graph_type' => env('METER_MEMORY_GRAPH_TYPE', 'bar'), // bar, line
'show_on_dashboard' => env('METER_MEMOR_ON_DASHBOARD', true)
],

// monitors active http connections count on port 80
Sarfraznawaz2005\Meter\Monitors\HttpConnectionsMonitor::class => [
'enabled' => env('METER_HTTP_CONNECTIONS_MONITOR', true),
'enabled' => env('METER_HTTP_CONNECTIONS_MONITOR', false),
'graph_type' => env('METER_HTTP_CONNECTIONS_GRAPH_TYPE', 'bar'), // bar, line
'show_on_dashboard' => env('METER_HTTP_CONNECTIONS_ON_DASHBOARD', true)
],
Expand Down
4 changes: 2 additions & 2 deletions src/Tables/Table.php
Expand Up @@ -49,8 +49,8 @@ public function getData(): array
$draw = request()->draw;
$start = request()->start;
$length = request()->length;
$orderColumn = request()->order[0]['column'];
$dir = request()->order[0]['dir'];
$orderColumn = request()->order[0]['column'] ?? null;
$dir = request()->order[0]['dir'] ?? null;
$searchValue = trim(request()->search['value']);

// sets the current page
Expand Down

0 comments on commit 82d9309

Please sign in to comment.