1
0
mirror of https://github.com/typemill/typemill.git synced 2025-07-30 19:00:32 +02:00

v2.3.0 pagination to image library to improve performance

This commit is contained in:
trendschau
2024-03-14 13:15:58 +01:00
parent 14ec0136f8
commit 1e1e5d609d
5 changed files with 678 additions and 643 deletions

View File

@@ -72,7 +72,6 @@ class ControllerApiImage extends Controller
{
$url = $request->getQueryParams()['url'] ?? false;
$path = $request->getQueryParams()['path'] ?? false;
$pagemedia = [];
$storage = new StorageWrapper('\Typemill\Models\Storage');

View File

@@ -490,33 +490,33 @@ class Storage
## Timeout ##
######################
public function timeoutIsOver($name, $timespan)
{
$location = 'cacheFolder';
$folder = '';
$filename = 'timer.yaml';
public function timeoutIsOver($name, $timespan)
{
$location = 'cacheFolder';
$folder = '';
$filename = 'timer.yaml';
// Get current timers from the YAML file, if it exists
$timers = $this->getYaml($location, $folder, $filename) ?: [];
// Get current timers from the YAML file, if it exists
$timers = $this->getYaml($location, $folder, $filename) ?: [];
$currentTime = time();
$timeThreshold = $currentTime - $timespan;
$currentTime = time();
$timeThreshold = $currentTime - $timespan;
# Check if the name exists and if the timestamp is older than the current time minus the timespan
if (!isset($timers[$name]) || !is_numeric($timers[$name]) || $timers[$name] <= $timeThreshold)
{
# If the name doesn't exist or the timestamp is older, update the timer
$timers[$name] = $currentTime;
# Check if the name exists and if the timestamp is older than the current time minus the timespan
if (!isset($timers[$name]) || !is_numeric($timers[$name]) || $timers[$name] <= $timeThreshold)
{
# If the name doesn't exist or the timestamp is older, update the timer
$timers[$name] = $currentTime;
# Update the YAML file with the new or updated timer
$this->updateYaml($location, $folder, $filename, $timers);
# Update the YAML file with the new or updated timer
$this->updateYaml($location, $folder, $filename, $timers);
return true;
}
return true;
}
# If the name exists and the timestamp is not older, return false
return false;
}
# If the name exists and the timestamp is not older, return false
return false;
}
##################
@@ -663,22 +663,18 @@ class Storage
foreach ($thumbs as $key => $name)
{
if (file_exists($this->liveFolder . $name))
{
$imagelist[] = [
'name' => $name,
'timestamp' => filemtime($this->liveFolder . $name),
'src_thumb' => 'media/thumbs/' . $name,
'src_live' => 'media/live/' . $name,
];
}
$imagelist[] = [
'name' => $name,
'src_thumb' => 'media/thumbs/' . $name,
'src_live' => 'media/live/' . $name,
];
}
$imagelist = Helpers::array_sort($imagelist, 'timestamp', SORT_DESC);
return $imagelist;
}
# get details from existing image for media library
public function getImageDetails($name)
{

View File

@@ -694,14 +694,6 @@ video {
right: 0px;
}
.-bottom-3 {
bottom: -0.75rem;
}
.right-4 {
right: 1rem;
}
.-top-3 {
top: -0.75rem;
}
@@ -710,6 +702,14 @@ video {
left: 50%;
}
.-bottom-3 {
bottom: -0.75rem;
}
.right-4 {
right: 1rem;
}
.bottom-3 {
bottom: 0.75rem;
}
@@ -718,14 +718,14 @@ video {
top: 2.5rem;
}
.z-20 {
z-index: 20;
}
.z-10 {
z-index: 10;
}
.z-20 {
z-index: 20;
}
.z-50 {
z-index: 50;
}
@@ -738,14 +738,14 @@ video {
margin: 0px;
}
.m-1 {
margin: 0.25rem;
}
.m-auto {
margin: auto;
}
.m-1 {
margin: 0.25rem;
}
.my-2 {
margin-top: 0.5rem;
margin-bottom: 0.5rem;
@@ -771,16 +771,16 @@ video {
margin-bottom: 2rem;
}
.my-3 {
margin-top: 0.75rem;
margin-bottom: 0.75rem;
}
.my-1 {
margin-top: 0.25rem;
margin-bottom: 0.25rem;
}
.my-3 {
margin-top: 0.75rem;
margin-bottom: 0.75rem;
}
.my-4 {
margin-top: 1rem;
margin-bottom: 1rem;
@@ -942,6 +942,10 @@ video {
height: 20rem;
}
.h-8 {
height: 2rem;
}
.h-full {
height: 100%;
}
@@ -950,10 +954,6 @@ video {
height: 8rem;
}
.h-8 {
height: 2rem;
}
.h-0 {
height: 0px;
}
@@ -1002,10 +1002,6 @@ video {
width: 40%;
}
.w-20 {
width: 5rem;
}
.w-16 {
width: 4rem;
}
@@ -1014,6 +1010,10 @@ video {
width: 1.25rem;
}
.w-20 {
width: 5rem;
}
.w-1\/4 {
width: 25%;
}
@@ -1046,10 +1046,6 @@ video {
width: 60%;
}
.w-half {
width: 48%;
}
.w-3\/4 {
width: 75%;
}
@@ -1070,6 +1066,10 @@ video {
width: 91.666667%;
}
.w-7 {
width: 1.75rem;
}
.max-w-md {
max-width: 28rem;
}
@@ -1102,10 +1102,6 @@ video {
flex-grow: 1;
}
.grow {
flex-grow: 1;
}
.border-collapse {
border-collapse: collapse;
}
@@ -1488,14 +1484,14 @@ video {
padding: 2rem;
}
.p-4 {
padding: 1rem;
}
.p-1 {
padding: 0.25rem;
}
.p-4 {
padding: 1rem;
}
.py-5 {
padding-top: 1.25rem;
padding-bottom: 1.25rem;
@@ -1666,6 +1662,10 @@ video {
padding-top: 0.75rem;
}
.pb-1 {
padding-bottom: 0.25rem;
}
.text-left {
text-align: left;
}
@@ -1715,6 +1715,11 @@ video {
line-height: 1.25rem;
}
.text-2xl {
font-size: 1.5rem;
line-height: 2rem;
}
.text-lg {
font-size: 1.125rem;
line-height: 1.75rem;
@@ -1725,11 +1730,6 @@ video {
line-height: 2.25rem;
}
.text-2xl {
font-size: 1.5rem;
line-height: 2rem;
}
.font-bold {
font-weight: 700;
}
@@ -1978,16 +1978,16 @@ video {
background-color: rgb(244 63 94 / var(--tw-bg-opacity));
}
.hover\:bg-stone-700:hover {
--tw-bg-opacity: 1;
background-color: rgb(68 64 60 / var(--tw-bg-opacity));
}
.hover\:bg-stone-100:hover {
--tw-bg-opacity: 1;
background-color: rgb(245 245 244 / var(--tw-bg-opacity));
}
.hover\:bg-stone-700:hover {
--tw-bg-opacity: 1;
background-color: rgb(68 64 60 / var(--tw-bg-opacity));
}
.hover\:bg-stone-900:hover {
--tw-bg-opacity: 1;
background-color: rgb(28 25 23 / var(--tw-bg-opacity));
@@ -2097,16 +2097,16 @@ video {
background-color: rgb(231 229 228 / var(--tw-bg-opacity));
}
.disabled\:text-stone-800:disabled {
--tw-text-opacity: 1;
color: rgb(41 37 36 / var(--tw-text-opacity));
}
.disabled\:text-stone-900:disabled {
--tw-text-opacity: 1;
color: rgb(28 25 23 / var(--tw-text-opacity));
}
.disabled\:text-stone-800:disabled {
--tw-text-opacity: 1;
color: rgb(41 37 36 / var(--tw-text-opacity));
}
.group:hover .group-hover\:visible {
visibility: visible;
}
@@ -2214,16 +2214,16 @@ video {
background-color: rgb(244 63 94 / var(--tw-bg-opacity));
}
.dark .hover\:dark\:bg-stone-600:hover {
--tw-bg-opacity: 1;
background-color: rgb(87 83 78 / var(--tw-bg-opacity));
}
.dark .hover\:dark\:bg-stone-900:hover {
--tw-bg-opacity: 1;
background-color: rgb(28 25 23 / var(--tw-bg-opacity));
}
.dark .hover\:dark\:bg-stone-600:hover {
--tw-bg-opacity: 1;
background-color: rgb(87 83 78 / var(--tw-bg-opacity));
}
.dark .dark\:hover\:bg-stone-200:hover {
--tw-bg-opacity: 1;
background-color: rgb(231 229 228 / var(--tw-bg-opacity));

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
version: '2.2.2'
version: '2.3.0'
title: 'Typemill'
author: 'Unknown'
copyright: false