-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpopup.html
More file actions
103 lines (96 loc) · 4.11 KB
/
popup.html
File metadata and controls
103 lines (96 loc) · 4.11 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>DevProxy</title>
<link rel="stylesheet" href="popup.css">
</head>
<body>
<div class="container">
<header>
<h1>
<img src="icons/icon128.png" alt="DevProxy" style="width: 33px; height: 33px; vertical-align: middle; margin-right: 8px;">
DevProxy
</h1>
<div class="section-header">
<div class="toggle-container" style="margin-right: 8px;">
<label class="switch">
<input type="checkbox" id="enableToggle">
<span class="slider"></span>
</label>
<span id="statusText">Disabled</span>
</div>
<button id="clearAllBtn" class="btn btn-danger" style="margin-right: 8px;">Clear All</button>
<button id="addRuleBtn" class="btn btn-primary">+ Add Rule</button>
</div>
</header>
<div class="rules-section">
<div id="rulesList" class="rules-list">
<!-- Rules will be dynamically added here -->
</div>
</div>
<!-- Add/Edit Rule Modal -->
<div id="ruleModal" class="modal">
<form id="ruleForm">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h3 id="modalTitle">Add Rule</h3>
<span class="close">×</span>
</div>
<div class="form-group">
<label for="urlPattern">URL Pattern (RegEx)</label>
<input type="text" id="urlPattern" placeholder="e.g., .*api\.example\.com.*" required>
<small>Use regular expressions to match URLs</small>
</div>
<div class="form-row">
<div class="form-col">
<div class="form-group">
<label for="statusCode">Status Code</label>
<select id="statusCode">
<option value="200">200 - OK</option>
<option value="201">201 - Created</option>
<option value="204">204 - No Content</option>
<option value="301">301 - Moved Permanently</option>
<option value="302">302 - Found</option>
<option value="304">304 - Not Modified</option>
<option value="400">400 - Bad Request</option>
<option value="401">401 - Unauthorized</option>
<option value="403">403 - Forbidden</option>
<option value="404">404 - Not Found</option>
<option value="500">500 - Internal Server Error</option>
<option value="502">502 - Bad Gateway</option>
<option value="503">503 - Service Unavailable</option>
</select>
</div>
</div>
<div class="form-col">
<div class="form-group">
<label for="delay">Delay (ms)</label>
<input type="number" id="delay" placeholder="0" min="0" value="0">
</div>
</div>
</div>
<div class="form-group">
<label for="responseBody">Response Body</label>
<textarea id="responseBody" rows="6" placeholder='{"message": "Custom response"}'></textarea>
<small>Can be JSON or plain text</small>
</div>
<div class="form-group">
<label for="responseHeaders">Response Headers (JSON)</label>
<textarea id="responseHeaders" rows="4" placeholder='{"Content-Type": "application/json", "X-Custom-Header": "value"}'></textarea>
<small>Optional: JSON object with custom headers</small>
</div>
</div>
<div class="form-actions">
<!-- <button type="button" id="cancelBtn" class="btn btn-secondary">Cancel</button> -->
<button type="submit" class="btn-save-rule">Save Rule</button>
</div>
</div>
</form>
</div>
</div>
<script src="popup.js"></script>
</body>
</html>