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:
@@ -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);
|
||||
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user