1
0
Fork 0
mirror of synced 2024-07-01 20:50:49 +12:00

update response format

This commit is contained in:
Damodar Lohani 2022-08-10 09:50:05 +00:00
parent 6fc98eb1cb
commit 9002bbe77e
2 changed files with 6 additions and 2 deletions

View file

@ -276,7 +276,7 @@ App::post('/v1/runtimes')
throw new Exception('Failed to create build container', 500);
}
$orchestration->networkConnect($runtimeId, App::getEnv('OPEN_RUNTIMES_NETWORK', 'appwrite_runtimes'));
$orchestration->networkConnect($runtimeId, App::getEnv('OPEN_RUNTIMES_NETWORK', 'appwrite-runtimes'));
/**
* Execute any commands if they were provided
@ -516,6 +516,7 @@ App::post('/v1/execution')
]);
$executorResponse = \curl_exec($ch);
$executorResponse = json_decode($executorResponse, true);
$statusCode = \curl_getinfo($ch, CURLINFO_HTTP_CODE);
@ -545,6 +546,9 @@ App::post('/v1/execution')
case $statusCode >= 100:
$stdout = $executorResponse['stdout'];
$res = $executorResponse['response'];
if(is_array($res)) {
$res = json_encode($res);
}
break;
default:
$stderr = ($executorResponse ?? [])['stderr'] ?? 'Execution failed.';

View file

@ -451,7 +451,7 @@ sort($patterns);
<h1>STDOUT</h1>
<div class="margin-bottom ide" data-ls-if="({{execution.stdout.length}})">
<pre data-ls-bind="{{execution.response}}"></pre>
<pre data-ls-bind="{{execution.stdout}}"></pre>
</div>
<div class="margin-bottom" data-ls-if="(!{{execution.stdout.length}})">