Skip to content
This repository has been archived by the owner on Jan 23, 2025. It is now read-only.

Commit

Permalink
Code Formatting
Browse files Browse the repository at this point in the history
Signed-off-by: wambuipixel <kiokowambui015@gmail.com>
  • Loading branch information
wambui-pixel committed Mar 19, 2024
1 parent edf8f9d commit 3c8e1af
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 24 deletions.
8 changes: 4 additions & 4 deletions internal/postgres/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ var (
// Config defines the options that are used when connecting to the PostgresSQL instance.
type Config struct {
Host string `env:"MG_UI_DB_HOST" envDefault:"localhost"`
Port string `env:"MG_UI_DB_PORT" envDefault:"5432"`
User string `env:"MG_UI_DB_USER" envDefault:"magistrala-ui"`
Pass string `env:"MG_UI_DB_PASS" envDefault:"magistrala-ui"`
Name string `env:"MG_UI_DB_NAME" envDefault:"dashboards"`
Port string `env:"MG_UI_DB_PORT" envDefault:"6007"`
User string `env:"MG_UI_DB_USER" envDefault:"magistrala"`
Pass string `env:"MG_UI_DB_PASS" envDefault:"magistrala"`
Name string `env:"MG_UI_DB_NAME" envDefault:"ui"`
SSLMode string `env:"MG_UI_DB_SSL_MODE" envDefault:"disable"`
SSLCert string `env:"MG_UI_DB_SSL_CERT" envDefault:""`
SSLKey string `env:"MG_UI_DB_SSL_KEY" envDefault:""`
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions ui/web/templates/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ <h5 class="modal-title" id="forgotPasswordModalLabel">Enter email</h5>
console.error("error submitting login form: ", error);
});
}
//code for toggling the visibility of the password
togglePassword.addEventListener("click", function () {
if (passwordField.type === "password") {
passwordField.type = "text";
Expand Down
27 changes: 13 additions & 14 deletions ui/web/templates/registration.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ <h2>Register</h2>
<i class="fas fa-solid fa-lock"></i>
<input
class="p-3 w-100"
type= "password"
type="password"
name="password"
id="password"
placeholder="Password"
/>
<span class ="password-toggle-icon"><i class="fas fa-eye"></i></span>
<span class="password-toggle-icon"><i class="fas fa-eye"></i></span>
</div>
<div id="passwordError" class="text-danger"></div>
</div>
Expand Down Expand Up @@ -135,18 +135,18 @@ <h2>Register</h2>
document.getElementById("register-button").addEventListener("click", () => {
registrationError.innerHTML = "";
});
//code for toggling the visibility of the password
//code for toggling the visibility of the password
togglePassword.addEventListener("click", function () {
if (passwordField.type === "password") {
passwordField.type = "text";
togglePassword.classList.remove("fa-eye");
togglePassword.classList.add("fa-eye-slash");
} else {
passwordField.type = "password";
togglePassword.classList.remove("fa-eye-slash");
togglePassword.classList.add("fa-eye");
}
})
if (passwordField.type === "password") {
passwordField.type = "text";
togglePassword.classList.remove("fa-eye");
togglePassword.classList.add("fa-eye-slash");
} else {
passwordField.type = "password";
togglePassword.classList.remove("fa-eye-slash");
togglePassword.classList.add("fa-eye");
}
});

function submitRegistrationForm() {
event.preventDefault();
Expand All @@ -172,7 +172,6 @@ <h2>Register</h2>
console.error("error submitting login form: ", error);
});
}


function showError(errorMessage) {
registrationError.innerHTML = errorMessage;
Expand Down
9 changes: 4 additions & 5 deletions ui/web/templates/updatepassword.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ <h2>Update Password</h2>
placeholder="Old password"
required
/>
<span class ="password-toggle-icon"><i class="fas fa-eye"></i></span>
<span class="password-toggle-icon"><i class="fas fa-eye"></i></span>
<div id="oldpassError" class="text-danger"></div>
</div>
</div>
Expand All @@ -49,7 +49,7 @@ <h2>Update Password</h2>
placeholder="New password"
required
/>
<span class ="password-toggle-icon"><i class="fas fa-eye"></i></span>
<span class="password-toggle-icon"><i class="fas fa-eye"></i></span>
<div id="newpassError" class="text-danger"></div>
</div>
</div>
Expand Down Expand Up @@ -104,7 +104,7 @@ <h2>Update Password</h2>
}
//code for toggling the visibility of the password
const togglePassword = document.querySelectorAll(".password-toggle-icon i");
togglePassword.forEach(icon => {
togglePassword.forEach((icon) => {
icon.addEventListener("click", function () {
const passwordField = icon.parentElement.previousElementSibling;
if (passwordField.type === "password") {
Expand All @@ -117,7 +117,7 @@ <h2>Update Password</h2>
icon.classList.add("fa-eye");
}
});
})
});
function showError(errorMessage) {
var loginError = document.getElementById("oldpassError");
loginError.innerHTML = errorMessage;
Expand All @@ -126,4 +126,3 @@ <h2>Update Password</h2>
</body>
</html>
{{ end }}

0 comments on commit 3c8e1af

Please sign in to comment.