diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index 64689904e..9c57fd1b5 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -175,7 +175,7 @@ $utopia->get('/v1/projects/:projectId/usage') ], 'last30' => [ 'start' => DateTime::createFromFormat('U', strtotime('-30 days')), - 'end' => DateTime::createFromFormat('U', strtotime('today')), + 'end' => DateTime::createFromFormat('U', strtotime('tomorrow')), 'group' => '1d', ], 'last90' => [ @@ -272,7 +272,7 @@ $utopia->get('/v1/projects/:projectId/usage') }, $requests)), ], 'network' => [ - 'data' => $network, + 'data' => array_map(function ($value) {return ['value' => round($value['value'] / 1000000, 2), 'date' => $value['date']];}, $network), // convert bytes to mb 'total' => array_sum(array_map(function ($item) { return $item['value']; }, $network)), diff --git a/app/views/console/home/index.phtml b/app/views/console/home/index.phtml index 22d519d26..736de09c5 100644 --- a/app/views/console/home/index.phtml +++ b/app/views/console/home/index.phtml @@ -36,7 +36,7 @@ $graph = $this->getParam('graph', false);
-
+
diff --git a/src/Appwrite/Task/Validator/Cron.php b/src/Appwrite/Task/Validator/Cron.php index 2188b04ec..68c7c4b0f 100644 --- a/src/Appwrite/Task/Validator/Cron.php +++ b/src/Appwrite/Task/Validator/Cron.php @@ -30,6 +30,10 @@ class Cron extends Validator */ public function isValid($value) { + if(empty($value)) { + return true; + } + if (!CronExpression::isValidExpression($value)) { return false; } diff --git a/tests/e2e/Services/Functions/FunctionsCustomClientTest.php b/tests/e2e/Services/Functions/FunctionsCustomClientTest.php index 22c774473..9f33156c4 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomClientTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomClientTest.php @@ -28,7 +28,6 @@ class FunctionsConsoleClientTest extends Scope 'key2' => 'value2', 'key3' => 'value3', ], - 'trigger' => 'event', 'events' => [ 'account.create', 'account.delete', diff --git a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php index 2b1a0d0ac..9e629f444 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php @@ -28,7 +28,6 @@ class FunctionsConsoleServerTest extends Scope 'key2' => 'value2', 'key3' => 'value3', ], - 'trigger' => 'event', 'events' => [ 'account.create', 'account.delete', @@ -50,7 +49,6 @@ class FunctionsConsoleServerTest extends Scope // 'key2' => 'value2', // 'key3' => 'value3', // ], $response1['body']['vars']); - $this->assertEquals('event', $response1['body']['trigger']); $this->assertEquals([ 'account.create', 'account.delete', @@ -136,7 +134,6 @@ class FunctionsConsoleServerTest extends Scope 'key5' => 'value5', 'key6' => 'value6', ], - 'trigger' => 'scheudle', 'events' => [ 'account.update.name', 'account.update.email', @@ -156,7 +153,6 @@ class FunctionsConsoleServerTest extends Scope // 'key5' => 'value5', // 'key6' => 'value6', // ], $response1['body']['vars']); - $this->assertEquals('scheudle', $response1['body']['trigger']); $this->assertEquals([ 'account.update.name', 'account.update.email',