Updated ENV web interface as well as the env API endpoint. Did some Facelift sn the Tasks page to be more mobile friendly.

This commit is contained in:
Abdulmhsen B. A. A
2024-05-08 13:38:37 +03:00
parent 194fe94128
commit ccb00dfda1
6 changed files with 188 additions and 109 deletions

View File

@@ -29,24 +29,17 @@ final class Env
{
$spec = require __DIR__ . '/../../../config/env.spec.php';
$response = [
'data' => [],
'file' => Config::get('path') . '/config/.env',
];
foreach ($this->envFile->getAll() as $key => $val) {
if (false === str_starts_with($key, 'WS_')) {
foreach ($spec as &$info) {
if (!$this->envFile->has($info['key'])) {
continue;
}
$response['data'][] = [
'key' => $key,
'value' => $val,
'mask' => (bool)ag($spec, "{$key}.mask", false),
];
$info['value'] = $this->envFile->get($info['key']);
}
return api_response(HTTP_STATUS::HTTP_OK, $response);
return api_response(HTTP_STATUS::HTTP_OK, [
'data' => $spec,
'file' => Config::get('path') . '/config/.env',
]);
}
#[Get(self::URL . '/{key}[/]', name: 'system.env.view')]