mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-05-25 16:12:34 +02:00
Add CA file upload to the maria db ui
This commit is contained in:
parent
0943e5d354
commit
bef4479976
2 changed files with 32 additions and 1 deletions
|
@ -6,6 +6,7 @@
|
||||||
"setupDatabaseSQLite": "A simple database file, recommended for small-scale deployments. Prior to v2.0.0, Uptime Kuma used SQLite as the default database.",
|
"setupDatabaseSQLite": "A simple database file, recommended for small-scale deployments. Prior to v2.0.0, Uptime Kuma used SQLite as the default database.",
|
||||||
"settingUpDatabaseMSG": "Setting up the database. It may take a while, please be patient.",
|
"settingUpDatabaseMSG": "Setting up the database. It may take a while, please be patient.",
|
||||||
"dbName": "Database Name",
|
"dbName": "Database Name",
|
||||||
|
"caFile": "Database CA certificate",
|
||||||
"Settings": "Settings",
|
"Settings": "Settings",
|
||||||
"Dashboard": "Dashboard",
|
"Dashboard": "Dashboard",
|
||||||
"Help": "Help",
|
"Help": "Help",
|
||||||
|
|
|
@ -90,8 +90,12 @@
|
||||||
<input id="floatingInput" v-model="dbConfig.dbName" type="text" class="form-control" required>
|
<input id="floatingInput" v-model="dbConfig.dbName" type="text" class="form-control" required>
|
||||||
<label for="floatingInput">{{ $t("dbName") }}</label>
|
<label for="floatingInput">{{ $t("dbName") }}</label>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
|
||||||
|
|
||||||
|
<div class="mb2 mt-3 short">
|
||||||
|
<label for="caInput" class="mb-2">{{ $t("caFile") }}</label>
|
||||||
|
<input id="caInput" type="file" accept="application/x-pem-file, .pem" class="form-control" @change="onCaFileChange">
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
<button class="btn btn-primary mt-4 short" type="submit" :disabled="disabledButton">
|
<button class="btn btn-primary mt-4 short" type="submit" :disabled="disabledButton">
|
||||||
{{ $t("Next") }}
|
{{ $t("Next") }}
|
||||||
</button>
|
</button>
|
||||||
|
@ -117,6 +121,7 @@ export default {
|
||||||
username: "",
|
username: "",
|
||||||
password: "",
|
password: "",
|
||||||
dbName: "kuma",
|
dbName: "kuma",
|
||||||
|
caFile: ""
|
||||||
},
|
},
|
||||||
info: {
|
info: {
|
||||||
needSetup: false,
|
needSetup: false,
|
||||||
|
@ -178,6 +183,15 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onCaFileChange(e) {
|
||||||
|
const fileReader = new FileReader();
|
||||||
|
fileReader.onload = () => {
|
||||||
|
this.dbConfig.caFile = fileReader.result;
|
||||||
|
console.log(this.dbConfig.caFile);
|
||||||
|
};
|
||||||
|
fileReader.readAsDataURL(e.target.files[0]);
|
||||||
|
},
|
||||||
|
|
||||||
test() {
|
test() {
|
||||||
this.$root.toastError("not implemented");
|
this.$root.toastError("not implemented");
|
||||||
}
|
}
|
||||||
|
@ -186,6 +200,22 @@ export default {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
@import "../assets/vars.scss";
|
||||||
|
|
||||||
|
.dark {
|
||||||
|
#caInput {
|
||||||
|
&::file-selector-button {
|
||||||
|
color: $primary;
|
||||||
|
background-color: $dark-bg;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover:not(:disabled):not([readonly])::file-selector-button {
|
||||||
|
color: $dark-font-color2;
|
||||||
|
background-color: $primary;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.form-container {
|
.form-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
Loading…
Add table
Reference in a new issue