[RocketMQ Console] 404 Error Page Process

This commit is contained in:
walking98
2019-04-19 17:23:00 +08:00
parent 5c61fabf75
commit e5a1259a67
6 changed files with 36 additions and 6 deletions

View File

@@ -23,7 +23,12 @@ import org.apache.rocketmq.common.MixAll;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.web.servlet.ErrorPage;
import org.springframework.boot.web.servlet.ErrorPageRegistrar;
import org.springframework.boot.web.servlet.ErrorPageRegistry;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpStatus;
import static org.apache.rocketmq.client.ClientConfig.SEND_MESSAGE_WITH_VIP_CHANNEL_PROPERTY;
@@ -105,4 +110,19 @@ public class RMQConfigure {
public void setLoginRequired(boolean loginRequired) {
this.loginRequired = loginRequired;
}
// Error Page process logic, move to a central configure later
@Bean
public ErrorPageRegistrar errorPageRegistrar() {
return new MyErrorPageRegistrar();
}
private static class MyErrorPageRegistrar implements ErrorPageRegistrar {
@Override
public void registerErrorPages(ErrorPageRegistry registry) {
registry.addErrorPages(new ErrorPage(HttpStatus.NOT_FOUND, "/404"));
}
}
}

View File

@@ -14,7 +14,7 @@ spring.http.encoding.enabled=true
spring.http.encoding.force=true
logging.config=classpath:logback.xml
#if this value is empty,use env value rocketmq.config.namesrvAddr NAMESRV_ADDR | now, you can set it in ops page.default localhost:9876
rocketmq.config.namesrvAddr=11.239.187.178:9876
rocketmq.config.namesrvAddr=
#if you use rocketmq version < 3.5.8, rocketmq.config.isVIPChannel should be false.default true
rocketmq.config.isVIPChannel=
#rocketmq-console's data path:dashboard/monitor

View File

@@ -207,8 +207,8 @@ app.config(['$routeProvider', '$httpProvider','$cookiesProvider','getDictNamePro
templateUrl: 'view/pages/ops.html',
controller:'opsController'
}).when('/404', {
templateUrl: '404'
}).otherwise('/login');
templateUrl: 'view/pages/404.html'
}).otherwise('/404');
$translateProvider.translations('en',en);
$translateProvider.translations('zh',zh);

View File

@@ -1,5 +1,5 @@
var en = {
"TITLE": "RocketMq-Console-Ng",
"TITLE": "RocketMQ-Console",
"CLOSE": "Close",
"NO": "NO.",
"ADDRESS": "Address",

View File

@@ -1,5 +1,5 @@
var zh = {
"TITLE": "RocketMq控制台",
"TITLE": "RocketMQ控制台",
"CLOSE": "关闭",
"NO": "编号",
"ADDRESS": "地址",

File diff suppressed because one or more lines are too long