[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.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.boot.context.properties.ConfigurationProperties; 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.context.annotation.Configuration;
import org.springframework.http.HttpStatus;
import static org.apache.rocketmq.client.ClientConfig.SEND_MESSAGE_WITH_VIP_CHANNEL_PROPERTY; 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) { public void setLoginRequired(boolean loginRequired) {
this.loginRequired = 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 spring.http.encoding.force=true
logging.config=classpath:logback.xml 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 #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 #if you use rocketmq version < 3.5.8, rocketmq.config.isVIPChannel should be false.default true
rocketmq.config.isVIPChannel= rocketmq.config.isVIPChannel=
#rocketmq-console's data path:dashboard/monitor #rocketmq-console's data path:dashboard/monitor

View File

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

View File

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

View File

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

File diff suppressed because one or more lines are too long