svelte-log-view 6.3.2 → 6.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/LogView.svelte +16 -22
package/package.json
CHANGED
package/src/LogView.svelte
CHANGED
|
@@ -41,6 +41,9 @@
|
|
|
41
41
|
let current;
|
|
42
42
|
if (entries.length > 0) {
|
|
43
43
|
current = entries[entries.length - 1];
|
|
44
|
+
if (follow) {
|
|
45
|
+
setSelected(entries.length - 1);
|
|
46
|
+
}
|
|
44
47
|
}
|
|
45
48
|
|
|
46
49
|
do {
|
|
@@ -73,22 +76,16 @@
|
|
|
73
76
|
}
|
|
74
77
|
|
|
75
78
|
if (selected < 0) {
|
|
76
|
-
const
|
|
79
|
+
const additionalEntries = [];
|
|
77
80
|
|
|
78
|
-
for (
|
|
79
|
-
|
|
81
|
+
for await (const entry of source.fetch(entries[0], -fetchAboveRows, fetchAboveRows)) {
|
|
82
|
+
additionalEntries.push(entry);
|
|
80
83
|
}
|
|
81
84
|
|
|
82
|
-
|
|
83
|
-
offsetRows += fetchAboveRows;
|
|
85
|
+
entries.unshift(...additionalEntries);
|
|
84
86
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
entries[i++] = entry;
|
|
88
|
-
if (i >= fetchAboveRows) {
|
|
89
|
-
break;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
87
|
+
selected += additionalEntries.length;
|
|
88
|
+
offsetRows += additionalEntries.length;
|
|
92
89
|
}
|
|
93
90
|
|
|
94
91
|
if (selected < offsetRows) {
|
|
@@ -103,17 +100,14 @@
|
|
|
103
100
|
}
|
|
104
101
|
|
|
105
102
|
function setFollow(flag) {
|
|
106
|
-
if (follow
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
source.abort();
|
|
103
|
+
if (follow !== flag) {
|
|
104
|
+
follow = flag;
|
|
105
|
+
if (flag) {
|
|
106
|
+
fetchFollow();
|
|
107
|
+
} else {
|
|
108
|
+
source.abort();
|
|
109
|
+
}
|
|
114
110
|
}
|
|
115
|
-
|
|
116
|
-
follow = flag;
|
|
117
111
|
}
|
|
118
112
|
|
|
119
113
|
function onkeydown(event) {
|