diff --git a/src/main/java/org/apache/rocketmq/console/config/RMQConfigure.java b/src/main/java/org/apache/rocketmq/console/config/RMQConfigure.java index 516cf1f..1bcb861 100644 --- a/src/main/java/org/apache/rocketmq/console/config/RMQConfigure.java +++ b/src/main/java/org/apache/rocketmq/console/config/RMQConfigure.java @@ -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")); + } + + } } diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index d75f709..c34688e 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -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 diff --git a/src/main/resources/static/src/app.js b/src/main/resources/static/src/app.js index 5843afc..ce837fc 100644 --- a/src/main/resources/static/src/app.js +++ b/src/main/resources/static/src/app.js @@ -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); diff --git a/src/main/resources/static/src/i18n/en.js b/src/main/resources/static/src/i18n/en.js index 582596d..41917c3 100644 --- a/src/main/resources/static/src/i18n/en.js +++ b/src/main/resources/static/src/i18n/en.js @@ -1,5 +1,5 @@ var en = { - "TITLE": "RocketMq-Console-Ng", + "TITLE": "RocketMQ-Console", "CLOSE": "Close", "NO": "NO.", "ADDRESS": "Address", diff --git a/src/main/resources/static/src/i18n/zh.js b/src/main/resources/static/src/i18n/zh.js index 2996b52..550d849 100644 --- a/src/main/resources/static/src/i18n/zh.js +++ b/src/main/resources/static/src/i18n/zh.js @@ -1,5 +1,5 @@ var zh = { - "TITLE": "RocketMq控制台", + "TITLE": "RocketMQ控制台", "CLOSE": "关闭", "NO": "编号", "ADDRESS": "地址", diff --git a/src/main/resources/static/view/pages/404.html b/src/main/resources/static/view/pages/404.html index 50c29ba..e42364a 100644 --- a/src/main/resources/static/view/pages/404.html +++ b/src/main/resources/static/view/pages/404.html @@ -13,4 +13,14 @@ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~ See the License for the specific language governing permissions and ~ limitations under the License. - --> \ No newline at end of file + --> +
+
+
+
+
+ 404 “This is not the web page you are looking for” + +
+
+
\ No newline at end of file