fix: update app target and improve notification handling

- Change APP_TARGET to new server address
- Add line break support in notification messages
- Include response details in webhook test notifications
- Add Content-Type header to webhook requests
This commit is contained in:
2026-05-07 19:23:35 +08:00
parent a97cb90c43
commit 49d9f4f389
3 changed files with 8 additions and 5 deletions

View File

@@ -36,7 +36,8 @@ function showNotification(message, type = 'info') {
cursor: pointer;
`;
notification.innerHTML = `<span style="font-size: 18px;">${icons[type] || icons.info}</span><span>${message}</span>`;
const formattedMessage = message.replace(/\n/g, '<br>');
notification.innerHTML = `<span style="font-size: 18px;">${icons[type] || icons.info}</span><span>${formattedMessage}</span>`;
document.body.appendChild(notification);

View File

@@ -229,7 +229,9 @@ export default {
testBody = testBody.replace(/\{\{\s*serviceName\s*\}\}/g, 'superfrpc_test_test');
testBody = testBody.replace(/\{\{\s*exceptionMsg\s*\}\}/g, 'WebHook Test');
const headers = {};
const headers = {
'Content-Type': 'application/json'
};
if (webhookSettings.headers) {
webhookSettings.headers.split('\n').forEach(line => {
const colonIndex = line.indexOf(':');
@@ -250,9 +252,9 @@ export default {
});
if (response.ok) {
showNotification('WebHook test successful', 'success');
showNotification(`WebHook test successful\nMessage: ${await response.text()}`, 'success');
} else {
showNotification(`WebHook test failed: HTTP ${response.status}`, 'error');
showNotification(`WebHook test failed: HTTP ${response.status}\nMessage: ${await response.text()}`, 'error');
}
} catch (error) {
showNotification(`WebHook test failed: ${error.message}`, 'error');

View File

@@ -1,7 +1,7 @@
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
const APP_TARGET = '192.168.1.19:19090'
const APP_TARGET = '192.168.20.4:19090'
export default defineConfig({
define: {