Skip to content

Commit f44c44c

Browse files
committed
fix(kernel): stop parent's program when restart
1 parent 4563c1f commit f44c44c

File tree

33 files changed

+5320
-4523
lines changed

33 files changed

+5320
-4523
lines changed

api/system/restart.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package system
2+
3+
import (
4+
"net/http"
5+
6+
"code.pfad.fr/risefront"
7+
"github.com/gin-gonic/gin"
8+
)
9+
10+
func Restart(c *gin.Context) {
11+
risefront.Restart()
12+
13+
c.JSON(http.StatusOK, gin.H{
14+
"message": "restarting...",
15+
})
16+
}

api/system/router.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ func InitPrivateRouter(r *gin.RouterGroup) {
2424
r.GET("upgrade/current", GetCurrentVersion)
2525

2626
r.POST("system/port_scan", PortScan)
27+
28+
r.Any("system/stats", GetProcessStats)
29+
r.Any("system/restart", Restart)
2730
}
2831

2932
func InitSelfCheckRouter(r *gin.RouterGroup) {
@@ -34,10 +37,6 @@ func InitSelfCheckRouter(r *gin.RouterGroup) {
3437
g.GET("timeout", middleware.Proxy(), TimeoutCheck)
3538
}
3639

37-
func InitBackupRestoreRouter(r *gin.RouterGroup) {
38-
// Backup and restore routes moved to api/backup package
39-
}
40-
4140
func InitWebSocketRouter(r *gin.RouterGroup) {
4241
r.GET("upgrade/perform", PerformCoreUpgrade)
4342
}

api/system/stats.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package system
2+
3+
import (
4+
"net/http"
5+
"os"
6+
7+
"github.com/gin-gonic/gin"
8+
)
9+
10+
func GetProcessStats(c *gin.Context) {
11+
pid := os.Getpid()
12+
13+
c.JSON(http.StatusOK, gin.H{
14+
"pid": pid,
15+
})
16+
}

app/src/language/ar/app.po

Lines changed: 314 additions & 294 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)