-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
233 lines (216 loc) · 11.1 KB
/
Copy pathindex.html
File metadata and controls
233 lines (216 loc) · 11.1 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>NPM Commander</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="titlebar-spacer" data-tauri-drag-region></div>
<!-- Tabs Bar -->
<div class="tabs-bar" id="tabsBar" data-tauri-drag-region>
<div class="tabs-container" id="tabsContainer">
<!-- Tabs injected here -->
</div>
<button class="add-tab-btn" id="addTabBtn" title="New Tab">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<line x1="12" y1="5" x2="12" y2="19"></line>
<line x1="5" y1="12" x2="19" y2="12"></line>
</svg>
</button>
<div style="flex: 1;" data-tauri-drag-region></div>
<button class="add-tab-btn" id="historyBtn" title="Recent Projects">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"></path>
</svg>
</button>
</div>
<div class="app-container">
<!-- Header -->
<header class="header" data-tauri-drag-region>
<div class="header-left" data-tauri-drag-region>
<img src="/assets/npm-logo.svg" alt="NPM" class="npm-logo" data-tauri-drag-region>
<div class="project-info" data-tauri-drag-region>
<h1 id="projectName" data-tauri-drag-region>Select a Project</h1>
<span class="project-path" id="projectPath" data-tauri-drag-region>No project loaded</span>
</div>
</div>
<div class="header-right">
<button class="btn btn-secondary hidden" id="openFinderBtn" title="Reveal in Finder">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"></path>
<circle cx="12" cy="13" r="3"></circle>
<line x1="12" y1="13" x2="16" y2="17"></line>
</svg>
Reveal in Finder
</button>
<button class="btn btn-secondary" id="selectFolderBtn">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"></path>
<circle cx="12" cy="12" r="3"></circle>
</svg>
<span id="selectFolderBtnText">Open Project</span>
</button>
<button class="btn btn-secondary hidden" id="clearProjectBtn" title="Exit Project">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M18 6L6 18M6 6l12 12"></path>
</svg>
Exit Project
</button>
</div>
</header>
<!-- Main Content -->
<div class="main-content">
<!-- Console Panel -->
<div class="console-panel">
<!-- URL Bar (shown when server is running) -->
<div class="url-bar" id="urlBar" style="display: none;">
<div class="url-display">
<span class="url-icon">🚀</span>
<span class="url-text" id="urlText">http://localhost:5173</span>
</div>
<div class="url-actions">
<button class="btn btn-icon" id="copyUrlBtn" title="Copy URL">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="2">
<rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
<path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path>
</svg>
Copy
</button>
<button class="btn btn-success" id="openUrlBtn">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="2">
<path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path>
<polyline points="15 3 21 3 21 9"></polyline>
<line x1="10" y1="14" x2="21" y2="3"></line>
</svg>
Open in Browser
</button>
</div>
</div>
<div class="console-header">
<h2>Console</h2>
<div class="console-actions">
<button class="btn btn-secondary btn-sm" id="copyErrorsBtn" title="Copy Errors & Warnings">
Copy Errors
</button>
<button class="btn btn-secondary btn-sm" id="copyAllBtn" title="Copy Entire Console">
Copy All
</button>
<button class="btn btn-icon" id="clearConsoleBtn" title="Clear Console">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="2">
<path
d="M3 6h18M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2M10 11v6M14 11v6">
</path>
</svg>
</button>
</div>
</div>
<div class="console" id="console">
<div class="console-welcome" id="dropZone">
<div class="drop-icon">
<svg width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="1.5">
<path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z">
</path>
<path d="M12 11v6"></path>
<path d="M9 14l3 3 3-3"></path>
</svg>
</div>
<h3>DROP FOLDER HERE</h3>
<p class="hint">or select a project to get started</p>
</div>
</div>
<!-- Ports View (hidden by default) -->
<div class="ports-view hidden" id="portsView">
<div class="ports-list" id="portsList">
<div class="ports-loading">Scanning ports...</div>
</div>
</div>
</div>
<!-- Sidebar -->
<div class="sidebar" id="sidebar">
<div class="sidebar-toggle" id="sidebarToggle" title="Toggle Dependencies Panel">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<polyline points="9 18 15 12 9 6"></polyline>
</svg>
</div>
<div class="sidebar-content">
<div class="sidebar-section">
<h3>Dependencies</h3>
<div class="deps-status" id="depsStatus">
<span class="status-dot"></span>
<span>Not loaded</span>
</div>
<div class="deps-list" id="depsList"></div>
</div>
<div class="sidebar-section">
<h3>Dev Dependencies</h3>
<div class="deps-list" id="devDepsList"></div>
</div>
</div>
</div>
</div>
<!-- Scripts Bar -->
<div class="scripts-footer">
<div class="scripts-bar" id="scriptsBar">
<div class="no-scripts">Load a project to see available scripts</div>
</div>
<button class="btn btn-secondary" id="viewPortsBtn" title="View all open ports">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M22 12h-4l-3 9L9 3l-3 9H2"></path>
</svg>
View All Ports
</button>
<button class="btn btn-danger hidden" id="killAllPortsBtn"
title="Kill processes on ports 3000-3010, 5173, 8000, 8080">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M18.36 6.64a9 9 0 1 1-12.73 0"></path>
<line x1="12" y1="2" x2="12" y2="12"></line>
</svg>
Kill All Ports
</button>
</div>
</div>
<!-- Drop Overlay -->
<div class="drop-overlay" id="dropOverlay">
<div class="drop-content">
<svg width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
<path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"></path>
<line x1="12" y1="11" x2="12" y2="17"></line>
<polyline points="9 14 12 17 15 14"></polyline>
</svg>
<p>Drop folder here</p>
</div>
</div>
<!-- Context Menu -->
<div id="contextMenu" class="context-menu hidden">
<div class="menu-item" id="ctxCopyAll">Copy All Output</div>
<div class="menu-divider"></div>
<div class="menu-item" id="ctxCopyErrors">Copy Errors Only</div>
<div class="menu-item" id="ctxCopyWarnings">Copy Warnings Only</div>
</div>
<!-- History Menu -->
<div id="historyMenu" class="context-menu hidden" style="width: 250px; right: 10px; left: auto; top: 70px;">
<div class="menu-item" style="color: var(--text-muted); pointer-events: none;">Recent Projects (Click to Open)
</div>
<div class="menu-divider"></div>
<div id="historyList"></div>
</div>
<!-- Custom Confirm Modal -->
<div id="customModal" class="custom-modal-overlay hidden">
<div class="custom-modal-content">
<h3 id="customModalTitle">Confirm</h3>
<p id="customModalMessage">Are you sure?</p>
<div class="custom-modal-actions">
<button class="btn btn-secondary" id="customModalCancel">Cancel</button>
<button class="btn btn-primary" id="customModalConfirm">OK</button>
</div>
</div>
</div>
<script type="module" src="app.js"></script>
</body>
</html>