mirror of
https://github.com/MCSManager/MCSManager.git
synced 2024-11-21 03:12:10 +08:00
开发 - 前端模板大致完成
This commit is contained in:
parent
d870ca35fa
commit
cb4cf1aee2
@ -171,6 +171,8 @@
|
||||
<script>
|
||||
if (!window.$) alert('[文件加载失败] 网络不通畅,请检查您的网络状态!');
|
||||
|
||||
MCSERVER.website = {};
|
||||
|
||||
$(function () {
|
||||
//事件
|
||||
window.onresize = function () {
|
||||
|
104
public/template/component/new_schedule.html
Normal file
104
public/template/component/new_schedule.html
Normal file
@ -0,0 +1,104 @@
|
||||
<div id='NewSchedule' class="OneContainer">
|
||||
<div class="col-md-12 ">
|
||||
<div class="Panel PanelBlue">
|
||||
<div class="PanelTitle">{{id}} 计划任务项目</div>
|
||||
<div class="PanelBody">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<p>这是服务器 {{servername}} 的其中一个计划任务项目控制。</p>
|
||||
<p>这里是计划任务项目的所有数据,请根据您的需要更改,如果不知如何更改,请仔细阅读下面说明:</p>
|
||||
<table class='PropertiesList' width="80%" style="margin: auto;">
|
||||
<tr>
|
||||
<th>任务间隔表达式</th>
|
||||
<th>任务性质</th>
|
||||
<th>任务指令</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<input type="text" v-model="time" placeholder="*/1 * * * * *">
|
||||
</th>
|
||||
<th>
|
||||
<input type="text" v-model="count" placeholder="未设置">
|
||||
</th>
|
||||
<th>
|
||||
<input style="width: 90%" type="text" v-model="commande" placeholder="如: stop">
|
||||
</th>
|
||||
</tr>
|
||||
</table>
|
||||
<br/>
|
||||
<p>
|
||||
<b>任务时间间隔?</b>
|
||||
</p>
|
||||
<p>如果您使用过 Linux 的 crontab 命令,您会发现它的用法非常相似。总共有 6 个 * 号,其中按照顺序代表不同的时间,分别是 秒,分,时,每月第几天,第几个月,每周第几天</p>
|
||||
<p>如果您不会使用这个,请按照以下修改:</p>
|
||||
<p>
|
||||
<code> */1 * * * * * </code> 代表每 1 秒钟执行一次 (1~59)
|
||||
<br />
|
||||
<code> * */5 * * * * </code> 代表每 5 分钟执行一次 (1~59)
|
||||
<br />
|
||||
<code> * * */4 * * * </code> 代表每 4 小时执行一次 (1~24)
|
||||
<br />
|
||||
<code> * * * */2 * * </code> 代表每 2 天执行一次 (1~31)
|
||||
<br />
|
||||
<code> */20 */2 * * * * </code> 代表每隔 2 分钟一分钟内每隔 20 秒执行一次
|
||||
<br />
|
||||
</p>
|
||||
<p>其他的您基本使用不到,无需学习过多。</p>
|
||||
<p>
|
||||
<b>任务性质?</b>
|
||||
</p>
|
||||
<p>数字 0 代表重复任务,不断执行,直到您手动删除掉它。</p>
|
||||
<p>数字大于 0 代表计次任务,代表着执行多少次之后自动删除。</p>
|
||||
<p>
|
||||
<b>任务指令?</b>
|
||||
</p>
|
||||
<p>向 Minecraft 服务器一样,正常的输入命令即可,切记不要加
|
||||
<code>/</code>
|
||||
</p>
|
||||
<p>特殊指令:__start__ 代表开启服务器,__restart__ 代表重启服务器。</p>
|
||||
</div>
|
||||
<br>
|
||||
</div>
|
||||
<div class="row">
|
||||
<hr>
|
||||
<div class="col-sm-12 PanelItemF">
|
||||
<div class="PanelItem" v-on:click="toBackNew()">
|
||||
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span> 保存
|
||||
</div>
|
||||
<div class="PanelItem" v-on:click="toBack()">
|
||||
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span> 放弃并返回
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
MI.rListener('onload', function () {
|
||||
let servername = MCSERVER.listenServername;
|
||||
let obj = MCSERVER.website.schedule.nowdata || {};
|
||||
new Vue({
|
||||
el: "#NewSchedule",
|
||||
data: {
|
||||
id: obj.id || "",
|
||||
time: obj.time || "",
|
||||
count: obj.count || 0,
|
||||
commande: obj.commande || "",
|
||||
servername: servername
|
||||
},
|
||||
methods: {
|
||||
toBack: function () {
|
||||
RES.redirectPage('./template/component/schedule.html', 'schedule/list',
|
||||
servername);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
MI.rListener('onend', function () {
|
||||
VIEW_MODEL['ServerSchedule'] = null;
|
||||
});
|
||||
</script>
|
@ -6,7 +6,7 @@
|
||||
<div class="PanelBody">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 PanelItemF">
|
||||
<div class="PanelItem" v-on:click="toBackConsole()">
|
||||
<div class="PanelItem" v-on:click="toBackNew()">
|
||||
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span> 新建计划任务项目
|
||||
</div>
|
||||
<div class="PanelItem" v-on:click="toBackConsole()">
|
||||
@ -35,7 +35,7 @@
|
||||
<th v-text="obj.time"></th>
|
||||
<th v-text="obj.commande"></th>
|
||||
<th>
|
||||
<a href="#">[ 配置 ]</a>
|
||||
<a href="#" v-on:click="toSchedule(obj)">[ 配置 ]</a>
|
||||
|
||||
<a href="#">[ 删除 ]</a>
|
||||
</th>
|
||||
@ -67,18 +67,26 @@
|
||||
|
||||
<script>
|
||||
MI.rListener('onload', function () {
|
||||
MCSERVER.website.schedule = {};
|
||||
|
||||
VIEW_MODEL.newVue('ServerSchedule', {
|
||||
el: '#ServerSchedule',
|
||||
methods: {
|
||||
toBackConsole: function () {
|
||||
RES.redirectPage('./template/component/console.html', 'server/console', this.servername);
|
||||
},
|
||||
toBackNew: function () {
|
||||
RES.redirectPage('./template/component/new_schedule.html', null);
|
||||
},
|
||||
toSchedule: function (obj) {
|
||||
MCSERVER.website.schedule.nowdata = obj;
|
||||
RES.redirectPage('./template/component/new_schedule.html', null);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
MI.rListener('onend', function () {
|
||||
VIEW_MODEL['ServerSchedule'] = null;
|
||||
// VIEW_MODEL['ServerSchedule'] = null;
|
||||
});
|
||||
</script>
|
@ -18,6 +18,7 @@ let e = {
|
||||
|
||||
function CreateScheduleJob(obj) {
|
||||
let id = tools.randomString(6) + "_" + new Date().getTime();
|
||||
let thisServer = serverModel.ServerManager().getServer(servername);
|
||||
if (obj.count <= 0) {
|
||||
schedulejob.createScheduleJob(id, obj.timestr, () => {
|
||||
|
||||
@ -45,15 +46,15 @@ WebSocketObserver().listener('schedule/list', (data) => {
|
||||
time: "5 * * * * *",
|
||||
commande: "__restart__",
|
||||
}, {
|
||||
id: "test_123456",
|
||||
id: "test_123457",
|
||||
count: 0,
|
||||
time: "5 * * * * *",
|
||||
commande: "__restart__",
|
||||
time: "*/6 * * * * *",
|
||||
commande: "kill xxxx",
|
||||
}, {
|
||||
id: "test_123456",
|
||||
id: "test_123458",
|
||||
count: 0,
|
||||
time: "5 * * * * *",
|
||||
commande: "__restart__",
|
||||
commande: "stop",
|
||||
}]
|
||||
});
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user