mirror of
https://github.com/lkddi/Xboard.git
synced 2026-04-28 14:57:22 +08:00
Use submodule for admin assets
This commit is contained in:
@@ -0,0 +1,3 @@
|
|||||||
|
[submodule "public/assets/admin"]
|
||||||
|
path = public/assets/admin
|
||||||
|
url = https://github.com/cedar2025/xboard-admin-dist.git
|
||||||
+2
-1
@@ -25,7 +25,8 @@ RUN echo "Attempting to clone branch: ${BRANCH_NAME} from ${REPO_URL} with CACHE
|
|||||||
rm -rf ./* && \
|
rm -rf ./* && \
|
||||||
rm -rf .git && \
|
rm -rf .git && \
|
||||||
git config --global --add safe.directory /www && \
|
git config --global --add safe.directory /www && \
|
||||||
git clone --depth 1 --branch ${BRANCH_NAME} ${REPO_URL} .
|
git clone --depth 1 --branch ${BRANCH_NAME} ${REPO_URL} . && \
|
||||||
|
git submodule update --init --recursive --force
|
||||||
|
|
||||||
COPY .docker/supervisor/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
COPY .docker/supervisor/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
rm -rf composer.phar
|
rm -rf composer.phar
|
||||||
wget https://github.com/composer/composer/releases/latest/download/composer.phar -O composer.phar
|
wget https://github.com/composer/composer/releases/latest/download/composer.phar -O composer.phar
|
||||||
php composer.phar install -vvv
|
php composer.phar install -vvv
|
||||||
|
git submodule update --init --recursive --force
|
||||||
php artisan xboard:install
|
php artisan xboard:install
|
||||||
|
|
||||||
if [ -f "/etc/init.d/bt" ] || [ -f "/.dockerenv" ]; then
|
if [ -f "/etc/init.d/bt" ] || [ -f "/.dockerenv" ]; then
|
||||||
|
|||||||
Submodule
+1
Submodule public/assets/admin added at 01bd0b3749
Binary file not shown.
File diff suppressed because one or more lines are too long
-470
File diff suppressed because one or more lines are too long
Vendored
-1
File diff suppressed because one or more lines are too long
Vendored
-21
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
-67731
File diff suppressed because one or more lines are too long
-1
File diff suppressed because one or more lines are too long
Vendored
-1947
File diff suppressed because one or more lines are too long
@@ -1,32 +0,0 @@
|
|||||||
<!doctype html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8" />
|
|
||||||
<link rel="icon" type="image/svg+xml" href="/images/favicon.svg" />
|
|
||||||
<link rel="icon" type="image/png" href="/images/favicon.png" />
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
||||||
<title>Shadcn Admin</title>
|
|
||||||
<meta
|
|
||||||
name="description"
|
|
||||||
content="Admin Dashboard UI built with Shadcn and Vite."
|
|
||||||
/>
|
|
||||||
<script>
|
|
||||||
window.settings = {
|
|
||||||
base_url: 'http://127.0.0.1:8000',
|
|
||||||
title: 'Xboard',
|
|
||||||
version: '1.0.0',
|
|
||||||
logo: 'https://xboard.io/i6mages/logo.png',
|
|
||||||
secure_path: '/afbced4e',
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<script src="./locales/en-US.js"></script>
|
|
||||||
<script src="./locales/zh-CN.js"></script>
|
|
||||||
<script src="./locales/ko-KR.js"></script>
|
|
||||||
<script type="module" crossorigin src="./assets/index.js"></script>
|
|
||||||
<link rel="stylesheet" crossorigin href="./assets/index.css">
|
|
||||||
<link rel="stylesheet" crossorigin href="./assets/vendor.css">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div id="root"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
Vendored
-3029
File diff suppressed because it is too large
Load Diff
Vendored
-2151
File diff suppressed because it is too large
Load Diff
Vendored
-3046
File diff suppressed because it is too large
Load Diff
@@ -14,12 +14,69 @@
|
|||||||
secure_path: "{{ $secure_path }}",
|
secure_path: "{{ $secure_path }}",
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<script type="module" crossorigin src="/assets/admin/assets/index.js"></script>
|
@php
|
||||||
<link rel="stylesheet" crossorigin href="/assets/admin/assets/index.css" />
|
$manifestPath = public_path('assets/admin/manifest.json');
|
||||||
<link rel="stylesheet" crossorigin href="/assets/admin/assets/vendor.css">
|
$manifest = file_exists($manifestPath) ? json_decode(file_get_contents($manifestPath), true) : null;
|
||||||
<script src="/assets/admin/locales/en-US.js"></script>
|
$entry = is_array($manifest) ? ($manifest['index.html'] ?? null) : null;
|
||||||
<script src="/assets/admin/locales/zh-CN.js"></script>
|
$scripts = [];
|
||||||
<script src="/assets/admin/locales/ko-KR.js"></script>
|
$styles = [];
|
||||||
|
$locales = [];
|
||||||
|
|
||||||
|
if (is_array($entry)) {
|
||||||
|
$visited = [];
|
||||||
|
$collectAssets = function ($chunkName) use (&$collectAssets, &$manifest, &$visited, &$scripts, &$styles) {
|
||||||
|
if (isset($visited[$chunkName]) || !isset($manifest[$chunkName]) || !is_array($manifest[$chunkName])) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$visited[$chunkName] = true;
|
||||||
|
$chunk = $manifest[$chunkName];
|
||||||
|
|
||||||
|
if (!empty($chunk['css']) && is_array($chunk['css'])) {
|
||||||
|
foreach ($chunk['css'] as $cssFile) {
|
||||||
|
$styles[$cssFile] = $cssFile;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($chunk['imports']) && is_array($chunk['imports'])) {
|
||||||
|
foreach ($chunk['imports'] as $import) {
|
||||||
|
$collectAssets($import);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($chunk['isEntry']) && !empty($chunk['file'])) {
|
||||||
|
$scripts[$chunk['file']] = $chunk['file'];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
$collectAssets('index.html');
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (glob(public_path('assets/admin/locales/*.js')) ?: [] as $localeFile) {
|
||||||
|
$locales[] = 'locales/' . basename($localeFile);
|
||||||
|
}
|
||||||
|
sort($locales);
|
||||||
|
@endphp
|
||||||
|
|
||||||
|
@if($entry && count($scripts) > 0)
|
||||||
|
@foreach($styles as $css)
|
||||||
|
<link rel="stylesheet" crossorigin href="/assets/admin/{{ $css }}" />
|
||||||
|
@endforeach
|
||||||
|
@foreach($locales as $locale)
|
||||||
|
<script src="/assets/admin/{{ $locale }}"></script>
|
||||||
|
@endforeach
|
||||||
|
@foreach($scripts as $js)
|
||||||
|
<script type="module" crossorigin src="/assets/admin/{{ $js }}"></script>
|
||||||
|
@endforeach
|
||||||
|
@else
|
||||||
|
{{-- Fallback: hardcoded paths for backward compatibility --}}
|
||||||
|
<script type="module" crossorigin src="/assets/admin/assets/index.js"></script>
|
||||||
|
<link rel="stylesheet" crossorigin href="/assets/admin/assets/index.css" />
|
||||||
|
<link rel="stylesheet" crossorigin href="/assets/admin/assets/vendor.css">
|
||||||
|
<script src="/assets/admin/locales/en-US.js"></script>
|
||||||
|
<script src="/assets/admin/locales/zh-CN.js"></script>
|
||||||
|
<script src="/assets/admin/locales/ko-KR.js"></script>
|
||||||
|
@endif
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ git fetch --all && git reset --hard origin/master && git pull origin master
|
|||||||
rm -rf composer.lock composer.phar
|
rm -rf composer.lock composer.phar
|
||||||
wget https://github.com/composer/composer/releases/latest/download/composer.phar -O composer.phar
|
wget https://github.com/composer/composer/releases/latest/download/composer.phar -O composer.phar
|
||||||
php composer.phar update -vvv
|
php composer.phar update -vvv
|
||||||
|
git submodule update --init --recursive --force
|
||||||
php artisan xboard:update
|
php artisan xboard:update
|
||||||
|
|
||||||
if [ -f "/etc/init.d/bt" ] || [ -f "/.dockerenv" ]; then
|
if [ -f "/etc/init.d/bt" ] || [ -f "/.dockerenv" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user