@dongnanyang/deploy-cli 0.12.1 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bin.js
CHANGED
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
function resolveEntry(argv) {
|
|
4
4
|
switch (argv[0]) {
|
|
5
5
|
case void 0:
|
|
6
|
-
case "tui":
|
|
7
|
-
case "--tui-next": return "tui
|
|
6
|
+
case "tui":
|
|
7
|
+
case "--tui-next": return "tui";
|
|
8
|
+
case "--legacy-tui": return "legacy-tui";
|
|
8
9
|
default: return "cli";
|
|
9
10
|
}
|
|
10
11
|
}
|
|
@@ -12,13 +13,13 @@ function resolveEntry(argv) {
|
|
|
12
13
|
async function runEntry(argv = process.argv.slice(2)) {
|
|
13
14
|
switch (resolveEntry(argv)) {
|
|
14
15
|
case "tui":
|
|
15
|
-
await import("./main.js");
|
|
16
|
-
break;
|
|
17
|
-
case "tui-next":
|
|
18
16
|
await import("./tui/main.js");
|
|
19
17
|
break;
|
|
18
|
+
case "legacy-tui":
|
|
19
|
+
await import("./main.js");
|
|
20
|
+
break;
|
|
20
21
|
case "cli": {
|
|
21
|
-
const cli = await import("./cli-
|
|
22
|
+
const cli = await import("./cli-DuwAYtpm.js");
|
|
22
23
|
process.exitCode = await cli.main(argv);
|
|
23
24
|
break;
|
|
24
25
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { C as run, S as execFailureMessage, _ as acmeProbeCommand, c as loadProject, f as removeProject, g as ACME_BIN, r as addProject, s as listProjects, v as certbotProbeCommand, x as resolveNginxPaths, y as createNginx } from "./project-BL00JHAo.js";
|
|
2
2
|
import { n as loadConfig, r as saveConfig, t as expandPath } from "./config-xUl8Oa3T.js";
|
|
3
|
-
import {
|
|
3
|
+
import { c as createDocker, l as logsArgs, o as checkProjectHealth, r as runDeploy, s as findProjectContainers, t as buildSpec } from "./deploy-DuQKdGV9.js";
|
|
4
4
|
import { accessSync, constants, existsSync, readFileSync } from "node:fs";
|
|
5
5
|
import { dirname, join } from "node:path";
|
|
6
6
|
import { fileURLToPath } from "node:url";
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { C as run, S as execFailureMessage, a as generateCompose, h as PROJECT_LABEL, m as COMPOSE_SERVICE_LABEL, o as hasComposeMarker, t as COMPOSE_MARKER, y as createNginx } from "./project-BL00JHAo.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { t as expandPath } from "./config-xUl8Oa3T.js";
|
|
3
|
+
import { existsSync, readFileSync, readdirSync, writeFileSync } from "node:fs";
|
|
4
|
+
import { dirname, join, resolve } from "node:path";
|
|
5
|
+
import { spawn } from "node:child_process";
|
|
4
6
|
//#region src/core/docker.ts
|
|
5
7
|
/** docker 调用默认超时(F5:docker daemon 挂起不得永久挂死 CLI),与流水线 600s 长步档同口径;--follow 流式豁免 */
|
|
6
8
|
const DOCKER_TIMEOUT_MS = 6e5;
|
|
@@ -372,5 +374,54 @@ async function runDeploy(project, opts) {
|
|
|
372
374
|
}
|
|
373
375
|
return { ok: true };
|
|
374
376
|
}
|
|
377
|
+
/** 扫描项目的部署脚本(v0.1.0 discoverScripts 迁移:*.sh 按名排序,目录不存在=空表) */
|
|
378
|
+
function discoverScripts(project) {
|
|
379
|
+
const projectPath = expandPath(project.path);
|
|
380
|
+
const deployPath = resolve(projectPath, project.deployDir);
|
|
381
|
+
let files;
|
|
382
|
+
try {
|
|
383
|
+
files = readdirSync(deployPath);
|
|
384
|
+
} catch {
|
|
385
|
+
return [];
|
|
386
|
+
}
|
|
387
|
+
return files.filter((f) => f.endsWith(".sh")).map((f) => ({
|
|
388
|
+
project: project.name,
|
|
389
|
+
name: f,
|
|
390
|
+
path: join(deployPath, f)
|
|
391
|
+
})).sort((a, b) => a.name.localeCompare(b.name));
|
|
392
|
+
}
|
|
393
|
+
/** 执行部署脚本(v0.1.0 runDeployScript 迁移:cwd=deploy 目录,stdout/stderr 逐行回调,exit 回调收尾) */
|
|
394
|
+
function runDeployScript(script, args, onOutput, onExit) {
|
|
395
|
+
const cwd = dirname(script.path);
|
|
396
|
+
const child = spawn("bash", [script.name, ...args], {
|
|
397
|
+
cwd,
|
|
398
|
+
stdio: [
|
|
399
|
+
"pipe",
|
|
400
|
+
"pipe",
|
|
401
|
+
"pipe"
|
|
402
|
+
],
|
|
403
|
+
env: { ...process.env }
|
|
404
|
+
});
|
|
405
|
+
const handleStream = (stream) => {
|
|
406
|
+
let buffer = "";
|
|
407
|
+
stream.on("data", (chunk) => {
|
|
408
|
+
buffer += chunk.toString();
|
|
409
|
+
const lines = buffer.split("\n");
|
|
410
|
+
buffer = lines.pop() || "";
|
|
411
|
+
for (const line of lines) if (line.trim()) onOutput(line);
|
|
412
|
+
});
|
|
413
|
+
stream.on("end", () => {
|
|
414
|
+
if (buffer.trim()) onOutput(buffer);
|
|
415
|
+
});
|
|
416
|
+
};
|
|
417
|
+
handleStream(child.stdout);
|
|
418
|
+
handleStream(child.stderr);
|
|
419
|
+
child.on("exit", onExit);
|
|
420
|
+
}
|
|
421
|
+
/** 记录脚本执行结果(v0.1.0 saveScriptResult 迁移:就地更新 lastRun/lastResult) */
|
|
422
|
+
function saveScriptResult(script, success) {
|
|
423
|
+
script.lastRun = (/* @__PURE__ */ new Date()).toISOString();
|
|
424
|
+
script.lastResult = success ? "success" : "fail";
|
|
425
|
+
}
|
|
375
426
|
//#endregion
|
|
376
|
-
export {
|
|
427
|
+
export { saveScriptResult as a, createDocker as c, runDeployScript as i, logsArgs as l, discoverScripts as n, checkProjectHealth as o, runDeploy as r, findProjectContainers as s, buildSpec as t };
|
package/dist/tui/main.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { a as generateCompose, b as isValidSlug, i as createManagedProject, l as managedComposeExists, s as listProjects, u as managedDir } from "../project-BL00JHAo.js";
|
|
2
2
|
import { n as loadConfig, t as expandPath } from "../config-xUl8Oa3T.js";
|
|
3
3
|
import { t as export_helper_default } from "../export-helper-CIEcxb5I.js";
|
|
4
|
-
import { a as createDocker, n as
|
|
4
|
+
import { a as saveScriptResult, c as createDocker, i as runDeployScript, n as discoverScripts, o as checkProjectHealth, r as runDeploy } from "../deploy-DuQKdGV9.js";
|
|
5
|
+
import { readFileSync } from "fs";
|
|
5
6
|
import { stringify } from "yaml";
|
|
6
7
|
import { Box, Text, createApp, useApp, useInput } from "@vue-tui/runtime";
|
|
7
|
-
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createTextVNode, createVNode, defineComponent, onScopeDispose, openBlock, reactive, ref, renderList, shallowRef, toDisplayString, toValue, watch, withCtx } from "vue";
|
|
8
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createTextVNode, createVNode, defineComponent, onMounted, onScopeDispose, onUnmounted, openBlock, reactive, ref, renderList, shallowRef, toDisplayString, toValue, watch, withCtx } from "vue";
|
|
8
9
|
import { ScrollBox } from "@vue-tui/components";
|
|
10
|
+
import { createServer } from "net";
|
|
11
|
+
import { Client } from "ssh2";
|
|
9
12
|
//#region src/tui/composables/useKeymap.ts
|
|
10
13
|
/** 六面板(spec 6.4):键位 1-6 与数组序一一对应 */
|
|
11
14
|
const PANEL_IDS = [
|
|
@@ -86,7 +89,7 @@ function useKeymap(handlers) {
|
|
|
86
89
|
* 键位:y/enter 确认、n/escape 取消;不可见时不响应。
|
|
87
90
|
* R17:visible 期间挂模态闸——全局键 1-6/q/? 一并停用(弹窗独占输入)。
|
|
88
91
|
*/
|
|
89
|
-
const _sfc_main$
|
|
92
|
+
const _sfc_main$10 = /*@__PURE__*/ defineComponent({
|
|
90
93
|
__name: "ConfirmModal",
|
|
91
94
|
props: {
|
|
92
95
|
visible: {
|
|
@@ -127,7 +130,7 @@ const _sfc_main$8 = /*@__PURE__*/ defineComponent({
|
|
|
127
130
|
return __returned__;
|
|
128
131
|
}
|
|
129
132
|
});
|
|
130
|
-
function _sfc_render$
|
|
133
|
+
function _sfc_render$10(_ctx, _cache, $props, $setup, $data, $options) {
|
|
131
134
|
return $setup.props.visible ? (openBlock(), createBlock($setup["Box"], {
|
|
132
135
|
key: 0,
|
|
133
136
|
flexDirection: "column",
|
|
@@ -156,10 +159,10 @@ function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
156
159
|
_: 1
|
|
157
160
|
})) : createCommentVNode("v-if", true);
|
|
158
161
|
}
|
|
159
|
-
var ConfirmModal_default = /*#__PURE__*/ export_helper_default(_sfc_main$
|
|
162
|
+
var ConfirmModal_default = /*#__PURE__*/ export_helper_default(_sfc_main$10, [["render", _sfc_render$10], ["__file", "/Users/yangdongnan/work/deploy-cli/src/tui/components/ConfirmModal.vue"]]);
|
|
160
163
|
//#endregion
|
|
161
164
|
//#region src/tui/components/ContainersPanel.vue
|
|
162
|
-
const _sfc_main$
|
|
165
|
+
const _sfc_main$9 = /*@__PURE__*/ defineComponent({
|
|
163
166
|
__name: "ContainersPanel",
|
|
164
167
|
props: {
|
|
165
168
|
rows: {
|
|
@@ -250,7 +253,7 @@ const _sfc_main$7 = /*@__PURE__*/ defineComponent({
|
|
|
250
253
|
return __returned__;
|
|
251
254
|
}
|
|
252
255
|
});
|
|
253
|
-
function _sfc_render$
|
|
256
|
+
function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
|
|
254
257
|
return openBlock(), createBlock($setup["Box"], {
|
|
255
258
|
flexDirection: "column",
|
|
256
259
|
flexGrow: 1,
|
|
@@ -391,7 +394,7 @@ function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
391
394
|
_: 1
|
|
392
395
|
});
|
|
393
396
|
}
|
|
394
|
-
var ContainersPanel_default = /*#__PURE__*/ export_helper_default(_sfc_main$
|
|
397
|
+
var ContainersPanel_default = /*#__PURE__*/ export_helper_default(_sfc_main$9, [["render", _sfc_render$9], ["__file", "/Users/yangdongnan/work/deploy-cli/src/tui/components/ContainersPanel.vue"]]);
|
|
395
398
|
//#endregion
|
|
396
399
|
//#region src/tui/components/DeployPanel.vue
|
|
397
400
|
/**
|
|
@@ -399,7 +402,7 @@ var ContainersPanel_default = /*#__PURE__*/ export_helper_default(_sfc_main$7, [
|
|
|
399
402
|
* 只吃 ViewModel(useDeployRun);发起部署入口在 Projects 面板 d(App 接线)。
|
|
400
403
|
* 失败即停视觉呈现:fail 步标「失败」,其后步骤标「跳过」。
|
|
401
404
|
*/
|
|
402
|
-
const _sfc_main$
|
|
405
|
+
const _sfc_main$8 = /*@__PURE__*/ defineComponent({
|
|
403
406
|
__name: "DeployPanel",
|
|
404
407
|
props: {
|
|
405
408
|
projectName: {
|
|
@@ -469,7 +472,7 @@ const _sfc_main$6 = /*@__PURE__*/ defineComponent({
|
|
|
469
472
|
return __returned__;
|
|
470
473
|
}
|
|
471
474
|
});
|
|
472
|
-
function _sfc_render$
|
|
475
|
+
function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
473
476
|
return openBlock(), createBlock($setup["Box"], {
|
|
474
477
|
flexDirection: "column",
|
|
475
478
|
flexGrow: 1,
|
|
@@ -590,7 +593,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
590
593
|
_: 1
|
|
591
594
|
});
|
|
592
595
|
}
|
|
593
|
-
var DeployPanel_default = /*#__PURE__*/ export_helper_default(_sfc_main$
|
|
596
|
+
var DeployPanel_default = /*#__PURE__*/ export_helper_default(_sfc_main$8, [["render", _sfc_render$8], ["__file", "/Users/yangdongnan/work/deploy-cli/src/tui/components/DeployPanel.vue"]]);
|
|
594
597
|
//#endregion
|
|
595
598
|
//#region src/tui/components/OutputPanel.vue
|
|
596
599
|
/**
|
|
@@ -598,7 +601,7 @@ var DeployPanel_default = /*#__PURE__*/ export_helper_default(_sfc_main$6, [["re
|
|
|
598
601
|
* 滚动/截断(T4#4 递延项):ScrollBox 有界视口(内容超高即截断)+ 旧 TUI g/G 键位语义(g 到顶、G 回底跟随)、↑/↓ 逐行;
|
|
599
602
|
* 列表上限在 useLogs(LOGS_LIMIT 环形截断),此处只管视口。
|
|
600
603
|
*/
|
|
601
|
-
const _sfc_main$
|
|
604
|
+
const _sfc_main$7 = /*@__PURE__*/ defineComponent({
|
|
602
605
|
__name: "OutputPanel",
|
|
603
606
|
props: { logs: {
|
|
604
607
|
type: Array,
|
|
@@ -641,7 +644,7 @@ const _sfc_main$5 = /*@__PURE__*/ defineComponent({
|
|
|
641
644
|
return __returned__;
|
|
642
645
|
}
|
|
643
646
|
});
|
|
644
|
-
function _sfc_render$
|
|
647
|
+
function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
|
|
645
648
|
return openBlock(), createBlock($setup["Box"], {
|
|
646
649
|
flexDirection: "column",
|
|
647
650
|
flexGrow: 1,
|
|
@@ -691,14 +694,14 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
691
694
|
_: 1
|
|
692
695
|
});
|
|
693
696
|
}
|
|
694
|
-
var OutputPanel_default = /*#__PURE__*/ export_helper_default(_sfc_main$
|
|
697
|
+
var OutputPanel_default = /*#__PURE__*/ export_helper_default(_sfc_main$7, [["render", _sfc_render$7], ["__file", "/Users/yangdongnan/work/deploy-cli/src/tui/components/OutputPanel.vue"]]);
|
|
695
698
|
//#endregion
|
|
696
699
|
//#region src/tui/components/ProjectsPanel.vue
|
|
697
700
|
/**
|
|
698
701
|
* Projects 面板(spec 6.4):项目列表 NAME/PATH/TYPE/ERROR + 动作事件出口。
|
|
699
702
|
* 只吃 ViewModel(rows);动作经 emit 交 App 接线(部署等 T6 接线)。
|
|
700
703
|
*/
|
|
701
|
-
const _sfc_main$
|
|
704
|
+
const _sfc_main$6 = /*@__PURE__*/ defineComponent({
|
|
702
705
|
__name: "ProjectsPanel",
|
|
703
706
|
props: {
|
|
704
707
|
rows: {
|
|
@@ -750,7 +753,7 @@ const _sfc_main$4 = /*@__PURE__*/ defineComponent({
|
|
|
750
753
|
return __returned__;
|
|
751
754
|
}
|
|
752
755
|
});
|
|
753
|
-
function _sfc_render$
|
|
756
|
+
function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
754
757
|
return openBlock(), createBlock($setup["Box"], {
|
|
755
758
|
flexDirection: "column",
|
|
756
759
|
flexGrow: 1,
|
|
@@ -875,14 +878,239 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
875
878
|
_: 1
|
|
876
879
|
});
|
|
877
880
|
}
|
|
878
|
-
var ProjectsPanel_default = /*#__PURE__*/ export_helper_default(_sfc_main$
|
|
881
|
+
var ProjectsPanel_default = /*#__PURE__*/ export_helper_default(_sfc_main$6, [["render", _sfc_render$6], ["__file", "/Users/yangdongnan/work/deploy-cli/src/tui/components/ProjectsPanel.vue"]]);
|
|
882
|
+
//#endregion
|
|
883
|
+
//#region src/tui/components/ScriptsPanel.vue
|
|
884
|
+
/**
|
|
885
|
+
* Scripts 面板(M2-T7 自 v0.1.0 DeployPanel 迁移):j/k/Enter/p 语义原样保留;
|
|
886
|
+
* p 开参数弹窗(旧 InputModal 语义:输入参数、Enter 执行、Esc 取消)。
|
|
887
|
+
* 只吃 ViewModel(rows/running);动作经 emit 交 App 接线(useScripts)。
|
|
888
|
+
*/
|
|
889
|
+
const _sfc_main$5 = /*@__PURE__*/ defineComponent({
|
|
890
|
+
__name: "ScriptsPanel",
|
|
891
|
+
props: {
|
|
892
|
+
rows: {
|
|
893
|
+
type: Array,
|
|
894
|
+
required: true
|
|
895
|
+
},
|
|
896
|
+
running: {
|
|
897
|
+
type: [String, null],
|
|
898
|
+
required: true
|
|
899
|
+
}
|
|
900
|
+
},
|
|
901
|
+
emits: ["run", "refresh"],
|
|
902
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
903
|
+
__expose();
|
|
904
|
+
const props = __props;
|
|
905
|
+
const emit = __emit;
|
|
906
|
+
const sel = ref(0);
|
|
907
|
+
watch(() => props.rows.length, () => {
|
|
908
|
+
sel.value = Math.min(sel.value, Math.max(0, props.rows.length - 1));
|
|
909
|
+
});
|
|
910
|
+
/** 传参弹窗(旧 App paramModal 归入面板):打开期间挂模态闸,列表键不触达 */
|
|
911
|
+
const paramsFor = ref(null);
|
|
912
|
+
const paramsText = ref("");
|
|
913
|
+
const paramsOpen = computed(() => paramsFor.value !== null);
|
|
914
|
+
useModalGate(paramsOpen);
|
|
915
|
+
function closeParams() {
|
|
916
|
+
paramsFor.value = null;
|
|
917
|
+
paramsText.value = "";
|
|
918
|
+
}
|
|
919
|
+
useInput((event) => {
|
|
920
|
+
const name = keyName(event);
|
|
921
|
+
const char = event.type === "text" ? event.text : event.type === "key" ? event.key.character : void 0;
|
|
922
|
+
if (paramsOpen.value) {
|
|
923
|
+
if (name === "enter") {
|
|
924
|
+
const script = paramsFor.value;
|
|
925
|
+
const args = paramsText.value.trim().split(/\s+/).filter(Boolean);
|
|
926
|
+
closeParams();
|
|
927
|
+
emit("run", script, args);
|
|
928
|
+
} else if (name === "escape") closeParams();
|
|
929
|
+
else if (name === "backspace") paramsText.value = paramsText.value.slice(0, -1);
|
|
930
|
+
else if (char) paramsText.value += char;
|
|
931
|
+
return;
|
|
932
|
+
}
|
|
933
|
+
if (props.rows.length === 0) return;
|
|
934
|
+
if (name === "j" || name === "down") sel.value = Math.min(sel.value + 1, props.rows.length - 1);
|
|
935
|
+
else if (name === "k" || name === "up") sel.value = Math.max(sel.value - 1, 0);
|
|
936
|
+
else if (name === "enter") emit("run", props.rows[sel.value], []);
|
|
937
|
+
else if (name === "p") {
|
|
938
|
+
paramsFor.value = props.rows[sel.value];
|
|
939
|
+
paramsText.value = "";
|
|
940
|
+
} else if (name === "f") emit("refresh");
|
|
941
|
+
});
|
|
942
|
+
function key(script) {
|
|
943
|
+
return `${script.project}/${script.name}`;
|
|
944
|
+
}
|
|
945
|
+
const __returned__ = {
|
|
946
|
+
props,
|
|
947
|
+
emit,
|
|
948
|
+
sel,
|
|
949
|
+
paramsFor,
|
|
950
|
+
paramsText,
|
|
951
|
+
paramsOpen,
|
|
952
|
+
closeParams,
|
|
953
|
+
key,
|
|
954
|
+
get Box() {
|
|
955
|
+
return Box;
|
|
956
|
+
},
|
|
957
|
+
get Text() {
|
|
958
|
+
return Text;
|
|
959
|
+
}
|
|
960
|
+
};
|
|
961
|
+
Object.defineProperty(__returned__, "__isScriptSetup", {
|
|
962
|
+
enumerable: false,
|
|
963
|
+
value: true
|
|
964
|
+
});
|
|
965
|
+
return __returned__;
|
|
966
|
+
}
|
|
967
|
+
});
|
|
968
|
+
function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
969
|
+
return openBlock(), createBlock($setup["Box"], {
|
|
970
|
+
flexDirection: "column",
|
|
971
|
+
flexGrow: 1,
|
|
972
|
+
borderStyle: "round",
|
|
973
|
+
borderColor: "cyan",
|
|
974
|
+
padding: 1
|
|
975
|
+
}, {
|
|
976
|
+
default: withCtx(() => [
|
|
977
|
+
createVNode($setup["Text"], {
|
|
978
|
+
bold: "",
|
|
979
|
+
color: "cyan"
|
|
980
|
+
}, {
|
|
981
|
+
default: withCtx(() => [..._cache[0] || (_cache[0] = [createTextVNode("Scripts 脚本(deploy/ 目录)", -1)])]),
|
|
982
|
+
_: 1
|
|
983
|
+
}),
|
|
984
|
+
$setup.props.rows.length === 0 ? (openBlock(), createBlock($setup["Text"], {
|
|
985
|
+
key: 0,
|
|
986
|
+
dimColor: ""
|
|
987
|
+
}, {
|
|
988
|
+
default: withCtx(() => [..._cache[1] || (_cache[1] = [createTextVNode("(暂无部署脚本)——在项目 deploy/ 目录放置 *.sh 后按 [f] 重扫", -1)])]),
|
|
989
|
+
_: 1
|
|
990
|
+
})) : createCommentVNode("v-if", true),
|
|
991
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList($setup.props.rows, (s, i) => {
|
|
992
|
+
return openBlock(), createBlock($setup["Box"], {
|
|
993
|
+
key: $setup.key(s),
|
|
994
|
+
flexDirection: "row",
|
|
995
|
+
flexShrink: 0
|
|
996
|
+
}, {
|
|
997
|
+
default: withCtx(() => [
|
|
998
|
+
createVNode($setup["Box"], { width: 2 }, {
|
|
999
|
+
default: withCtx(() => [createVNode($setup["Text"], { color: i === $setup.sel ? "cyan" : void 0 }, {
|
|
1000
|
+
default: withCtx(() => [createTextVNode(toDisplayString(i === $setup.sel ? ">" : " "), 1)]),
|
|
1001
|
+
_: 2
|
|
1002
|
+
}, 1032, ["color"])]),
|
|
1003
|
+
_: 2
|
|
1004
|
+
}, 1024),
|
|
1005
|
+
createVNode($setup["Box"], { width: 2 }, {
|
|
1006
|
+
default: withCtx(() => [$setup.props.running === $setup.key(s) ? (openBlock(), createBlock($setup["Text"], {
|
|
1007
|
+
key: 0,
|
|
1008
|
+
color: "yellow"
|
|
1009
|
+
}, {
|
|
1010
|
+
default: withCtx(() => [..._cache[2] || (_cache[2] = [createTextVNode("▸", -1)])]),
|
|
1011
|
+
_: 1
|
|
1012
|
+
})) : s.lastResult === "success" ? (openBlock(), createBlock($setup["Text"], {
|
|
1013
|
+
key: 1,
|
|
1014
|
+
color: "green"
|
|
1015
|
+
}, {
|
|
1016
|
+
default: withCtx(() => [..._cache[3] || (_cache[3] = [createTextVNode("✓", -1)])]),
|
|
1017
|
+
_: 1
|
|
1018
|
+
})) : s.lastResult === "fail" ? (openBlock(), createBlock($setup["Text"], {
|
|
1019
|
+
key: 2,
|
|
1020
|
+
color: "red"
|
|
1021
|
+
}, {
|
|
1022
|
+
default: withCtx(() => [..._cache[4] || (_cache[4] = [createTextVNode("✗", -1)])]),
|
|
1023
|
+
_: 1
|
|
1024
|
+
})) : (openBlock(), createBlock($setup["Text"], { key: 3 }))]),
|
|
1025
|
+
_: 2
|
|
1026
|
+
}, 1024),
|
|
1027
|
+
createVNode($setup["Box"], { flexGrow: 1 }, {
|
|
1028
|
+
default: withCtx(() => [createVNode($setup["Text"], {
|
|
1029
|
+
wrap: "truncate",
|
|
1030
|
+
bold: i === $setup.sel,
|
|
1031
|
+
color: i === $setup.sel ? "cyan" : void 0
|
|
1032
|
+
}, {
|
|
1033
|
+
default: withCtx(() => [createTextVNode(toDisplayString($setup.key(s)), 1)]),
|
|
1034
|
+
_: 2
|
|
1035
|
+
}, 1032, ["bold", "color"])]),
|
|
1036
|
+
_: 2
|
|
1037
|
+
}, 1024),
|
|
1038
|
+
createVNode($setup["Box"], { flexShrink: 0 }, {
|
|
1039
|
+
default: withCtx(() => [$setup.props.running === $setup.key(s) ? (openBlock(), createBlock($setup["Text"], {
|
|
1040
|
+
key: 0,
|
|
1041
|
+
color: "yellow"
|
|
1042
|
+
}, {
|
|
1043
|
+
default: withCtx(() => [..._cache[5] || (_cache[5] = [createTextVNode("running...", -1)])]),
|
|
1044
|
+
_: 1
|
|
1045
|
+
})) : createCommentVNode("v-if", true)]),
|
|
1046
|
+
_: 2
|
|
1047
|
+
}, 1024)
|
|
1048
|
+
]),
|
|
1049
|
+
_: 2
|
|
1050
|
+
}, 1024);
|
|
1051
|
+
}), 128)),
|
|
1052
|
+
createVNode($setup["Text"], { dimColor: "" }, {
|
|
1053
|
+
default: withCtx(() => [..._cache[6] || (_cache[6] = [createTextVNode("j/k 选择 · Enter 执行 · p 传参执行 · f 重扫", -1)])]),
|
|
1054
|
+
_: 1
|
|
1055
|
+
}),
|
|
1056
|
+
createCommentVNode(" 传参弹窗(旧 InputModal 文案) "),
|
|
1057
|
+
$setup.paramsFor ? (openBlock(), createBlock($setup["Box"], {
|
|
1058
|
+
key: 1,
|
|
1059
|
+
flexDirection: "column",
|
|
1060
|
+
borderStyle: "round",
|
|
1061
|
+
borderColor: "cyan",
|
|
1062
|
+
padding: 1
|
|
1063
|
+
}, {
|
|
1064
|
+
default: withCtx(() => [
|
|
1065
|
+
createVNode($setup["Text"], {
|
|
1066
|
+
bold: "",
|
|
1067
|
+
color: "cyan"
|
|
1068
|
+
}, {
|
|
1069
|
+
default: withCtx(() => [createTextVNode("执行: " + toDisplayString($setup.paramsFor.project) + "/" + toDisplayString($setup.paramsFor.name), 1)]),
|
|
1070
|
+
_: 1
|
|
1071
|
+
}),
|
|
1072
|
+
createVNode($setup["Box"], {
|
|
1073
|
+
flexDirection: "row",
|
|
1074
|
+
marginTop: 1,
|
|
1075
|
+
gap: 1
|
|
1076
|
+
}, {
|
|
1077
|
+
default: withCtx(() => [createVNode($setup["Text"], { dimColor: "" }, {
|
|
1078
|
+
default: withCtx(() => [..._cache[7] || (_cache[7] = [createTextVNode("参数:", -1)])]),
|
|
1079
|
+
_: 1
|
|
1080
|
+
}), createVNode($setup["Text"], {
|
|
1081
|
+
bold: "",
|
|
1082
|
+
color: "cyan"
|
|
1083
|
+
}, {
|
|
1084
|
+
default: withCtx(() => [createTextVNode(toDisplayString($setup.paramsText) + "_", 1)]),
|
|
1085
|
+
_: 1
|
|
1086
|
+
})]),
|
|
1087
|
+
_: 1
|
|
1088
|
+
}),
|
|
1089
|
+
createVNode($setup["Box"], {
|
|
1090
|
+
flexDirection: "row",
|
|
1091
|
+
marginTop: 1
|
|
1092
|
+
}, {
|
|
1093
|
+
default: withCtx(() => [createVNode($setup["Text"], { dimColor: "" }, {
|
|
1094
|
+
default: withCtx(() => [..._cache[8] || (_cache[8] = [createTextVNode("[Enter] 执行 [Esc] 取消", -1)])]),
|
|
1095
|
+
_: 1
|
|
1096
|
+
})]),
|
|
1097
|
+
_: 1
|
|
1098
|
+
})
|
|
1099
|
+
]),
|
|
1100
|
+
_: 1
|
|
1101
|
+
})) : createCommentVNode("v-if", true)
|
|
1102
|
+
]),
|
|
1103
|
+
_: 1
|
|
1104
|
+
});
|
|
1105
|
+
}
|
|
1106
|
+
var ScriptsPanel_default = /*#__PURE__*/ export_helper_default(_sfc_main$5, [["render", _sfc_render$5], ["__file", "/Users/yangdongnan/work/deploy-cli/src/tui/components/ScriptsPanel.vue"]]);
|
|
879
1107
|
//#endregion
|
|
880
1108
|
//#region src/tui/components/StatusPanel.vue
|
|
881
1109
|
/**
|
|
882
1110
|
* Status 面板(spec 6.4):项目健康聚合 CONTAINERS/HTTP/NGINX(口径同 CLI status 表格)。
|
|
883
1111
|
* 只吃 ViewModel(rows);单行错误降级展示(检查失败/配置不可用行 + 继续,M2-T2 #10 的 UI 面)。
|
|
884
1112
|
*/
|
|
885
|
-
const _sfc_main$
|
|
1113
|
+
const _sfc_main$4 = /*@__PURE__*/ defineComponent({
|
|
886
1114
|
__name: "StatusPanel",
|
|
887
1115
|
props: {
|
|
888
1116
|
rows: {
|
|
@@ -919,7 +1147,7 @@ const _sfc_main$3 = /*@__PURE__*/ defineComponent({
|
|
|
919
1147
|
return __returned__;
|
|
920
1148
|
}
|
|
921
1149
|
});
|
|
922
|
-
function _sfc_render$
|
|
1150
|
+
function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
923
1151
|
return openBlock(), createBlock($setup["Box"], {
|
|
924
1152
|
flexDirection: "column",
|
|
925
1153
|
flexGrow: 1,
|
|
@@ -1043,10 +1271,10 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1043
1271
|
_: 1
|
|
1044
1272
|
});
|
|
1045
1273
|
}
|
|
1046
|
-
var StatusPanel_default = /*#__PURE__*/ export_helper_default(_sfc_main$
|
|
1274
|
+
var StatusPanel_default = /*#__PURE__*/ export_helper_default(_sfc_main$4, [["render", _sfc_render$4], ["__file", "/Users/yangdongnan/work/deploy-cli/src/tui/components/StatusPanel.vue"]]);
|
|
1047
1275
|
//#endregion
|
|
1048
1276
|
//#region src/tui/components/StatusBar.vue
|
|
1049
|
-
const _sfc_main$
|
|
1277
|
+
const _sfc_main$3 = /*@__PURE__*/ defineComponent({
|
|
1050
1278
|
__name: "StatusBar",
|
|
1051
1279
|
props: {
|
|
1052
1280
|
activePanel: {
|
|
@@ -1079,7 +1307,7 @@ const _sfc_main$2 = /*@__PURE__*/ defineComponent({
|
|
|
1079
1307
|
return __returned__;
|
|
1080
1308
|
}
|
|
1081
1309
|
});
|
|
1082
|
-
function _sfc_render$
|
|
1310
|
+
function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1083
1311
|
return openBlock(), createBlock($setup["Box"], {
|
|
1084
1312
|
paddingX: 1,
|
|
1085
1313
|
flexDirection: "row",
|
|
@@ -1099,7 +1327,172 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1099
1327
|
_: 1
|
|
1100
1328
|
});
|
|
1101
1329
|
}
|
|
1102
|
-
var StatusBar_default = /*#__PURE__*/ export_helper_default(_sfc_main$
|
|
1330
|
+
var StatusBar_default = /*#__PURE__*/ export_helper_default(_sfc_main$3, [["render", _sfc_render$3], ["__file", "/Users/yangdongnan/work/deploy-cli/src/tui/components/StatusBar.vue"]]);
|
|
1331
|
+
//#endregion
|
|
1332
|
+
//#region src/tui/components/TunnelsPanel.vue
|
|
1333
|
+
/**
|
|
1334
|
+
* Tunnels 面板(spec 6.4 面板 5):旧 v0.1.0 TunnelPanel 迁移——j/k/s/x/a 语义原样保留。
|
|
1335
|
+
* 只吃 ViewModel(rows);动作经 emit 交 App 接线(useTunnels)。
|
|
1336
|
+
*/
|
|
1337
|
+
const _sfc_main$2 = /*@__PURE__*/ defineComponent({
|
|
1338
|
+
__name: "TunnelsPanel",
|
|
1339
|
+
props: { rows: {
|
|
1340
|
+
type: Array,
|
|
1341
|
+
required: true
|
|
1342
|
+
} },
|
|
1343
|
+
emits: [
|
|
1344
|
+
"start",
|
|
1345
|
+
"stop",
|
|
1346
|
+
"startAll"
|
|
1347
|
+
],
|
|
1348
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
1349
|
+
__expose();
|
|
1350
|
+
const props = __props;
|
|
1351
|
+
const emit = __emit;
|
|
1352
|
+
const sel = ref(0);
|
|
1353
|
+
watch(() => props.rows.length, () => {
|
|
1354
|
+
sel.value = Math.min(sel.value, Math.max(0, props.rows.length - 1));
|
|
1355
|
+
});
|
|
1356
|
+
useInput((event) => {
|
|
1357
|
+
const name = keyName(event);
|
|
1358
|
+
if (name === "a") emit("startAll");
|
|
1359
|
+
if (props.rows.length === 0) return;
|
|
1360
|
+
if (name === "j" || name === "down") sel.value = Math.min(sel.value + 1, props.rows.length - 1);
|
|
1361
|
+
else if (name === "k" || name === "up") sel.value = Math.max(sel.value - 1, 0);
|
|
1362
|
+
else if (name === "s") emit("start", props.rows[sel.value].name);
|
|
1363
|
+
else if (name === "x") emit("stop", props.rows[sel.value].name);
|
|
1364
|
+
});
|
|
1365
|
+
const __returned__ = {
|
|
1366
|
+
props,
|
|
1367
|
+
emit,
|
|
1368
|
+
sel,
|
|
1369
|
+
STATUS_MARK: {
|
|
1370
|
+
running: "●",
|
|
1371
|
+
error: "✗",
|
|
1372
|
+
stopped: "○"
|
|
1373
|
+
},
|
|
1374
|
+
STATUS_COLOR: {
|
|
1375
|
+
running: "green",
|
|
1376
|
+
error: "red",
|
|
1377
|
+
stopped: "gray"
|
|
1378
|
+
},
|
|
1379
|
+
get Box() {
|
|
1380
|
+
return Box;
|
|
1381
|
+
},
|
|
1382
|
+
get Text() {
|
|
1383
|
+
return Text;
|
|
1384
|
+
}
|
|
1385
|
+
};
|
|
1386
|
+
Object.defineProperty(__returned__, "__isScriptSetup", {
|
|
1387
|
+
enumerable: false,
|
|
1388
|
+
value: true
|
|
1389
|
+
});
|
|
1390
|
+
return __returned__;
|
|
1391
|
+
}
|
|
1392
|
+
});
|
|
1393
|
+
function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1394
|
+
return openBlock(), createBlock($setup["Box"], {
|
|
1395
|
+
flexDirection: "column",
|
|
1396
|
+
flexGrow: 1,
|
|
1397
|
+
borderStyle: "round",
|
|
1398
|
+
borderColor: "cyan",
|
|
1399
|
+
padding: 1
|
|
1400
|
+
}, {
|
|
1401
|
+
default: withCtx(() => [
|
|
1402
|
+
createVNode($setup["Text"], {
|
|
1403
|
+
bold: "",
|
|
1404
|
+
color: "cyan"
|
|
1405
|
+
}, {
|
|
1406
|
+
default: withCtx(() => [..._cache[0] || (_cache[0] = [createTextVNode("5. Tunnels 隧道", -1)])]),
|
|
1407
|
+
_: 1
|
|
1408
|
+
}),
|
|
1409
|
+
$setup.props.rows.length === 0 ? (openBlock(), createBlock($setup["Text"], {
|
|
1410
|
+
key: 0,
|
|
1411
|
+
dimColor: ""
|
|
1412
|
+
}, {
|
|
1413
|
+
default: withCtx(() => [..._cache[1] || (_cache[1] = [createTextVNode("(暂无隧道配置)", -1)])]),
|
|
1414
|
+
_: 1
|
|
1415
|
+
})) : createCommentVNode("v-if", true),
|
|
1416
|
+
$setup.props.rows.length === 0 ? (openBlock(), createBlock($setup["Text"], {
|
|
1417
|
+
key: 1,
|
|
1418
|
+
dimColor: ""
|
|
1419
|
+
}, {
|
|
1420
|
+
default: withCtx(() => [..._cache[2] || (_cache[2] = [createTextVNode("编辑 ~/.deploy-cli/config.json 添加", -1)])]),
|
|
1421
|
+
_: 1
|
|
1422
|
+
})) : createCommentVNode("v-if", true),
|
|
1423
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList($setup.props.rows, (t, i) => {
|
|
1424
|
+
return openBlock(), createBlock($setup["Box"], {
|
|
1425
|
+
key: t.name,
|
|
1426
|
+
flexDirection: "row",
|
|
1427
|
+
flexShrink: 0
|
|
1428
|
+
}, {
|
|
1429
|
+
default: withCtx(() => [
|
|
1430
|
+
createVNode($setup["Box"], { width: 2 }, {
|
|
1431
|
+
default: withCtx(() => [createVNode($setup["Text"], { color: i === $setup.sel ? "cyan" : void 0 }, {
|
|
1432
|
+
default: withCtx(() => [createTextVNode(toDisplayString(i === $setup.sel ? ">" : " "), 1)]),
|
|
1433
|
+
_: 2
|
|
1434
|
+
}, 1032, ["color"])]),
|
|
1435
|
+
_: 2
|
|
1436
|
+
}, 1024),
|
|
1437
|
+
createVNode($setup["Box"], { width: 2 }, {
|
|
1438
|
+
default: withCtx(() => [createVNode($setup["Text"], { color: $setup.STATUS_COLOR[t.status] }, {
|
|
1439
|
+
default: withCtx(() => [createTextVNode(toDisplayString($setup.STATUS_MARK[t.status]), 1)]),
|
|
1440
|
+
_: 2
|
|
1441
|
+
}, 1032, ["color"])]),
|
|
1442
|
+
_: 2
|
|
1443
|
+
}, 1024),
|
|
1444
|
+
createVNode($setup["Box"], { width: 24 }, {
|
|
1445
|
+
default: withCtx(() => [createVNode($setup["Text"], {
|
|
1446
|
+
wrap: "truncate",
|
|
1447
|
+
bold: i === $setup.sel,
|
|
1448
|
+
color: i === $setup.sel ? "cyan" : void 0
|
|
1449
|
+
}, {
|
|
1450
|
+
default: withCtx(() => [createTextVNode(toDisplayString(t.name), 1)]),
|
|
1451
|
+
_: 2
|
|
1452
|
+
}, 1032, ["bold", "color"])]),
|
|
1453
|
+
_: 2
|
|
1454
|
+
}, 1024),
|
|
1455
|
+
createVNode($setup["Box"], { flexShrink: 0 }, {
|
|
1456
|
+
default: withCtx(() => [createVNode($setup["Text"], { dimColor: "" }, {
|
|
1457
|
+
default: withCtx(() => [createTextVNode(":" + toDisplayString(t.localPort) + " -> " + toDisplayString(t.remoteHost) + ":" + toDisplayString(t.remotePort), 1)]),
|
|
1458
|
+
_: 2
|
|
1459
|
+
}, 1024)]),
|
|
1460
|
+
_: 2
|
|
1461
|
+
}, 1024),
|
|
1462
|
+
createVNode($setup["Box"], { flexShrink: 0 }, {
|
|
1463
|
+
default: withCtx(() => [t.autoStart ? (openBlock(), createBlock($setup["Text"], {
|
|
1464
|
+
key: 0,
|
|
1465
|
+
dimColor: ""
|
|
1466
|
+
}, {
|
|
1467
|
+
default: withCtx(() => [..._cache[3] || (_cache[3] = [createTextVNode(" (auto)", -1)])]),
|
|
1468
|
+
_: 1
|
|
1469
|
+
})) : createCommentVNode("v-if", true)]),
|
|
1470
|
+
_: 2
|
|
1471
|
+
}, 1024),
|
|
1472
|
+
createVNode($setup["Box"], { flexGrow: 1 }, {
|
|
1473
|
+
default: withCtx(() => [t.message ? (openBlock(), createBlock($setup["Text"], {
|
|
1474
|
+
key: 0,
|
|
1475
|
+
color: "red",
|
|
1476
|
+
wrap: "truncate"
|
|
1477
|
+
}, {
|
|
1478
|
+
default: withCtx(() => [createTextVNode(toDisplayString(t.message), 1)]),
|
|
1479
|
+
_: 2
|
|
1480
|
+
}, 1024)) : createCommentVNode("v-if", true)]),
|
|
1481
|
+
_: 2
|
|
1482
|
+
}, 1024)
|
|
1483
|
+
]),
|
|
1484
|
+
_: 2
|
|
1485
|
+
}, 1024);
|
|
1486
|
+
}), 128)),
|
|
1487
|
+
createVNode($setup["Text"], { dimColor: "" }, {
|
|
1488
|
+
default: withCtx(() => [..._cache[4] || (_cache[4] = [createTextVNode("j/k 选择 · s 启动 · x 停止 · a 全部启动", -1)])]),
|
|
1489
|
+
_: 1
|
|
1490
|
+
})
|
|
1491
|
+
]),
|
|
1492
|
+
_: 1
|
|
1493
|
+
});
|
|
1494
|
+
}
|
|
1495
|
+
var TunnelsPanel_default = /*#__PURE__*/ export_helper_default(_sfc_main$2, [["render", _sfc_render$2], ["__file", "/Users/yangdongnan/work/deploy-cli/src/tui/components/TunnelsPanel.vue"]]);
|
|
1103
1496
|
//#endregion
|
|
1104
1497
|
//#region src/tui/composables/useWizard.ts
|
|
1105
1498
|
/** 类型步选项(顺序=spec 6.1 compose|image|static) */
|
|
@@ -2089,6 +2482,292 @@ function useProjects(opts = {}) {
|
|
|
2089
2482
|
};
|
|
2090
2483
|
}
|
|
2091
2484
|
//#endregion
|
|
2485
|
+
//#region src/tui/composables/useScripts.ts
|
|
2486
|
+
/**
|
|
2487
|
+
* Scripts 面板数据面(M2-T7,自 v0.1.0 useDeploy + deploy-runner 迁移):
|
|
2488
|
+
* 扫描各项目 deploy/ 目录 → 行;执行走 core runDeployScript,输出/结果日志口径与 v0.1.0 逐字一致。
|
|
2489
|
+
*/
|
|
2490
|
+
function useScripts(opts = {}) {
|
|
2491
|
+
const { info, success, warn, error: logError } = useLogs();
|
|
2492
|
+
const config = opts.load ? opts.load() : loadConfig();
|
|
2493
|
+
const rows = ref([]);
|
|
2494
|
+
const running = ref(null);
|
|
2495
|
+
function scan() {
|
|
2496
|
+
const all = [];
|
|
2497
|
+
for (const project of config.projects) all.push(...discoverScripts(project));
|
|
2498
|
+
rows.value = all;
|
|
2499
|
+
info(`扫描完成: ${config.projects.length} 个项目, ${all.length} 个脚本`);
|
|
2500
|
+
}
|
|
2501
|
+
function run(script, args = []) {
|
|
2502
|
+
const key = `${script.project}/${script.name}`;
|
|
2503
|
+
if (running.value !== null) {
|
|
2504
|
+
warn(`已有脚本在运行: ${running.value}`);
|
|
2505
|
+
return Promise.resolve();
|
|
2506
|
+
}
|
|
2507
|
+
running.value = key;
|
|
2508
|
+
info(`▸ ${key}${args.length ? " " + args.join(" ") : ""}`);
|
|
2509
|
+
return new Promise((settle) => {
|
|
2510
|
+
(opts.run ?? runDeployScript)(script, args, (line) => {
|
|
2511
|
+
info(` ${line}`);
|
|
2512
|
+
}, (code) => {
|
|
2513
|
+
const ok = code === 0;
|
|
2514
|
+
saveScriptResult(script, ok);
|
|
2515
|
+
if (ok) success(`✓ ${key} 完成`);
|
|
2516
|
+
else logError(`✗ ${key} 失败 (exit ${code})`);
|
|
2517
|
+
running.value = null;
|
|
2518
|
+
settle();
|
|
2519
|
+
});
|
|
2520
|
+
});
|
|
2521
|
+
}
|
|
2522
|
+
return {
|
|
2523
|
+
rows,
|
|
2524
|
+
running,
|
|
2525
|
+
scan,
|
|
2526
|
+
run
|
|
2527
|
+
};
|
|
2528
|
+
}
|
|
2529
|
+
//#endregion
|
|
2530
|
+
//#region src/core/tunnel.ts
|
|
2531
|
+
/** 读取私钥文件内容(v0.1.0 readPrivateKey 迁移:~ 展开后读盘) */
|
|
2532
|
+
function readPrivateKey(keyPath) {
|
|
2533
|
+
const expanded = expandPath(keyPath);
|
|
2534
|
+
return readFileSync(expanded, "utf-8");
|
|
2535
|
+
}
|
|
2536
|
+
/** 建立 SSH 连接(v0.1.0 createSSHConn 迁移:readyTimeout 10s + 12s 整体超时) */
|
|
2537
|
+
function createSSHConn(server) {
|
|
2538
|
+
return new Promise((resolve, reject) => {
|
|
2539
|
+
const conn = new Client();
|
|
2540
|
+
const config = {
|
|
2541
|
+
host: server.host,
|
|
2542
|
+
port: server.port,
|
|
2543
|
+
username: server.username,
|
|
2544
|
+
readyTimeout: 1e4
|
|
2545
|
+
};
|
|
2546
|
+
if (server.privateKey) config.privateKey = readPrivateKey(server.privateKey);
|
|
2547
|
+
else if (server.password) config.password = server.password;
|
|
2548
|
+
const timer = setTimeout(() => reject(/* @__PURE__ */ new Error("SSH 连接超时")), 12e3);
|
|
2549
|
+
conn.on("ready", () => {
|
|
2550
|
+
clearTimeout(timer);
|
|
2551
|
+
resolve(conn);
|
|
2552
|
+
});
|
|
2553
|
+
conn.on("error", (err) => {
|
|
2554
|
+
clearTimeout(timer);
|
|
2555
|
+
reject(err);
|
|
2556
|
+
});
|
|
2557
|
+
conn.connect(config);
|
|
2558
|
+
});
|
|
2559
|
+
}
|
|
2560
|
+
/** 隧道管理器实现 */
|
|
2561
|
+
var TunnelManagerImpl = class {
|
|
2562
|
+
config;
|
|
2563
|
+
activeTunnels = /* @__PURE__ */ new Map();
|
|
2564
|
+
/** 失败/断开原因(states() 行 overlay;成功启动/手动停止时清除) */
|
|
2565
|
+
lastError = /* @__PURE__ */ new Map();
|
|
2566
|
+
handlers = /* @__PURE__ */ new Set();
|
|
2567
|
+
constructor(config) {
|
|
2568
|
+
this.config = config;
|
|
2569
|
+
}
|
|
2570
|
+
emit(event) {
|
|
2571
|
+
for (const handler of [...this.handlers]) handler(event);
|
|
2572
|
+
}
|
|
2573
|
+
log(level, message) {
|
|
2574
|
+
this.emit({
|
|
2575
|
+
type: "log",
|
|
2576
|
+
level,
|
|
2577
|
+
message
|
|
2578
|
+
});
|
|
2579
|
+
}
|
|
2580
|
+
async start(name) {
|
|
2581
|
+
try {
|
|
2582
|
+
await this.startInner(name);
|
|
2583
|
+
this.lastError.delete(name);
|
|
2584
|
+
} catch (error) {
|
|
2585
|
+
this.lastError.set(name, error instanceof Error ? error.message : String(error));
|
|
2586
|
+
throw error;
|
|
2587
|
+
}
|
|
2588
|
+
}
|
|
2589
|
+
async startInner(name) {
|
|
2590
|
+
const tunnel = this.config.tunnels.find((t) => t.name === name);
|
|
2591
|
+
if (!tunnel) throw new Error(`未找到隧道: ${name}`);
|
|
2592
|
+
if (this.activeTunnels.has(name)) throw new Error(`隧道 "${name}" 已在运行`);
|
|
2593
|
+
const server = this.config.servers.find((s) => s.name === tunnel.server);
|
|
2594
|
+
if (!server) throw new Error(`找不到服务器: ${tunnel.server}`);
|
|
2595
|
+
this.log("info", `正在连接 ${server.host}...`);
|
|
2596
|
+
const conn = await createSSHConn(server);
|
|
2597
|
+
this.log("info", `SSH 已连接 ${server.username}@${server.host}`);
|
|
2598
|
+
const netServer = createServer((socket) => {
|
|
2599
|
+
conn.forwardOut(socket.remoteAddress || "127.0.0.1", socket.remotePort || 0, tunnel.remoteHost, tunnel.remotePort, (err, stream) => {
|
|
2600
|
+
if (err) {
|
|
2601
|
+
socket.destroy();
|
|
2602
|
+
return;
|
|
2603
|
+
}
|
|
2604
|
+
socket.pipe(stream);
|
|
2605
|
+
stream.pipe(socket);
|
|
2606
|
+
socket.on("error", () => stream.end());
|
|
2607
|
+
socket.on("close", () => stream.end());
|
|
2608
|
+
stream.on("error", () => socket.destroy());
|
|
2609
|
+
stream.on("close", () => socket.destroy());
|
|
2610
|
+
});
|
|
2611
|
+
});
|
|
2612
|
+
try {
|
|
2613
|
+
await new Promise((resolve, reject) => {
|
|
2614
|
+
netServer.on("error", reject);
|
|
2615
|
+
netServer.listen(tunnel.localPort, "127.0.0.1", resolve);
|
|
2616
|
+
});
|
|
2617
|
+
} catch (error) {
|
|
2618
|
+
conn.end();
|
|
2619
|
+
throw error;
|
|
2620
|
+
}
|
|
2621
|
+
conn.on("close", () => {
|
|
2622
|
+
if (!this.activeTunnels.has(name)) return;
|
|
2623
|
+
this.stop(name);
|
|
2624
|
+
this.lastError.set(name, "SSH 连接断开");
|
|
2625
|
+
this.log("warn", `隧道 "${name}" SSH 连接断开`);
|
|
2626
|
+
this.emit({
|
|
2627
|
+
type: "stopped",
|
|
2628
|
+
name,
|
|
2629
|
+
reason: "disconnect"
|
|
2630
|
+
});
|
|
2631
|
+
});
|
|
2632
|
+
conn.on("error", () => {
|
|
2633
|
+
if (!this.activeTunnels.has(name)) return;
|
|
2634
|
+
this.stop(name);
|
|
2635
|
+
this.lastError.set(name, "SSH 错误");
|
|
2636
|
+
this.log("error", `隧道 "${name}" SSH 错误`);
|
|
2637
|
+
this.emit({
|
|
2638
|
+
type: "stopped",
|
|
2639
|
+
name,
|
|
2640
|
+
reason: "error"
|
|
2641
|
+
});
|
|
2642
|
+
});
|
|
2643
|
+
this.activeTunnels.set(name, {
|
|
2644
|
+
server: netServer,
|
|
2645
|
+
conn
|
|
2646
|
+
});
|
|
2647
|
+
this.log("success", `隧道 "${name}" 已启动: localhost:${tunnel.localPort} -> ${tunnel.remoteHost}:${tunnel.remotePort}`);
|
|
2648
|
+
}
|
|
2649
|
+
stop(name) {
|
|
2650
|
+
const active = this.activeTunnels.get(name);
|
|
2651
|
+
if (!active) return;
|
|
2652
|
+
active.server.close();
|
|
2653
|
+
active.conn.end();
|
|
2654
|
+
this.activeTunnels.delete(name);
|
|
2655
|
+
this.lastError.delete(name);
|
|
2656
|
+
}
|
|
2657
|
+
stopAll() {
|
|
2658
|
+
for (const name of [...this.activeTunnels.keys()]) this.stop(name);
|
|
2659
|
+
}
|
|
2660
|
+
status(name) {
|
|
2661
|
+
return this.activeTunnels.has(name) ? "running" : "stopped";
|
|
2662
|
+
}
|
|
2663
|
+
states() {
|
|
2664
|
+
return this.config.tunnels.map((t) => {
|
|
2665
|
+
const running = this.activeTunnels.has(t.name);
|
|
2666
|
+
const error = running ? void 0 : this.lastError.get(t.name);
|
|
2667
|
+
return {
|
|
2668
|
+
name: t.name,
|
|
2669
|
+
server: t.server,
|
|
2670
|
+
localPort: t.localPort,
|
|
2671
|
+
remoteHost: t.remoteHost,
|
|
2672
|
+
remotePort: t.remotePort,
|
|
2673
|
+
autoStart: t.autoStart,
|
|
2674
|
+
status: running ? "running" : error !== void 0 ? "error" : "stopped",
|
|
2675
|
+
message: error
|
|
2676
|
+
};
|
|
2677
|
+
});
|
|
2678
|
+
}
|
|
2679
|
+
async autoStart() {
|
|
2680
|
+
for (const tunnel of this.config.tunnels) {
|
|
2681
|
+
if (!tunnel.autoStart) continue;
|
|
2682
|
+
if (this.activeTunnels.has(tunnel.name)) continue;
|
|
2683
|
+
try {
|
|
2684
|
+
await this.start(tunnel.name);
|
|
2685
|
+
} catch (error) {
|
|
2686
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
2687
|
+
this.log("error", `隧道 "${tunnel.name}" 启动失败: ${message}`);
|
|
2688
|
+
}
|
|
2689
|
+
}
|
|
2690
|
+
}
|
|
2691
|
+
onEvent(handler) {
|
|
2692
|
+
this.handlers.add(handler);
|
|
2693
|
+
return () => {
|
|
2694
|
+
this.handlers.delete(handler);
|
|
2695
|
+
};
|
|
2696
|
+
}
|
|
2697
|
+
};
|
|
2698
|
+
/** 创建隧道管理器(ssh2 隧道沿用 v0.1.0 逻辑重构——spec 6.2 core/tunnel.ts) */
|
|
2699
|
+
function createTunnelManager(config) {
|
|
2700
|
+
return new TunnelManagerImpl(config);
|
|
2701
|
+
}
|
|
2702
|
+
//#endregion
|
|
2703
|
+
//#region src/tui/composables/useTunnels.ts
|
|
2704
|
+
/**
|
|
2705
|
+
* Tunnels 面板数据面(M2-T7,自 v0.1.0 useTunnels 迁移):core/tunnel 事件 → 响应式行 + 全局日志。
|
|
2706
|
+
* - manager log 事件 → useLogs(旧 onLog 归宿);stopped 事件(SSH 断开/错误)→ 行转 error 带原因。
|
|
2707
|
+
* - 行为基线 = v0.1.0 useTunnels;两处意图行为修正:重复启动只 warn 不误标 error 行、
|
|
2708
|
+
* SSH 断开行不再残留 running(旧实现状态漂移)。
|
|
2709
|
+
*/
|
|
2710
|
+
function useTunnels(opts = {}) {
|
|
2711
|
+
const { info, success, warn, error: logError } = useLogs();
|
|
2712
|
+
const config = opts.load ? opts.load() : loadConfig();
|
|
2713
|
+
const manager = opts.manager ?? createTunnelManager(config);
|
|
2714
|
+
const tunnels = ref(manager.states());
|
|
2715
|
+
manager.onEvent((event) => {
|
|
2716
|
+
if (event.type === "log") if (event.level === "info") info(event.message);
|
|
2717
|
+
else if (event.level === "success") success(event.message);
|
|
2718
|
+
else if (event.level === "warn") warn(event.message);
|
|
2719
|
+
else logError(event.message);
|
|
2720
|
+
else tunnels.value = manager.states();
|
|
2721
|
+
});
|
|
2722
|
+
async function start(name) {
|
|
2723
|
+
const tunnel = config.tunnels.find((t) => t.name === name);
|
|
2724
|
+
if (!tunnel) return;
|
|
2725
|
+
if (!config.servers.find((s) => s.name === tunnel.server)) {
|
|
2726
|
+
logError(`找不到服务器: ${tunnel.server}`);
|
|
2727
|
+
return;
|
|
2728
|
+
}
|
|
2729
|
+
if (manager.status(name) === "running") {
|
|
2730
|
+
warn(`隧道 "${name}" 已在运行`);
|
|
2731
|
+
return;
|
|
2732
|
+
}
|
|
2733
|
+
const row = tunnels.value.find((t) => t.name === name);
|
|
2734
|
+
if (row) row.status = "running";
|
|
2735
|
+
try {
|
|
2736
|
+
await manager.start(name);
|
|
2737
|
+
} catch (error) {
|
|
2738
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
2739
|
+
logError(`隧道 "${name}" 启动失败: ${message}`);
|
|
2740
|
+
}
|
|
2741
|
+
tunnels.value = manager.states();
|
|
2742
|
+
}
|
|
2743
|
+
function stop(name) {
|
|
2744
|
+
manager.stop(name);
|
|
2745
|
+
tunnels.value = manager.states();
|
|
2746
|
+
info(`隧道 "${name}" 已停止`);
|
|
2747
|
+
}
|
|
2748
|
+
async function startAll() {
|
|
2749
|
+
for (const t of tunnels.value) {
|
|
2750
|
+
if (t.status === "running") continue;
|
|
2751
|
+
await start(t.name);
|
|
2752
|
+
}
|
|
2753
|
+
}
|
|
2754
|
+
async function autoStart() {
|
|
2755
|
+
await manager.autoStart();
|
|
2756
|
+
tunnels.value = manager.states();
|
|
2757
|
+
}
|
|
2758
|
+
function cleanup() {
|
|
2759
|
+
manager.stopAll();
|
|
2760
|
+
}
|
|
2761
|
+
return {
|
|
2762
|
+
tunnels,
|
|
2763
|
+
start,
|
|
2764
|
+
stop,
|
|
2765
|
+
startAll,
|
|
2766
|
+
autoStart,
|
|
2767
|
+
cleanup
|
|
2768
|
+
};
|
|
2769
|
+
}
|
|
2770
|
+
//#endregion
|
|
2092
2771
|
//#region src/tui/App.vue
|
|
2093
2772
|
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
2094
2773
|
__name: "App",
|
|
@@ -2100,6 +2779,8 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
2100
2779
|
const { rows: containerRows, error: containerError, following, refresh: refreshContainers, restart, stop, remove, followLogs } = useContainers();
|
|
2101
2780
|
const { rows: healthRows, error: healthError, refresh: refreshHealth } = useHealth();
|
|
2102
2781
|
const { projectName: deployProject, steps: deploySteps, lines: deployLines, running: deployRunning, done: deployDone, failedStep: deployFailedStep, start: startDeploy } = useDeployRun();
|
|
2782
|
+
const { tunnels: tunnelRows, start: startTunnel, stop: stopTunnel, startAll: startAllTunnels, autoStart: autoStartTunnels, cleanup: cleanupTunnels } = useTunnels();
|
|
2783
|
+
const { rows: scriptRows, running: scriptRunning, scan: scanScripts, run: runScript } = useScripts();
|
|
2103
2784
|
const activePanel = ref("projects");
|
|
2104
2785
|
const helpVisible = ref(false);
|
|
2105
2786
|
const wizardOpen = ref(false);
|
|
@@ -2108,11 +2789,21 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
2108
2789
|
activePanel.value = panel;
|
|
2109
2790
|
helpVisible.value = false;
|
|
2110
2791
|
},
|
|
2111
|
-
onQuit: () =>
|
|
2792
|
+
onQuit: () => {
|
|
2793
|
+
cleanupTunnels();
|
|
2794
|
+
exit();
|
|
2795
|
+
},
|
|
2112
2796
|
onHelp: () => {
|
|
2113
2797
|
helpVisible.value = !helpVisible.value;
|
|
2114
2798
|
}
|
|
2115
2799
|
});
|
|
2800
|
+
onMounted(() => {
|
|
2801
|
+
scanScripts();
|
|
2802
|
+
autoStartTunnels();
|
|
2803
|
+
});
|
|
2804
|
+
onUnmounted(() => {
|
|
2805
|
+
cleanupTunnels();
|
|
2806
|
+
});
|
|
2116
2807
|
watch(activePanel, (panel) => {
|
|
2117
2808
|
if (panel === "projects") refreshProjects();
|
|
2118
2809
|
else if (panel === "containers") refreshContainers();
|
|
@@ -2181,6 +2872,16 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
2181
2872
|
deployDone,
|
|
2182
2873
|
deployFailedStep,
|
|
2183
2874
|
startDeploy,
|
|
2875
|
+
tunnelRows,
|
|
2876
|
+
startTunnel,
|
|
2877
|
+
stopTunnel,
|
|
2878
|
+
startAllTunnels,
|
|
2879
|
+
autoStartTunnels,
|
|
2880
|
+
cleanupTunnels,
|
|
2881
|
+
scriptRows,
|
|
2882
|
+
scriptRunning,
|
|
2883
|
+
scanScripts,
|
|
2884
|
+
runScript,
|
|
2184
2885
|
activePanel,
|
|
2185
2886
|
helpVisible,
|
|
2186
2887
|
wizardOpen,
|
|
@@ -2190,7 +2891,6 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
2190
2891
|
onDeploy,
|
|
2191
2892
|
onWizardCreated,
|
|
2192
2893
|
onWizardClose,
|
|
2193
|
-
panelTitle: computed(() => `${PANEL_IDS.indexOf(activePanel.value) + 1}. ${PANEL_TITLES[activePanel.value]}`),
|
|
2194
2894
|
get Box() {
|
|
2195
2895
|
return Box;
|
|
2196
2896
|
},
|
|
@@ -2201,8 +2901,10 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
2201
2901
|
DeployPanel: DeployPanel_default,
|
|
2202
2902
|
OutputPanel: OutputPanel_default,
|
|
2203
2903
|
ProjectsPanel: ProjectsPanel_default,
|
|
2904
|
+
ScriptsPanel: ScriptsPanel_default,
|
|
2204
2905
|
StatusPanel: StatusPanel_default,
|
|
2205
2906
|
StatusBar: StatusBar_default,
|
|
2907
|
+
TunnelsPanel: TunnelsPanel_default,
|
|
2206
2908
|
WizardPanel: WizardPanel_default,
|
|
2207
2909
|
get PANEL_IDS() {
|
|
2208
2910
|
return PANEL_IDS;
|
|
@@ -2243,7 +2945,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2243
2945
|
})]),
|
|
2244
2946
|
_: 1
|
|
2245
2947
|
}),
|
|
2246
|
-
createCommentVNode("
|
|
2948
|
+
createCommentVNode(" 主面板区:六面板全部实装(T7 隧道/脚本迁移收尾);创建向导(n)打开时独占主区 "),
|
|
2247
2949
|
createVNode($setup["Box"], {
|
|
2248
2950
|
flexDirection: "column",
|
|
2249
2951
|
flexGrow: 1,
|
|
@@ -2279,22 +2981,38 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2279
2981
|
"error",
|
|
2280
2982
|
"following",
|
|
2281
2983
|
"onRefresh"
|
|
2282
|
-
])) : $setup.activePanel === "deploy" ? (openBlock(),
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2984
|
+
])) : $setup.activePanel === "deploy" ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [createCommentVNode(" 面板 3 Deploy:流水线(T6)+ 脚本区(T7,v0.1.0 DeployPanel 语义)复合;\n gap=0 + 脚本区单行空态:80x24 终端部署进行时 21 行恰好放下(部署框 15 + 脚本框 6) "), createVNode($setup["Box"], {
|
|
2985
|
+
flexDirection: "column",
|
|
2986
|
+
flexGrow: 1,
|
|
2987
|
+
gap: 0
|
|
2988
|
+
}, {
|
|
2989
|
+
default: withCtx(() => [createVNode($setup["DeployPanel"], {
|
|
2990
|
+
"project-name": $setup.deployProject,
|
|
2991
|
+
steps: $setup.deploySteps,
|
|
2992
|
+
lines: $setup.deployLines,
|
|
2993
|
+
running: $setup.deployRunning,
|
|
2994
|
+
done: $setup.deployDone,
|
|
2995
|
+
"failed-step": $setup.deployFailedStep
|
|
2996
|
+
}, null, 8, [
|
|
2997
|
+
"project-name",
|
|
2998
|
+
"steps",
|
|
2999
|
+
"lines",
|
|
3000
|
+
"running",
|
|
3001
|
+
"done",
|
|
3002
|
+
"failed-step"
|
|
3003
|
+
]), createVNode($setup["ScriptsPanel"], {
|
|
3004
|
+
rows: $setup.scriptRows,
|
|
3005
|
+
running: $setup.scriptRunning,
|
|
3006
|
+
onRun: $setup.runScript,
|
|
3007
|
+
onRefresh: $setup.scanScripts
|
|
3008
|
+
}, null, 8, [
|
|
3009
|
+
"rows",
|
|
3010
|
+
"running",
|
|
3011
|
+
"onRun",
|
|
3012
|
+
"onRefresh"
|
|
3013
|
+
])]),
|
|
3014
|
+
_: 1
|
|
3015
|
+
})], 2112)) : $setup.activePanel === "status" ? (openBlock(), createBlock($setup["StatusPanel"], {
|
|
2298
3016
|
key: 4,
|
|
2299
3017
|
rows: $setup.healthRows,
|
|
2300
3018
|
error: $setup.healthError,
|
|
@@ -2303,28 +3021,21 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2303
3021
|
"rows",
|
|
2304
3022
|
"error",
|
|
2305
3023
|
"onRefresh"
|
|
2306
|
-
])) : $setup.activePanel === "
|
|
3024
|
+
])) : $setup.activePanel === "tunnels" ? (openBlock(), createBlock($setup["TunnelsPanel"], {
|
|
2307
3025
|
key: 5,
|
|
2308
|
-
|
|
2309
|
-
|
|
3026
|
+
rows: $setup.tunnelRows,
|
|
3027
|
+
onStart: $setup.startTunnel,
|
|
3028
|
+
onStop: $setup.stopTunnel,
|
|
3029
|
+
onStartAll: $setup.startAllTunnels
|
|
3030
|
+
}, null, 8, [
|
|
3031
|
+
"rows",
|
|
3032
|
+
"onStart",
|
|
3033
|
+
"onStop",
|
|
3034
|
+
"onStartAll"
|
|
3035
|
+
])) : $setup.activePanel === "output" ? (openBlock(), createBlock($setup["OutputPanel"], {
|
|
2310
3036
|
key: 6,
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
borderStyle: "round",
|
|
2314
|
-
padding: 1
|
|
2315
|
-
}, {
|
|
2316
|
-
default: withCtx(() => [createVNode($setup["Text"], {
|
|
2317
|
-
bold: "",
|
|
2318
|
-
color: "cyan"
|
|
2319
|
-
}, {
|
|
2320
|
-
default: withCtx(() => [createTextVNode(toDisplayString($setup.panelTitle), 1)]),
|
|
2321
|
-
_: 1
|
|
2322
|
-
}), createVNode($setup["Text"], { dimColor: "" }, {
|
|
2323
|
-
default: withCtx(() => [..._cache[6] || (_cache[6] = [createTextVNode("(骨架占位:面板内容随 M2 后续任务实现)", -1)])]),
|
|
2324
|
-
_: 1
|
|
2325
|
-
})]),
|
|
2326
|
-
_: 1
|
|
2327
|
-
}))]),
|
|
3037
|
+
logs: $setup.logs
|
|
3038
|
+
}, null, 8, ["logs"])) : createCommentVNode("v-if", true)]),
|
|
2328
3039
|
_: 1
|
|
2329
3040
|
}),
|
|
2330
3041
|
createCommentVNode(" 帮助浮层(? 开关) "),
|
|
@@ -2341,7 +3052,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2341
3052
|
bold: "",
|
|
2342
3053
|
color: "yellow"
|
|
2343
3054
|
}, {
|
|
2344
|
-
default: withCtx(() => [..._cache[
|
|
3055
|
+
default: withCtx(() => [..._cache[6] || (_cache[6] = [createTextVNode("快捷键帮助", -1)])]),
|
|
2345
3056
|
_: 1
|
|
2346
3057
|
}),
|
|
2347
3058
|
(openBlock(true), createElementBlock(Fragment, null, renderList($setup.PANEL_IDS, (id, i) => {
|
|
@@ -2351,7 +3062,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2351
3062
|
}, 1024);
|
|
2352
3063
|
}), 128)),
|
|
2353
3064
|
createVNode($setup["Text"], null, {
|
|
2354
|
-
default: withCtx(() => [..._cache[
|
|
3065
|
+
default: withCtx(() => [..._cache[7] || (_cache[7] = [createTextVNode("? 打开/关闭帮助 │ q 退出", -1)])]),
|
|
2355
3066
|
_: 1
|
|
2356
3067
|
})
|
|
2357
3068
|
]),
|