Skip to content

Commit e5f2433

Browse files
committed
更新 Dockerfile 以添加运行参数,增强功能;优化文件选择按钮样式,提升用户体验;新增 GitHub Actions 工作流以支持多架构 Docker 镜像构建和推送
1 parent 645a0a6 commit e5f2433

File tree

3 files changed

+115
-2
lines changed

3 files changed

+115
-2
lines changed

.github/workflows/docker.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Docker Build and Push
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
docker:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout repository
11+
uses: actions/checkout@v3
12+
13+
- name: Login to Docker Hub
14+
uses: docker/login-action@v2
15+
with:
16+
username: ${{ secrets.DOCKERHUB_USERNAME }}
17+
password: ${{ secrets.DOCKERHUB_PASSWORD }}
18+
19+
- name: Set up QEMU # 用于多平台编译
20+
uses: docker/setup-qemu-action@v2
21+
22+
- name: Set up Docker Buildx
23+
uses: docker/setup-buildx-action@v2
24+
25+
- name: Build and push multi-arch Docker image
26+
uses: docker/build-push-action@v4
27+
with:
28+
context: .
29+
push: true
30+
platforms: linux/amd64,linux/arm64
31+
tags: cmliu/webssh:latest

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ RUN \
1515

1616
EXPOSE 8888/tcp
1717
USER webssh
18-
CMD ["python", "run.py"]
18+
CMD ["python", "run.py", "--delay=10", "--encoding=utf-8", "--fbidhttp=False", "--maxconn=20", "--origin=*", "--policy=warning", "--redirect=False", "--timeout=10", "--debug", "--xsrf=False", "--xheaders", "--wpintvl=1"]

webssh/templates/index.html

Lines changed: 83 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,74 @@
208208
/* 防止按钮被压缩 */
209209
}
210210

211+
/* 文件选择按钮的基本样式 */
212+
.file-btn {
213+
/* 移除右上角和右下角的圆角 */
214+
border-top-right-radius: 0;
215+
border-bottom-right-radius: 0;
216+
/* 设置内边距,使按钮更大更易点击 */
217+
padding: 0.8rem 1.2rem;
218+
/* 使用预定义的主题色作为背景色 */
219+
background: var(--secondary-color);
220+
/* 移除边框 */
221+
border: none;
222+
/* 添加过渡效果,使样式变化更平滑 */
223+
transition: all 0.3s ease;
224+
/* 设置相对定位,为光效动画做准备 */
225+
position: relative;
226+
/* 隐藏超出按钮范围的内容 */
227+
overflow: hidden;
228+
}
229+
230+
/* 鼠标悬停时的按钮样式 */
231+
.file-btn:hover {
232+
/* 添加渐变背景,使按钮更有层次感 */
233+
background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
234+
/* 添加发光效果 */
235+
box-shadow: 0 0 15px rgba(52, 152, 219, 0.5);
236+
/* 轻微放大按钮,增加交互感 */
237+
transform: scale(1.05);
238+
}
239+
240+
/* 创建光效动画的元素 */
241+
.file-btn:before {
242+
/* 创建伪元素 */
243+
content: '';
244+
/* 绝对定位,相对于按钮定位 */
245+
position: absolute;
246+
top: 0;
247+
/* 初始位置在按钮左侧外部 */
248+
left: -100%;
249+
width: 100%;
250+
height: 100%;
251+
/* 创建透明渐变,形成光效 */
252+
background: linear-gradient(
253+
120deg,
254+
transparent,
255+
rgba(255, 255, 255, 0.2),
256+
transparent
257+
);
258+
/* 添加过渡效果 */
259+
transition: 0.5s;
260+
}
261+
262+
/* 鼠标悬停时触发光效动画 */
263+
.file-btn:hover:before {
264+
/* 将光效移动到按钮右侧,形成扫光效果 */
265+
left: 100%;
266+
}
267+
268+
.file-input {
269+
border-top-left-radius: 0;
270+
border-bottom-left-radius: 0;
271+
background: #f8f9fa;
272+
}
273+
274+
.input-group-btn {
275+
margin: 0;
276+
padding: 0;
277+
}
278+
211279
@media (max-width: 768px) {
212280
.main-container {
213281
padding: 1rem;
@@ -380,7 +448,21 @@ <h1 class="page-title">WebSSH Console</h1>
380448
<div class="row">
381449
<div class="col-md-6 mb-3">
382450
<label for="privatekey">私钥 (Private Key)</label>
383-
<input class="form-control" type="file" id="privatekey" name="privatekey" value="">
451+
<div class="input-group">
452+
<label class="input-group-btn">
453+
<span class="btn btn-primary file-btn">
454+
<i class="fas fa-folder-open"></i> 选择文件
455+
<input
456+
type="file"
457+
id="privatekey"
458+
name="privatekey"
459+
style="display: none;"
460+
onchange="document.getElementById('showFilename').value = this.files.length ? this.files[0].name : '未选择文件'"
461+
>
462+
</span>
463+
</label>
464+
<input type="text" class="form-control file-input" id="showFilename" placeholder="未选择私钥文件" readonly>
465+
</div>
384466
</div>
385467
<div class="col-md-6 mb-3">
386468
<label for="passphrase">密钥口令 (Passphrase)</label>

0 commit comments

Comments
 (0)