mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-23 23:48:56 +01:00
Handle natural language to cron translation error on web client
This commit is contained in:
parent
70ee9ddf91
commit
19c5af3ebc
1 changed files with 11 additions and 0 deletions
|
@ -172,6 +172,17 @@
|
|||
|
||||
// Get cron string from natural language user schedule, if changed
|
||||
const crontime = scheduleEl.getAttribute('data-original') !== scheduleEl.value ? getCronString(scheduleEl.value) : scheduleEl.getAttribute('data-cron');
|
||||
if (crontime.startsWith("ERROR:")) {
|
||||
notificationEl.textContent = `⚠️ Failed to automate. Fix or simplify Schedule input field.`;
|
||||
notificationEl.style.display = "block";
|
||||
let originalScheduleElBorder = scheduleEl.style.border;
|
||||
scheduleEl.style.border = "2px solid red";
|
||||
setTimeout(function() {
|
||||
scheduleEl.style.border = originalScheduleElBorder;
|
||||
}, 2000);
|
||||
|
||||
return;
|
||||
}
|
||||
const encodedCrontime = encodeURIComponent(crontime);
|
||||
|
||||
// Construct query string and select method for API call
|
||||
|
|
Loading…
Reference in a new issue