mirror of
https://github.com/certd/certd.git
synced 2026-04-24 04:17:25 +08:00
chore: 支持手动上传证书并部署
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
<template>
|
||||
<div class="file-input">
|
||||
<a-button :type="type" @click="onClick">{{ text }}</a-button> {{ fileName }}
|
||||
<div class="hidden">
|
||||
<input ref="fileInputRef" type="file" @change="onFileChange" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, defineEmits, defineProps } from "vue";
|
||||
const fileInputRef = ref<HTMLInputElement | null>(null);
|
||||
|
||||
const props = defineProps<{
|
||||
text: string;
|
||||
type: string;
|
||||
}>();
|
||||
const fileName = ref("");
|
||||
const emit = defineEmits(["change"]);
|
||||
function onClick() {
|
||||
fileInputRef.value.click();
|
||||
}
|
||||
function onFileChange(e: any) {
|
||||
fileName.value = e.target.files[0].name;
|
||||
emit("change", e);
|
||||
}
|
||||
</script>
|
||||
@@ -10,10 +10,12 @@ import Plugins from "./plugins/index";
|
||||
import LoadingButton from "./loading-button.vue";
|
||||
import IconSelect from "./icon-select.vue";
|
||||
import ExpiresTimeText from "./expires-time-text.vue";
|
||||
import FileInput from "./file-input.vue";
|
||||
export default {
|
||||
install(app: any) {
|
||||
app.component("PiContainer", PiContainer);
|
||||
app.component("TextEditable", TextEditable);
|
||||
app.component("FileInput", FileInput);
|
||||
|
||||
app.component("CronLight", CronLight);
|
||||
app.component("CronEditor", CronEditor);
|
||||
@@ -29,5 +31,5 @@ export default {
|
||||
app.component("ExpiresTimeText", ExpiresTimeText);
|
||||
app.use(vip);
|
||||
app.use(Plugins);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user