Fix required API methods
This commit is contained in:
@@ -26,7 +26,7 @@ func registerEvents() {
|
|||||||
func registerAPIEndpoints() error {
|
func registerAPIEndpoints() error {
|
||||||
if err := api.RegisterEndpoint(api.Endpoint{
|
if err := api.RegisterEndpoint(api.Endpoint{
|
||||||
Path: "core/shutdown",
|
Path: "core/shutdown",
|
||||||
Read: api.PermitSelf,
|
Write: api.PermitSelf,
|
||||||
ActionFunc: shutdown,
|
ActionFunc: shutdown,
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -34,7 +34,7 @@ func registerAPIEndpoints() error {
|
|||||||
|
|
||||||
if err := api.RegisterEndpoint(api.Endpoint{
|
if err := api.RegisterEndpoint(api.Endpoint{
|
||||||
Path: "core/restart",
|
Path: "core/restart",
|
||||||
Read: api.PermitAdmin,
|
Write: api.PermitAdmin,
|
||||||
ActionFunc: restart,
|
ActionFunc: restart,
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
func registerAPI() error {
|
func registerAPI() error {
|
||||||
if err := api.RegisterEndpoint(api.Endpoint{
|
if err := api.RegisterEndpoint(api.Endpoint{
|
||||||
Path: "dns/clear",
|
Path: "dns/clear",
|
||||||
Read: api.PermitUser,
|
Write: api.PermitUser,
|
||||||
ActionFunc: clearNameCache,
|
ActionFunc: clearNameCache,
|
||||||
Name: "Clear cached DNS records",
|
Name: "Clear cached DNS records",
|
||||||
Description: "Deletes all saved DNS records from the database.",
|
Description: "Deletes all saved DNS records from the database.",
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import (
|
|||||||
func registerAPIEndpoints() error {
|
func registerAPIEndpoints() error {
|
||||||
return api.RegisterEndpoint(api.Endpoint{
|
return api.RegisterEndpoint(api.Endpoint{
|
||||||
Path: "ui/reload",
|
Path: "ui/reload",
|
||||||
Read: api.PermitUser,
|
Write: api.PermitUser,
|
||||||
ActionFunc: reloadUI,
|
ActionFunc: reloadUI,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ const (
|
|||||||
|
|
||||||
func registerAPIEndpoints() error {
|
func registerAPIEndpoints() error {
|
||||||
return api.RegisterEndpoint(api.Endpoint{
|
return api.RegisterEndpoint(api.Endpoint{
|
||||||
Path: apiPathCheckForUpdates,
|
Path: apiPathCheckForUpdates,
|
||||||
Read: api.PermitUser,
|
Write: api.PermitUser,
|
||||||
ActionFunc: func(_ *api.Request) (msg string, err error) {
|
ActionFunc: func(_ *api.Request) (msg string, err error) {
|
||||||
if err := TriggerUpdate(); err != nil {
|
if err := TriggerUpdate(); err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
|
|||||||
Reference in New Issue
Block a user