Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Polish: Consistent notifications in PBS setup and scripts

rcourtmana6283db5b13d
diff --git a/frontend-modern/src/components/Settings/NodeModal.tsx b/frontend-modern/src/components/Settings/NodeModal.tsx
index 20c9b54850..1ca74988f5 100644
--- a/frontend-modern/src/components/Settings/NodeModal.tsx
+++ b/frontend-modern/src/components/Settings/NodeModal.tsx
@@ -285,7 +285,7 @@ export const NodeModal: Component<NodeModalProps> = (props) => {
const normalizedName = data.name.trim() || deriveNameFromHost(data.host);
if (!normalizedName) {
- showError('Node name is required');
+ notificationStore.error('Node name is required');
return;
}
@@ -1043,12 +1043,12 @@ export const NodeModal: Component<NodeModalProps> = (props) => {
document.body.removeChild(a);
URL.revokeObjectURL(url);
- showSuccess(
+ notificationStore.success(
'Script downloaded! Upload it to your server and run: bash pulse-setup.sh',
);
} catch (error) {
logger.error('Failed to download script:', error);
- showSuccess(
+ notificationStore.error(
'Failed to download script. Please check your connection.',
);
}
@@ -1389,13 +1389,13 @@ export const NodeModal: Component<NodeModalProps> = (props) => {
setAgentInstallCommand(data.command);
const copied = await copyToClipboard(data.command);
if (copied) {
- showSuccess('Command copied to clipboard');
+ notificationStore.success('Command copied to clipboard');
}
}
} catch (error) {
logger.error('[Agent Install] Error:', error);
setAgentCommandError(error instanceof Error ? error.message : 'Failed to generate command');
- showError('Failed to generate install command');
+ notificationStore.error('Failed to generate install command');
} finally {
setLoadingAgentCommand(false);
}
@@ -1468,17 +1468,17 @@ export const NodeModal: Component<NodeModalProps> = (props) => {
if (data.command) {
setQuickSetupCommand(data.command);
if (await copyToClipboard(data.command)) {
- showSuccess('Command copied to clipboard!');
+ notificationStore.success('Command copied to clipboard!');
} else {
- showError('Failed to copy to clipboard');
+ notificationStore.error('Failed to copy to clipboard');
}
}
} else {
- showError('Failed to generate setup URL');
+ notificationStore.error('Failed to generate setup URL');
}
} catch (error) {
logger.error('Failed to copy command:', error);
- showError('Failed to copy command');
+ notificationStore.error('Failed to copy command');
}
}}
class="absolute top-2 right-2 p-1.5 text-gray-400 hover:text-gray-200 bg-gray-700 rounded-md transition-colors"
@@ -1597,12 +1597,12 @@ export const NodeModal: Component<NodeModalProps> = (props) => {
document.body.removeChild(a);
URL.revokeObjectURL(url);
- showSuccess(
+ notificationStore.success(
'Script downloaded! Upload it to your PBS and run: bash pulse-pbs-setup.sh',
);
} catch (error) {
logger.error('Failed to download script:', error);
- showSuccess(
+ notificationStore.error(
'Failed to download script. Please check your connection.',
);
}