Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
f8cfbfa4
authored
Jun 22, 2026
by
CaIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor(log): remove legacy log deletion endpoint and associated types
parent
f84b7d59
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
14 deletions
+6
-14
controller/log.go
+4
-0
router/api-router.go
+2
-0
web/default/src/features/system-settings/api.ts
+0
-8
web/default/src/features/system-settings/types.ts
+0
-6
No files found.
controller/log.go
View file @
f8cfbfa4
...
@@ -150,6 +150,10 @@ func GetLogsSelfStat(c *gin.Context) {
...
@@ -150,6 +150,10 @@ func GetLogsSelfStat(c *gin.Context) {
return
return
}
}
// DeleteHistoryLogs is the legacy synchronous log cleanup endpoint (DELETE /api/log/).
// It deletes directly instead of going through the async system task. It is kept only
// for the classic frontend; the default frontend uses POST /api/system-task/log-cleanup.
// TODO: remove this handler (and its route) once the classic frontend is removed.
func
DeleteHistoryLogs
(
c
*
gin
.
Context
)
{
func
DeleteHistoryLogs
(
c
*
gin
.
Context
)
{
targetTimestamp
,
_
:=
strconv
.
ParseInt
(
c
.
Query
(
"target_timestamp"
),
10
,
64
)
targetTimestamp
,
_
:=
strconv
.
ParseInt
(
c
.
Query
(
"target_timestamp"
),
10
,
64
)
if
targetTimestamp
==
0
{
if
targetTimestamp
==
0
{
...
...
router/api-router.go
View file @
f8cfbfa4
...
@@ -304,6 +304,8 @@ func SetApiRouter(router *gin.Engine) {
...
@@ -304,6 +304,8 @@ func SetApiRouter(router *gin.Engine) {
}
}
logRoute
:=
apiRouter
.
Group
(
"/log"
)
logRoute
:=
apiRouter
.
Group
(
"/log"
)
logRoute
.
GET
(
"/"
,
middleware
.
AdminAuth
(),
controller
.
GetAllLogs
)
logRoute
.
GET
(
"/"
,
middleware
.
AdminAuth
(),
controller
.
GetAllLogs
)
// Legacy synchronous direct-delete route used only by the classic frontend.
// TODO: remove once the classic frontend is removed; the default frontend uses /system-task/log-cleanup.
logRoute
.
DELETE
(
"/"
,
middleware
.
RootAuth
(),
controller
.
DeleteHistoryLogs
)
logRoute
.
DELETE
(
"/"
,
middleware
.
RootAuth
(),
controller
.
DeleteHistoryLogs
)
logRoute
.
GET
(
"/stat"
,
middleware
.
AdminAuth
(),
controller
.
GetLogsStat
)
logRoute
.
GET
(
"/stat"
,
middleware
.
AdminAuth
(),
controller
.
GetLogsStat
)
logRoute
.
GET
(
"/self/stat"
,
middleware
.
UserAuth
(),
controller
.
GetLogsSelfStat
)
logRoute
.
GET
(
"/self/stat"
,
middleware
.
UserAuth
(),
controller
.
GetLogsSelfStat
)
...
...
web/default/src/features/system-settings/api.ts
View file @
f8cfbfa4
...
@@ -19,7 +19,6 @@ For commercial licensing, please contact support@quantumnous.com
...
@@ -19,7 +19,6 @@ For commercial licensing, please contact support@quantumnous.com
import
{
api
}
from
'@/lib/api'
import
{
api
}
from
'@/lib/api'
import
type
{
import
type
{
ConfirmPaymentComplianceResponse
,
ConfirmPaymentComplianceResponse
,
DeleteLogsResponse
,
FetchUpstreamRatiosRequest
,
FetchUpstreamRatiosRequest
,
LogCleanupTask
,
LogCleanupTask
,
SystemOptionsResponse
,
SystemOptionsResponse
,
...
@@ -48,13 +47,6 @@ export async function confirmPaymentCompliance() {
...
@@ -48,13 +47,6 @@ export async function confirmPaymentCompliance() {
return
res
.
data
return
res
.
data
}
}
export
async
function
deleteLogsBefore
(
targetTimestamp
:
number
)
{
const
res
=
await
api
.
delete
<
DeleteLogsResponse
>
(
'/api/log/'
,
{
params
:
{
target_timestamp
:
targetTimestamp
},
})
return
res
.
data
}
export
async
function
startLogCleanupTask
(
targetTimestamp
:
number
)
{
export
async
function
startLogCleanupTask
(
targetTimestamp
:
number
)
{
const
res
=
await
api
.
post
<
SystemTaskResponse
<
LogCleanupTask
>>
(
const
res
=
await
api
.
post
<
SystemTaskResponse
<
LogCleanupTask
>>
(
'/api/system-task/log-cleanup'
,
'/api/system-task/log-cleanup'
,
...
...
web/default/src/features/system-settings/types.ts
View file @
f8cfbfa4
...
@@ -50,12 +50,6 @@ export type ConfirmPaymentComplianceResponse = {
...
@@ -50,12 +50,6 @@ export type ConfirmPaymentComplianceResponse = {
}
}
}
}
export
type
DeleteLogsResponse
=
{
success
:
boolean
message
:
string
data
?:
number
}
export
type
SystemTaskStatus
=
'pending'
|
'running'
|
'succeeded'
|
'failed'
export
type
SystemTaskStatus
=
'pending'
|
'running'
|
'succeeded'
|
'failed'
export
type
SystemTask
<
export
type
SystemTask
<
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment