mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-12 21:39:18 +00:00
Config (#3502)
* [Update] 修改config * [Update] 移动存储设置到到terminal中 * [Update] 修改permission 查看 * [Update] pre merge * [Update] 录像存储 * [Update] 命令存储 * [Update] 添加存储测试可连接性 * [Update] 修改 meta 值的 key 为大写 * [Update] 修改 Terminal 相关 Storage 配置 * [Update] 删除之前获取录像/命令存储的代码 * [Update] 修改导入失败 * [Update] 迁移文件添加default存储 * [Update] 删除之前代码,添加help_text信息 * [Update] 删除之前代码 * [Update] 删除之前代码 * [Update] 抽象命令/录像存储 APIView * [Update] 抽象命令/录像存储 APIView 1 * [Update] 抽象命令/录像存储 DictField * [Update] 抽象命令/录像存储列表页面 * [Update] 修复CustomDictField的bug * [Update] RemoteApp 页面添加 hidden * [Update] 用户页面添加用户关联授权 * [Update] 修改存储测试可连接性 target * [Update] 修改配置 * [Update] 修改存储前端 Form 渲染逻辑 * [Update] 修改存储细节 * [Update] 统一存储类型到 const 文件 * [Update] 修改迁移文件及Model,创建默认存储 * [Update] 修改迁移文件及Model初始化默认数据 * [Update] 修改迁移文件 * [Update] 修改迁移文件 * [Update] 修改迁移文件 * [Update] 修改迁移文件 * [Update] 修改迁移文件 * [Update] 修改迁移文件 * [Update] 修改迁移文件 * [Update] 限制删除默认存储配置,只允许创建扩展的存储类型 * [Update] 修改ip字段长度 * [Update] 修改ip字段长度 * [Update] 修改一些css * [Update] 修改关联 * [Update] 添加操作日志定时清理 * [Update] 修改记录syslog的instance encoder * [Update] 忽略登录产生的操作日志 * [Update] 限制更新存储时不覆盖原有AK SK 等字段 * [Update] 修改迁移文件添加comment字段 * [Update] 修改迁移文件 * [Update] 添加 comment 字段 * [Update] 修改默认存储no -> null * [Update] 修改细节 * [Update] 更新翻译(存储配置 * [Update] 修改定时任务注册,修改系统用户资产、节点关系api * [Update] 添加监控磁盘任务 * [Update] 修改session * [Update] 拆分serializer * [Update] 还原setting原来的manager
This commit is contained in:
@@ -413,7 +413,7 @@ $.fn.serializeObject = function () {
|
||||
};
|
||||
|
||||
function makeLabel(data) {
|
||||
return "<label class='detail-key'><b>" + data[0] + ": </b></label>" + data[1] + "</br>"
|
||||
return "<label class='detail-key'><b>" + data[0] + ": </b></label> " + data[1] + "</br>"
|
||||
}
|
||||
|
||||
function parseTableFilter(value) {
|
||||
@@ -600,6 +600,7 @@ jumpserver.initServerSideDataTable = function (options) {
|
||||
// op_html: 'div.btn-group?',
|
||||
// paging: true,
|
||||
// paging_numbers_length: 5;
|
||||
// hideDefaultDefs: false;
|
||||
// }
|
||||
var pagingNumbersLength = 5;
|
||||
if (options.paging_numbers_length){
|
||||
@@ -613,7 +614,8 @@ jumpserver.initServerSideDataTable = function (options) {
|
||||
orderable: false,
|
||||
width: "20px",
|
||||
createdCell: function (td, cellData) {
|
||||
$(td).html('<input type="checkbox" class="text-center ipt_check" id=99991937>'.replace('99991937', cellData));
|
||||
var data = '<input type="checkbox" class="text-center ipt_check" id=Id>'.replace('Id', cellData);
|
||||
$(td).html(data);
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -622,6 +624,9 @@ jumpserver.initServerSideDataTable = function (options) {
|
||||
render: $.fn.dataTable.render.text()
|
||||
}
|
||||
];
|
||||
if (options.hideDefaultDefs) {
|
||||
columnDefs = [];
|
||||
}
|
||||
var select_style = options.select_style || 'multi';
|
||||
columnDefs = options.columnDefs ? options.columnDefs.concat(columnDefs) : columnDefs;
|
||||
var select = {
|
||||
@@ -635,7 +640,7 @@ jumpserver.initServerSideDataTable = function (options) {
|
||||
pageLength: options.pageLength || 15,
|
||||
// dom: options.dom || '<"#uc.pull-left">fltr<"row m-t"<"col-md-8"<"#op.col-md-6"><"col-md-6 text-center"i>><"col-md-4"p>>',
|
||||
// dom: options.dom || '<"#uc.pull-left"><"pull-right"<"inline"l><"#fb.inline"><"inline"<"table-filter"f>><"#fa.inline">>tr<"row m-t"<"col-md-8"<"#op.col-md-6"><"col-md-6 text-center"i>><"col-md-4"p>>',
|
||||
dom: dom,
|
||||
dom: options.dom || dom,
|
||||
order: options.order || [],
|
||||
buttons: [],
|
||||
columnDefs: columnDefs,
|
||||
@@ -1241,10 +1246,28 @@ function readFile(ref) {
|
||||
return ref
|
||||
}
|
||||
|
||||
function nodesSelect2Init(selector, url) {
|
||||
if (!url) {
|
||||
url = '/api/v1/assets/nodes/'
|
||||
|
||||
|
||||
function select2AjaxInit(option) {
|
||||
/*
|
||||
{
|
||||
selector:
|
||||
url: ,
|
||||
disabledData: ,
|
||||
displayFormat,
|
||||
idFormat,
|
||||
}
|
||||
*/
|
||||
var selector = option.selector;
|
||||
var url = option.url;
|
||||
var disabledData = option.disabledData;
|
||||
var displayFormat = option.displayFormat || function (data) {
|
||||
return data.name;
|
||||
};
|
||||
var idFormat = option.idFormat || function (data) {
|
||||
return data.id;
|
||||
};
|
||||
|
||||
return $(selector).select2({
|
||||
closeOnSelect: false,
|
||||
ajax: {
|
||||
@@ -1260,43 +1283,53 @@ function nodesSelect2Init(selector, url) {
|
||||
},
|
||||
processResults: function (data) {
|
||||
var results = $.map(data.results, function (v, i) {
|
||||
return {id: v.id, text: v.full_value}
|
||||
var display = displayFormat(v);
|
||||
var id = idFormat(v);
|
||||
var d = {id: id, text: display};
|
||||
if (disabledData && disabledData.indexOf(v.id) !== -1) {
|
||||
d.disabled = true;
|
||||
}
|
||||
return d;
|
||||
});
|
||||
var more = !!data.next;
|
||||
return {results: results, pagination: {"more": more}}
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
function usersSelect2Init(selector, url) {
|
||||
function usersSelect2Init(selector, url, disabledData) {
|
||||
if (!url) {
|
||||
url = '/api/v1/users/users/'
|
||||
}
|
||||
return $(selector).select2({
|
||||
closeOnSelect: false,
|
||||
ajax: {
|
||||
url: url,
|
||||
data: function (params) {
|
||||
var page = params.page || 1;
|
||||
var query = {
|
||||
search: params.term,
|
||||
offset: (page - 1) * 10,
|
||||
limit: 10
|
||||
};
|
||||
return query
|
||||
},
|
||||
processResults: function (data) {
|
||||
var results = $.map(data.results, function (v, i) {
|
||||
var display = v.name + '(' + v.username +')';
|
||||
return {id: v.id, text: display}
|
||||
});
|
||||
var more = !!data.next;
|
||||
return {results: results, pagination: {"more": more}}
|
||||
}
|
||||
},
|
||||
})
|
||||
function displayFormat(v) {
|
||||
return v.name + '(' + v.username +')';
|
||||
}
|
||||
var option = {
|
||||
url: url,
|
||||
selector: selector,
|
||||
disabledData: disabledData,
|
||||
displayFormat: displayFormat
|
||||
};
|
||||
return select2AjaxInit(option)
|
||||
}
|
||||
|
||||
|
||||
function nodesSelect2Init(selector, url, disabledData) {
|
||||
if (!url) {
|
||||
url = '/api/v1/assets/nodes/'
|
||||
}
|
||||
function displayFormat(v) {
|
||||
return v.full_value;
|
||||
}
|
||||
var option = {
|
||||
url: url,
|
||||
selector: selector,
|
||||
disabledData: disabledData,
|
||||
displayFormat: displayFormat
|
||||
};
|
||||
return select2AjaxInit(option)
|
||||
}
|
||||
|
||||
function showCeleryTaskLog(taskId) {
|
||||
@@ -1324,7 +1357,7 @@ function initDateRangePicker(selector, options) {
|
||||
timePicker24Hour: true,
|
||||
autoApply: true,
|
||||
};
|
||||
var userLang = navigator.language || navigator.userLanguage;;
|
||||
var userLang = navigator.language || navigator.userLanguage;
|
||||
if (userLang.indexOf('zh') !== -1) {
|
||||
defaultOption.locale = zhLocale;
|
||||
}
|
||||
|
2
apps/static/js/plugins/select2/i18n/zh-CN.js
vendored
Normal file
2
apps/static/js/plugins/select2/i18n/zh-CN.js
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
/*! Select2 4.0.12 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
||||
!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/zh-CN",[],function(){return{errorLoading:function(){return"无法载入结果。"},inputTooLong:function(n){return"请删除"+(n.input.length-n.maximum)+"个字符"},inputTooShort:function(n){return"请再输入至少"+(n.minimum-n.input.length)+"个字符"},loadingMore:function(){return"载入更多结果…"},maximumSelected:function(n){return"最多只能选择"+n.maximum+"个项目"},noResults:function(){return"未找到结果"},searching:function(){return"搜索中…"},removeAllItems:function(){return"删除所有项目"}}}),n.define,n.require}();
|
Reference in New Issue
Block a user