small setup patches (spelling mistakes)

This commit is contained in:
2023-11-12 12:09:27 +01:00
parent f6e4d3f8e3
commit 0d8f3d3e0a
3 changed files with 7 additions and 5 deletions

View File

@@ -54,6 +54,7 @@ module.exports = ( app, settings ) => {
} }
let updatedSettings = settings; let updatedSettings = settings;
updatedSettings[ 'name' ] = req.body.websiteName; updatedSettings[ 'name' ] = req.body.websiteName;
updatedSettings[ 'yourDomain' ] = req.body.yourDomain;
updatedSettings[ 'mailSender' ] = req.body.mailDisplay; updatedSettings[ 'mailSender' ] = req.body.mailDisplay;
db.saveSettings( updatedSettings ); db.saveSettings( updatedSettings );
res.send( 'ok' ); res.send( 'ok' );

View File

@@ -17,6 +17,8 @@
<h2>General information</h2> <h2>General information</h2>
<label for="name">Name of the website</label><br> <label for="name">Name of the website</label><br>
<input type="text" name="name" id="name" v-model="formData.websiteName"><br> <input type="text" name="name" id="name" v-model="formData.websiteName"><br>
<label for="name">URL of the website</label><br>
<input type="text" name="domain" id="domain" v-model="formData.yourDomain"><br>
<h2>Database</h2> <h2>Database</h2>
@@ -108,7 +110,6 @@ export default {
}, },
methods: { methods: {
submit() { submit() {
this.collectUrl();
if ( this.formData.dbType === 'mysql' ) { if ( this.formData.dbType === 'mysql' ) {
if ( !this.formData.db.port || !this.formData.db.host || !this.formData.db.database || !this.formData.db.user || !this.formData.db.password ) { if ( !this.formData.db.port || !this.formData.db.host || !this.formData.db.database || !this.formData.db.user || !this.formData.db.password ) {
this.$refs.notification.createNotification( 'Database settings are not complete!', 5, 'error', 'normal' ); this.$refs.notification.createNotification( 'Database settings are not complete!', 5, 'error', 'normal' );
@@ -149,7 +150,7 @@ export default {
this.$router.push( '/setup/root' ); this.$router.push( '/setup/root' );
}, },
collectUrl() { collectUrl() {
this.formData.yourDomain = location.protocol + '//' + location.host; this.formData.yourDomain = location.protocol + '//' + location.host + ( location.port ? ':' + location.port : '' );
this.formData.db.host = location.hostname; this.formData.db.host = location.hostname;
} }
}, },
@@ -157,6 +158,7 @@ export default {
if ( sessionStorage.getItem( 'basics' ) ) { if ( sessionStorage.getItem( 'basics' ) ) {
this.formData = JSON.parse( sessionStorage.getItem( 'basics' ) ); this.formData = JSON.parse( sessionStorage.getItem( 'basics' ) );
} }
this.collectUrl();
} }
}; };
</script> </script>

View File

@@ -124,15 +124,14 @@ export default {
let requirementsCount = { 'special': 0, 'numbers': 0, 'lower': 0, 'upper': 0, 'incorrect': '' }; let requirementsCount = { 'special': 0, 'numbers': 0, 'lower': 0, 'upper': 0, 'incorrect': '' };
const pw = this.formData.password; const pw = this.formData.password;
for ( let l in pw ) { for ( let l in pw ) {
console.log( pw[ l ] );
if ( /[a-z]/.test( pw[ l ] ) ) { if ( /[a-z]/.test( pw[ l ] ) ) {
requirementsCount[ 'lower' ] += 1; requirementsCount[ 'lower' ] += 1;
} else if ( /[A-Z]/.test( pw[ l ] ) ) { } else if ( /[A-Z]/.test( pw[ l ] ) ) {
requirementsCount[ 'upper' ] += 1; requirementsCount[ 'upper' ] += 1;
} else if ( lookup.includes( pw[ l ] ) ) { } else if ( lookup.includes( pw[ l ] ) ) {
requirementsCount[ 'special' ] += 1; requirementsCount[ 'special' ] += 1;
} else if ( !isNaN( pw[ l ] * 1 ) ) { } else if ( !isNaN( pw[ l ] ) ) {
requirementsCount[ 'number' ] += 1; requirementsCount[ 'numbers' ] += 1;
} else { } else {
console.log( 'incorrect letter' ); console.log( 'incorrect letter' );
requirementsCount[ 'incorrect' ] = pw[ l ]; requirementsCount[ 'incorrect' ] = pw[ l ];