mirror of
https://github.com/MCSManager/MCSManager.git
synced 2024-11-27 06:59:54 +08:00
Feat: quick install flow
This commit is contained in:
parent
f8385e818f
commit
a9addeb584
@ -31,4 +31,6 @@ export default class SystemConfig {
|
||||
|
||||
// i18n
|
||||
language = "en_us";
|
||||
|
||||
quickInstallAddr = "https://mcsmanager.com/support/quick_install.json";
|
||||
}
|
||||
|
@ -8,6 +8,8 @@ import RemoteRequest from "../../service/remote_command";
|
||||
import { multiOperationForwarding } from "../../service/instance_service";
|
||||
import { timeUuid } from "../../service/password";
|
||||
import { $t } from "../../i18n";
|
||||
import axios from "axios";
|
||||
import { systemConfig } from "../../setting";
|
||||
|
||||
const router = new Router({ prefix: "/instance" });
|
||||
|
||||
@ -189,4 +191,20 @@ router.post("/multi_kill", permission({ level: 10 }), async (ctx) => {
|
||||
}
|
||||
});
|
||||
|
||||
// [Top-level Permission]
|
||||
// Get quick install list
|
||||
router.get("/quick_install_list", permission({ level: 10 }), async (ctx) => {
|
||||
const ADDR = systemConfig.quickInstallAddr;
|
||||
try {
|
||||
const response = await axios.request({
|
||||
method: "GET",
|
||||
url: ADDR
|
||||
});
|
||||
if (response.status !== 200) throw new Error("Response code != 200");
|
||||
ctx.body = response.data;
|
||||
} catch (err) {
|
||||
ctx.body = [];
|
||||
}
|
||||
});
|
||||
|
||||
export default router;
|
||||
|
Loading…
Reference in New Issue
Block a user