mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-17 14:42:51 +00:00
no message
This commit is contained in:
parent
20e543f721
commit
45ee092593
@ -209,7 +209,7 @@ class AppsController extends AbstractController
|
|||||||
$logContent = implode("\n", $output);
|
$logContent = implode("\n", $output);
|
||||||
|
|
||||||
return Base::retSuccess('success', [
|
return Base::retSuccess('success', [
|
||||||
'log' => $logContent
|
'log' => trim($logContent)
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -58,6 +58,7 @@ class Apps
|
|||||||
public static function appInfo(string $appName): array
|
public static function appInfo(string $appName): array
|
||||||
{
|
{
|
||||||
return Base::retSuccess("success", [
|
return Base::retSuccess("success", [
|
||||||
|
'name' => $appName,
|
||||||
'info' => self::getAppInfo($appName),
|
'info' => self::getAppInfo($appName),
|
||||||
'local' => self::getAppLocalInfo($appName),
|
'local' => self::getAppLocalInfo($appName),
|
||||||
'versions' => self::getAvailableVersions($appName),
|
'versions' => self::getAvailableVersions($appName),
|
||||||
@ -298,13 +299,26 @@ class Apps
|
|||||||
'name' => $field['name'],
|
'name' => $field['name'],
|
||||||
'type' => $field['type'] ?? 'text',
|
'type' => $field['type'] ?? 'text',
|
||||||
'default' => $field['default'] ?? '',
|
'default' => $field['default'] ?? '',
|
||||||
'label' => self::getMultiLanguageField($field['label']),
|
'label' => self::getMultiLanguageField($field['label'] ?? ''),
|
||||||
'placeholder' => self::getMultiLanguageField($field['placeholder']),
|
'placeholder' => self::getMultiLanguageField($field['placeholder'] ?? ''),
|
||||||
|
'required' => $field['required'] ?? false,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// 处理 select 类型的选项
|
||||||
|
if ($normalizedField['type'] === 'select' && isset($field['options']) && is_array($field['options'])) {
|
||||||
|
$selectOptions = [];
|
||||||
|
foreach ($field['options'] as $option) {
|
||||||
|
$selectOptions[] = [
|
||||||
|
'label' => self::getMultiLanguageField($option['label'] ?? ''),
|
||||||
|
'value' => $option['value'] ?? '',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
$normalizedField['options'] = $selectOptions;
|
||||||
|
}
|
||||||
|
|
||||||
// 处理其他属性
|
// 处理其他属性
|
||||||
foreach ($field as $key => $value) {
|
foreach ($field as $key => $value) {
|
||||||
if (!in_array($key, ['name', 'type', 'default', 'label', 'placeholder'])) {
|
if (!in_array($key, ['name', 'type', 'default', 'label', 'placeholder', 'required', 'options'])) {
|
||||||
$normalizedField[$key] = $value;
|
$normalizedField[$key] = $value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user