You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cloudreve/static/js/admin/task.js

32 lines
921 B

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

$("#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();
}
})