Web 面板languages.xml使用 NPS 版本号作为缓存标识
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
- NPC 安装到系统服务失败 BUG [#338](https://github.com/yisier/nps/issues/338)
|
||||
- 隧道实际未运行但面板提示「启动成功」、运行状态始终为关闭的问题 [#339](https://github.com/yisier/nps/issues/339)
|
||||
- 配置 `allow_ports` 后随机生成端口问题 [#339](https://github.com/yisier/nps/issues/339)
|
||||
- Web 面板`languages.xml`使用 NPS 版本号作为缓存标识 [#342](https://github.com/yisier/nps/issues/342)
|
||||
- 新增:
|
||||
- 客户端、隧道、域名解析修改接口支持修改流量数据 [#341](https://github.com/yisier/nps/issues/341)
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ import (
|
||||
|
||||
"ehang.io/nps/lib/common"
|
||||
"ehang.io/nps/lib/file"
|
||||
"ehang.io/nps/lib/version"
|
||||
"ehang.io/nps/server"
|
||||
"github.com/astaxie/beego"
|
||||
)
|
||||
@@ -41,6 +42,7 @@ func (self *LoginController) Index() {
|
||||
self.Data["web_base_url"] = webBaseUrl
|
||||
self.Data["register_allow"], _ = beego.AppConfig.Bool("allow_user_register")
|
||||
self.Data["captcha_open"], _ = beego.AppConfig.Bool("open_captcha")
|
||||
self.Data["version"] = version.VERSION
|
||||
self.TplName = "login/index.html"
|
||||
}
|
||||
|
||||
@@ -125,6 +127,7 @@ func (self *LoginController) doLogin(username, password string, explicit bool) b
|
||||
func (self *LoginController) Register() {
|
||||
if self.Ctx.Request.Method == "GET" {
|
||||
self.Data["web_base_url"] = beego.AppConfig.String("web_base_url")
|
||||
self.Data["version"] = version.VERSION
|
||||
self.TplName = "login/register.html"
|
||||
} else {
|
||||
if b, err := beego.AppConfig.Bool("allow_user_register"); err != nil || !b {
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
$.fn.cloudLang = function () {
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: window.nps.web_base_url + '/static/page/languages.xml?v=202512051',
|
||||
url: window.nps.web_base_url + '/static/page/languages.xml?v=' + window.nps.version,
|
||||
dataType: 'xml',
|
||||
success: function (xml) {
|
||||
languages['content'] = xml2json($(xml).children())['content'];
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
window.nps = {"web_base_url": {{.web_base_url}} }
|
||||
window.nps = {"web_base_url": {{.web_base_url}}, "version": "{{.version}}" }
|
||||
|
||||
// Login Page Flipbox control
|
||||
function login() {
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
<div><strong langtag="word-copyright"></strong> <span langtag="application"></span> © 2018-2019</div>
|
||||
</div>
|
||||
<script>
|
||||
window.nps = { "web_base_url": {{.web_base_url}} }
|
||||
window.nps = { "web_base_url": {{.web_base_url}}, "version": "{{.version}}" }
|
||||
function register() {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
|
||||
@@ -155,7 +155,7 @@
|
||||
</html>
|
||||
|
||||
<script>
|
||||
window.nps = { "web_base_url": {{.web_base_url}} }
|
||||
window.nps = { "web_base_url": {{.web_base_url}}, "version": "{{.version}}" }
|
||||
/* googleTranslateElementInit()
|
||||
|
||||
function googleTranslateElementInit() {
|
||||
|
||||
Reference in New Issue
Block a user