1
0
Fork 0
mirror of synced 2024-06-02 10:54:44 +12:00

Function monitor view, hide stats graphs if stats disabled

This commit is contained in:
Damodar Lohani 2021-01-13 07:25:23 +05:45
parent 8da252366d
commit 075dd222ac
2 changed files with 6 additions and 0 deletions

View file

@ -390,6 +390,7 @@ App::get('/console/functions/function')
->setParam('fileLimit', App::getEnv('_APP_STORAGE_LIMIT', 0))
->setParam('fileLimitHuman', Storage::human(App::getEnv('_APP_STORAGE_LIMIT', 0)))
->setParam('timeout', (int) App::getEnv('_APP_FUNCTIONS_TIMEOUT', 900))
->setParam('usageStatsEnabled',App::getEnv('_APP_USAGE_STATS','enabled') == 'enabled');
;
$layout

View file

@ -3,6 +3,7 @@ $fileLimit = $this->getParam('fileLimit', 0);
$fileLimitHuman = $this->getParam('fileLimitHuman', 0);
$events = array_keys($this->getParam('events', []));
$timeout = $this->getParam('timeout', 900);
$usageStatsEnabled = $this->getParam('usageStatsEnabled',true);
?>
<div
data-service="functions.get"
@ -281,6 +282,7 @@ $timeout = $this->getParam('timeout', 900);
data-event="load"
data-name="usage"
data-param-function-id="{{router.params.id}}">
<?php if($usageStatsEnabled) : ?>
<div class="box margin-bottom-small">
<div class="margin-start-negative-small margin-end-negative-small margin-top-negative-small margin-bottom-negative-small">
<div class="chart margin-bottom-no">
@ -316,6 +318,9 @@ $timeout = $this->getParam('timeout', 900);
<ul class="chart-notes margin-bottom-large">
<li class="red">Errors <span data-ls-bind="({{usage.failures.total}})"></span></li>
</ul>
<?php else: ?>
<p>Usage stats is disabled.</p>
<?php endif; ?>
</div>
</li>
<li data-state="/console/functions/function/logs?id={{router.params.id}}&project={{router.params.project}}">