whistle.pastekitlab 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +16 -0
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -312,6 +312,22 @@ module.exports = {
|
|
|
312
312
|
broadcastToClients('RESPONSE', responseData);
|
|
313
313
|
|
|
314
314
|
next();
|
|
315
|
+
},
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* 插件 UI 页面
|
|
319
|
+
*/
|
|
320
|
+
ui: function(req, res) {
|
|
321
|
+
const optionsPath = path.join(__dirname, 'options.html');
|
|
322
|
+
fs.readFile(optionsPath, 'utf8', (err, data) => {
|
|
323
|
+
if (err) {
|
|
324
|
+
res.writeHead(500);
|
|
325
|
+
res.end('Internal Server Error');
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
res.setHeader('Content-Type', 'text/html; charset=utf-8');
|
|
329
|
+
res.end(data);
|
|
330
|
+
});
|
|
315
331
|
}
|
|
316
332
|
};
|
|
317
333
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "whistle.pastekitlab",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Whistle plugin for PasteKit Lab - Intercepts requests and sends them to requestlistviewer via WebSocket",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -23,6 +23,6 @@
|
|
|
23
23
|
"whistleConfig": {
|
|
24
24
|
"name": "pastekitlab",
|
|
25
25
|
"description": "PasteKit Lab 请求拦截插件,通过 WebSocket 将请求发送到 requestlistviewer 展示",
|
|
26
|
-
"
|
|
26
|
+
"ui": "options.html"
|
|
27
27
|
}
|
|
28
28
|
}
|