// Path: src/main/java/com/behase/relumin/config/SchedulerConfig.java
// @Data
// public class SchedulerConfig {
//     public static final String DEFAULT_REFRESH_CLUSTERS_INTERVAL_MILLIS = "120000";
//     public static final String DEFAULT_COLLECT_STATICS_INFO_INTERVAL_MILLIS = "120000";
//     public static final String DEFAULT_COLLECT_STATICS_INFO_MAX_COUNT = "1500";
//     public static final String DEFAULT_COLLECT_SLOW_LOG_MAX_COUNT = "1500";
// 
//     private String refreshClustersIntervalMillis;
// 
//     private String collectStaticsInfoIntervalMillis;
//     private String collectStaticsInfoMaxCount;
//     private String collectSlowLogMaxCount;
// }
// 
// Path: src/main/java/com/behase/relumin/model/LoginUser.java
// @Data
// @Builder
// @NoArgsConstructor
// public class LoginUser {
//     private String username;
//     private String displayName;
//     private String password;
//     private String role;
// 
//     public LoginUser(String username, String displayName, String rawPassword, String role) {
//         this.username = username;
//         this.displayName = displayName;
//         this.password = new StandardPasswordEncoder().encode(rawPassword);
//         this.role = Role.get(role).getAuthority();
//     }
// 
//     @JsonIgnore
//     public User getSpringUser() {
//         return new User(username, password, Lists.newArrayList(Role.get(role)));
//     }
// 
//     public void setRawPassword(String rawPassword) {
//         this.password = new StandardPasswordEncoder().encode(rawPassword);
//     }
// }
// 
// Path: src/main/java/com/behase/relumin/service/UserService.java
// public interface UserService extends UserDetailsService {
//     LoginUser getUser(String username) throws Exception;
// 
//     List<LoginUser> getUsers() throws Exception;
// 
//     void addUser(String username, String displayName, String password, String role) throws Exception;
// 
//     void changePassword(String username, String oldPassword, String password) throws Exception;
// 
//     void updateUser(String username, String displayName, String role) throws Exception;
// 
//     void deleteUser(String username) throws Exception;
// }


import com.behase.relumin.config.SchedulerConfig;
import com.behase.relumin.model.LoginUser;
import com.behase.relumin.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.core.Authentication;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
package com.behase.relumin.controller;


@Controller
public class WebController {
    @Autowired
    private UserService userService;

    @Value("${build.number}")
    private String buildNumber;

    @Value("${scheduler.collectStaticsInfoIntervalMillis:"
            + SchedulerConfig.DEFAULT_COLLECT_STATICS_INFO_INTERVAL_MILLIS + "}")
    private String collectStaticsInfoIntervalMillis;

    @Value("${auth.enabled}")
    private boolean authEnabled;

    @Value("${auth.allowAnonymous}")
// Path: src/main/java/com/behase/relumin/config/SchedulerConfig.java
// @Data
// public class SchedulerConfig {
//     public static final String DEFAULT_REFRESH_CLUSTERS_INTERVAL_MILLIS = "120000";
//     public static final String DEFAULT_COLLECT_STATICS_INFO_INTERVAL_MILLIS = "120000";
//     public static final String DEFAULT_COLLECT_STATICS_INFO_MAX_COUNT = "1500";
//     public static final String DEFAULT_COLLECT_SLOW_LOG_MAX_COUNT = "1500";
// 
//     private String refreshClustersIntervalMillis;
// 
//     private String collectStaticsInfoIntervalMillis;
//     private String collectStaticsInfoMaxCount;
//     private String collectSlowLogMaxCount;
// }
// 
// Path: src/main/java/com/behase/relumin/model/LoginUser.java
// @Data
// @Builder
// @NoArgsConstructor
// public class LoginUser {
//     private String username;
//     private String displayName;
//     private String password;
//     private String role;
// 
//     public LoginUser(String username, String displayName, String rawPassword, String role) {
//         this.username = username;
//         this.displayName = displayName;
//         this.password = new StandardPasswordEncoder().encode(rawPassword);
//         this.role = Role.get(role).getAuthority();
//     }
// 
//     @JsonIgnore
//     public User getSpringUser() {
//         return new User(username, password, Lists.newArrayList(Role.get(role)));
//     }
// 
//     public void setRawPassword(String rawPassword) {
//         this.password = new StandardPasswordEncoder().encode(rawPassword);
//     }
// }
// 
// Path: src/main/java/com/behase/relumin/service/UserService.java
// public interface UserService extends UserDetailsService {
//     LoginUser getUser(String username) throws Exception;
// 
//     List<LoginUser> getUsers() throws Exception;
// 
//     void addUser(String username, String displayName, String password, String role) throws Exception;
// 
//     void changePassword(String username, String oldPassword, String password) throws Exception;
// 
//     void updateUser(String username, String displayName, String role) throws Exception;
// 
//     void deleteUser(String username) throws Exception;
// }


// Path: src/main/java/com/behase/relumin/controller/WebController.java
import com.behase.relumin.config.SchedulerConfig;
import com.behase.relumin.model.LoginUser;
import com.behase.relumin.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.core.Authentication;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

package com.behase.relumin.controller;


@Controller
public class WebController {
    @Autowired
    private UserService userService;

    @Value("${build.number}")
    private String buildNumber;

    @Value("${scheduler.collectStaticsInfoIntervalMillis:"
            + SchedulerConfig.DEFAULT_COLLECT_STATICS_INFO_INTERVAL_MILLIS + "}")
    private String collectStaticsInfoIntervalMillis;

    @Value("${auth.enabled}")
    private boolean authEnabled;

    @Value("${auth.allowAnonymous}")
    private boolean authAllowAnonymous;