mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-11-30 06:24:46 +03:00
feat(nodes): add remote Xray and panel restart actions (#6970)
An operator running a master with sub-nodes could probe or update a node from the Nodes page but had to log in to the node, or SSH into it, to restart Xray or the panel (#6937). Add Restart Xray and Restart panel to the node actions, behind a confirmation. Xray restarts through the node runtime; the panel restart is a new Remote call that the node accepts with node-admin credentials, the authority that already covers updatePanel. Both are refused for a disabled node.
This commit is contained in:
@@ -760,6 +760,11 @@ func (r *Remote) RestartXray(ctx context.Context) error {
|
||||
return err
|
||||
}
|
||||
|
||||
func (r *Remote) RestartPanel(ctx context.Context) error {
|
||||
_, err := r.do(ctx, http.MethodPost, "panel/api/setting/restartPanel", nil)
|
||||
return err
|
||||
}
|
||||
|
||||
// UpdatePanel asks the node to run its own official self-updater (update.sh)
|
||||
// and restart onto the latest release. The node returns as soon as the job is
|
||||
// launched; the new version surfaces on the next heartbeat. When dev is true the
|
||||
|
||||
Reference in New Issue
Block a user