|
@@ -581,14 +581,25 @@
|
581
|
581
|
return;
|
582
|
582
|
}
|
583
|
583
|
if(Number(search.text)) {
|
584
|
|
- var query = new QSqlQuery();
|
585
|
|
- query.prepare("SELECT machine, time FROM roasting_log WHERE files[1] = :file");
|
586
|
|
- query.bind(":file", Number(search.text));
|
587
|
|
- query.exec();
|
588
|
|
- if(query.next()) {
|
589
|
|
- window.loadBatch(query.value(0), query.value(1));
|
|
584
|
+ if(search.text.startsWith('00')) {
|
|
585
|
+ var query = new QSqlQuery();
|
|
586
|
+ query.prepare("SELECT machine, time FROM scheduled_roasts WHERE id = :id");
|
|
587
|
+ query.bind(":id", Number(search.text));
|
|
588
|
+ query.exec();
|
|
589
|
+ if(query.next()) {
|
|
590
|
+ window.loadBatch(query.value(0), query.value(1));
|
|
591
|
+ }
|
|
592
|
+ query = query.invalidate();
|
|
593
|
+ } else {
|
|
594
|
+ var query = new QSqlQuery();
|
|
595
|
+ query.prepare("SELECT machine, time FROM roasting_log WHERE files[1] = :file");
|
|
596
|
+ query.bind(":file", Number(search.text));
|
|
597
|
+ query.exec();
|
|
598
|
+ if(query.next()) {
|
|
599
|
+ window.loadBatch(query.value(0), query.value(1));
|
|
600
|
+ }
|
|
601
|
+ query = query.invalidate();
|
590
|
602
|
}
|
591
|
|
- query = query.invalidate();
|
592
|
603
|
} else {
|
593
|
604
|
var tag = JSON.parse(search.text);
|
594
|
605
|
if(tag.m != undefined && tag.t != undefined) {
|