wip custom certificates

This commit is contained in:
Dennis
2021-07-29 09:07:06 +02:00
parent 58ffbe8c74
commit 6601f44013
6 changed files with 54 additions and 37 deletions

48
package-lock.json generated
View File

@@ -6,10 +6,10 @@
"": {
"devDependencies": {
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@inertiajs/inertia": "^0.9.2",
"@inertiajs/inertia-vue": "^0.6.2",
"@inertiajs/progress": "^0.2.5",
"@tailwindcss/forms": "^0.3.3",
"@inertiajs/inertia": "^0.10.0",
"@inertiajs/inertia-vue": "^0.7.1",
"@inertiajs/progress": "^0.2.6",
"@tailwindcss/forms": "^0.3.2",
"@tailwindcss/typography": "^0.4.1",
"autoprefixer": "^10.2.5",
"axios": "^0.21.1",
@@ -1597,9 +1597,9 @@
}
},
"node_modules/@inertiajs/inertia": {
"version": "0.9.2",
"resolved": "https://registry.npmjs.org/@inertiajs/inertia/-/inertia-0.9.2.tgz",
"integrity": "sha512-itHzyc/Qq3zd9GZPkL5vbd2ir7BELHalablNptvHkiJ1rU/WGI8Fdh1zjZIVBEmqB/EjA6YGoUVl3ftYFP1uoQ==",
"version": "0.10.0",
"resolved": "https://registry.npmjs.org/@inertiajs/inertia/-/inertia-0.10.0.tgz",
"integrity": "sha512-WGjVOeY4UENv2IVe921pTZFqH3VR5bqucjWoK2ES4w9wILr/YroMx2npkLHyL9LHiBeVWZBX3YJlv22fhFQ5nw==",
"dev": true,
"dependencies": {
"axios": "^0.21.1",
@@ -1608,16 +1608,16 @@
}
},
"node_modules/@inertiajs/inertia-vue": {
"version": "0.6.2",
"resolved": "https://registry.npmjs.org/@inertiajs/inertia-vue/-/inertia-vue-0.6.2.tgz",
"integrity": "sha512-VZyRkvA85ok1qei1CM6w+3rPNVvrWWfEKUS6VZ/4TSD+EyRitUpPAB2owp2UiPk/TGhOBVsmSV578msfC8lmhQ==",
"version": "0.7.1",
"resolved": "https://registry.npmjs.org/@inertiajs/inertia-vue/-/inertia-vue-0.7.1.tgz",
"integrity": "sha512-ysmmCv+d56ox9lrbFO4IrW1z1+kHWVIBSE6xhc0W4+tOtlOlIGL5nsGtGOAwFT9JNOk3hF9lrqKWESUPa6YeAg==",
"dev": true,
"dependencies": {
"lodash.clonedeep": "^4.5.0",
"lodash.isequal": "^4.5.0"
},
"peerDependencies": {
"@inertiajs/inertia": "^0.9.0",
"@inertiajs/inertia": "^0.10.0",
"vue": "^2.6.0"
}
},
@@ -1637,15 +1637,15 @@
}
},
"node_modules/@inertiajs/progress": {
"version": "0.2.5",
"resolved": "https://registry.npmjs.org/@inertiajs/progress/-/progress-0.2.5.tgz",
"integrity": "sha512-BSO/gHPY5oLYeAoSJMj3Cjr+oaXnbTy3noDPXN0KOgoUF1xbVrnHpac0BhIwCsF3svOK1xfI2WveWo4FFJ99MQ==",
"version": "0.2.6",
"resolved": "https://registry.npmjs.org/@inertiajs/progress/-/progress-0.2.6.tgz",
"integrity": "sha512-ZhrP9d4QGFoAWN7+I/4lv1BWruAvOfhTKgPoMJd2PUi3aVEgn5wBzbL6heQJgCASrIQvReud5UPum4sxxoWrlA==",
"dev": true,
"dependencies": {
"nprogress": "^0.2.0"
},
"peerDependencies": {
"@inertiajs/inertia": "^0.6.0 || ^0.7.0 || ^0.8.0 || ^0.9.0"
"@inertiajs/inertia": "^0.6.0 || ^0.7.0 || ^0.8.0 || ^0.9.0 || ^0.10.0"
}
},
"node_modules/@nodelib/fs.scandir": {
@@ -11620,9 +11620,9 @@
}
},
"@inertiajs/inertia": {
"version": "0.9.2",
"resolved": "https://registry.npmjs.org/@inertiajs/inertia/-/inertia-0.9.2.tgz",
"integrity": "sha512-itHzyc/Qq3zd9GZPkL5vbd2ir7BELHalablNptvHkiJ1rU/WGI8Fdh1zjZIVBEmqB/EjA6YGoUVl3ftYFP1uoQ==",
"version": "0.10.0",
"resolved": "https://registry.npmjs.org/@inertiajs/inertia/-/inertia-0.10.0.tgz",
"integrity": "sha512-WGjVOeY4UENv2IVe921pTZFqH3VR5bqucjWoK2ES4w9wILr/YroMx2npkLHyL9LHiBeVWZBX3YJlv22fhFQ5nw==",
"dev": true,
"requires": {
"axios": "^0.21.1",
@@ -11642,9 +11642,9 @@
}
},
"@inertiajs/inertia-vue": {
"version": "0.6.2",
"resolved": "https://registry.npmjs.org/@inertiajs/inertia-vue/-/inertia-vue-0.6.2.tgz",
"integrity": "sha512-VZyRkvA85ok1qei1CM6w+3rPNVvrWWfEKUS6VZ/4TSD+EyRitUpPAB2owp2UiPk/TGhOBVsmSV578msfC8lmhQ==",
"version": "0.7.1",
"resolved": "https://registry.npmjs.org/@inertiajs/inertia-vue/-/inertia-vue-0.7.1.tgz",
"integrity": "sha512-ysmmCv+d56ox9lrbFO4IrW1z1+kHWVIBSE6xhc0W4+tOtlOlIGL5nsGtGOAwFT9JNOk3hF9lrqKWESUPa6YeAg==",
"dev": true,
"requires": {
"lodash.clonedeep": "^4.5.0",
@@ -11652,9 +11652,9 @@
}
},
"@inertiajs/progress": {
"version": "0.2.5",
"resolved": "https://registry.npmjs.org/@inertiajs/progress/-/progress-0.2.5.tgz",
"integrity": "sha512-BSO/gHPY5oLYeAoSJMj3Cjr+oaXnbTy3noDPXN0KOgoUF1xbVrnHpac0BhIwCsF3svOK1xfI2WveWo4FFJ99MQ==",
"version": "0.2.6",
"resolved": "https://registry.npmjs.org/@inertiajs/progress/-/progress-0.2.6.tgz",
"integrity": "sha512-ZhrP9d4QGFoAWN7+I/4lv1BWruAvOfhTKgPoMJd2PUi3aVEgn5wBzbL6heQJgCASrIQvReud5UPum4sxxoWrlA==",
"dev": true,
"requires": {
"nprogress": "^0.2.0"

View File

@@ -10,10 +10,10 @@
},
"devDependencies": {
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@inertiajs/inertia": "^0.9.2",
"@inertiajs/inertia-vue": "^0.6.2",
"@inertiajs/progress": "^0.2.5",
"@tailwindcss/forms": "^0.3.3",
"@inertiajs/inertia": "^0.10.0",
"@inertiajs/inertia-vue": "^0.7.1",
"@inertiajs/progress": "^0.2.6",
"@tailwindcss/forms": "^0.3.2",
"@tailwindcss/typography": "^0.4.1",
"autoprefixer": "^10.2.5",
"axios": "^0.21.1",

7
public/js/app.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -19,12 +19,20 @@
<SettingsSegment>
<template #title>{{ __('Create') }}</template>
<template #subtitle>
{{ __('Request a new Let\'s Encrypt certificate here. Make sure that the DNS has fully propagated.')}}
<span v-if="form.type === 'letsencrypt'" v-text="__('Request a new Let\'s Encrypt certificate here. Make sure that the DNS has fully propagated.')"></span>
<span v-if="form.type === 'custom'" v-text="__('Install your own SSL certificate here. Make sure to enter the private key and certificate.')"></span>
</template>
<template #form>
<form class="space-y-4" @submit.prevent="submit">
<FormInput :label="__('Domain')" :errors="$page.props.errors.domain" v-model="form.domain"/>
<FormSelect :label="__('Select certificate type')" v-model="form.type">
<option value="letsencrypt">Let's Encrypt certificate</option>
<option value="custom">Custom SSL certificate</option>
</FormSelect>
<FormInput v-if="form.type === 'letsencrypt'" :label="__('Domain')" :errors="$page.props.errors.domain" v-model="form.domain"/>
<FormTextarea v-if="form.type === 'custom'" :label="__('Private key')" :errors="$page.props.errors.private_key" rows="2" v-model="form.private_key" />
<FormTextarea v-if="form.type === 'custom'" :label="__('Certificate')" :errors="$page.props.errors.certificate" rows="2" v-model="form.certificate" />
<FormActions>
<Button>{{ __('Save changes') }}</Button>
</FormActions>
@@ -88,6 +96,8 @@
import SettingsLayout from '@/components/layouts/SettingsLayout'
import SettingsSegment from '@/components/SettingsSegment'
import FormInput from '@/components/forms/FormInput'
import FormSelect from '@/components/forms/FormSelect'
import FormTextarea from '@/components/forms/FormTextarea'
import Form from '@/components/Form'
import Pagination from '@/components/Pagination'
import EmptyImage from '@/components/EmptyImage'
@@ -124,6 +134,8 @@
StatusBubble,
NotificationBadge,
FormInput,
FormSelect,
FormTextarea,
SettingsLayout,
SettingsSegment,
Form,
@@ -145,6 +157,7 @@
form: {
domain: null,
type: 'letsencrypt'
},
breadcrumbs: [
@@ -225,14 +238,15 @@
submit() {
this.sending = true
this.$inertia.post(this.route('sites.certificates.store', this.site.id), this.form)
.then(() => {
this.$inertia.post(this.route('sites.certificates.store', this.site.id), this.form, {
onFinish: () => {
this.sending = false
if (!Object.keys(this.$page.props.errors).length) {
this.setDomainData();
}
})
}
});
},
confirmDelete(certificate) {

3
resources/js/app.js vendored
View File

@@ -1,4 +1,4 @@
import { InertiaApp, plugin } from '@inertiajs/inertia-vue'
import { InertiaApp, plugin, InertiaLink } from '@inertiajs/inertia-vue'
import Vue from 'vue';
import VueMeta from 'vue-meta'
import store from '@/store'
@@ -14,6 +14,7 @@ Vue.use(VueMeta)
Vue.use(VueClipboard)
Vue.mixin({ methods: { route: window.route } })
Vue.mixin(require('./mixins'));
Vue.component('InertiaLink', InertiaLink)
import { InertiaProgress } from '@inertiajs/progress'
InertiaProgress.init({

View File

@@ -92,6 +92,7 @@
"Permanent": "Permanent",
"Certificate has been created": "Certificaat is aangemaakt",
"Certificate has been deleted": "Certificaat is verwijderd",
"Select certificate type": "Selecteer certificaat type",
"Danger zone": "Gevaren zone",
"Current password": "Huidig wachtwoord",
"New password": "Nieuw wachtwoord",