rename /install/ path names to be more fitting

This commit is contained in:
Eugene Bujak 2019-02-01 18:52:56 +03:00
parent c14aff3dba
commit d3e81c47f6
1 changed files with 4 additions and 4 deletions

View File

@ -708,7 +708,7 @@ type firstRunData struct {
Interfaces map[string]interface{} `json:"interfaces"` Interfaces map[string]interface{} `json:"interfaces"`
} }
func handleGetDefaultAddresses(w http.ResponseWriter, r *http.Request) { func handleInstallGetAddresses(w http.ResponseWriter, r *http.Request) {
data := firstRunData{} data := firstRunData{}
ifaces, err := getValidNetInterfaces() ifaces, err := getValidNetInterfaces()
if err != nil { if err != nil {
@ -755,7 +755,7 @@ func handleGetDefaultAddresses(w http.ResponseWriter, r *http.Request) {
} }
} }
func handleSetAllSettings(w http.ResponseWriter, r *http.Request) { func handleInstallConfigure(w http.ResponseWriter, r *http.Request) {
newSettings := firstRunData{} newSettings := firstRunData{}
err := json.NewDecoder(r.Body).Decode(&newSettings) err := json.NewDecoder(r.Body).Decode(&newSettings)
if err != nil { if err != nil {
@ -816,6 +816,6 @@ func registerControlHandlers() {
http.HandleFunc("/control/dhcp/find_active_dhcp", postInstall(optionalAuth(ensurePOST(handleDHCPFindActiveServer)))) http.HandleFunc("/control/dhcp/find_active_dhcp", postInstall(optionalAuth(ensurePOST(handleDHCPFindActiveServer))))
// TODO: move to registerInstallHandlers() // TODO: move to registerInstallHandlers()
http.HandleFunc("/control/install/get_default_addresses", preInstall(ensureGET(handleGetDefaultAddresses))) http.HandleFunc("/control/install/get_addresses", preInstall(ensureGET(handleInstallGetAddresses)))
http.HandleFunc("/control/install/set_all_settings", preInstall(ensurePOST(handleSetAllSettings))) http.HandleFunc("/control/install/configure", preInstall(ensurePOST(handleInstallConfigure)))
} }