Merge branch 'main' into nya

This commit is contained in:
alongw 2024-01-15 21:05:42 +08:00
commit 8355a18c85
8 changed files with 25 additions and 15 deletions

View File

@ -21,7 +21,6 @@
"@koa/router": "^10.0.0",
"archiver": "^5.3.1",
"axios": "^1.1.3",
"common": "file:../common",
"compressing": "^1.5.1",
"crypto": "^1.0.1",
"dockerode": "3.1.0",
@ -32,7 +31,6 @@
"koa-body": "^4.2.0",
"koa-send": "^5.0.1",
"log4js": "^6.4.0",
"mcsmanager-common": "file:../common/dist",
"module-alias": "^2.2.3",
"node-disk-info": "^1.3.0",
"node-schedule": "^2.0.0",
@ -46,6 +44,7 @@
"yaml": "^1.10.2"
},
"devDependencies": {
"common": "file:../common",
"@types/archiver": "^5.3.1",
"@types/axios": "^0.14.0",
"@types/dockerode": "^3.2.7",

View File

@ -1,14 +1,18 @@
<script setup lang="ts">
import type { LayoutCard } from "@/types";
import LayoutContainer from "./LayoutContainer.vue";
import { useScreen } from "../hooks/useScreen";
import LoginCard from "@/widgets/LoginCard.vue";
defineProps<{
card: LayoutCard;
}>();
const { isPhone } = useScreen();
</script>
<template>
<div>
<div v-if="!isPhone">
<div class="login-page-bg">
<a-row :gutter="[24, 24]">
<a-col :span="6">
@ -82,6 +86,9 @@ defineProps<{
</div>
</div>
</div>
<div v-else>
<LoginCard></LoginCard>
</div>
</template>
<style></style>

View File

@ -24,7 +24,7 @@ onMounted(async () => {
await execute();
});
const props = defineProps<{
card: LayoutCard;
card?: LayoutCard;
}>();
const formData = reactive({
@ -99,7 +99,7 @@ const loginSuccess = () => {
<template #body>
<div v-show="loginStep === 0" class="login-panel-body">
<a-typography-title :level="3" class="mb-20">
{{ props.card.title ? props.card.title : t("TXT_CODE_3ba5ad") }}
{{ props.card?.title ? props.card?.title : t("TXT_CODE_3ba5ad") }}
</a-typography-title>
<a-typography-paragraph class="mb-20">
{{ t("TXT_CODE_5b60ad00") }}

View File

@ -3,7 +3,7 @@
currentPath="$(pwd)"
for action in "daemon" "panel" "frontend"
do
terminalCmd="tell app \"Terminal\" to do script \"cd $currentPath && npm run start-$action\""
terminalCmd="tell app \"Terminal\" to do script \"cd $currentPath && npm run $action\""
echo "Run: $terminalCmd"
osascript -e "$terminalCmd"
done

View File

@ -1,5 +1,5 @@
start npm run start-daemon
start npm run start-panel
start npm run start-frontend
start npm run daemon
start npm run panel
start npm run frontend

View File

@ -4,9 +4,9 @@
"scripts": {
"i18n": "i18next-scanner --config i18-scanner.config.js",
"preview-build": "cd common && npm install && npm run build",
"start-daemon": "cd daemon && npm run dev",
"start-frontend": "cd frontend && npm run dev",
"start-panel": "cd panel && npm run dev"
"daemon": "cd daemon && npm run dev",
"frontend": "cd frontend && npm run dev",
"panel": "cd panel && npm run dev"
},
"dependencies": {
"crc": "^4.3.2",

View File

@ -21,7 +21,6 @@
"@koa/router": "^10.0.0",
"axios": "^1.6.2",
"bcryptjs": "^2.4.3",
"common": "file:../common",
"crypto": "^1.0.1",
"i18n": "^0.15.0",
"i18next": "^21.8.14",
@ -42,6 +41,7 @@
"uuid": "^8.3.2"
},
"devDependencies": {
"common": "file:../common",
"@types/bcryptjs": "^2.4.2",
"@types/fs-extra": "^9.0.11",
"@types/koa": "^2.13.1",

View File

@ -20,6 +20,10 @@ import { middleware as protocolMiddleware } from "./app/middleware/protocol";
import { mountRouters } from "./app/index";
import versionAdapter from "./app/service/version_adapter";
function hasParams(name: string) {
return process.argv.includes(name);
}
function setupHttp(koaApp: Koa, port: number, host?: string) {
const httpServer = http.createServer(koaApp.callback());
@ -38,8 +42,8 @@ function setupHttp(koaApp: Koa, port: number, host?: string) {
logger.info($t("TXT_CODE_app.exitTip", { port }));
logger.info("==================================");
if (os.platform() == "win32") {
open(`http://localhost:${port}/`).then(() => {});
if (os.platform() == "win32" && hasParams("--open")) {
open(`http://localhost:${port}/`);
}
}