9 Commits

Author SHA1 Message Date
Cametendo
0b30c66307 Fix theme store connection 2026-05-27 15:59:49 +02:00
Cametendo
d038ebc2e3 Fix themestore 2026-05-27 15:41:38 +02:00
Cametendo
e19828868f Merge branch 'main' into feature/marketplace 2026-05-27 14:59:59 +02:00
Cametendo
bf05b5d295 FIxed Theme Browser not showing themes 2026-05-13 16:48:55 +02:00
Cametendo
3b65f482c7 some shit 2026-05-13 16:32:44 +02:00
Cametendo
7cea9e5ea4 Merge main into feature/marketplace 2026-05-13 16:23:30 +02:00
Cametendo
43f0a742b6 Working marketplace 2026-05-13 15:29:47 +02:00
Cametendo
3438888314 Fix merge conflict 2026-05-06 14:24:53 +02:00
Cametendo
af21317040 Add marketplace 2026-05-06 14:17:25 +02:00
18 changed files with 57 additions and 13 deletions

View File

@@ -68,7 +68,7 @@ class Cors extends BaseConfig
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Headers
*/
'allowedHeaders' => ['Content-Type', 'Authorization', 'X-API-Key'],
'allowedHeaders' => ['Content-Type', 'Authorization', 'X-API-Key', 'Accept', 'Fetch'],
/**
* Set headers to expose.
@@ -93,7 +93,7 @@ class Cors extends BaseConfig
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Methods
*/
'allowedMethods' => ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS'],
'allowedMethods' => ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS', 'FETCH'],
/**
* Set how many seconds the results of a preflight request can be cached.

View File

@@ -5,7 +5,9 @@ use CodeIgniter\Router\RouteCollection;
/**
* @var RouteCollection $routes
*/
$routes->get('/', 'Home::index');
$routes->get('/', static function () {
return redirect()->to('/themes');
});
$routes->get('/themes', 'ThemeStore::index');
$routes->post('/themes/upload', 'ThemeStore::upload');
$routes->get('/themes/preview/(:segment)', 'ThemeStore::preview/$1');
@@ -96,18 +98,20 @@ $routes->group('api/v1', ['namespace' => 'App\Controllers\Api\V1', 'filter' => [
});
$routes->get('/themes', 'ThemeStore::index');
$routes->options('/themes', static function () {
header('Access-Control-Allow-Origin: http://localhost:5173');
$origin = service('request')->getHeaderLine('Origin') ?: '*';
header('Access-Control-Allow-Origin: ' . $origin);
header('Access-Control-Allow-Methods: GET, OPTIONS');
header('Access-Control-Allow-Headers: Content-Type, Accept, Fetch');
header('Access-Control-Allow-Credentials: true');
header('Access-Control-Allow-Headers: Content-Type, Accept');
header('Vary: Origin');
return response()->setStatusCode(204);
});
$routes->post('/themes/upload', 'ThemeStore::upload');
$routes->options('/themes/upload', static function () {
header('Access-Control-Allow-Origin: http://localhost:5173');
$origin = service('request')->getHeaderLine('Origin') ?: '*';
header('Access-Control-Allow-Origin: ' . $origin);
header('Access-Control-Allow-Methods: POST, OPTIONS');
header('Access-Control-Allow-Headers: Content-Type, Accept, Fetch');
header('Access-Control-Allow-Credentials: true');
header('Access-Control-Allow-Headers: Content-Type, Accept');
header('Vary: Origin');
return response()->setStatusCode(204);
});
$routes->get('/themes/preview/(:segment)', 'ThemeStore::preview/$1');

View File

@@ -24,8 +24,9 @@ class ThemeStore extends BaseController
}
if ($this->request->isAJAX() || $this->request->hasHeader('Fetch') || str_contains($this->request->getHeaderLine('Accept'), 'application/json')) {
header('Access-Control-Allow-Origin: http://localhost:5173');
header('Access-Control-Allow-Credentials: true');
$origin = $this->request->getHeaderLine('Origin') ?: '*';
header('Access-Control-Allow-Origin: ' . $origin);
header('Vary: Origin');
return $this->response->setJSON($themes);
}
@@ -38,8 +39,9 @@ class ThemeStore extends BaseController
public function upload(): Response
{
header('Access-Control-Allow-Origin: http://localhost:5173');
header('Access-Control-Allow-Credentials: true');
$origin = $this->request->getHeaderLine('Origin') ?: '*';
header('Access-Control-Allow-Origin: ' . $origin);
header('Vary: Origin');
$file = $this->request->getFile('theme_css');
$displayName = trim($this->request->getPost('display_name') ?? '');

0
public/themes/2341342134-1441f7.css Executable file → Normal file
View File

0
public/themes/arctic-frost.css Executable file → Normal file
View File

File diff suppressed because one or more lines are too long

0
public/themes/extract-test-theme-5fae6e.css Executable file → Normal file
View File

0
public/themes/forest-grove.css Executable file → Normal file
View File

0
public/themes/manual-game-update-2-e1a77a.css Executable file → Normal file
View File

0
public/themes/manual-game-update-7cc79d.css Executable file → Normal file
View File

0
public/themes/midnight-void.css Executable file → Normal file
View File

0
public/themes/obsidian-rose.css Executable file → Normal file
View File

0
public/themes/ocean-breeze.css Executable file → Normal file
View File

0
public/themes/red-extract-theme-a3aabe.css Executable file → Normal file
View File

0
public/themes/sunset-ember.css Executable file → Normal file
View File

0
public/themes/test-theme-103fb1.css Executable file → Normal file
View File

0
public/themes/test-theme-6fcabb.css Executable file → Normal file
View File

0
public/themes/themestore-theme-by-came-0da6fd.css Executable file → Normal file
View File