`;
}
function refresh () {
document.getElementById('content').innerHTML = '
加载中
';
fetchStatus();
fetchConfig();
}
refresh();
setInterval(refresh, 30000);
```
--------------------------------
### Generate Small QR Code to String
Source: https://github.com/napneko/napcatqq/blob/main/packages/napcat-qrcode/README.md
Generate a small QR code and receive it as a string via a callback, using the `small: true` option.
```javascript
qrcode.generate('This will be a small QRCode, eh!', {small: true}, function (qrcode) {
console.log(qrcode)
});
```
--------------------------------
### Generate QR Code to String
Source: https://github.com/napneko/napcatqq/blob/main/packages/napcat-qrcode/README.md
Generate a QR code and receive it as a string via a callback function, instead of displaying it directly in the terminal.
```javascript
qrcode.generate('http://github.com', function (qrcode) {
console.log(qrcode);
});
```
--------------------------------
### Generate QR Code in Terminal
Source: https://github.com/napneko/napcatqq/blob/main/packages/napcat-qrcode/README.md
Generate and display a QR code for the given data directly in the terminal.
```javascript
qrcode.generate('This will be a QRCode, eh!');
```
--------------------------------
### Generate Small QR Code
Source: https://github.com/napneko/napcatqq/blob/main/packages/napcat-qrcode/README.md
Generate a smaller QR code by passing the `small: true` option. This can be useful for limited terminal space.
```javascript
qrcode.generate('This will be a small QRCode, eh!', {small: true});
```
--------------------------------
### Test Static Resource Access
Source: https://github.com/napneko/napcatqq/blob/main/packages/napcat-plugin-builtin/webui/dashboard.html
Tests the ability to access static resources provided by the plugin. This function fetches a 'test.txt' file from the plugin's static base path. It does not require authentication.
```javascript
async function testStaticResource () {
const resultDiv = document.getElementById('static-result');
resultDiv.innerHTML = '
加载中
';
try {
const response = await fetch(`${staticBase}/static/test.txt`);
if (response.ok) {
const text = await response.text();
resultDiv.innerHTML = `
文件系统静态资源访问成功
${text}
`;
} else {
resultDiv.innerHTML = `
请求失败: ${response.status} ${response.statusText}
`;
}
} catch (error) {
resultDiv.innerHTML = `
请求失败: ${error.message}
`;
}
}
```
--------------------------------
### Test Memory Resource Access
Source: https://github.com/napneko/napcatqq/blob/main/packages/napcat-plugin-builtin/webui/dashboard.html
Tests the ability to access memory-based resources provided by the plugin. This function fetches a 'dynamic/info.json' file from the plugin's memory base path. It does not require authentication.
```javascript
async function testMemoryResource () {
const resultDiv = document.getElementById('static-result');
resultDiv.innerHTML = '
`;
}
}
```
--------------------------------
### Require Node.js Library
Source: https://github.com/napneko/napcatqq/blob/main/packages/napcat-qrcode/README.md
Require the qrcode-terminal module in your Node.js application to access its functions.
```javascript
var qrcode = require('qrcode-terminal');
```
--------------------------------
### Set QR Code Error Level
Source: https://github.com/napneko/napcatqq/blob/main/packages/napcat-qrcode/README.md
Set the error correction level for subsequent QR code generations. The default is 'L'. 'Q' provides a higher level of error correction.
```javascript
qrcode.setErrorLevel('Q');
qrcode.generate('This will be a QRCode with error level Q!');
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.