further refine notifications
This commit is contained in:
@ -1328,7 +1328,6 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
async function updateMods() {
|
async function updateMods() {
|
||||||
try {
|
try {
|
||||||
const key = `action-update-mods`;
|
const key = `action-update-mods`;
|
||||||
const notification = showNotification('Updating mods...', 'loading', key);
|
|
||||||
const response = await wsRequest('/update-mods', 'POST');
|
const response = await wsRequest('/update-mods', 'POST');
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
updateNotification(notification, `Failed to update mods: ${response.error}`, 'error', key);
|
updateNotification(notification, `Failed to update mods: ${response.error}`, 'error', key);
|
||||||
@ -1336,7 +1335,6 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
} else {
|
} else {
|
||||||
const output = response.output || 'No output from mod update.';
|
const output = response.output || 'No output from mod update.';
|
||||||
elements.updateModsOutput.textContent = output;
|
elements.updateModsOutput.textContent = output;
|
||||||
updateNotification(notification, 'Mods updated successfully', 'success', key);
|
|
||||||
}
|
}
|
||||||
elements.updateModsModal.classList.remove('hidden');
|
elements.updateModsModal.classList.remove('hidden');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@ -1391,9 +1389,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
elements.generateMyLinkBtn.addEventListener('click', async () => {
|
elements.generateMyLinkBtn.addEventListener('click', async () => {
|
||||||
try {
|
try {
|
||||||
const key = `action-my-link`;
|
const key = `action-my-link`;
|
||||||
const notification = showNotification('Generating connection link...', 'loading', key);
|
|
||||||
await wsRequest('/my-link');
|
await wsRequest('/my-link');
|
||||||
updateNotification(notification, 'Connection link generated successfully', 'success', key);
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Generate connection link error:', error);
|
console.error('Generate connection link error:', error);
|
||||||
showNotification(`Failed to generate connection link: ${error.message}`, 'error', 'my-link-error');
|
showNotification(`Failed to generate connection link: ${error.message}`, 'error', 'my-link-error');
|
||||||
@ -1403,9 +1399,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
elements.generateGeyserLinkBtn.addEventListener('click', async () => {
|
elements.generateGeyserLinkBtn.addEventListener('click', async () => {
|
||||||
try {
|
try {
|
||||||
const key = `action-my-geyser-link`;
|
const key = `action-my-geyser-link`;
|
||||||
const notification = showNotification('Generating Geyser link...', 'loading', key);
|
|
||||||
await wsRequest('/my-geyser-link');
|
await wsRequest('/my-geyser-link');
|
||||||
updateNotification(notification, 'Geyser link generated successfully', 'success', key);
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Generate geyser link error:', error);
|
console.error('Generate geyser link error:', error);
|
||||||
showNotification(`Failed to generate Geyser link: ${error.message}`, 'error', 'geyser-link-error');
|
showNotification(`Failed to generate Geyser link: ${error.message}`, 'error', 'geyser-link-error');
|
||||||
@ -1415,9 +1409,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
elements.generateSftpLinkBtn.addEventListener('click', async () => {
|
elements.generateSftpLinkBtn.addEventListener('click', async () => {
|
||||||
try {
|
try {
|
||||||
const key = `action-my-sftp`;
|
const key = `action-my-sftp`;
|
||||||
const notification = showNotification('Generating SFTP link...', 'loading', key);
|
|
||||||
await wsRequest('/my-sftp');
|
await wsRequest('/my-sftp');
|
||||||
updateNotification(notification, 'SFTP link generated successfully', 'success', key);
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Generate SFTP link error:', error);
|
console.error('Generate SFTP link error:', error);
|
||||||
showNotification(`Failed to generate SFTP link: ${error.message}`, 'error', 'sftp-link-error');
|
showNotification(`Failed to generate SFTP link: ${error.message}`, 'error', 'sftp-link-error');
|
||||||
|
Reference in New Issue
Block a user