mirror of
https://github.com/mickael-kerjean/filestash
synced 2025-12-20 07:13:33 +01:00
19 lines
439 B
JavaScript
19 lines
439 B
JavaScript
import rxjs from "../../lib/rx.js";
|
|
import ajax from "../../lib/ajax.js";
|
|
|
|
const log$ = ajax({
|
|
url: url(1024 * 100), // fetch the last 100kb by default
|
|
responseType: "text",
|
|
}).pipe(
|
|
rxjs.map(({ response }) => response),
|
|
);
|
|
|
|
export function url(logSize = 0) {
|
|
return "admin/api/logs" + (logSize ? `?maxSize=${logSize}` : "");
|
|
}
|
|
|
|
export function get() {
|
|
return log$.pipe(
|
|
rxjs.repeat({ delay: 10000 }),
|
|
);
|
|
}
|