fix: FilePreview iframe高度撑满 + 手机端响应式布局

This commit is contained in:
2026-05-24 22:25:50 +08:00
parent fbd029a7fe
commit 3823f70714
7 changed files with 69 additions and 6 deletions
+2
View File
@@ -1,7 +1,9 @@
# Exclude build artifacts and dependencies
node_modules
dist
!dist/
target
!target/app-v7.jar
# Exclude IDE and system files
.git
+14
View File
@@ -0,0 +1,14 @@
import requests
r = requests.get('http://192.168.31.240:41733/api/reports?projectId=1').json()
print('Reports in project 1:')
for rep in r:
print(' ', rep['id'], rep['fileName'])
if 'test.html' in rep['fileName']:
rid = rep['id']
r2 = requests.delete(f'http://192.168.31.240:41733/api/reports/{rid}')
print(f' Deleted test.html (id={rid}): {r2.status_code}')
# Verify
r3 = requests.get('http://192.168.31.240:41733/api/projects/1').json()
print('Project now has', r3['reportCount'], 'reports')
+13
View File
@@ -0,0 +1,13 @@
import requests
base = 'http://192.168.31.240:41733'
r = requests.get(f'{base}/api/projects', timeout=10)
projects = r.json()
print('Current projects:', projects)
for p in projects:
pid = p['id']
name = p['name']
r2 = requests.delete(f'{base}/api/projects/{pid}')
print(f'Delete project {pid} ({name}): {r2.status_code}')
+4 -4
View File
@@ -37,17 +37,17 @@
<!-- Preview content -->
<div class="flex-1 overflow-auto p-6 bg-slate-50/50">
<!-- HTML Preview -->
<div v-if="normalizedFileType === 'html'" class="bg-white rounded-2xl shadow-xl overflow-hidden border border-orange-200/30">
<div v-if="normalizedFileType === 'html'" class="bg-white rounded-2xl shadow-xl overflow-hidden border border-orange-200/30 flex flex-col" style="min-height: 500px;">
<iframe
ref="iframeRef"
:srcdoc="content"
class="w-full h-full min-h-[500px]"
class="w-full flex-1"
sandbox="allow-same-origin"
></iframe>
</div>
<!-- Markdown Preview -->
<div v-else-if="normalizedFileType === 'md'" class="bg-white rounded-2xl shadow-xl p-8 border border-orange-200/30 prose max-w-none prose-orange">
<div v-else-if="normalizedFileType === 'md'" class="bg-white rounded-2xl shadow-xl p-8 border border-orange-200/30 prose max-w-none prose-orange flex-1 overflow-auto" style="min-height: 500px;">
<div v-html="renderedMarkdown"></div>
</div>
@@ -56,7 +56,7 @@
<iframe
v-if="pdfUrl"
:src="pdfUrl"
class="w-full flex-1 min-h-[500px]"
class="w-full flex-1"
type="application/pdf"
></iframe>
<div v-else class="flex items-center justify-center h-full">
+17 -2
View File
@@ -3,7 +3,9 @@
<!-- Main Content -->
<main class="relative z-10 flex h-screen overflow-hidden">
<!-- Left: Glass Sidebar with Reports List -->
<div class="w-[400px] glass-light border-r border-orange-200/50 flex flex-col shadow-2xl">
<!-- Mobile: show only list, hide when preview is selected -->
<div class="w-full md:w-[400px] flex-1 flex flex-col glass-light border-r border-orange-200/50 shadow-2xl overflow-y-auto"
:class="{ 'hidden md:flex': selectedReport }">
<!-- Header -->
<div class="bg-white/80 backdrop-blur-xl border-b border-orange-200/50 p-6">
<router-link
@@ -78,7 +80,20 @@
</div>
<!-- Right: File Preview -->
<div class="flex-1 flex flex-col bg-white/50">
<!-- Mobile: show only when report selected, with back button -->
<div class="flex-1 flex flex-col bg-white/50"
:class="{ 'hidden md:flex': !selectedReport }">
<!-- Mobile back button -->
<button
v-if="selectedReport"
@click="selectedReport = null"
class="md:hidden flex items-center space-x-2 px-4 py-3 text-orange-500 hover:text-orange-600 border-b border-orange-200/50"
>
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7" />
</svg>
<span>返回列表</span>
</button>
<FilePreview :report="selectedReport" :content="reportContent" />
</div>
</main>
+15
View File
@@ -0,0 +1,15 @@
import requests
from requests.auth import HTTPBasicAuth
s = requests.Session()
creds = [
('1415243231@qq.com', 'zy18742526670'),
('1415243231@qq.com', 'abc88888888'),
('panda', 'zy18742526670'),
('panda', 'abc88888888'),
]
for user, pwd in creds:
r = s.get('http://www.1415243231.top:8418/api/v1/user', auth=HTTPBasicAuth(user, pwd))
result = r.json().get('login', r.text[:50]) if r.ok else f'HTTP {r.status_code}'
print(f'{user}/{pwd}: {r.status_code} - {result}')
+4
View File
@@ -0,0 +1,4 @@
{
"prompt": "A modern tech project experience report cover, gradient orange background with geometric patterns, Chinese text style, clean minimal design with gears and code symbols, professional software development theme, high quality digital art",
"resolution": "1920x1080"
}