@pmate/cli 0.20.6 → 0.20.8
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/dist/index.js +4 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -20105,10 +20105,6 @@ var ServiceRuntimeRunner = class {
|
|
|
20105
20105
|
}
|
|
20106
20106
|
}
|
|
20107
20107
|
async log(service, options = {}) {
|
|
20108
|
-
if (service.runtimeType === "rust" || service.runtimeType === "python") {
|
|
20109
|
-
await this.showScriptLogs(service);
|
|
20110
|
-
return;
|
|
20111
|
-
}
|
|
20112
20108
|
const namespace = service.namespace;
|
|
20113
20109
|
const appName = service.name;
|
|
20114
20110
|
const page = await this.fetchLogPage(namespace, appName, {
|
|
@@ -20118,7 +20114,7 @@ var ServiceRuntimeRunner = class {
|
|
|
20118
20114
|
});
|
|
20119
20115
|
ui.title(`Logs for ${namespace}/${appName}`);
|
|
20120
20116
|
ui.info("Source", { mode: options.history ? "history" : "online" });
|
|
20121
|
-
this.renderPage(page);
|
|
20117
|
+
this.renderPage(page, { oldestFirst: Boolean(options.follow) });
|
|
20122
20118
|
if (options.follow) {
|
|
20123
20119
|
await this.followLogs(namespace, appName, {
|
|
20124
20120
|
page: options.page ?? 0,
|
|
@@ -20452,14 +20448,15 @@ var ServiceRuntimeRunner = class {
|
|
|
20452
20448
|
}
|
|
20453
20449
|
return payload.data;
|
|
20454
20450
|
}
|
|
20455
|
-
renderPage(page) {
|
|
20451
|
+
renderPage(page, options = {}) {
|
|
20456
20452
|
ui.info("Page", {
|
|
20457
20453
|
page: page.page,
|
|
20458
20454
|
totalPage: page.totalPage,
|
|
20459
20455
|
pageSize: page.pageSize,
|
|
20460
20456
|
items: page.data.length
|
|
20461
20457
|
});
|
|
20462
|
-
|
|
20458
|
+
const items = options.oldestFirst ? [...page.data].reverse() : page.data;
|
|
20459
|
+
for (const item of items) {
|
|
20463
20460
|
ui.plain(this.renderLogLine(item));
|
|
20464
20461
|
}
|
|
20465
20462
|
}
|