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

View File

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

View File

@ -312,9 +312,21 @@ export default {
return x; return x;
}, },
outputTypesOptionsDy() { outputTypesOptionsDy() {
return this.$parent.quickcommandInfo.program === "quickcommand" switch (this.$parent.quickcommandInfo.program) {
? _.without(this.outputTypesOptions, "terminal") case "quickcommand":
: this.outputTypesOptions; 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: { methods: {

View File

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