@lazycatcloud/lzc-cli 1.1.8 → 1.1.9
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/README.md +69 -11
- package/lib/api.js +71 -39
- package/lib/app/index.js +76 -21
- package/lib/app/lpk_build.js +95 -63
- package/lib/app/lpk_create.js +63 -41
- package/lib/app/lpk_create_generator.js +202 -0
- package/lib/app/lpk_devshell.js +393 -328
- package/lib/app/lpk_devshell_docker.js +211 -0
- package/lib/app/lpk_installer.js +63 -26
- package/lib/app/lpk_log.js +68 -0
- package/lib/app/lpk_status.js +18 -0
- package/lib/app/lpk_uninstall.js +19 -0
- package/lib/appstore/index.js +37 -0
- package/lib/appstore/login.js +96 -93
- package/lib/appstore/publish.js +62 -0
- package/lib/autologin.js +0 -78
- package/lib/box/api/clientapi.js +1322 -0
- package/lib/box/api/empty.js +35 -0
- package/lib/box/check_qemu.js +1 -0
- package/lib/box/index.js +41 -94
- package/lib/box/qemu_vm_mgr.js +208 -239
- package/lib/box/schemes/vm_box_system_debian.json +1 -1
- package/lib/docker-compose.js +1 -2
- package/lib/env.js +19 -101
- package/lib/key.js +1 -0
- package/lib/sdk.js +10 -25
- package/lib/utils.js +156 -132
- package/package.json +19 -10
- package/scripts/cli.js +14 -135
- package/template/_lpk/README.md +31 -0
- package/template/_lpk/exec.sh +19 -0
- package/template/_lpk/golang.manifest.yml.in +16 -0
- package/template/_lpk/lazycat.png +0 -0
- package/template/_lpk/lite.manifest.yml.in +19 -0
- package/template/_lpk/local_devshell/Dockerfile +16 -0
- package/template/_lpk/local_devshell/build.sh +5 -0
- package/template/_lpk/local_devshell/entrypoint.sh +87 -0
- package/template/{_lazycat/debug/shell → _lpk/local_devshell}/sshd_config +8 -8
- package/template/_lpk/manifest.yml.in +0 -1
- package/template/{vue/lzc-build.yml → _lpk/vue.lzc-build.yml.in} +9 -1
- package/template/golang/README.md +0 -2
- package/template/golang/_gitignore +2 -0
- package/template/golang/build.sh +6 -0
- package/template/golang/lazycat.png +0 -0
- package/template/golang/lzc-build.yml +9 -1
- package/template/golang/rego.go +15 -16
- package/template/golang/rego_test.go +13 -0
- package/template/ionic_vue3/lazycat.png +0 -0
- package/template/ionic_vue3/lzc-build.yml +9 -1
- package/template/lite/error_pages/502.html.tpl +13 -0
- package/template/lite/lazycat.png +0 -0
- package/template/lite/lzc-build.yml +60 -0
- package/cmds/app.js +0 -133
- package/cmds/config.js +0 -55
- package/cmds/create.js +0 -55
- package/cmds/dev.js +0 -130
- package/cmds/init.js +0 -125
- package/cmds/log.js +0 -103
- package/cmds/publish.js +0 -116
- package/lib/archiver.js +0 -105
- package/lib/box/hportal.js +0 -120
- package/lib/builder.js +0 -313
- package/lib/dev.js +0 -314
- package/lib/generator.js +0 -146
- package/template/_lazycat/_gitignore +0 -1
- package/template/_lazycat/app-config +0 -1
- package/template/_lazycat/debug/devforward/50x.html +0 -30
- package/template/_lazycat/debug/devforward/Dockerfile +0 -16
- package/template/_lazycat/debug/devforward/docker-compose.override.yml.in +0 -11
- package/template/_lazycat/debug/devforward/entrypoint.sh +0 -10
- package/template/_lazycat/debug/devforward/nginx.conf.template +0 -56
- package/template/_lazycat/debug/devforward/sshd_config +0 -116
- package/template/_lazycat/debug/shell/50x.html +0 -32
- package/template/_lazycat/debug/shell/Dockerfile +0 -18
- package/template/_lazycat/debug/shell/build.sh +0 -15
- package/template/_lazycat/debug/shell/docker-compose.override.yml.in +0 -13
- package/template/_lazycat/debug/shell/entrypoint.sh +0 -12
- package/template/_lazycat/docker-compose.yml.in +0 -15
- package/template/_lazycat/icon.svg +0 -1
- package/template/_lazycat/screenshot.png +0 -0
- package/template/_lpk/sync/Dockerfile +0 -16
- package/template/_lpk/sync/build.sh +0 -5
- package/template/_lpk/sync/entrypoint.sh +0 -8
- package/template/_lpk/sync/sshd_config +0 -117
- package/template/_lpk/sync.manifest.yml.in +0 -3
- package/template/release/golang/Dockerfile +0 -18
- package/template/release/golang/build.sh +0 -13
- package/template/release/ionic_vue3/Dockerfile +0 -10
- package/template/release/ionic_vue3/build.sh +0 -7
- package/template/release/ionic_vue3/docker-compose.yml.in +0 -3
- package/template/release/vue/Dockerfile +0 -10
- package/template/release/vue/build.sh +0 -10
- package/template/release/vue/docker-compose.yml.in +0 -3
- package/template/vue/README.md +0 -29
- package/template/vue/_dockerignore +0 -1
- package/template/vue/babel.config.js +0 -3
- package/template/vue/package.json +0 -43
- package/template/vue/public/favicon.ico +0 -0
- package/template/vue/public/index.html +0 -33
- package/template/vue/src/App.vue +0 -39
- package/template/vue/src/main.js +0 -8
- package/template/vue/src/todo.vue +0 -640
- package/template/vue/src/top-bar.vue +0 -100
- package/template/vue/src/webdav.vue +0 -183
- package/template/vue/vue.config.js +0 -21
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="webdav">
|
|
3
|
-
<div class="fm-title">
|
|
4
|
-
<div class="fm-title-path">
|
|
5
|
-
当前路径:
|
|
6
|
-
<span>{{ pwd }}</span>
|
|
7
|
-
</div>
|
|
8
|
-
</div>
|
|
9
|
-
|
|
10
|
-
<div class="fm-content">
|
|
11
|
-
<table>
|
|
12
|
-
<thead>
|
|
13
|
-
<tr>
|
|
14
|
-
<th>MIME类型</th>
|
|
15
|
-
<th>最后更新</th>
|
|
16
|
-
<th>大小</th>
|
|
17
|
-
<th>是否文件夹</th>
|
|
18
|
-
<th>文件名</th>
|
|
19
|
-
</tr>
|
|
20
|
-
</thead>
|
|
21
|
-
<tbody>
|
|
22
|
-
<tr>
|
|
23
|
-
<td></td>
|
|
24
|
-
<td></td>
|
|
25
|
-
<td></td>
|
|
26
|
-
<td></td>
|
|
27
|
-
<td class="fm-arrow" @click="handleLast">↵..</td>
|
|
28
|
-
</tr>
|
|
29
|
-
<tr
|
|
30
|
-
v-for="item in items"
|
|
31
|
-
:key="item.filename"
|
|
32
|
-
:title="`文件路径: ` + item.filename"
|
|
33
|
-
>
|
|
34
|
-
<td>{{ item.mime || "-" }}</td>
|
|
35
|
-
<td>{{ item.lastmod }}</td>
|
|
36
|
-
<td>{{ item.size }}</td>
|
|
37
|
-
<td>{{ item.type === "directory" ? "是" : "否" }}</td>
|
|
38
|
-
<td
|
|
39
|
-
:class="[item.type === 'directory' ? 'is-dir' : 'is-file']"
|
|
40
|
-
@click="handleFile(item)"
|
|
41
|
-
>
|
|
42
|
-
{{ item.basename }}
|
|
43
|
-
</td>
|
|
44
|
-
<td class="fm-delete" @click="handleDelete(item)">✗</td>
|
|
45
|
-
</tr>
|
|
46
|
-
</tbody>
|
|
47
|
-
</table>
|
|
48
|
-
</div>
|
|
49
|
-
|
|
50
|
-
<div class="fm-bottom"></div>
|
|
51
|
-
</div>
|
|
52
|
-
</template>
|
|
53
|
-
|
|
54
|
-
<script>
|
|
55
|
-
function pathJoin(path1, path2) {
|
|
56
|
-
let res = path1 + "/" + path2;
|
|
57
|
-
return (
|
|
58
|
-
"/" +
|
|
59
|
-
res
|
|
60
|
-
.split("/")
|
|
61
|
-
.filter((r) => r !== "")
|
|
62
|
-
.join("/")
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export default {
|
|
67
|
-
async mounted() {
|
|
68
|
-
this.enterDir(this.pwd);
|
|
69
|
-
},
|
|
70
|
-
data() {
|
|
71
|
-
return {
|
|
72
|
-
pwd: "/",
|
|
73
|
-
items: [],
|
|
74
|
-
};
|
|
75
|
-
},
|
|
76
|
-
methods: {
|
|
77
|
-
async isDir(path) {
|
|
78
|
-
try {
|
|
79
|
-
let res = await this.$lzc.fs.stat(path);
|
|
80
|
-
return res.type === "directory";
|
|
81
|
-
} catch (e) {
|
|
82
|
-
return Promise.reject(e);
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
toPwd(path) {
|
|
86
|
-
let p;
|
|
87
|
-
if (path.startsWith("/")) {
|
|
88
|
-
p = path;
|
|
89
|
-
} else {
|
|
90
|
-
p = pathJoin(this.pwd, path);
|
|
91
|
-
}
|
|
92
|
-
return p;
|
|
93
|
-
},
|
|
94
|
-
enterDir(path) {
|
|
95
|
-
return this.$lzc.fs
|
|
96
|
-
.getDirectoryContents(path)
|
|
97
|
-
.then((res) => {
|
|
98
|
-
this.items = res;
|
|
99
|
-
this.pwd = path;
|
|
100
|
-
})
|
|
101
|
-
.catch((err) => console.error(err));
|
|
102
|
-
},
|
|
103
|
-
download(path) {
|
|
104
|
-
let res = this.$lzc.fs.getFileDownloadLink(path);
|
|
105
|
-
let basename = path.split("/").reverse()[0];
|
|
106
|
-
let a = document.createElement("a");
|
|
107
|
-
a.href = res;
|
|
108
|
-
a.download = basename;
|
|
109
|
-
a.click();
|
|
110
|
-
},
|
|
111
|
-
handleFile(item) {
|
|
112
|
-
if (item.type === "directory") {
|
|
113
|
-
return this.enterDir(this.toPwd(item.basename));
|
|
114
|
-
} else {
|
|
115
|
-
return this.download(this.toPwd(item.basename));
|
|
116
|
-
}
|
|
117
|
-
},
|
|
118
|
-
handleLast() {
|
|
119
|
-
let res = this.pwd.split("/").reverse().slice(1);
|
|
120
|
-
this.enterDir("/" + res.reverse().join("/"));
|
|
121
|
-
},
|
|
122
|
-
handleDelete(item) {
|
|
123
|
-
this.$lzc.fs
|
|
124
|
-
.deleteFile(item.filename)
|
|
125
|
-
.then(() => {
|
|
126
|
-
this.enterDir(this.pwd);
|
|
127
|
-
})
|
|
128
|
-
.catch((e) => {
|
|
129
|
-
console.error(e);
|
|
130
|
-
});
|
|
131
|
-
},
|
|
132
|
-
},
|
|
133
|
-
};
|
|
134
|
-
</script>
|
|
135
|
-
|
|
136
|
-
<style scoped>
|
|
137
|
-
.webdav {
|
|
138
|
-
width: 100%;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
.fm-title {
|
|
142
|
-
margin: 14px;
|
|
143
|
-
}
|
|
144
|
-
.fm-title-path {
|
|
145
|
-
display: flex;
|
|
146
|
-
flex-direction: row;
|
|
147
|
-
}
|
|
148
|
-
.fm-title-path span {
|
|
149
|
-
margin-left: 14px;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
.fm-item {
|
|
153
|
-
display: flex;
|
|
154
|
-
flex-direction: row;
|
|
155
|
-
}
|
|
156
|
-
.fm-content {
|
|
157
|
-
margin: 14px;
|
|
158
|
-
}
|
|
159
|
-
th,
|
|
160
|
-
td {
|
|
161
|
-
padding: 0 14px;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
.is-dir {
|
|
165
|
-
color: #3daee9;
|
|
166
|
-
cursor: pointer;
|
|
167
|
-
}
|
|
168
|
-
.is-file {
|
|
169
|
-
color: #1cdc9a;
|
|
170
|
-
cursor: pointer;
|
|
171
|
-
}
|
|
172
|
-
.is-dir:hover {
|
|
173
|
-
text-decoration: underline;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
.fm-arrow {
|
|
177
|
-
color: #da4453;
|
|
178
|
-
}
|
|
179
|
-
.fm-delete {
|
|
180
|
-
color: #da4453;
|
|
181
|
-
cursor: pointer;
|
|
182
|
-
}
|
|
183
|
-
</style>
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
const nodeVersions = process.versions.node.split(".");
|
|
2
|
-
if (
|
|
3
|
-
nodeVersions[0] >= 17 &&
|
|
4
|
-
process.env["NODE_OPTIONS"] &&
|
|
5
|
-
process.env["NODE_OPTIONS"].search(/--openssl-legacy-provider/) == -1
|
|
6
|
-
) {
|
|
7
|
-
console.warn(`
|
|
8
|
-
当前 nodejs 版本为 ${process.version}
|
|
9
|
-
|
|
10
|
-
nodejs 17.0.0 后的版本由于使用的 openssl 3.0 的原因。需要使用设置
|
|
11
|
-
export NODE_OPTIONS=--openssl-legacy-provider
|
|
12
|
-
|
|
13
|
-
推荐使用 vue3 进行开发。
|
|
14
|
-
`);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
module.exports = {
|
|
18
|
-
devServer: {
|
|
19
|
-
historyApiFallback: true,
|
|
20
|
-
},
|
|
21
|
-
};
|