-
-
Notifications
You must be signed in to change notification settings - Fork 213
Add Playground loading progress, password protection, and mobile responsive layout #143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: copilot/add-typescript-compiler-integration
Are you sure you want to change the base?
Add Playground loading progress, password protection, and mobile responsive layout #143
Conversation
…pport Co-authored-by: qaiu <29825328+qaiu@users.noreply.github.com>
|
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
|---|---|---|---|---|---|
| 23192782 | Triggered | Generic Password | 5fbbe5b | web-service/src/main/java/cn/qaiu/lz/web/config/PlaygroundConfig.java | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secret safely. Learn here the best practices.
- Revoke and rotate this secret.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
1 similar comment
|
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
|---|---|---|---|---|---|
| 23192782 | Triggered | Generic Password | 5fbbe5b | web-service/src/main/java/cn/qaiu/lz/web/config/PlaygroundConfig.java | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secret safely. Learn here the best practices.
- Revoke and rotate this secret.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
Co-authored-by: qaiu <29825328+qaiu@users.noreply.github.com>
…ode readability Co-authored-by: qaiu <29825328+qaiu@users.noreply.github.com>
Per user requirements, enhances the JS Playground with loading indication, access control, and mobile support while maintaining minimal changes to existing codebase.
Loading Progress Indicator
Password Protection
Backend configuration in
app-dev.yml:GET /v2/playground/status,POST /v2/playground/login/types.jsPlaygroundConfigsingleton loads from config, logs security warnings for default passwordMobile Responsive Layout
col-resizerow-resizeshouldShowAuthUIsimplifies conditional renderingDocumentation
PLAYGROUND_PASSWORD_PROTECTION.md: configuration guide, API endpoints, security recommendationsREADME.mdwith documentation linkAll endpoints now verify authentication via
checkAuth(ctx)before processing. Public mode bypasses auth whenplayground.public: true.Original prompt
下面先给你一个整体设计思路,然后按功能 1/2/3 分开说具体实现方案,保持尽量贴近你现有代码(前后端都要改),也方便后面继续在当前分支上编码。
总体说明
你现在的状态是:
copilot/add-typescript-compiler-integration分支上:/playground页面因为要加载编译器和前端代码,在网慢时会有“白屏等待”的体验问题。你新提的需求:
下面分点说实现方案(会以“怎么改前端/后端”为主)。
A. Playground 加载动画 + 进度条
你打包策略已经在压缩 JS,这部分不用改。我们主要在前端做:
1. 加载什么的时候显示?
Playground.vue加载过程一般有几步:为了用户有感知,建议这样:
2. 前端实现要点(Vue)
在
Playground.vue增加:模板中加一个加载蒙层(不改原布局,只上一个绝对定位层):
配套 CSS 放在
Playground.vue内<style scoped>或全局:以后如果要更真实的下载进度,可以改
loadScript为XMLHttpRequest/fetch + Blob + URL.createObjectURL,在onprogress回调里更新进度。B. /playground 密码访问 & public 模式开关
1. 配置设计
在后端配置(例如
application.yml或你现有的配置系统)增加:或如果你已有类似的
ParserConfig/WebConfig,可以放进去。2. 后端访问控制(推荐“轻量级登录态”方式)
需求是“配置密码访问”,不是完整账号系统,可以做一个简单版:
方案
POST /api/playground/login,入参:passwordplayground.public == true:直接返回成功,不需要密码。false:密码不等则 401。HttpSession记录状态。/playground页面对应后端渲染 / static controller;/v2/playground/**REST 接口;/playgroundGET 请求,返回一个简单的“输入密码”页面(你前端也可以自己实现这一层 Vue)。从你项目现状看,你已经是前后端分离(
web-front+web-service),更合适做法是:web-service控制/v2/playground/**等 API;web-front在Playground.vue加一个“密码校验界面”,在调用任何 API 前先验证。后端伪代码(PlaygroundApi 增加)