GitHub Actions
commited on
Commit
ยท
35c5064
1
Parent(s):
29964a7
Auto-deploy from GitHub Actions - 2025-12-12 07:12:05
Browse files- app/routes.py +9 -3
- templates/index.html +2 -1
app/routes.py
CHANGED
|
@@ -4290,11 +4290,17 @@ def get_files():
|
|
| 4290 |
|
| 4291 |
# ์๋ณธ ํ์ผ๋ง ์กฐํ (parent_file_id๊ฐ None์ธ ํ์ผ)
|
| 4292 |
# ๊ด๋ฆฌ์๊ฐ ์๋ ๊ฒฝ์ฐ ๊ณต๊ฐ ํ์ผ๋ง ์กฐํ, ๊ด๋ฆฌ์๋ ๋ชจ๋ ํ์ผ ์กฐํ ๊ฐ๋ฅ
|
| 4293 |
-
|
|
|
|
| 4294 |
query = UploadedFile.query.filter_by(parent_file_id=None, is_public=True)
|
| 4295 |
-
print(f"[ํ์ผ ์กฐํ] ๊ณต๊ฐ ํ์ผ๋ง ์กฐํ (์ฌ์ฉ์: {current_user.username}, ๊ด๋ฆฌ์: {current_user.is_admin})")
|
| 4296 |
else:
|
| 4297 |
query = UploadedFile.query.filter_by(parent_file_id=None)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4298 |
print(f"[ํ์ผ ์กฐํ] ๋ชจ๋ ํ์ผ ์กฐํ (์ฌ์ฉ์: {current_user.username}, ๊ด๋ฆฌ์: {current_user.is_admin})")
|
| 4299 |
|
| 4300 |
# ๋ชจ๋ธ ํํฐ๋ง ์ ์ ์ฒด ํ์ผ ์ ํ์ธ
|
|
@@ -4305,7 +4311,7 @@ def get_files():
|
|
| 4305 |
query = query.filter_by(model_name=model_name)
|
| 4306 |
print(f"[ํ์ผ ์กฐํ] ๋ชจ๋ธ '{model_name}' ํํฐ๋ง")
|
| 4307 |
|
| 4308 |
-
files = query.order_by(UploadedFile.
|
| 4309 |
|
| 4310 |
# ํํฐ๋ง ํ ํ์ผ ์์ ๋ชจ๋ธ๋ช
ํ์ธ
|
| 4311 |
print(f"[ํ์ผ ์กฐํ] ํํฐ๋ง ํ ํ์ผ ์: {len(files)}๊ฐ")
|
|
|
|
| 4290 |
|
| 4291 |
# ์๋ณธ ํ์ผ๋ง ์กฐํ (parent_file_id๊ฐ None์ธ ํ์ผ)
|
| 4292 |
# ๊ด๋ฆฌ์๊ฐ ์๋ ๊ฒฝ์ฐ ๊ณต๊ฐ ํ์ผ๋ง ์กฐํ, ๊ด๋ฆฌ์๋ ๋ชจ๋ ํ์ผ ์กฐํ ๊ฐ๋ฅ
|
| 4293 |
+
# ๋ชจ๋ธ ํํฐ๊ฐ ์๋ ๊ฒฝ์ฐ(์ ์ฒด ๋ชจ๋ธ)์๋ ๊ณต๊ฐ๋ ํ์ผ๋ง ์กฐํํ๋๋ก ๋ณ๊ฒฝ (์ฌ์ฉ์ ์์ฒญ)
|
| 4294 |
+
if public_only or (not current_user.is_admin) or (not model_name and not current_user.is_admin):
|
| 4295 |
query = UploadedFile.query.filter_by(parent_file_id=None, is_public=True)
|
| 4296 |
+
print(f"[ํ์ผ ์กฐํ] ๊ณต๊ฐ ํ์ผ๋ง ์กฐํ (์ฌ์ฉ์: {current_user.username}, ๊ด๋ฆฌ์: {current_user.is_admin}, ๋ชจ๋ธ: {model_name})")
|
| 4297 |
else:
|
| 4298 |
query = UploadedFile.query.filter_by(parent_file_id=None)
|
| 4299 |
+
# ๋ชจ๋ธ์ด ์ง์ ๋์ง ์์์ง๋ง ๊ด๋ฆฌ์์ธ ๊ฒฝ์ฐ์๋ ๊ณต๊ฐ ํ์ผ๋ง ๋ณด๊ณ ์ถ์ ๊ฒฝ์ฐ๋ฅผ ์ํด
|
| 4300 |
+
# ํด๋ผ์ด์ธํธ์์ public_only=true๋ฅผ ๋ณด๋ผ ์ ์์
|
| 4301 |
+
if not model_name and not public_only and current_user.is_admin:
|
| 4302 |
+
# ๊ด๋ฆฌ์๊ฐ ์ ์ฒด ๋ชฉ๋ก์ ๋ณผ ๋๋ ๋ชจ๋ ํ์ผ์ ๋ค ๋ณด์ฌ์ค (๊ธฐ์กด ๋ก์ง ์ ์ง)
|
| 4303 |
+
pass
|
| 4304 |
print(f"[ํ์ผ ์กฐํ] ๋ชจ๋ ํ์ผ ์กฐํ (์ฌ์ฉ์: {current_user.username}, ๊ด๋ฆฌ์: {current_user.is_admin})")
|
| 4305 |
|
| 4306 |
# ๋ชจ๋ธ ํํฐ๋ง ์ ์ ์ฒด ํ์ผ ์ ํ์ธ
|
|
|
|
| 4311 |
query = query.filter_by(model_name=model_name)
|
| 4312 |
print(f"[ํ์ผ ์กฐํ] ๋ชจ๋ธ '{model_name}' ํํฐ๋ง")
|
| 4313 |
|
| 4314 |
+
files = query.order_by(UploadedFile.original_filename.asc()).all()
|
| 4315 |
|
| 4316 |
# ํํฐ๋ง ํ ํ์ผ ์์ ๋ชจ๋ธ๋ช
ํ์ธ
|
| 4317 |
print(f"[ํ์ผ ์กฐํ] ํํฐ๋ง ํ ํ์ผ ์: {len(files)}๊ฐ")
|
templates/index.html
CHANGED
|
@@ -2795,7 +2795,8 @@
|
|
| 2795 |
listContainer.innerHTML = '<div style="text-align: center; color: var(--text-secondary); padding: 24px;">์น์์ค ๋ชฉ๋ก์ ๋ถ๋ฌ์ค๋ ์ค...</div>';
|
| 2796 |
|
| 2797 |
try {
|
| 2798 |
-
|
|
|
|
| 2799 |
const response = await fetch(url);
|
| 2800 |
if (!response.ok) throw new Error('์น์์ค ๋ชฉ๋ก์ ๋ถ๋ฌ์ฌ ์ ์์ต๋๋ค.');
|
| 2801 |
|
|
|
|
| 2795 |
listContainer.innerHTML = '<div style="text-align: center; color: var(--text-secondary); padding: 24px;">์น์์ค ๋ชฉ๋ก์ ๋ถ๋ฌ์ค๋ ์ค...</div>';
|
| 2796 |
|
| 2797 |
try {
|
| 2798 |
+
// ์ ์ฒด ๋ชจ๋ธ ์ ํ ์ ๊ณต๊ฐ๋ ๋ชจ๋ ํ์ผ ์กฐํ (public_only=true)
|
| 2799 |
+
const url = modelName ? `/api/files?model_name=${encodeURIComponent(modelName)}` : '/api/files?public_only=true';
|
| 2800 |
const response = await fetch(url);
|
| 2801 |
if (!response.ok) throw new Error('์น์์ค ๋ชฉ๋ก์ ๋ถ๋ฌ์ฌ ์ ์์ต๋๋ค.');
|
| 2802 |
|