新增 html

This commit is contained in:
fofolee 2022-04-22 17:32:22 +08:00
parent 0909e76bbb
commit 9101892376
5 changed files with 31 additions and 5 deletions

BIN
plugin/logo/html.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -84,6 +84,7 @@
<div class="col-auto justify-end flex">
<q-btn-group unelevated>
<q-btn-dropdown
v-show="quickcommandInfo.program !== 'html'"
style="padding: 0 10px"
dense
flat
@ -374,7 +375,10 @@ export default {
//
runCurrentCommand() {
let command = _.cloneDeep(this.quickcommandInfo);
command.output = this.$refs.sidebar?.currentCommand.output || "text";
command.output =
this.$refs.sidebar?.currentCommand.output || command.program === "html"
? "html"
: "text";
command.cmdType = this.$refs.sidebar?.cmdType.name;
this.$refs.result.runCurrentCommand(command);
},

View File

@ -113,6 +113,8 @@ export default {
}
!outPlugin && this.showRunResult(stdout, true, action);
});
} else if (currentCommand.program === "html") {
this.showRunResult(currentCommand.cmd, true, action);
} else {
let option =
currentCommand.program === "custom"

View File

@ -312,9 +312,21 @@ export default {
return x;
},
outputTypesOptionsDy() {
return this.$parent.quickcommandInfo.program === "quickcommand"
? _.without(this.outputTypesOptions, "terminal")
: this.outputTypesOptions;
switch (this.$parent.quickcommandInfo.program) {
case "quickcommand":
return _.without(this.outputTypesOptions, "terminal");
case "html":
return ["html"];
default:
return this.outputTypesOptions;
}
},
},
watch: {
outputTypesOptionsDy(val) {
if (!val.includes(this.currentCommand.output)) {
this.currentCommand.output = val[0];
}
},
},
methods: {

View File

@ -12,6 +12,14 @@ const programs = {
color: "primary",
icon: "logo/quickcommand.png",
},
html: {
name: "html",
bin: "",
argv: "",
ext: "",
color: "deep-orange",
icon: "logo/html.png",
},
shell: {
name: "shell",
bin: "bash",
@ -118,4 +126,4 @@ const programs = {
icon: "logo/custom.png",
},
};
export default programs
export default programs