complete full functions;

add some translations;
This commit is contained in:
2023-09-25 18:33:10 +08:00
parent 4e93c2b92b
commit 7310e1117c
13 changed files with 532 additions and 406 deletions

View File

@@ -0,0 +1,36 @@
var loadClientInfo = (function ($) {
var i18n = {};
/**
* get client info
* @param lang {Map<string,string>} language json
* @param title {string} page title
*/
function loadClientInfo(lang, title) {
i18n = lang;
$("#title").text(title);
$('#content').empty();
var loading = layui.layer.load();
$.getJSON('/proxy/api/config', {
type: 'none'
}).done(function (result) {
if (result.success) {
renderCommonInfo(result.data);
} else {
layui.layer.msg(result.message);
}
}).always(function () {
layui.layer.close(loading);
});
}
function renderCommonInfo(data) {
data.tcp_mux = i18n[data.tcp_mux];
data.tls_enable = i18n[data.tls_enable];
var html = layui.laytpl($('#clientInfoTemplate').html()).render(data);
$('#content').html(html);
}
return loadClientInfo;
})(layui.$);