Renamings
This commit is contained in:
parent
8c8317253a
commit
0b5717cde5
|
@ -30,7 +30,7 @@ import { buildBackupsEndpoints } from "./backups"
|
|||
import { buildEnvironmentVariableEndpoints } from "./environmentVariables"
|
||||
import { buildEventEndpoints } from "./events"
|
||||
import { buildAuditLogsEndpoints } from "./auditLogs"
|
||||
import { buildSystemLogsEndpoints } from "./systemLogs"
|
||||
import { buildLogsEndpoints } from "./logs"
|
||||
|
||||
/**
|
||||
* Random identifier to uniquely identify a session in a tab. This is
|
||||
|
@ -278,6 +278,6 @@ export const createAPIClient = config => {
|
|||
...buildEnvironmentVariableEndpoints(API),
|
||||
...buildEventEndpoints(API),
|
||||
...buildAuditLogsEndpoints(API),
|
||||
...buildSystemLogsEndpoints(API),
|
||||
...buildLogsEndpoints(API),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
export const buildSystemLogsEndpoints = API => ({
|
||||
export const buildLogsEndpoints = API => ({
|
||||
/**
|
||||
* Gets a stream for the system logs.
|
||||
*/
|
||||
getSystemLogs: async () => {
|
||||
return await API.get({
|
||||
url: "/api/global/system/logs",
|
||||
url: "/api/system/logs",
|
||||
json: false,
|
||||
parseResponse: async response => {
|
||||
return response
|
|
@ -1,10 +1,12 @@
|
|||
import { UserCtx } from "@budibase/types"
|
||||
import { context, logging } from "@budibase/backend-core"
|
||||
import { installation, logging } from "@budibase/backend-core"
|
||||
|
||||
export async function getLogs(ctx: UserCtx) {
|
||||
const logReadStream = logging.system.getLogReadStream()
|
||||
|
||||
const fileName = `${context.getTenantId()}-${Date.now()}.logs`
|
||||
const { installId } = await installation.getInstall()
|
||||
|
||||
const fileName = `${installId}-${Date.now()}.logs`
|
||||
|
||||
ctx.set("content-disposition", `attachment; filename=${fileName}`)
|
||||
ctx.body = logReadStream
|
||||
|
|
|
@ -4,6 +4,6 @@ import * as controller from "../../controllers/system/logs"
|
|||
|
||||
const router: Router = new Router()
|
||||
|
||||
router.get("/api/global/system/logs", middleware.adminOnly, controller.getLogs)
|
||||
router.get("/api/system/logs", middleware.adminOnly, controller.getLogs)
|
||||
|
||||
export default router
|
||||
|
|
Loading…
Reference in New Issue