Fix noVNC iframe height to fill screen and increase Xvfb resolution

This commit is contained in:
Khoa.vo 2025-12-19 16:07:56 +07:00
parent abba15f1bc
commit cc18b99b63
3 changed files with 9 additions and 8 deletions

View file

@ -148,7 +148,7 @@ class PlaywrightManager:
cls._vnc_context = await cls._vnc_browser.new_context( cls._vnc_context = await cls._vnc_browser.new_context(
user_agent=cls.DEFAULT_USER_AGENT, user_agent=cls.DEFAULT_USER_AGENT,
viewport={"width": 1200, "height": 750} viewport={"width": 1920, "height": 1000}
) )
cls._vnc_page = await cls._vnc_context.new_page() cls._vnc_page = await cls._vnc_context.new_page()

View file

@ -147,10 +147,11 @@ export const Login: React.FC = () => {
</div> </div>
{/* VNC Iframe */} {/* VNC Iframe */}
<div className="flex-1 bg-gray-900"> <div className="flex-1" style={{ minHeight: 'calc(100vh - 80px)' }}>
<iframe <iframe
src={getVncUrl()} src={getVncUrl()}
className="w-full h-full border-0" className="w-full border-0"
style={{ height: 'calc(100vh - 80px)' }}
title="TikTok Login" title="TikTok Login"
/> />
</div> </div>
@ -189,8 +190,8 @@ export const Login: React.FC = () => {
onClick={handleVncLogin} onClick={handleVncLogin}
disabled={isLoading} disabled={isLoading}
className={`w-full py-4 rounded-2xl font-bold text-base flex items-center justify-center gap-3 transition-all ${isLoading className={`w-full py-4 rounded-2xl font-bold text-base flex items-center justify-center gap-3 transition-all ${isLoading
? 'bg-gray-700 text-gray-400 cursor-not-allowed' ? 'bg-gray-700 text-gray-400 cursor-not-allowed'
: 'bg-gradient-to-r from-pink-500 to-orange-500 text-white shadow-lg shadow-pink-500/25 hover:shadow-pink-500/40 active:scale-[0.98]' : 'bg-gradient-to-r from-pink-500 to-orange-500 text-white shadow-lg shadow-pink-500/25 hover:shadow-pink-500/40 active:scale-[0.98]'
}`} }`}
> >
{isLoading ? ( {isLoading ? (
@ -235,8 +236,8 @@ export const Login: React.FC = () => {
onClick={handleManualLogin} onClick={handleManualLogin}
disabled={!sessionId.trim() || isLoading} disabled={!sessionId.trim() || isLoading}
className={`w-full py-2.5 rounded-lg font-medium text-sm transition-all ${sessionId.trim() && !isLoading className={`w-full py-2.5 rounded-lg font-medium text-sm transition-all ${sessionId.trim() && !isLoading
? 'bg-white/10 hover:bg-white/20 text-white' ? 'bg-white/10 hover:bg-white/20 text-white'
: 'bg-white/5 text-gray-600 cursor-not-allowed' : 'bg-white/5 text-gray-600 cursor-not-allowed'
}`} }`}
> >
Connect Connect

View file

@ -5,7 +5,7 @@ logfile_maxbytes=0
loglevel=info loglevel=info
[program:xvfb] [program:xvfb]
command=Xvfb :99 -screen 0 1280x800x24 command=Xvfb :99 -screen 0 1920x1080x24
autorestart=true autorestart=true
priority=100 priority=100
stdout_logfile=/dev/stdout stdout_logfile=/dev/stdout