Commit 5cdd0397 authored by abbycin's avatar abbycin

add readme

parent 8ebfa65c
# 编译
```
npm install archiver
node build.js
```
如果一切正常会生成目录`mo`和压缩包`mo.zip`
# 安装
解压`mo.zip`到合适的目录,并进入到这个目录
### Windows
Windows 10 需要管理员运行cmd
```
.\backend.exe -run install
```
即可安装为服务
### Linux
可能需要给`backend`可执行权限,切换到root
```
chmod +x backend
./backend -run install
```
即可安装为服务
----
其他命令行参数(backend -run arg), arg可选值如下
```
start
stop
restart
install
uninstall
```
\ No newline at end of file
...@@ -145,26 +145,29 @@ export default { ...@@ -145,26 +145,29 @@ export default {
this.form.getFieldDecorator(v, { initialValue: "" }); this.form.getFieldDecorator(v, { initialValue: "" });
}); });
request( this.refresh();
"GET",
"/api/db",
null,
ok => {
if (ok.code !== 0) {
throw ok.msg;
}
this.data = [];
for (let [title, v] of Object.entries(ok.data)) {
this.data.push({ title, ...v });
}
this.orgData = _.cloneDeep(this.data);
},
err => {
this.$message.error(`错误: ${err}`);
}
);
}, },
methods: { methods: {
refresh() {
request(
"GET",
"/api/db",
null,
ok => {
if (ok.code !== 0) {
throw ok.msg;
}
this.data = [];
for (let [title, v] of Object.entries(ok.data)) {
this.data.push({ title, ...v });
}
this.orgData = _.cloneDeep(this.data);
},
err => {
this.$message.error(`错误: ${err}`);
}
);
},
removeOne(index) { removeOne(index) {
this.modified.push(this.data[index].title); this.modified.push(this.data[index].title);
this.data.splice(index, 1); this.data.splice(index, 1);
...@@ -250,7 +253,7 @@ export default { ...@@ -250,7 +253,7 @@ export default {
payload[title] = v; payload[title] = v;
delete payload[title].title; delete payload[title].title;
} }
for (let item of this.orgData) { for (let item of this.orgData) {
let title = item.title; let title = item.title;
payload[title] = { ...item }; payload[title] = { ...item };
...@@ -264,9 +267,10 @@ export default { ...@@ -264,9 +267,10 @@ export default {
if (ok.code !== 0) { if (ok.code !== 0) {
throw ok.msg; throw ok.msg;
} }
for(let [_, v] of oldData) { for (let [_, v] of oldData) {
this.orgData.push(v); this.orgData.push(v);
} }
this.refresh();
this.$message.info("所以更改提交成功"); this.$message.info("所以更改提交成功");
}, },
err => { err => {
...@@ -275,7 +279,7 @@ export default { ...@@ -275,7 +279,7 @@ export default {
); );
}, },
resetChange() { resetChange() {
this.data = _.cloneDeep(this.orgData); this.refresh();
this.searchText = ""; this.searchText = "";
this.$message.info("所以更改已回退"); this.$message.info("所以更改已回退");
}, },
...@@ -288,7 +292,7 @@ export default { ...@@ -288,7 +292,7 @@ export default {
}, },
partition(dbname) { partition(dbname) {
if(dbname === null || dbname.length === 0) { if (dbname === null || dbname.length === 0) {
this.$message.error(`数据库不能为空`); this.$message.error(`数据库不能为空`);
return; return;
} }
...@@ -319,14 +323,22 @@ export default { ...@@ -319,14 +323,22 @@ export default {
}; };
this.partitionIsRunning = true; this.partitionIsRunning = true;
url = `${getu(url)}/api/${dbname}/ikm6/system/runCreatePartitionTableTask`; url = `${getu(
request("GET", url, null, ok => { url
this.partitionIsRunning = false; )}/api/${dbname}/ikm6/system/runCreatePartitionTableTask`;
this.$message.info(`分表请求已提交,结果为: ${ok}`); request(
}, err => { "GET",
this.partitionIsRunning = false; url,
this.$message.error(`分表创建出错,结果为:${err}`); null,
}); ok => {
this.partitionIsRunning = false;
this.$message.info(`分表请求已提交,结果为: ${ok}`);
},
err => {
this.partitionIsRunning = false;
this.$message.error(`分表创建出错,结果为:${err}`);
}
);
} }
} }
}; };
......
<template> <template>
<a-form :form="form" @submit="handleUpdate"> <a-form :form="form" @submit="handleUpdate">
<a-form-item <a-form-item
v-bind="formItemLayout"
label="Server Root" label="Server Root"
extra="绝对路径,例如 /opt/tophttpserver/1.1.9" extra="绝对路径,例如 /opt/tophttpserver/1.1.9"
> >
...@@ -19,7 +18,7 @@ ...@@ -19,7 +18,7 @@
]" ]"
/> />
</a-form-item> </a-form-item>
<a-form-item v-bind="formItemLayout" label="Service URL" extra="检查tophttpserver是否可用,仅支持GET"> <a-form-item label="Service URL" extra="检查tophttpserver是否可用,仅支持GET">
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :span="22"> <a-col :span="22">
<a-input <a-input
...@@ -34,7 +33,7 @@ ...@@ -34,7 +33,7 @@
</a-col> </a-col>
</a-row> </a-row>
</a-form-item> </a-form-item>
<a-form-item v-bind="tailFormItemLayout"> <a-form-item >
<a-button :disabled="restart" type="danger" @click="handleRestart">重启 httpserver</a-button> <a-button :disabled="restart" type="danger" @click="handleRestart">重启 httpserver</a-button>
<a-button type="primary" html-type="submit" style="float: right">更新配置</a-button> <a-button type="primary" html-type="submit" style="float: right">更新配置</a-button>
</a-form-item> </a-form-item>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment