Compare commits

...

14 Commits

Author SHA1 Message Date
lexx 57b0727788 fix image limit 2025-07-03 15:28:52 +03:00
lexx 58b047edd2 Merge pull request 'Fix gte' (#24) from Fixing-date-&-datetime-compare-bugs into dev
Reviewed-on: #24
2025-06-16 15:48:36 +00:00
arvanitakis a78b699a5e Fix 2025-06-16 18:23:14 +03:00
lexx e910ae9878 login 2025-05-16 13:53:41 +03:00
lexx 362c649d36 Merge branch 'dev' of ssh://code.radical-elements.com:2727/lucent/lucent-laravel into dev 2025-05-16 13:27:48 +03:00
lexx 852c4d608d thumbnail limit 2025-05-16 13:27:25 +03:00
lexx aa59e55a41 meta htmx 2025-05-15 19:18:03 +03:00
lexx 348bad80e0 Merge pull request 'Fix' (#23) from Catching-thumbnail-rebuild-error into dev
Reviewed-on: #23
2025-05-06 10:46:58 +00:00
arvanitakis f0d4686141 Fix 2025-05-06 13:46:00 +03:00
lexx a482ab3c7e login urls 2025-03-20 21:06:40 +02:00
lexx c580882ec0 fix url 2025-03-20 20:57:47 +02:00
lexx 2cf8379cbe urls update 2025-03-20 20:53:51 +02:00
lexx c39ec469df files bug 2025-01-22 20:03:12 +02:00
lexx 232fcc8845 csv render title 2024-12-18 13:02:09 +02:00
15 changed files with 40 additions and 28 deletions
+4
View File
@@ -0,0 +1,4 @@
{
"$schema": "/phpactor.schema.json",
"language_server_phpstan.enabled": false
}
+2 -1
View File
@@ -14,7 +14,8 @@
"intervention/image": "^2.7",
"phpoption/phpoption": "^1.9",
"spatie/image-optimizer": "^1.6",
"staudenmeir/laravel-cte": "^1.0"
"staudenmeir/laravel-cte": "^1.0",
"mustache/mustache": "^2.14"
},
"require-dev": {
Generated
+3 -3
View File
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "71cf4c1de3d614ce2f9607763bf5687f",
"content-hash": "e8fb1bee28ad339453d50110f7fea2f5",
"packages": [
{
"name": "brick/math",
@@ -5729,8 +5729,8 @@
"ext-zip": "*",
"ext-sqlite3": "*",
"ext-imagick": "*",
"php": "^8.3",
"ext-pdo": "*"
"ext-pdo": "*",
"php": "^8.3"
},
"platform-dev": [],
"plugin-api-version": "2.3.0"
+1 -1
View File
@@ -9,7 +9,7 @@
<div class="form">
<h2 class="mb-5">Enter Lucent</h2>
<form hx-post="/lucent/login" >
<form hx-post="{{config("lucent.url")}}/lucent/login" >
@csrf
<p>Submit your email address and you will receive a <b>login link</b> to your email</p>
<p>Don't forget to check your spam folder</p>
+1 -1
View File
@@ -9,7 +9,7 @@
<div class="form">
<h2 class="mb-5">Welcome to Lucent</h2>
<form hx-post="/lucent/verify" hx-redirect="/lucent" hx-target-error=".form-errors" >
<form hx-post="{{config("lucent.url")}}/lucent/verify" hx-redirect="{{config("lucent.url")}}/lucent" hx-target-error=".form-errors" >
<input type="hidden" value="{{$email}}" name="email" />
<input type="hidden" value="{{$token}}" name="token" />
@csrf
+4 -4
View File
@@ -6,11 +6,11 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>@yield('title') - Lucent Data Platform</title>
<meta name="htmx-config" content='{"selfRequestsOnly": false}' />
@if(config("lucent.env") === "production")
<!-- if production -->
<link rel="stylesheet" href="/vendor/lucent/dist/{{ $manifest['main.js']["css"][0] }}"/>
<script type="module" src="/vendor/lucent/dist/{{ $manifest['main.js']["file"] }}"></script>
<link rel="stylesheet" href="{{url('vendor/lucent/dist/'.$manifest['main.js']["css"][0])}}"/>
<script type="module" src="{{url('vendor/lucent/dist/'.$manifest['main.js']["file"])}}"></script>
@else
<!-- if development -->
@php
@@ -20,7 +20,7 @@
@endif
{{-- <link rel="icon" type="image/x-icon" href="/favicon.ico"/>--}}
<link rel="icon" type="image/x-icon" href="{{url('favicon.ico')}}">
</head>
+5 -7
View File
@@ -8,8 +8,8 @@
<title>@yield('title') - Lucent Data Platform</title>
@if(config("lucent.env") == "production")
<!-- if production -->
<link rel="stylesheet" href="/vendor/lucent/dist/{{ $manifest['main.js']["css"][0] }}"/>
<script type="module" src="/vendor/lucent/dist/{{ $manifest['main.js']["file"] }}"></script>
<link rel="stylesheet" href="{{url('vendor/lucent/dist/'.$manifest['main.js']["css"][0])}}"/>
<script type="module" src="{{url('vendor/lucent/dist/'.$manifest['main.js']["file"])}}"></script>
@else
<!-- if development -->
@php
@@ -18,16 +18,14 @@
<script type="module" crossorigin src="http://127.0.0.1:5173/main.js"></script>
@endif
<link rel="icon" type="image/x-icon" href="/favicon.ico">
<link rel="icon" type="image/x-icon" href="{{url('favicon.ico')}}">
</head>
<body>
@yield('content')
</body>
</html>
+8 -2
View File
@@ -41,11 +41,17 @@ class RebuildThumbnails extends Command
public function rebuildThumbnails(FilesSchema $schema): void
{
$this->info("Rebuilding thumbnails for ". $schema->name);
$records = $this->query->filter(["schema" => $schema->name])->run()->records;
$records = $this->query->limit(0)->filter(["schema" => $schema->name])->run()->records;
$disk = $this->fileService->loadDisk($schema->disk);
foreach ($records as $record) {
$this->fileService->createTemplates($disk, $record->_file->path);
try{
$this->fileService->createTemplates($disk, $record->_file->path);
} catch (Exception $e) {
echo "File ". $record->_file->originalName . " could not be rebuilt \n" ;
}
}
}
+3 -2
View File
@@ -80,7 +80,7 @@ class FileService
}
if($this->isImage($mimetype)){
$this->createTemplates($disk, $path, $file);
$this->createTemplates($disk, $path);
}
@@ -136,7 +136,8 @@ class FileService
{
$originalImage = $this->imageManager->make($disk->get($path));
foreach (config("lucent.imageFilters") as $preset => $filterClass) {
$image = $originalImage->filter(new $filterClass);
$imageClone = clone $originalImage;
$image = $imageClone->filter(new $filterClass);
$templateUri = "/templates/" . $preset . "/" . $path;
$disk->put($templateUri, $image->encode('webp', 75));
}
+4 -2
View File
@@ -20,6 +20,7 @@ use Lucent\Schema\System;
use Lucent\Schema\Ui\Reference;
use Lucent\Schema\Validator\ValidatorException;
use Lucent\Svelte\Svelte;
use Lucent\ViewModel\ViewModel;
use function Lucent\Response\fail;
use function Lucent\Response\ok;
@@ -32,7 +33,8 @@ class RecordController extends Controller
private readonly Svelte $svelte,
private readonly Query $query,
private readonly Manager $recordManager,
private readonly OperatorRegistry $operatorRegistry
private readonly OperatorRegistry $operatorRegistry,
private readonly ViewModel $viewModel,
)
{
}
@@ -176,7 +178,7 @@ class RecordController extends Controller
$c[] = "";
}elseif (count($fieldRecords) === 1){
$c[] = data_get($fieldRecords,"0.id");
$c[] = data_get($fieldRecords,"0.data.name");
$c[] = $this->viewModel->getRecordName($fieldRecords[0]);
}else{
$c[] = collect($fieldRecords)->pluck("id")->join("::");
$c[] = collect($fieldRecords)->pluck("data.name")->join("::");
+1 -1
View File
@@ -23,7 +23,7 @@ readonly class GreaterThan implements IBuilderConverter
return $builder->orWhere($this->argument->field, ">", $this->formatValue());
}
private function formatValue(): int|float
private function formatValue(): int|float|string
{
$value = trim($this->argument->value);
if (is_numeric($value)) {
@@ -23,7 +23,7 @@ readonly class GreaterThanEquals implements IBuilderConverter
return $builder->orWhere($this->argument->field, ">=", $this->formatValue());
}
private function formatValue(): int|float
private function formatValue(): int|float|string
{
$value = trim($this->argument->value);
if (is_numeric($value)) {
+1 -1
View File
@@ -23,7 +23,7 @@ readonly class LessThan implements IBuilderConverter
return $builder->orWhere($this->argument->field, "<", $this->formatValue());
}
private function formatValue(): int|float
private function formatValue(): int|float|string
{
$value = trim($this->argument->value);
if (is_numeric($value)) {
@@ -23,7 +23,7 @@ readonly class LessThanEquals implements IBuilderConverter
return $builder->orWhere($this->argument->field, "<=", $this->formatValue());
}
private function formatValue(): int|float
private function formatValue(): int|float|string
{
$value = trim($this->argument->value);
if (is_numeric($value)) {
+1 -1
View File
@@ -21,7 +21,7 @@ class ViewModel
public function getRecordName(QueryRecord $record): string
{
$schema = $this->channelService->getSchema($record->schema)->get();
if (empty($schema->titleTemplate)) {
if (empty($schema->cardTitle)) {
$title = match (get_class($schema)) {
CollectionSchema::class => $record->data[$schema->fields->filter(fn(FieldInterface $f) => $f->info->name === "text")->first()->name],
FilesSchema::class => $record->_file->path,