Files
n8n-enterprise-unlocked/packages/editor-ui/src/components/mixins/titleChange.ts
Rupenieks 44f7b7a9c2 Dynamic title based on workflow execution (#865)
*  Added title changes based on workflow execution

*  Title changes on workflow open, reset on workflow delete, fixed not showing when page refreshed

*  Title icons
2020-08-25 20:37:24 +02:00

25 lines
643 B
TypeScript

type Status = 'EXECUTING' | 'IDLE' | 'ERROR';
export default {
/**
* Change title of n8n tab
* @param workflow Name of workflow
* @param status Status of workflow
*/
set (workflow : string, status : Status) {
if (status === 'EXECUTING') {
window.document.title = `n8n - 🔄 ${workflow}}`;
}
else if (status === 'IDLE') {
window.document.title = `n8n - ▶️ ${workflow}`;
}
else {
window.document.title = `n8n - ⚠️ ${workflow}`;
}
},
reset () {
document.title = `n8n - Workflow Automation`;
}
};