This commit is contained in:
parent
a275356c10
commit
889a78a82b
@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
import request from '../utils/request';
|
||||
import { GET_STATE, LOGINPAGE_ENABLED, GET_NOTICE, SERVER_GUIDE } from '../constants';
|
||||
import { GET_STATE, LOGINPAGE_ENABLED, GET_NOTICE, SERVER_GUIDE, LANGUAGE_KEY } from '../constants';
|
||||
|
||||
const initialState = {
|
||||
version: null,
|
||||
@ -78,7 +78,7 @@ const getState = () => dispatch =>
|
||||
|
||||
const getNotice = () => dispatch =>
|
||||
request
|
||||
.get('v1/console/server/announcement')
|
||||
.get('v1/console/server/announcement?language=' + localStorage.getItem(LANGUAGE_KEY))
|
||||
.then(res => {
|
||||
dispatch({
|
||||
type: GET_NOTICE,
|
||||
|
@ -27,6 +27,7 @@ import com.alibaba.nacos.sys.utils.DiskUtils;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.io.File;
|
||||
@ -62,8 +63,10 @@ public class ServerStateController {
|
||||
}
|
||||
|
||||
@GetMapping("/announcement")
|
||||
public RestResult<String> getAnnouncement() {
|
||||
File announcementFile = new File(EnvUtil.getConfPath(), ANNOUNCEMENT_FILE);
|
||||
public RestResult<String> getAnnouncement(
|
||||
@RequestParam(required = false, name = "language", defaultValue = "zh-CN") String language) {
|
||||
String file = ANNOUNCEMENT_FILE.substring(0, ANNOUNCEMENT_FILE.length() - 5) + "_" + language + ".conf";
|
||||
File announcementFile = new File(EnvUtil.getConfPath(), file);
|
||||
String announcement = null;
|
||||
if (announcementFile.exists() && announcementFile.isFile()) {
|
||||
announcement = DiskUtils.readFile(announcementFile);
|
||||
|
@ -35,7 +35,7 @@
|
||||
<link rel="stylesheet" type="text/css" href="console-ui/public/css/icon.css">
|
||||
<link rel="stylesheet" type="text/css" href="console-ui/public/css/font-awesome.css">
|
||||
<!-- 第三方css结束 -->
|
||||
<link href="./css/main.css?95cd0f64829dcbfb990e" rel="stylesheet"></head>
|
||||
<link href="./css/main.css?8aafb58c7f29949ac658" rel="stylesheet"></head>
|
||||
|
||||
<body>
|
||||
<div id="root" style="overflow:hidden"></div>
|
||||
@ -56,6 +56,6 @@
|
||||
<script src="console-ui/public/js/merge.js"></script>
|
||||
<script src="console-ui/public/js/loader.js"></script>
|
||||
<!-- 第三方js结束 -->
|
||||
<script type="text/javascript" src="./js/main.js?95cd0f64829dcbfb990e"></script></body>
|
||||
<script type="text/javascript" src="./js/main.js?8aafb58c7f29949ac658"></script></body>
|
||||
|
||||
</html>
|
||||
|
File diff suppressed because one or more lines are too long
1
distribution/conf/announcement_en-US.conf
Normal file
1
distribution/conf/announcement_en-US.conf
Normal file
@ -0,0 +1 @@
|
||||
Authentication has not been enabled in cluster, please refer to <a href="https://nacos.io/en-us/docs/v2/guide/user/auth.html">Documentation</a> to enable~
|
2
pom.xml
2
pom.xml
@ -348,7 +348,7 @@
|
||||
<exclude>**/any.proto</exclude>
|
||||
<exclude>src/main/java/com/alibaba/nacos/common/packagescan/classreading/**</exclude>
|
||||
<exclude>.flattened-pom.xml</exclude>
|
||||
<exclude>**/announcement.conf</exclude>
|
||||
<exclude>**/announcement*.conf</exclude>
|
||||
<exclude>**/console-guide.conf</exclude>
|
||||
<exclude>**/reflect-config.json</exclude>
|
||||
<exclude>**/resource-config.json</exclude>
|
||||
|
Loading…
Reference in New Issue
Block a user