-
Notifications
You must be signed in to change notification settings - Fork 1
/
popup.html
275 lines (268 loc) · 17.2 KB
/
popup.html
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
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
<!doctype html>
<html lang="en" data-bs-theme="auto">
<head>
<script src="assets/js/color-modes.js"></script>
<title>Basuki</title>
<link href="assets/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="./styles/popup.css">
</head>
<body>
<svg xmlns="http://www.w3.org/2000/svg" class="d-none">
<symbol id="check2" viewBox="0 0 16 16">
<path d="M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z"/>
</symbol>
<symbol id="circle-half" viewBox="0 0 16 16">
<path d="M8 15A7 7 0 1 0 8 1v14zm0 1A8 8 0 1 1 8 0a8 8 0 0 1 0 16z"/>
</symbol>
<symbol id="moon-stars-fill" viewBox="0 0 16 16">
<path d="M6 .278a.768.768 0 0 1 .08.858 7.208 7.208 0 0 0-.878 3.46c0 4.021 3.278 7.277 7.318 7.277.527 0 1.04-.055 1.533-.16a.787.787 0 0 1 .81.316.733.733 0 0 1-.031.893A8.349 8.349 0 0 1 8.344 16C3.734 16 0 12.286 0 7.71 0 4.266 2.114 1.312 5.124.06A.752.752 0 0 1 6 .278z"/>
<path d="M10.794 3.148a.217.217 0 0 1 .412 0l.387 1.162c.173.518.579.924 1.097 1.097l1.162.387a.217.217 0 0 1 0 .412l-1.162.387a1.734 1.734 0 0 0-1.097 1.097l-.387 1.162a.217.217 0 0 1-.412 0l-.387-1.162A1.734 1.734 0 0 0 9.31 6.593l-1.162-.387a.217.217 0 0 1 0-.412l1.162-.387a1.734 1.734 0 0 0 1.097-1.097l.387-1.162zM13.863.099a.145.145 0 0 1 .274 0l.258.774c.115.346.386.617.732.732l.774.258a.145.145 0 0 1 0 .274l-.774.258a1.156 1.156 0 0 0-.732.732l-.258.774a.145.145 0 0 1-.274 0l-.258-.774a1.156 1.156 0 0 0-.732-.732l-.774-.258a.145.145 0 0 1 0-.274l.774-.258c.346-.115.617-.386.732-.732L13.863.1z"/>
</symbol>
<symbol id="sun-fill" viewBox="0 0 16 16">
<path d="M8 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM8 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 0zm0 13a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 13zm8-5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2a.5.5 0 0 1 .5.5zM3 8a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2A.5.5 0 0 1 3 8zm10.657-5.657a.5.5 0 0 1 0 .707l-1.414 1.415a.5.5 0 1 1-.707-.708l1.414-1.414a.5.5 0 0 1 .707 0zm-9.193 9.193a.5.5 0 0 1 0 .707L3.05 13.657a.5.5 0 0 1-.707-.707l1.414-1.414a.5.5 0 0 1 .707 0zm9.193 2.121a.5.5 0 0 1-.707 0l-1.414-1.414a.5.5 0 0 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .707zM4.464 4.465a.5.5 0 0 1-.707 0L2.343 3.05a.5.5 0 1 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .708z"/>
</symbol>
<symbol id="bootstrap" viewBox="0 0 118 94">
<title>Bootstrap</title>
<path fill-rule="evenodd" clip-rule="evenodd"
d="M24.509 0c-6.733 0-11.715 5.893-11.492 12.284.214 6.14-.064 14.092-2.066 20.577C8.943 39.365 5.547 43.485 0 44.014v5.972c5.547.529 8.943 4.649 10.951 11.153 2.002 6.485 2.28 14.437 2.066 20.577C12.794 88.106 17.776 94 24.51 94H93.5c6.733 0 11.714-5.893 11.491-12.284-.214-6.14.064-14.092 2.066-20.577 2.009-6.504 5.396-10.624 10.943-11.153v-5.972c-5.547-.529-8.934-4.649-10.943-11.153-2.002-6.484-2.28-14.437-2.066-20.577C105.214 5.894 100.233 0 93.5 0H24.508zM80 57.863C80 66.663 73.436 72 62.543 72H44a2 2 0 01-2-2V24a2 2 0 012-2h18.437c9.083 0 15.044 4.92 15.044 12.474 0 5.302-4.01 10.049-9.119 10.88v.277C75.317 46.394 80 51.21 80 57.863zM60.521 28.34H49.948v14.934h8.905c6.884 0 10.68-2.772 10.68-7.727 0-4.643-3.264-7.207-9.012-7.207zM49.948 49.2v16.458H60.91c7.167 0 10.964-2.876 10.964-8.281 0-5.406-3.903-8.178-11.425-8.178H49.948z"/>
</symbol>
<symbol id="lightning-charge-fill" viewBox="0 0 16 16">
<path d="M11.251.068a.5.5 0 0 1 .227.58L9.677 6.5H13a.5.5 0 0 1 .364.843l-8 8.5a.5.5 0 0 1-.842-.49L6.323 9.5H3a.5.5 0 0 1-.364-.843l8-8.5a.5.5 0 0 1 .615-.09z"/>
</symbol>
<symbol id="incognito" viewBox="0 0 16 16">
<path fill-rule="evenodd"
d="m4.736 1.968-.892 3.269-.014.058C2.113 5.568 1 6.006 1 6.5 1 7.328 4.134 8 8 8s7-.672 7-1.5c0-.494-1.113-.932-2.83-1.205l-.014-.058-.892-3.27c-.146-.533-.698-.849-1.239-.734C9.411 1.363 8.62 1.5 8 1.5s-1.411-.136-2.025-.267c-.541-.115-1.093.2-1.239.735m.015 3.867a.25.25 0 0 1 .274-.224c.9.092 1.91.143 2.975.143a30 30 0 0 0 2.975-.143.25.25 0 0 1 .05.498c-.918.093-1.944.145-3.025.145s-2.107-.052-3.025-.145a.25.25 0 0 1-.224-.274M3.5 10h2a.5.5 0 0 1 .5.5v1a1.5 1.5 0 0 1-3 0v-1a.5.5 0 0 1 .5-.5m-1.5.5q.001-.264.085-.5H2a.5.5 0 0 1 0-1h3.5a1.5 1.5 0 0 1 1.488 1.312 3.5 3.5 0 0 1 2.024 0A1.5 1.5 0 0 1 10.5 9H14a.5.5 0 0 1 0 1h-.085q.084.236.085.5v1a2.5 2.5 0 0 1-5 0v-.14l-.21-.07a2.5 2.5 0 0 0-1.58 0l-.21.07v.14a2.5 2.5 0 0 1-5 0zm8.5-.5h2a.5.5 0 0 1 .5.5v1a1.5 1.5 0 0 1-3 0v-1a.5.5 0 0 1 .5-.5"/>
</symbol>
<symbol id="shuffle" viewBox="0 0 16 16">
<path fill-rule="evenodd"
d="M0 3.5A.5.5 0 0 1 .5 3H1c2.202 0 3.827 1.24 4.874 2.418.49.552.865 1.102 1.126 1.532.26-.43.636-.98 1.126-1.532C9.173 4.24 10.798 3 13 3v1c-1.798 0-3.173 1.01-4.126 2.082A9.6 9.6 0 0 0 7.556 8a9.6 9.6 0 0 0 1.317 1.918C9.828 10.99 11.204 12 13 12v1c-2.202 0-3.827-1.24-4.874-2.418A10.6 10.6 0 0 1 7 9.05c-.26.43-.636.98-1.126 1.532C4.827 11.76 3.202 13 1 13H.5a.5.5 0 0 1 0-1H1c1.798 0 3.173-1.01 4.126-2.082A9.6 9.6 0 0 0 6.444 8a9.6 9.6 0 0 0-1.317-1.918C4.172 5.01 2.796 4 1 4H.5a.5.5 0 0 1-.5-.5"/>
<path d="M13 5.466V1.534a.25.25 0 0 1 .41-.192l2.36 1.966c.12.1.12.284 0 .384l-2.36 1.966a.25.25 0 0 1-.41-.192m0 9v-3.932a.25.25 0 0 1 .41-.192l2.36 1.966c.12.1.12.284 0 .384l-2.36 1.966a.25.25 0 0 1-.41-.192"/>
</symbol>
</svg>
<div class="dropdown position-fixed bottom-0 end-0 mb-3 me-3 bd-mode-toggle">
<button class="btn btn-bd-primary py-2 dropdown-toggle d-flex align-items-center"
id="bd-theme"
type="button"
aria-expanded="false"
data-bs-toggle="dropdown"
aria-label="Toggle theme (auto)">
<svg class="bi my-1 theme-icon-active" width="1em" height="1em">
<use href="#circle-half"></use>
</svg>
<span class="visually-hidden" id="bd-theme-text">Toggle theme</span>
</button>
<ul class="dropdown-menu dropdown-menu-end shadow" aria-labelledby="bd-theme-text">
<li>
<button type="button" class="dropdown-item d-flex align-items-center" data-bs-theme-value="light"
aria-pressed="false">
<svg class="bi me-2 opacity-50" width="1em" height="1em">
<use href="#sun-fill"></use>
</svg>
Light
<svg class="bi ms-auto d-none" width="1em" height="1em">
<use href="#check2"></use>
</svg>
</button>
</li>
<li>
<button type="button" class="dropdown-item d-flex align-items-center" data-bs-theme-value="dark"
aria-pressed="false">
<svg class="bi me-2 opacity-50" width="1em" height="1em">
<use href="#moon-stars-fill"></use>
</svg>
Dark
<svg class="bi ms-auto d-none" width="1em" height="1em">
<use href="#check2"></use>
</svg>
</button>
</li>
<li>
<button type="button" class="dropdown-item d-flex align-items-center active" data-bs-theme-value="auto"
aria-pressed="true">
<svg class="bi me-2 opacity-50" width="1em" height="1em">
<use href="#circle-half"></use>
</svg>
Auto
<svg class="bi ms-auto d-none" width="1em" height="1em">
<use href="#check2"></use>
</svg>
</button>
</li>
</ul>
</div>
<main class="d-flex flex-nowrap flex-shrink-0">
<div class="d-flex flex-column flex-shrink-0 bg-body-tertiary" style="width: 4.5rem;">
<a href="https://github.com/zakyyudha/basuki" target="_blank"
class="d-block p-3 link-body-emphasis text-decoration-none"
data-bs-toggle="tooltip" title="Basuki"
data-bs-placement="right">
<svg class="bi pe-none" width="40" height="32">
<use xlink:href="#bootstrap"></use>
</svg>
</a>
<ul class="nav nav-pills nav-flush flex-column mb-auto text-center">
<li class="nav-item" data-bs-toggle="tooltip" title="Pengalihan API">
<a href="#apiRedirector" class="nav-link active py-3 border-bottom rounded-0" aria-current="page"
data-bs-toggle="tab" data-bs-placement="right" aria-label="Home">
<svg class="bi pe-none" width="24" height="24" role="img" aria-label="Pengalihan API">
<use xlink:href="#lightning-charge-fill"></use>
</svg>
</a>
</li>
<li data-bs-toggle="tooltip" title="Memintas Permintaan">
<a href="#interceptRequest" class="nav-link py-3 border-bottom rounded-0" data-bs-toggle="tab"
data-bs-placement="right" aria-label="Memintas Permintaan">
<svg class="bi pe-none" width="24" height="24" role="img" aria-label="Memintas Permintaan">
<use xlink:href="#shuffle"></use>
</svg>
</a>
</li>
<li data-bs-toggle="tooltip" title="Isolasi Sesi">
<a href="#sessionIsolation" class="nav-link py-3 border-bottom rounded-0" data-bs-toggle="tab"
data-bs-placement="right" aria-label="Isolasi Sesi">
<svg class="bi pe-none" width="24" height="24" role="img" aria-label="Isolasi Sesi">
<use xlink:href="#incognito"></use>
</svg>
</a>
</li>
</ul>
</div>
<div class="container mt-4 mb-3">
<div class="tab-content">
<div class="tab-pane container active" id="apiRedirector">
<h3 class="text-center">Pengalihan API</h3>
<ul class="nav nav-tabs mt-3">
<li class="nav-item">
<a class="nav-link active" data-bs-toggle="tab" id="apiRedirect-tabCreateConfiguration"
href="#createConfiguration">Tambah
Konfigurasi</a>
</li>
<li class="nav-item">
<a class="nav-link" data-bs-toggle="tab" href="#configurations">Konfigurasi</a>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane container active" id="createConfiguration">
<input type="hidden" id="id">
<div class="mb-3 mt-3">
<label for="configName" class="form-label">Nama Konfigurasi:</label>
<input type="text" class="form-control" id="configName"
placeholder="Masukkan nama konfigurasi">
</div>
<div class="mb-3 mt-3">
<label for="urlContains" class="form-label">Jika Pranala Berisikan:</label>
<input type="text" class="form-control" id="urlContains"
placeholder="Masukkan potongan dari pranala">
</div>
<div class="mb-3 mt-3">
<label for="replaceText" class="form-label">Maka Ubah:</label>
<input type="text" class="form-control" id="replaceText"
placeholder="Masukkan teks yang ingin diubah">
</div>
<div class="mb-3 mt-3">
<label for="withText" class="form-label">Dengan:</label>
<input type="text" class="form-control" id="withText" placeholder="Masukkan teks pengganti">
</div>
<div class="d-grid">
<button id="save" class="btn btn-primary btn-block">Simpan</button>
</div>
</div>
<div class="tab-pane container fade" id="configurations">
<table class="table table-hover mt-3" id="configTable">
<thead class="table-dark">
<tr>
<th>Nama Konfigurasi</th>
<th>Aktifkan</th>
<th>Debug</th>
<th>Aksi</th>
</tr>
</thead>
<tbody id="configList"></tbody>
</table>
</div>
</div>
</div>
<div class="tab-pane container fade" id="interceptRequest">
<h3 class="text-center">Memintas Permintaan</h3>
<ul class="nav nav-tabs mt-3">
<li class="nav-item">
<a class="nav-link active" data-bs-toggle="tab" id="apiIntercept-tabCreateConfiguration"
href="#intercept-createConfiguration">Tambah
Konfigurasi</a>
</li>
<li class="nav-item">
<a class="nav-link" data-bs-toggle="tab" href="#intercept-configurations">Konfigurasi</a>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane container active" id="intercept-createConfiguration">
<input type="hidden" id="interceptId">
<div class="mb-3 mt-3">
<label for="interceptConfigName" class="form-label">Nama Konfigurasi:</label>
<input type="text" class="form-control" id="interceptConfigName"
placeholder="Masukkan nama konfigurasi">
</div>
<div class="mb-3 mt-3">
<label for="interceptUrlContains" class="form-label">Jika Pranala Berisikan:</label>
<input type="text" class="form-control" id="interceptUrlContains"
placeholder="Masukkan potongan dari pranala">
</div>
<div class="mb-3 mt-3">
<label for="interceptHttpStatusCode" class="form-label">Kode Status HTTP:</label>
<input type="number" min="100" max="599" value="200" class="form-control"
id="interceptHttpStatusCode"
placeholder="Masukkan Kode Status HTTP">
</div>
<div class="mb-3 mt-3">
<label for="interceptRequestMethod" class="form-label">Metode <i>Request</i>:</label>
<select class="form-select" id="interceptRequestMethod">
<option value="GET">GET</option>
<option value="POST">POST</option>
<option value="PUT">PUT</option>
<option value="DELETE">DELETE</option>
<option value="PATCH">PATCH</option>
<option value="OPTIONS">OPTIONS</option>
<option value="HEAD">HEAD</option>
</select>
</div>
<div class="mb-3 mt-3">
<label for="interceptResponseBody" class="form-label">Respon <i>Body</i>:</label>
<textarea class="form-control" id="interceptResponseBody" rows="10"
placeholder="Masukkan Respon API"></textarea>
</div>
<div class="d-grid">
<button id="intercept-save" class="btn btn-primary btn-block">Simpan</button>
</div>
</div>
<div class="tab-pane container fade" id="intercept-configurations">
<table class="table table-hover mt-3" id="intercept-configTable">
<thead class="table-dark">
<tr>
<th>Nama Konfigurasi</th>
<th>Aktifkan</th>
<th>Debug</th>
<th>Aksi</th>
</tr>
</thead>
<tbody id="intercept-configList"></tbody>
</table>
</div>
</div>
</div>
<div class="tab-pane container fade" id="sessionIsolation">
<h3 class="text-center">Isolasi Sesi</h3>
<a href="#" class="btn btn-danger d-block mt-3" id="isolation-clearSessionIsolation">Hapus Sesi Aktif</a>
</div>
</div>
</div>
</main>
<footer class="footer py-3 mt-auto bg-body-tertiary">
<div class="container">
<span class="text-body-secondary">Basuki v2.0.0</span>
</div>
</footer>
<script src="assets/dist/js/bootstrap.bundle.min.js"></script>
<script src="scripts/sidebars.js"></script>
<script src="./scripts/popup.js"></script>
</body>
</html>