添加了部分cron的list页面

This commit is contained in:
yumaojun03
2016-12-14 09:54:16 +08:00
parent a0c9e3d117
commit b348f7f1ce
4 changed files with 60 additions and 37 deletions

View File

@@ -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;
}