mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-16 00:14:48 +00:00
Merge remote-tracking branch 'origin/main' into 11244-deprecated-docker-flags
This commit is contained in:
commit
4a7e77f809
15 files changed
+357
-10
No files matched your search
@@ -149,8 +149,8 @@ class ScheduledJobManager implements ShouldQueue
|
||||
|
||||
private function processScheduledBackupsAndTasks(): void
|
||||
{
|
||||
$lastBackupId = 0;
|
||||
$lastTaskId = 0;
|
||||
$lastBackupId = null;
|
||||
$lastTaskId = null;
|
||||
|
||||
do {
|
||||
$backups = $this->scheduledBackupQuery($lastBackupId)->get();
|
||||
@@ -190,16 +190,16 @@ class ScheduledJobManager implements ShouldQueue
|
||||
}
|
||||
}
|
||||
|
||||
private function scheduledBackupQuery(int $lastBackupId): Builder
|
||||
private function scheduledBackupQuery(?int $lastBackupId): Builder
|
||||
{
|
||||
return ScheduledDatabaseBackup::with(['database', 'team.subscription'])
|
||||
->where('enabled', true)
|
||||
->where('id', '>', $lastBackupId)
|
||||
->when($lastBackupId !== null, fn (Builder $query) => $query->where('id', '>', $lastBackupId))
|
||||
->orderBy('id')
|
||||
->limit(self::CHUNK_SIZE);
|
||||
}
|
||||
|
||||
private function scheduledTaskQuery(int $lastTaskId): Builder
|
||||
private function scheduledTaskQuery(?int $lastTaskId): Builder
|
||||
{
|
||||
return ScheduledTask::with([
|
||||
'service.destination.server.settings',
|
||||
@@ -208,7 +208,7 @@ class ScheduledJobManager implements ShouldQueue
|
||||
'application.destination.server.team.subscription',
|
||||
])
|
||||
->where('enabled', true)
|
||||
->where('id', '>', $lastTaskId)
|
||||
->when($lastTaskId !== null, fn (Builder $query) => $query->where('id', '>', $lastTaskId))
|
||||
->orderBy('id')
|
||||
->limit(self::CHUNK_SIZE);
|
||||
}
|
||||
|
||||
@@ -101,6 +101,7 @@ class StackForm extends Component
|
||||
$rules = data_get($field, 'rules', 'nullable');
|
||||
$isPassword = data_get($field, 'isPassword', false);
|
||||
$customHelper = data_get($field, 'customHelper', false);
|
||||
$sortOrder = data_get($field, 'sortOrder');
|
||||
$this->fields->put($key, [
|
||||
'serviceName' => $serviceName,
|
||||
'key' => $key,
|
||||
@@ -109,6 +110,7 @@ class StackForm extends Component
|
||||
'isPassword' => $isPassword,
|
||||
'rules' => $rules,
|
||||
'customHelper' => $customHelper,
|
||||
'sortOrder' => $sortOrder,
|
||||
]);
|
||||
|
||||
$this->validationAttributes["fields.$key.value"] = $fieldKey;
|
||||
@@ -116,7 +118,7 @@ class StackForm extends Component
|
||||
}
|
||||
$this->fields = $this->fields->groupBy('serviceName')->map(function ($group) {
|
||||
return $group->sortBy(function ($field) {
|
||||
return data_get($field, 'isPassword') ? 1 : 0;
|
||||
return data_get($field, 'sortOrder') ?? (data_get($field, 'isPassword') ? 1 : 0);
|
||||
})->mapWithKeys(function ($field) {
|
||||
return [$field['key'] => $field];
|
||||
});
|
||||
|
||||
@@ -1180,6 +1180,27 @@ class Service extends BaseModel
|
||||
}
|
||||
$fields->put('Openclaw', $data->toArray());
|
||||
break;
|
||||
case $image->contains('coollabsio/jean-server'):
|
||||
$data = collect([]);
|
||||
$settings = [
|
||||
'Token' => ['key' => 'SERVICE_PASSWORD_64_JEAN', 'rules' => 'required', 'isPassword' => true, 'sortOrder' => 1, 'customHelper' => 'Token required to access Jean Server. Variable name: SERVICE_PASSWORD_64_JEAN'],
|
||||
'Allowed Origins' => ['key' => 'JEAN_ALLOWED_ORIGINS', 'rules' => 'nullable|string', 'sortOrder' => 2, 'customHelper' => 'Comma-separated additional browser origins. Same-origin access is always allowed. Variable name: JEAN_ALLOWED_ORIGINS'],
|
||||
];
|
||||
|
||||
foreach ($settings as $label => $setting) {
|
||||
$variable = $this->environment_variables()->where('key', $setting['key'])->first();
|
||||
if (! $variable) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$data->put($label, [
|
||||
...$setting,
|
||||
'value' => data_get($variable, 'value'),
|
||||
]);
|
||||
}
|
||||
|
||||
$fields->put('', $data->toArray());
|
||||
break;
|
||||
default:
|
||||
$data = collect([]);
|
||||
$admin_user = $this->environment_variables()->where('key', 'SERVICE_USER_ADMIN')->first();
|
||||
|
||||
@@ -15,9 +15,16 @@ trait HasMetrics
|
||||
|
||||
public function getMemoryMetrics(int $mins = 5): ?array
|
||||
{
|
||||
$field = $this->isServerMetrics() ? 'usedPercent' : 'used';
|
||||
if ($this->isServerMetrics()) {
|
||||
return $this->getMetrics('memory', $mins, 'usedPercent');
|
||||
}
|
||||
|
||||
return $this->getMetrics('memory', $mins, $field);
|
||||
$metrics = $this->getMetrics('memory', $mins, 'used');
|
||||
if ($metrics === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return convertContainerMemoryBytesToMegabytes($metrics);
|
||||
}
|
||||
|
||||
private function getMetrics(string $type, int $mins, string $valueField): ?array
|
||||
|
||||
Reference in new issue
Block a user