Files
Cloudreve/static/js/admin/task.js
T
2018-10-20 15:25:35 +08:00

32 lines
921 B
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
$("#saveTask").click(function() {
$("#saveTask").attr("disabled", "true");
$.post("/Admin/SaveTaskOption",
$("#taskOptions").serialize()
, function(data) {
if (data.error == "1") {
toastr["warning"](data.msg);
$("#saveTask").removeAttr("disabled");
} else if (data.error == "200") {
toastr["success"]("设置已保存");
$("#saveTask").removeAttr("disabled");
}else{
toastr["warning"]("未知错误");
$("#saveTask").removeAttr("disabled");
}
});
})
$("#generateToken").click(function(){
len = 64;
  var $chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678';
var maxPos = $chars.length;
  var pwd = '';
  for (i = 0; i < len; i++) {
    pwd += $chars.charAt(Math.floor(Math.random() * maxPos));
  }
  $("#task_queue_token").val(pwd);
})
$(document).ready(function(){
if(document.location.href.indexOf("page")!=-1){
$("[href='#list']").click();
}
})