Pakon & Safari - no data ve webUI

pakon

#1

Zdravim,
mam tu takovy evergreen s Pakonem a Safari. pakon-show v CLI funguje, vypisuje vsechno a aktualne, ale ve webUI vidim pouze:


Vic ani Ň. Proste nic. Na zacateku jen rychle problikne “Loading data…” (problikne to tak rychle, ze to co v tom kolecku je vim z jinyho browseru), hned na to se ukaze to co je na screenshotu a to je vse co z webUI ziskam (proste bez dat).


#2

Zdravím,

děkujeme za nahlášení. Chybu jsme zreprodukovali na Macu se Safari a podíváme se na ní.


#3

Jen chci upozornit ze chyba trva i v TurrisOS 3.11.2 (Foris 99.1).

Vypada to na “tradicni” zkomoleni data pro Ajax (date_from a date_to jsou “NaN” namisto platneho unixtime), tedy nejspis totez co jsem popisoval uz drive, tedy neco ve smyslu:
Firefox:

> Date.parse('2019-01-15 11:21');
< 1547547660000

Chrome:

> Date.parse('2019-01-15 11:21');
< 1547547660000

Safari:

> Date.parse('2019-01-15 11:21');
< NaN

EDIT: Nerikam ze je to spravne (nejsem javascriptar, jediny co o tom vim, ze je nekdy peklo najit konsensus mezi pouzivanymi browsery), ale:

Firefox:

> Date.parse('2019-01-15T11:21');
< 1547547660000

Chrome:

> Date.parse('2019-01-15T11:21');
< 1547547660000

Safari:

> Date.parse('2019-01-15T11:21');
< 1547547660000

#4

Tak po malym patchi:

Patch cislo 1
--- /usr/lib/python3.6/site-packages/foris_plugins/pakon/templates/javascript/pakon/pakon.js.j2.orig	2019-01-03 12:32:48.000000000 +0100
+++ /usr/lib/python3.6/site-packages/foris_plugins/pakon/templates/javascript/pakon/pakon.js.j2	2019-01-16 11:36:25.267684541 +0100
@@ -70,13 +70,13 @@
         $('#time-from').val('00:00:00.00');
         time_from = "00:00:00";
     }
-    from = Date.parse($('#date-from').val() + ' ' + time_from);
+    from = Date.parse($('#date-from').val() + 'T' + time_from);
     let time_to = $('#time-to').val();
     if(time_to == "") {
         $('#time-to').val('00:00:00.00');
         time_to = "00:00:00";
     }
-    to = Date.parse($('#date-to').val() + ' ' + time_to);
+    to = Date.parse($('#date-to').val() + 'T' + time_to);
 }
 
 function apply() {

Uz Pakon dela vypis ve vsech* trech prohlizecich.

Skoda jen, ze vypsana tabulka v Safari je plna NaNu :-):


(panejo, ta tabulka je obrovska - jako co do velikosti pisma. A diky tomu i pekne siroka. Snad jsem si nekde ve Forisu nezapl upravu pro zhorseny zrak)

*) Omlouvam se vsem uzivatelum jakehokoliv jineho prohlizece.


#5

A druhy patch, kvuli zobrazeni:

Patch cislo 2
--- /usr/lib/python3.6/site-packages/foris_plugins/pakon/static/js/data_manager.js.orig	2019-01-03 12:32:48.000000000 +0100
+++ /usr/lib/python3.6/site-packages/foris_plugins/pakon/static/js/data_manager.js	2019-01-16 12:27:08.669199882 +0100
@@ -234,7 +234,7 @@
                 proto = "";
             send += cur_entry[6];
             recv += cur_entry[7];
-            tmp_date = new Date(Date.parse(cur_entry[0]));
+            tmp_date = new Date(Date.parse(cur_entry[0].replace(' ','T')));
             if(tmp_date < st_date) st_date = tmp_date;
             tmp_date = new Date(tmp_date.getTime() + cur_entry[1] * 1000);
             if(tmp_date > nd_date) nd_date = tmp_date;
@@ -250,7 +250,7 @@
             recv = cur_entry[7];
             proto = cur_entry[4];
             a_entries = [cur_entry];
-            st_date = new Date(Date.parse(cur_entry[0]));
+            st_date = new Date(Date.parse(cur_entry[0].replace(' ','T')));
             nd_date = new Date(st_date.getTime() + cur_entry[1] * 1000);
         }
         last_entry = cur_entry;

Jako chodi to, ale jestli je to koser, to musi posoudit nekdo jiny.
Kazdopadne uz vidim co mam.


#6

Thank you for your hard work! We really appreciate it. We’ve applied your patches and it will be included in next release of Turris OS.