mirror of
https://github.com/web-infra-dev/midscene.git
synced 2025-12-27 06:59:10 +00:00
android playground compatible with windows (#592)
* fix(playground): simplify class property definitions and add root redirect for static file serving * fix(scrcpy-player): update empty state rendering logic to handle server validity more accurately
This commit is contained in:
parent
8fc7d74d0a
commit
06ce3c889b
@ -785,7 +785,7 @@ export const ScrcpyPlayer = forwardRef<ScrcpyRefMethods, ScrcpyProps>(
|
||||
<div className="video-section">
|
||||
<div ref={videoContainerRef} className="video-container">
|
||||
<div className="canvas-wrapper" />
|
||||
{!connected && serverValid ? (
|
||||
{!connected && serverValid && (
|
||||
<div className="empty-state">
|
||||
<div className="empty-state-icon">📱</div>
|
||||
<div className="empty-state-text">
|
||||
@ -809,7 +809,8 @@ export const ScrcpyPlayer = forwardRef<ScrcpyRefMethods, ScrcpyProps>(
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
) : (
|
||||
)}
|
||||
{!serverValid && (
|
||||
<span>Please launch playground server!</span>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@ -269,6 +269,11 @@ export default class PlaygroundServer {
|
||||
|
||||
// Set up static file serving after all API routes are defined
|
||||
if (this.staticPath) {
|
||||
this.app.get('/', (req, res) => {
|
||||
// compatible with windows
|
||||
res.redirect('/index.html');
|
||||
});
|
||||
|
||||
this.app.get('*', (req, res) => {
|
||||
const requestedPath = join(this.staticPath!, req.path);
|
||||
if (existsSync(requestedPath)) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user