mirror of https://github.com/ouqiang/gocron
删除未使用的JS库
parent
b7aab3abb3
commit
91f33515f6
|
@ -14,7 +14,6 @@ import (
|
|||
"os/exec"
|
||||
"syscall"
|
||||
"github.com/ouqiang/cron-scheduler/modules/logger"
|
||||
"github.com/ouqiang/cron-scheduler/modules/crontask"
|
||||
)
|
||||
|
||||
// 1号进程id
|
||||
|
@ -123,8 +122,6 @@ func catchSignal() {
|
|||
logger.Info("收到信号 -- ", s)
|
||||
switch s {
|
||||
case syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM:
|
||||
// 删除所有任务
|
||||
crontask.DefaultCronTask.DeleteAll()
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,8 +17,8 @@ type Host struct {
|
|||
type LoginType int8
|
||||
|
||||
const (
|
||||
PublicKey = 1
|
||||
UserPassword = 2
|
||||
PublicKey = iota + 1 // 公钥认证
|
||||
UserPassword // 用户名密码认证
|
||||
)
|
||||
|
||||
// 新增
|
||||
|
|
|
@ -9,21 +9,21 @@ type Protocol int8
|
|||
type TaskType int8
|
||||
|
||||
const (
|
||||
HTTP Protocol = 1
|
||||
SSHCommand Protocol = 2
|
||||
SSHScript Protocol = 3
|
||||
HTTP Protocol = iota + 1 // HTTP协议
|
||||
SSHCommand // SSHM命令
|
||||
SSHScript
|
||||
)
|
||||
|
||||
const (
|
||||
Timing TaskType = 1
|
||||
Delay TaskType = 2
|
||||
Timing TaskType = iota + 1 // 定时任务
|
||||
Delay // 延时任务
|
||||
)
|
||||
|
||||
// 任务
|
||||
type Task struct {
|
||||
Id int `xorm:"int pk autoincr"`
|
||||
Name string `xorm:"varchar(64) notnull"` // 任务名称
|
||||
Spec string `xorm:"varchar(64) notnull"` // crontab 时间格式
|
||||
Spec string `xorm:"varchar(64) notnull"` // crontab
|
||||
Protocol Protocol `xorm:"tinyint notnull"` // 协议 1:http 2:ssh-command 3:ssh-script
|
||||
Type TaskType `xorm:"tinyint notnull default 1"` // 任务类型 1: 定时任务 2: 延时任务
|
||||
Command string `xorm:"varchar(512) notnull"` // URL地址或shell命令
|
||||
|
|
|
@ -7,7 +7,14 @@ import (
|
|||
// 任务执行日志
|
||||
type TaskLog struct {
|
||||
Id int `xorm:"int pk autoincr"`
|
||||
TaskId int `xorm:"int not null"` // 任务ID
|
||||
Name string `xorm:"varchar(64) notnull"` // 任务名称
|
||||
Spec string `xorm:"varchar(64) notnull"` // crontab
|
||||
Protocol Protocol `xorm:"tinyint notnull"` // 协议 1:http 2:ssh-command 3:ssh-script
|
||||
Type TaskType `xorm:"tinyint notnull default 1"` // 任务类型 1: 定时任务 2: 延时任务
|
||||
Command string `xorm:"varchar(512) notnull"` // URL地址或shell命令
|
||||
Timeout int `xorm:"mediumint notnull default 0"` // 任务执行超时时间(单位秒),0不限制
|
||||
Delay int `xorm:"int notnull default 0"` // 延时任务,延时时间(单位秒)
|
||||
SshHosts string `xorm:"varchar(1024) notnull defalut '' "` // SSH主机名,逗号分隔
|
||||
StartTime time.Time `xorm:"datetime created"` // 开始执行时间
|
||||
EndTime time.Time `xorm:"datetime updated"` // 执行完成(失败)时间
|
||||
Status Status `xorm:"tinyint notnull default 1"` // 状态 1:执行中 2:执行完毕 0:执行失败
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,36 +0,0 @@
|
|||
/**
|
||||
* Created by ouqiang on 2017/4/1.
|
||||
*/
|
||||
|
||||
function Util() {
|
||||
var util = {}
|
||||
util.post = function(url, params, callback) {
|
||||
// 用户认证失败
|
||||
var AUTH_ERROR = -1;
|
||||
var FAILURE = 1;
|
||||
var SUCCESS = 0;
|
||||
$.post(
|
||||
url,
|
||||
params,
|
||||
function(response) {
|
||||
if (!response) {
|
||||
|
||||
}
|
||||
if (response.code === undefined) {
|
||||
|
||||
}
|
||||
if (response.code == AUTH_ERROR) {
|
||||
location.href = '/login';
|
||||
return;
|
||||
}
|
||||
if (response.code == FAILURE) {
|
||||
return;
|
||||
}
|
||||
callback(response.code, response.message, response.data);
|
||||
},
|
||||
'json'
|
||||
)
|
||||
};
|
||||
|
||||
return util;
|
||||
}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,12 @@
|
|||
package host
|
||||
|
||||
import "gopkg.in/macaron.v1"
|
||||
|
||||
func Create(ctx *macaron.Context) {
|
||||
ctx.Data["Title"] = "主机管理"
|
||||
ctx.HTML(200, "host/create")
|
||||
}
|
||||
|
||||
func Store(ctx *macaron.Context) {
|
||||
|
||||
}
|
|
@ -8,6 +8,7 @@ import (
|
|||
"gopkg.in/macaron.v1"
|
||||
"strconv"
|
||||
"github.com/ouqiang/cron-scheduler/modules/logger"
|
||||
"github.com/go-macaron/binding"
|
||||
)
|
||||
|
||||
// 系统安装
|
||||
|
@ -15,7 +16,7 @@ import (
|
|||
type InstallForm struct {
|
||||
DbType string `binding:"IN(mysql)"`
|
||||
DbHost string `binding:"Required"`
|
||||
DbPort int `binding:"Required;Range(1-65535)"` // todo 限制端口范围1-65535, 为什么规则未生效?
|
||||
DbPort int `binding:"Required;Range(1,65535)"`
|
||||
DbUsername string `binding:"Required"`
|
||||
DbPassword string `binding:"Required"`
|
||||
DbName string `binding:"Required"`
|
||||
|
@ -25,18 +26,21 @@ type InstallForm struct {
|
|||
AdminEmail string `binding:"Email"`
|
||||
}
|
||||
|
||||
// 显示安装页面
|
||||
func Show(ctx *macaron.Context) {
|
||||
func(f InstallForm) Error(ctx *macaron.Context, errs binding.Errors) {
|
||||
logger.Error(errs)
|
||||
}
|
||||
|
||||
func Create(ctx *macaron.Context) {
|
||||
if app.Installed {
|
||||
ctx.Redirect("/")
|
||||
}
|
||||
ctx.Data["Title"] = "安装"
|
||||
ctx.Data["DisableNav"] = true
|
||||
ctx.HTML(200, "install/show")
|
||||
ctx.HTML(200, "install/create")
|
||||
}
|
||||
|
||||
// 安装,
|
||||
func Install(ctx *macaron.Context, form InstallForm) string {
|
||||
// 安装
|
||||
func Store(ctx *macaron.Context, form InstallForm) string {
|
||||
json := utils.Json{}
|
||||
if app.Installed {
|
||||
logger.Warn("系统重复安装")
|
||||
|
|
|
@ -4,6 +4,8 @@ import (
|
|||
"github.com/go-macaron/binding"
|
||||
"github.com/ouqiang/cron-scheduler/routers/install"
|
||||
"gopkg.in/macaron.v1"
|
||||
"github.com/ouqiang/cron-scheduler/routers/task"
|
||||
"github.com/ouqiang/cron-scheduler/routers/host"
|
||||
)
|
||||
|
||||
// 路由注册
|
||||
|
@ -24,7 +26,34 @@ func Register(m *macaron.Macaron) {
|
|||
})
|
||||
// 系统安装
|
||||
m.Group("/install", func() {
|
||||
m.Get("", install.Show)
|
||||
m.Post("", binding.Bind(install.InstallForm{}), install.Install)
|
||||
m.Get("", install.Create)
|
||||
m.Post("/store", binding.Bind(install.InstallForm{}), install.Store)
|
||||
})
|
||||
|
||||
// 用户
|
||||
m.Group("/user", func() {
|
||||
|
||||
})
|
||||
|
||||
// 任务
|
||||
m.Group("/task", func() {
|
||||
m.Get("/create", task.Create)
|
||||
m.Post("/store", task.Store)
|
||||
})
|
||||
|
||||
// 主机
|
||||
m.Group("/host", func() {
|
||||
m.Get("/create", host.Create)
|
||||
m.Get("/store", host.Store)
|
||||
})
|
||||
|
||||
// 任务日志
|
||||
m.Group("/tasklog/", func() {
|
||||
|
||||
})
|
||||
|
||||
// API接口
|
||||
m.Group("/api/v1", func() {
|
||||
|
||||
})
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
package task
|
||||
|
||||
import "gopkg.in/macaron.v1"
|
||||
|
||||
func Create(ctx *macaron.Context) {
|
||||
ctx.Data["Title"] = "任务管理"
|
||||
ctx.HTML(200, "task/create")
|
||||
}
|
||||
|
||||
func Store(ctx *macaron.Context) {
|
||||
|
||||
}
|
|
@ -1,3 +1,30 @@
|
|||
|
||||
</div>
|
||||
</div>
|
||||
<footer>
|
||||
<div id="copyrights">
|
||||
<div class="inset">
|
||||
<div class="bigcontainer">
|
||||
<div class="fl">
|
||||
<p>© 2017 cron-scheduler
|
||||
<i class="Github Alternate icon"></i><a href="https://github.com/ouqiang/cron-scheduler" target="_blank">
|
||||
GitHub
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
<script type="text/javascript" src="/resource/javascript/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="/resource/javascript/framework.js"></script>
|
||||
<script>
|
||||
$(
|
||||
function(){
|
||||
$('.ui.dropdown').dropdown();
|
||||
$('select.dropdown').dropdown();
|
||||
}
|
||||
);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,24 +1,52 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="renderer" content="webkit">
|
||||
<title>{{{.Title}}}</title>
|
||||
<link rel="stylesheet" href="/plugins/semantic-ui/semantic.min.css">
|
||||
<script type="text/javascript" src="/js/jquery-3.1.1.min.js"></script>
|
||||
<script type="text/javascript" src="/js/vue.min.js"></script>
|
||||
<script type="text/javascript" src="/js/main.js"></script>
|
||||
<script type="text/javascript" src="/plugins/semantic-ui/semantic.min.js"></script>
|
||||
<link type="text/css" rel="stylesheet" href="/resource/css/framework.css" />
|
||||
<link type="text/css" rel="stylesheet" href="/resource/css/main.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="ui container" style="padding:30px;">
|
||||
{{{/* 控制导航栏是否显示 */}}}
|
||||
{{{if not .DisableNav}}}
|
||||
<div class="ui menu">
|
||||
<a class="item">主页</a>
|
||||
<a class="item">Submit</a>
|
||||
<div class="right menu">
|
||||
<a class="item">注册/登录</a>
|
||||
<a class="item">帮助</a>
|
||||
<div class="page">
|
||||
<!--header begin-->
|
||||
<header>
|
||||
<div class="bigcontainer">
|
||||
<div id="logo">
|
||||
定时任务管理平台
|
||||
</div>
|
||||
<div class="user">
|
||||
<div class="ui inline labeled icon top right pointing dropdown">
|
||||
{{{if not .Logined}}}
|
||||
<img class="ui avatar image" src="/resource/images/gopher-avatar.png">
|
||||
你好
|
||||
<i class="dropdown icon"></i>
|
||||
<div class="menu">
|
||||
<a class="item" href="/user/logout"><i class="sign in icon"></i>登录</a>
|
||||
</div>
|
||||
{{{else}}}
|
||||
<img class="ui avatar image" src="/resource/images/gopher-avatar.png">
|
||||
你好,{{{.Username}}}
|
||||
<i class="dropdown icon"></i>
|
||||
<div class="menu">
|
||||
<a class="item" href="/"><i class="reply mail icon"></i>返回首页</a>
|
||||
<a class="item" href="/user/logout"><i class="sign out icon"></i>注销登录</a>
|
||||
</div>
|
||||
{{{end}}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<!-- the main menu-->
|
||||
<div class="ui teal inverted menu">
|
||||
<div class="bigcontainer">
|
||||
<div class="right menu">
|
||||
<a class="item" href="/"><i class="home icon"></i>首页</a>
|
||||
<a class="item" href="/task"><i class="tasks icon"></i>任务</a>
|
||||
<a class="item" href="/host"><i class="linux icon"></i>主机</a>
|
||||
<a class="active item" href="/user"><i class="user icon"></i>账户</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{{end}}}
|
||||
<div class="container">
|
||||
|
|
|
@ -0,0 +1,78 @@
|
|||
{{{ template "common/header" . }}}
|
||||
|
||||
<div class="ui grid">
|
||||
<!--the vertical menu-->
|
||||
{{{ template "host/menu" . }}}
|
||||
|
||||
<div class="twelve wide column">
|
||||
<form class="ui form fluid vertical segment">
|
||||
<div class="two fields">
|
||||
<div class="field">
|
||||
<label>主机名 (域名或IP)</label>
|
||||
<div class="ui small left icon input">
|
||||
<input type="text" placeholder="127.0.0.1" name="name">
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>主机别名 (方便记忆和引用)</label>
|
||||
<div class="ui small left icon input">
|
||||
<input type="text" placeholder="db" name="alias">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="two fields">
|
||||
<div class="field">
|
||||
<label>SSH用户名</label>
|
||||
<div class="ui small left icon input">
|
||||
<input type="text" placeholder="root" name="username">
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>SSH密码</label>
|
||||
<div class="ui small left icon input">
|
||||
<input type="text" placeholder="123456" name="password">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="two fields">
|
||||
<div class="field">
|
||||
<label>SSH端口</label>
|
||||
<div class="ui small left icon input">
|
||||
<input type="text" placeholder="22" name="port" value="22">
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>认证方式 (建议使用公钥认证)</label>
|
||||
<div class="ui dropdown selection">
|
||||
<input type="hidden" name="login_type" value="1">
|
||||
<div class="default text">公钥</div>
|
||||
<i class="dropdown icon"></i>
|
||||
<div class="menu">
|
||||
<div class="item active" data-value="1">公钥</div>
|
||||
<div class="item" data-value="2">用户名密码</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="two fields">
|
||||
<div class="field">
|
||||
<label>备注</label>
|
||||
<div class="ui small left icon input">
|
||||
<textarea rows="5" name="remark" placeholder="数据库服务器"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ui primary submit button">提交</div>
|
||||
</form>
|
||||
</div>
|
||||
<!--the newDevice form-->
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
</script>
|
||||
|
||||
{{{ template "common/footer" . }}}
|
|
@ -0,0 +1,12 @@
|
|||
<div class="four wide column">
|
||||
<div class="verticalMenu">
|
||||
<div class="ui vertical pointing menu fluid">
|
||||
<a class="active teal item" href="/host">
|
||||
<i class="linux icon"></i> 主机列表
|
||||
</a>
|
||||
<a class="item" href="/host/create">
|
||||
<i class="plus icon"></i> 添加主机
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -1,54 +1,67 @@
|
|||
{{{ template "common/header" . }}}
|
||||
|
||||
<h1 class="ui header center aligned">安装</h1>
|
||||
<div class="ui grid">
|
||||
{{{ template "install/menu" . }}}
|
||||
<div class="twelve wide column">
|
||||
<form class="ui form">
|
||||
<div class="ui grey inverted segment center aligned">数据库配置</div>
|
||||
<div class="field">
|
||||
<label>数据库(目前只支持MySQL)</label>
|
||||
<select class="ui search dropdown" name="db_type">
|
||||
<option value="mysql">MySQL</option>
|
||||
</select>
|
||||
<div class="three fields">
|
||||
<div class="field">
|
||||
<label>数据库(目前只支持MySQL)</label>
|
||||
<select class="ui search dropdown" name="db_type">
|
||||
<option value="mysql">MySQL</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>主机名</label>
|
||||
<input type="text" name="db_host" value="127.0.0.1">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>端口</label>
|
||||
<input type="text" name="db_port" value="3306">
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>主机名</label>
|
||||
<input type="text" placeholder="主机名" name="db_host" value="127.0.0.1">
|
||||
<div class="two fields">
|
||||
<div class="field">
|
||||
<label>用户名</label>
|
||||
<input type="text" name="db_username">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>密码</label>
|
||||
<input type="text" name="db_password">
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>端口</label>
|
||||
<input type="text" placeholder="端口" name="db_port" value="3306">
|
||||
<div class="two fields">
|
||||
<div class="field">
|
||||
<label>数据库名称</label>
|
||||
<input type="text" name="db_name">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>表前缀</label>
|
||||
<input type="text" name="db_table_prefix" value="cron_">
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>用户名</label>
|
||||
<input type="text" placeholder="用户名" name="db_username">
|
||||
<div class="two fields">
|
||||
<div class="field">
|
||||
<label>管理员账号</label>
|
||||
<input type="text" name="admin_username">
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>密码</label>
|
||||
<input type="text" placeholder="密码" name="db_password">
|
||||
<div class="two fields">
|
||||
<div class="field">
|
||||
<label>管理员密码</label>
|
||||
<input type="text" name="admin_password">
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>数据库名称</label>
|
||||
<input type="text" placeholder="数据库名称" name="db_name">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>表前缀</label>
|
||||
<input type="text" placeholder="cron_" name="db_table_prefix" value="cron_">
|
||||
</div>
|
||||
|
||||
<div class="ui grey inverted segment center aligned">管理员账号配置</div>
|
||||
<div class="field">
|
||||
<label>管理员账号</label>
|
||||
<input type="text" placeholder="管理员账号" name="admin_username">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>管理员密码</label>
|
||||
<input type="text" placeholder="管理员密码" name="admin_password">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>管理员邮箱</label>
|
||||
<input type="text" placeholder="管理员邮箱" name="admin_email">
|
||||
<div class="two fields">
|
||||
<div class="field">
|
||||
<label>管理员邮箱</label>
|
||||
<input type="text" name="admin_email">
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui primary submit button">提交</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
// 表单验证规则
|
||||
|
@ -56,7 +69,7 @@
|
|||
.form({
|
||||
onSuccess: function(event, fields) {
|
||||
var util = new Util();
|
||||
util.post('/install', fields, function(code, message) {
|
||||
util.post('/install/store', fields, function(code, message) {
|
||||
|
||||
});
|
||||
return false;
|
|
@ -0,0 +1,9 @@
|
|||
<div class="four wide column">
|
||||
<div class="verticalMenu">
|
||||
<div class="ui vertical pointing menu fluid">
|
||||
<a class="active teal item" href="/install">
|
||||
<i class="linux icon"></i> 安装
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,95 @@
|
|||
{{{ template "common/header" . }}}
|
||||
|
||||
<div class="ui grid">
|
||||
<!--the vertical menu-->
|
||||
|
||||
{{{template "task/menu" .}}}
|
||||
<div class="twelve wide column">
|
||||
<form class="ui form fluid vertical segment">
|
||||
<div class="two fields">
|
||||
<div class="field">
|
||||
<label>任务名称</label>
|
||||
<div class="ui small left icon input">
|
||||
<input type="text" placeholder="数据库备份" name="name">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="two fields">
|
||||
<div class="field">
|
||||
<label>crontab表达式 (每行一个表达式)</label>
|
||||
<textarea rows="5" name="spec" placeholder="*/5 * * * * * *"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="three fields">
|
||||
<div class="field">
|
||||
<label>协议</label>
|
||||
<div class="ui dropdown selection">
|
||||
<input type="hidden" name="protocol" value="2">
|
||||
<div class="default text">SSH-Command (执行shell命令)</div>
|
||||
<i class="dropdown icon"></i>
|
||||
<div class="menu">
|
||||
<div class="item active" data-value="2">SSH-Command (执行shell命令)</div>
|
||||
<div class="item" data-value="3">SSH-Script (执行shell脚本,把本地脚本复制到远程运行)</div>
|
||||
<div class="item" data-value="1">HTTP (执行http-post请求)</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label>任务类型</label>
|
||||
<div class="ui dropdown selection">
|
||||
<input type="hidden" name="type" value="1">
|
||||
<div class="default text">定时任务</div>
|
||||
<i class="dropdown icon"></i>
|
||||
<div class="menu">
|
||||
<div class="item active" data-value="1">定时任务</div>
|
||||
<div class="item" data-value="2">延时任务</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label>主机</label>
|
||||
<div class="ui dropdown selection">
|
||||
<input type="hidden" name="type" value="1">
|
||||
<div class="default text">定时任务</div>
|
||||
<i class="dropdown icon"></i>
|
||||
<div class="menu">
|
||||
<div class="item active" data-value="1">定时任务</div>
|
||||
<div class="item" data-value="2">延时任务</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>命令 (根据选择的协议类型确定,shell命令|shell脚本名称|URL地址)</label>
|
||||
<input type="text" name="spec" placeholder="tail -n 10 /var/log/nginx/error.log">
|
||||
</div>
|
||||
<div class="three fields">
|
||||
<div class="field">
|
||||
<label>任务超时时间 (单位秒,0不限制)</label>
|
||||
<input type="text" name="timeout" placeholder="60">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>延时时间 (单位秒)</label>
|
||||
<input type="text" name="timeout" placeholder="60">
|
||||
</div>
|
||||
</div>
|
||||
<div class="three field">
|
||||
<div class="field">
|
||||
<label>备注</label>
|
||||
<textarea rows="5" name="remark" placeholder="数据库备份, 每天凌晨执行一次"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui primary submit button">提交</div>
|
||||
</form>
|
||||
</div>
|
||||
<!--the newDevice form-->
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
</script>
|
||||
|
||||
{{{ template "common/footer" . }}}
|
|
@ -0,0 +1,15 @@
|
|||
<div class="four wide column">
|
||||
<div class="verticalMenu">
|
||||
<div class="ui vertical pointing menu fluid">
|
||||
<a class="active teal item" href="/task">
|
||||
<i class="tasks icon"></i> 任务列表
|
||||
</a>
|
||||
<a class="item" href="/task/create">
|
||||
<i class="plus icon"></i> 添加任务
|
||||
</a>
|
||||
<a class="item" href="">
|
||||
<i class="bar chart icon"></i> 任务日志
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
Loading…
Reference in New Issue