-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
130 lines (113 loc) · 4.66 KB
/
index.html
File metadata and controls
130 lines (113 loc) · 4.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; connect-src 'self' ws: wss:; img-src 'self' data:;">
<title>SSH客户端</title>
<link rel="stylesheet" href="src/styles/main.css">
<link rel="stylesheet" href="node_modules/@xterm/xterm/css/xterm.css">
<script>
// 确保 window.xtermJS 在使用前已定义
window.xtermJS = window.xtermJS || {};
</script>
</head>
<body>
<!-- 使用原生构建的简易UI,避免Vue相关错误 -->
<div id="app">
<div class="layout">
<!-- 侧边栏 -->
<div class="sidebar">
<div class="sidebar-header">
<h3>连接管理</h3>
<button id="toggle-sidebar" class="toggle-btn">«</button>
</div>
<div class="connection-list" id="connection-list">
<!-- 连接列表将由JavaScript动态填充 -->
</div>
<div class="sidebar-footer">
<button id="add-connection-btn" class="sidebar-btn add-btn">
<span class="icon">+</span> 添加连接
</button>
<button id="settings-btn" class="sidebar-btn settings-btn">
<span class="icon">⚙</span> 设置
</button>
</div>
</div>
<!-- 主界面区域 -->
<div class="main-content">
<!-- 标签页 -->
<div class="tabs" id="tabs-container">
<!-- 标签页将由JavaScript动态填充 -->
</div>
<!-- 终端容器 -->
<div class="terminals-container" id="terminals-container">
<!-- 终端将由JavaScript动态填充 -->
</div>
</div>
</div>
<!-- 连接表单模态框 -->
<div class="modal" id="connection-modal" style="display: none;">
<div class="modal-content">
<span class="close" id="close-modal">×</span>
<h2 id="modal-title">新建连接</h2>
<div class="form-group">
<label for="name">名称</label>
<input type="text" id="name" required>
</div>
<div class="form-group">
<label for="host">主机</label>
<input type="text" id="host" required>
</div>
<div class="form-group">
<label for="port">端口</label>
<input type="number" id="port" value="22" required>
</div>
<div class="form-group">
<label for="username">用户名</label>
<input type="text" id="username" required>
</div>
<div class="form-group">
<label for="authType">认证类型</label>
<select id="authType">
<option value="password">密码</option>
<option value="privateKey">私钥</option>
</select>
</div>
<div class="form-group" id="password-group">
<label for="password">密码</label>
<input type="password" id="password">
</div>
<div class="form-group" id="privatekey-group" style="display: none;">
<label for="privateKey">私钥路径</label>
<input type="text" id="privateKey">
<label for="passphrase">密码短语 (可选)</label>
<input type="password" id="passphrase">
</div>
<div class="form-buttons">
<button type="button" id="save-connection" class="save-btn">保存</button>
<button type="button" id="cancel-connection" class="cancel-btn">取消</button>
</div>
</div>
</div>
<!-- 上下文菜单 -->
<div class="context-menu" id="context-menu" style="display: none; position: fixed; z-index: 1001;">
<div class="menu-item" id="edit-connection">编辑</div>
<div class="menu-item" id="duplicate-connection">复制</div>
<div class="menu-item delete" id="delete-connection">删除</div>
</div>
</div>
<!-- 引入外部JavaScript文件,按正确顺序加载 -->
<!-- 核心模块 -->
<script src="src/js/modules/language-manager.js"></script>
<script src="src/js/modules/connection-manager.js"></script>
<script src="src/js/modules/ui-manager.js"></script>
<script src="src/js/modules/tab-manager.js"></script>
<script src="src/js/modules/terminal-manager.js"></script>
<script src="src/js/modules/settings-component.js"></script>
<script src="src/js/modules/sidebar-component.js"></script>
<!-- 应用入口 -->
<script src="src/js/app.js"></script>
<script src="src/js/renderer.js"></script>
</body>
</html>