mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-13 13:59:17 +00:00
添加了部分cron的list页面
This commit is contained in:
@@ -333,3 +333,35 @@ jumpserver.initDataTable = function (options) {
|
||||
|
||||
return table;
|
||||
};
|
||||
|
||||
/**
|
||||
* 替换所有匹配exp的字符串为指定字符串
|
||||
* @param exp 被替换部分的正则
|
||||
* @param newStr 替换成的字符串
|
||||
*/
|
||||
String.prototype.replaceAll = function (exp, newStr) {
|
||||
return this.replace(new RegExp(exp, "gm"), newStr);
|
||||
};
|
||||
|
||||
/**
|
||||
* 原型:字符串格式化
|
||||
* @param args 格式化参数值
|
||||
*/
|
||||
String.prototype.format = function(args) {
|
||||
var result = this;
|
||||
if (arguments.length < 1) {
|
||||
return result;
|
||||
}
|
||||
|
||||
var data = arguments;
|
||||
if (arguments.length == 1 && typeof (args) == "object") {
|
||||
data = args;
|
||||
}
|
||||
for ( var key in data) {
|
||||
var value = data[key];
|
||||
if (undefined != value) {
|
||||
result = result.replaceAll("\\{" + key + "\\}", value);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
Reference in New Issue
Block a user