diff options
Diffstat (limited to 'src/main/resources')
-rw-r--r-- | src/main/resources/application.properties | 15 | ||||
-rw-r--r-- | src/main/resources/templates/actuatorDashboard.html | 39 | ||||
-rw-r--r-- | src/main/resources/templates/admin.html | 53 | ||||
-rw-r--r-- | src/main/resources/templates/client.html | 53 | ||||
-rw-r--r-- | src/main/resources/templates/contact.html | 53 | ||||
-rw-r--r-- | src/main/resources/templates/index.html | 37 | ||||
-rw-r--r-- | src/main/resources/templates/login.html | 87 | ||||
-rw-r--r-- | src/main/resources/templates/navbar.html | 77 | ||||
-rw-r--r-- | src/main/resources/templates/pkgs/add.html | 109 | ||||
-rw-r--r-- | src/main/resources/templates/pkgs/edit.html | 109 | ||||
-rw-r--r-- | src/main/resources/templates/pkgs/index.html | 62 | ||||
-rw-r--r-- | src/main/resources/templates/pkgs/sorting.html | 6 | ||||
-rw-r--r-- | src/main/resources/templates/profile.html | 84 | ||||
-rw-r--r-- | src/main/resources/templates/register.html | 155 | ||||
-rw-r--r-- | src/main/resources/templates/user.html | 53 |
15 files changed, 992 insertions, 0 deletions
diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties new file mode 100644 index 0000000..f6a7814 --- /dev/null +++ b/src/main/resources/application.properties @@ -0,0 +1,15 @@ +spring.application.name=builddb + +spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver +spring.datasource.url=jdbc:mysql://nucleus.berzerkula.org:3306/builddb_users +spring.datasource.username=kb0iic +spring.datasource.password=ENC(1xjvlowHDUgzAYCjEEaYcSQOQHL2SHo8) + +spring.jpa.show-sql=true +spring.jpa.hibernate.ddl-auto=update + +jasypt.encryptor.algorithm=PBEWithMD5AndDES +jasypt.encryptor.iv-generator-classname=org.jasypt.iv.NoIvGenerator +jasypt.encryptor.password=builddb + +management.endpoints.web.exposure.include=*
\ No newline at end of file diff --git a/src/main/resources/templates/actuatorDashboard.html b/src/main/resources/templates/actuatorDashboard.html new file mode 100644 index 0000000..e97bb8f --- /dev/null +++ b/src/main/resources/templates/actuatorDashboard.html @@ -0,0 +1,39 @@ +<!DOCTYPE html> +<html xmlns:th="http://www.thymeleaf.org"> +<head> + <title>spring-boot-actuator</title> + <meta charset="UTF-8" /> + <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous"> +</head> +<body> +<div id="app" class="container"> + <nav class="navbar navbar-expand-lg fixed-top bg-body-tertiary border-bottom"> + <div class="container"> + <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"> + <span class="navbar-toggler-icon"></span> + </button> + <div class="collapse navbar-collapse" id="navbarSupportedContent"> + <a class="navbar-brand" href="/actuatorDashboard">spring-boot-actuator</a> + <ul class="navbar-nav me-auto mb-2 mb-lg-0"> + <li class="nav-link text-dark"><a th:href="@{/actuator/metrics}">/metrics</a></li> + <li class="nav-link text-dark"><a th:href="@{/actuator/env}">/env</a></li> + <li class="nav-link text-dark"><a th:href="@{/actuator/dump}">/dump</a></li> + <li class="nav-link text-dark"><a th:href="@{/actuator/health}">/health</a></li> + <li class="nav-link text-dark"><a th:href="@{/actuator/beans}">/beans</a></li> + <li class="nav-link text-dark"><a th:href="@{/actuator/autoconfig}">/autoconfig</a></li> + <li class="nav-link text-dark"><a th:href="@{/actuator/info}">/info</a></li> + <li class="nav-link text-dark"><a th:href="@{/actuator/shutdown}">/shutdown</a></li> + </ul> + </div> + </div> + </nav> + + <hr> + <hr> + + <a href="/" class="btn btn-link">Home</a> +</div> + +<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script> +</body> +</html>
\ No newline at end of file diff --git a/src/main/resources/templates/admin.html b/src/main/resources/templates/admin.html new file mode 100644 index 0000000..16f8f7f --- /dev/null +++ b/src/main/resources/templates/admin.html @@ -0,0 +1,53 @@ +<!doctype html> +<html lang="en"> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <title>builddb</title> + <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous"> +</head> +<body> + +<div class="container py-5"> + <div class="rounded border p-4"> + <h2 class="text-center mb-4">Admin Page</h2> + <hr> + <a href="/" class="btn btn-link">Home</a> + </div> +</div> + + +<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script> +</body> +</html> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/templates/client.html b/src/main/resources/templates/client.html new file mode 100644 index 0000000..487d427 --- /dev/null +++ b/src/main/resources/templates/client.html @@ -0,0 +1,53 @@ +<!doctype html> +<html lang="en"> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <title>builddb</title> + <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous"> +</head> +<body> + +<div class="container py-5"> + <div class="rounded border p-4"> + <h2 class="text-center mb-4">Client Page</h2> + <hr> + <a href="/" class="btn btn-link">Home</a> + </div> +</div> + + +<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script> +</body> +</html> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/templates/contact.html b/src/main/resources/templates/contact.html new file mode 100644 index 0000000..f1c6a3f --- /dev/null +++ b/src/main/resources/templates/contact.html @@ -0,0 +1,53 @@ +<!doctype html> +<html lang="en"> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <title>builddb</title> + <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous"> +</head> +<body> + +<div class="container py-5"> + <div class="rounded border p-4"> + <h2 class="text-center mb-4">Contact</h2> + <hr> + <a href="/" class="btn btn-link">Home</a> + </div> +</div> + + +<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script> +</body> +</html> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/index.html new file mode 100644 index 0000000..b33e45f --- /dev/null +++ b/src/main/resources/templates/index.html @@ -0,0 +1,37 @@ +<!doctype html> +<html lang="en" xmlns:th="http://www.thymeleaf.org" + xmlns:sec="http://www.thymeleaf.org"> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <title>builddb</title> + <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous"> + <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css"> +</head> +<body> + +<nav th:insert="~{/navbar :: navigation}"></nav> + +<hr> + +<div class="container py-5"> + <h1 class="text-center">Builddb</h1> + + + + <a class="btn btn-primary me-3" sec:authorize="hasRole('client')" href="/pkgs">Packages</a> +</div> + +<hr> + +<div th:if="${tableError}" + class="alert alert-danger alert-dismissible fade show" role="alert"> + + <strong>Invalid table!</strong> + <button type="button" class="btn-close" data-bs-dismiss="alert" + aria-label="Close"></button> +</div> + +<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script> +</body> +</html>
\ No newline at end of file diff --git a/src/main/resources/templates/login.html b/src/main/resources/templates/login.html new file mode 100644 index 0000000..0893fa0 --- /dev/null +++ b/src/main/resources/templates/login.html @@ -0,0 +1,87 @@ +<!doctype html> +<html lang="en" xmlns:th="http://www.thymeleaf.org" + xmlns:sec="http://www.thymeleaf.org"> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <title>builddb</title> + <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous"> +</head> +<body> + +<div class="container py-5"> + <div class="mx-auto rounded border p-4" style="width: 400px"> + <h2 class="text-center mb-4">Login</h2> + <hr /> + + + <div th:if="${param.error}" + class="alert alert-danger alert-dismissible fade show" role="alert"> + + <strong>Invalid Email or Password!</strong> + <button type="button" class="btn-close" data-bs-dismiss="alert" + aria-label="Close"></button> + </div> + + <form method="post"> + <input type="hidden" th:name="${_csrf.parameterName}" + th:value="${_csrf.token}" /> + + + <div class="mb-3"> + <label class="form-label">Email</label> + <input class="form-control" name="email" /> + </div> + + <div class="mb-3"> + <label class="form-label">Password</label> + <input class="form-control" type="password" name="password" /> + </div> + + <div class="row mb-3"> + <div class="col d-grid"> + <button type="submit" class="btn btn-primary">Submit</button> + </div> + <div class="col d-grid"> + <a href="/" class="btn btn-outline-primary">Cancel</a> + </div> + </div> + </form> + </div> +</div> + + +<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script> +</body> +</html> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/templates/navbar.html b/src/main/resources/templates/navbar.html new file mode 100644 index 0000000..0aa60e0 --- /dev/null +++ b/src/main/resources/templates/navbar.html @@ -0,0 +1,77 @@ +<nav th:fragment="navigation" class="navbar navbar-expand-lg fixed-top bg-body-tertiary border-bottom"> + <div class="container"> + <a class="navbar-brand" href="/">builddb</a> + <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"> + <span class="navbar-toggler-icon"></span> + </button> + <div class="collapse navbar-collapse" id="navbarSupportedContent"> + <ul class="navbar-nav me-auto mb-2 mb-lg-0"> + <li class="nav-item"> + <a class="nav-link text-dark" href="/">Home</a> + </li> + <li class="nav-item"> + <a class="nav-link text-dark" href="/contact">Contact</a> + </li> + <li class="nav-item"> + <a class="nav-link text-dark" href="/user">User</a> + </li> + <li class="nav-item"> + <a class="nav-link text-dark" sec:authorize="hasRole('client')" href="/client">Client</a> + </li> + <li class="nav-item"> + <a class="nav-link text-dark" sec:authorize="hasRole('admin')" href="/admin">Admin</a> + </li> + <li class="nav-item"> + <a class="nav-link text-dark" sec:authorize="hasRole('admin')" href="/actuatorDashboard">Actuator</a> + </li> + </ul> + + <ul class="navbar-nav me-3" sec:authorize="hasRole('admin')"> + <li class="nav-item dropdown"> + <a class="nav-link dropdown-toggle text-dark" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false"> + Admin + </a> + <ul class="dropdown-menu"> + <li><a class="dropdown-item" href="/profile">Profile</a></li> + <li><a class="dropdown-item" href="/">Home</a></li> + </ul> + </li> + </ul> + + <ul class="navbar-nav me-3" sec:authorize="hasRole('client')"> + <li class="nav-item dropdown"> + <a class="nav-link dropdown-toggle text-dark" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false"> + Client + </a> + <ul class="dropdown-menu"> + <li><a class="dropdown-item" href="/profile">Profile</a></li> + <li><a class="dropdown-item" href="/">Home</a></li> + </ul> + </li> + </ul> + + <form sec:authorize="isAuthenticated()" method="post" action="/logout"> + <input type="hidden" th:name="${_csrf.parameterName}" + th:value="${_csrf.token}" /> + + <button type="submit" class="btn btn-danger"> + <i class="fa-solid fa-right-from-bracket"></i> + </button> + </form> + + <ul class="navbar-nav" sec:authorize="!isAuthenticated()"> + <li class="nav-item"> + <a href="/register" class="btn btn-outline-primary me-2"> + <i class="fa-regular fa-id-card"></i> + </a> + </li> + <li class="nav-item"> + <a href="/login" class="btn btn-primary"> + <i class="fa-solid fa-right-to-bracket"></i> + </a> + </li> + </ul> + + </div> + </div> +</nav>
\ No newline at end of file diff --git a/src/main/resources/templates/pkgs/add.html b/src/main/resources/templates/pkgs/add.html new file mode 100644 index 0000000..107784f --- /dev/null +++ b/src/main/resources/templates/pkgs/add.html @@ -0,0 +1,109 @@ +<!doctype html> +<html lang="en" xmlns:th="http://www.thymeleaf.org" + xmlns:sec="http://www.thymeleaf.org"> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <title>builddb</title> + <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous"> +</head> +<body> + +<nav th:insert="~{/navbar :: navigation}"></nav> + +<hr> + +<div class="container"> + <div class="col-md-8 mx-auto rounded border p-4 m-4"> + <h2 class="text-center mb-5">Add Package</h2> + + <form method="post" enctype="multipart/form-data" th:object="${pkgDto}"> + <input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}" /> + + <div class="row mb-3"> + <label class="col-sm-4 col-form-label">Sequence</label> + <div class="col-sm-8"> + <input class="form-control" th:field="${pkgDto.sequence}" /> + <p th:if="${#fields.hasErrors('sequence')}" th:errorclass="text-danger" th:errors="${pkgDto.sequence}"></p> + </div> + </div> + + <div class="row mb-3"> + <label class="col-sm-4 col-form-label">Name</label> + <div class="col-sm-8"> + <input class="form-control" th:field="${pkgDto.name}" /> + <p th:if="${#fields.hasErrors('name')}" th:errorclass="text-danger" th:errors="${pkgDto.name}"></p> + </div> + </div> + + <div class="row mb-3"> + <label class="col-sm-4 col-form-label">Version</label> + <div class="col-sm-8"> + <input class="form-control" th:field="${pkgDto.version}" /> + <p th:if="${#fields.hasErrors('version')}" th:errorclass="text-danger" th:errors="${pkgDto.version}"></p> + </div> + </div> + + <div class="row mb-3"> + <label class="col-sm-4 col-form-label">Configure</label> + <div class="col-sm-8"> + <textarea class="form-control" th:field="${pkgDto.configure}" /> + <p th:if="${#fields.hasErrors('configure')}" th:errorclass="text-danger" th:errors="${pkgDto.configure}"></p> + </div> + </div> + + <div class="row mb-3"> + <label class="col-sm-4 col-form-label">Build</label> + <div class="col-sm-8"> + <textarea class="form-control" th:field="${pkgDto.build}" /> + <p th:if="${#fields.hasErrors('build')}" th:errorclass="text-danger" th:errors="${pkgDto.build}"></p> + </div> + </div> + + <div class="row mb-3"> + <label class="col-sm-4 col-form-label">Install</label> + <div class="col-sm-8"> + <textarea class="form-control" th:field="${pkgDto.install}" /> + <p th:if="${#fields.hasErrors('install')}" th:errorclass="text-danger" th:errors="${pkgDto.install}"></p> + </div> + </div> + + <div class="row mb-3"> + <label class="col-sm-4 col-form-label">Setup</label> + <div class="col-sm-8"> + <textarea class="form-control" th:field="${pkgDto.setup}" /> + <p th:if="${#fields.hasErrors('setup')}" th:errorclass="text-danger" th:errors="${pkgDto.setup}"></p> + </div> + </div> + + <div class="row mb-3"> + <label class="col-sm-4 col-form-label">Notes</label> + <div class="col-sm-8"> + <textarea class="form-control" th:field="${pkgDto.notes}" /> + <p th:if="${#fields.hasErrors('notes')}" th:errorclass="text-danger" th:errors="${pkgDto.notes}"></p> + </div> + </div> + + <div class="row mb-3"> + <label class="col-sm-4 col-form-label">Url</label> + <div class="col-sm-8"> + <textarea class="form-control" th:field="${pkgDto.url}" /> + <p th:if="${#fields.hasErrors('Url')}" th:errorclass="text-danger" th:errors="${pkgDto.url}"></p> + </div> + </div> + + <div class="row"> + <div class="offset-sm-4 col-sm-4 d-grid"> + <button type="submit" class="btn btn-primary">Submit</button> + </div> + <div class="col-sm-4 d-grid"> + <a class="btn btn-outline-primary" href="/pkgs" role="button">Cancel</a> + </div> + </div> + </form> + </div> +</div> + +<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script> +</body> +</html>
\ No newline at end of file diff --git a/src/main/resources/templates/pkgs/edit.html b/src/main/resources/templates/pkgs/edit.html new file mode 100644 index 0000000..34ad9a8 --- /dev/null +++ b/src/main/resources/templates/pkgs/edit.html @@ -0,0 +1,109 @@ +<!doctype html> +<html lang="en" xmlns:th="http://www.thymeleaf.org" + xmlns:sec="http://www.thymeleaf.org"> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <title>builddb</title> + <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous"> +</head> +<body> + +<nav th:insert="~{/navbar :: navigation}"></nav> + +<hr> + +<div class="container"> + <div class="col-md-8 mx-auto rounded border p-4 m-4"> + <h2 class="text-center mb-5">Edit Package</h2> + + <form method="post" enctype="multipart/form-data" th:object="${pkgDto}"> + <input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}" /> + + <div class="row mb-3"> + <label class="col-sm-4 col-form-label">Sequence</label> + <div class="col-sm-8"> + <input class="form-control" th:field="${pkgDto.sequence}" /> + <p th:if="${#fields.hasErrors('sequence')}" th:errorclass="text-danger" th:errors="${pkgDto.sequence}"></p> + </div> + </div> + + <div class="row mb-3"> + <label class="col-sm-4 col-form-label">Name</label> + <div class="col-sm-8"> + <input class="form-control" th:field="${pkgDto.name}" /> + <p th:if="${#fields.hasErrors('name')}" th:errorclass="text-danger" th:errors="${pkgDto.name}"></p> + </div> + </div> + + <div class="row mb-3"> + <label class="col-sm-4 col-form-label">Version</label> + <div class="col-sm-8"> + <input class="form-control" th:field="${pkgDto.version}" /> + <p th:if="${#fields.hasErrors('version')}" th:errorclass="text-danger" th:errors="${pkgDto.version}"></p> + </div> + </div> + + <div class="row mb-3"> + <label class="col-sm-4 col-form-label">Configure</label> + <div class="col-sm-8"> + <textarea class="form-control" th:field="${pkgDto.configure}" /> + <p th:if="${#fields.hasErrors('configure')}" th:errorclass="text-danger" th:errors="${pkgDto.configure}"></p> + </div> + </div> + + <div class="row mb-3"> + <label class="col-sm-4 col-form-label">Build</label> + <div class="col-sm-8"> + <textarea class="form-control" th:field="${pkgDto.build}" /> + <p th:if="${#fields.hasErrors('build')}" th:errorclass="text-danger" th:errors="${pkgDto.build}"></p> + </div> + </div> + + <div class="row mb-3"> + <label class="col-sm-4 col-form-label">Install</label> + <div class="col-sm-8"> + <textarea class="form-control" th:field="${pkgDto.install}" /> + <p th:if="${#fields.hasErrors('install')}" th:errorclass="text-danger" th:errors="${pkgDto.install}"></p> + </div> + </div> + + <div class="row mb-3"> + <label class="col-sm-4 col-form-label">Setup</label> + <div class="col-sm-8"> + <textarea class="form-control" th:field="${pkgDto.setup}" /> + <p th:if="${#fields.hasErrors('setup')}" th:errorclass="text-danger" th:errors="${pkgDto.setup}"></p> + </div> + </div> + + <div class="row mb-3"> + <label class="col-sm-4 col-form-label">Notes</label> + <div class="col-sm-8"> + <textarea class="form-control" th:field="${pkgDto.notes}" /> + <p th:if="${#fields.hasErrors('notes')}" th:errorclass="text-danger" th:errors="${pkgDto.notes}"></p> + </div> + </div> + + <div class="row mb-3"> + <label class="col-sm-4 col-form-label">Url</label> + <div class="col-sm-8"> + <textarea class="form-control" th:field="${pkgDto.url}" /> + <p th:if="${#fields.hasErrors('Url')}" th:errorclass="text-danger" th:errors="${pkgDto.url}"></p> + </div> + </div> + + <div class="row"> + <div class="offset-sm-4 col-sm-4 d-grid"> + <button type="submit" class="btn btn-primary">Submit</button> + </div> + <div class="col-sm-4 d-grid"> + <a class="btn btn-outline-primary" href="/pkgs/" role="button">Cancel</a> + </div> + </div> + </form> + </div> +</div> + +<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script> +</body> +</html>
\ No newline at end of file diff --git a/src/main/resources/templates/pkgs/index.html b/src/main/resources/templates/pkgs/index.html new file mode 100644 index 0000000..04eb45a --- /dev/null +++ b/src/main/resources/templates/pkgs/index.html @@ -0,0 +1,62 @@ +<!doctype html> +<html lang="en"> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <title>Builddb</title> + <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous"> + <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css"> +</head> +<body> +<nav th:insert="~{/navbar :: navigation}"></nav> + +<hr> +<hr> + +<div class="container"> + <h1 class="text-center my-4">Packages</h1> + <a class="btn btn-primary fa fa-add" href="/pkgs/add"></a> + + <hr> + + <table class="table table-bordered table-hover table-striped"> + <thead> + <tr> + <th id="0" th:replace="~{pkgs/sorting :: sorting('sequence', 'Seq')}">Seq</th> + <th th:replace="~{pkgs/sorting :: sorting('name', 'Name')}">Name</th> + <th>Version</th> + <th>Configure</th> + <th>Build</th> + <th>Install</th> + <th>Setup</th> + <th>Notes</th> + <th>Url</th> + <th>Action</th> + </tr> + </thead> + <tbody class="table-group-divider"> + <tr th:each="pkg : ${pkgs}"> + <td th:id="${pkg.id}" th:text="${pkg.sequence}"></td> + <td th:text="${pkg.name}"></td> + <td th:text="${pkg.version}"></td> + <td th:text="${pkg.configure}"></td> + <td th:text="${pkg.build}"></td> + <td th:text="${pkg.install}"></td> + <td th:text="${pkg.setup}"></td> + <td th:text="${pkg.notes}"></td> + <td th:text="${pkg.url}"></td> + <td style="white-space:nowrap"> + <a class="btn btn-primary btn-sm fa fa-edit" + th:href="@{/pkgs/edit(id=${pkg.id})}"></a> + <a class="btn btn-danger btn-sm fa fa-trash" + th:href="@{/pkgs/delete(id=${pkg.id})}" + onclick="return confirm('Delete?')"></a> + </td> + </tr> + </tbody> + </table> +</div> + +<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script> +</body> +</html>
\ No newline at end of file diff --git a/src/main/resources/templates/pkgs/sorting.html b/src/main/resources/templates/pkgs/sorting.html new file mode 100644 index 0000000..199ef68 --- /dev/null +++ b/src/main/resources/templates/pkgs/sorting.html @@ -0,0 +1,6 @@ +<th scope="col" th:fragment="sorting(field, label)"> + <a class="text-decoration-none text-dark" + th:href="@{'/pkgs?' + ${sortField!=null ? '&sort=' + field + ',' + (sortField == field ? reverseSortDirection : sortDirection) : ''}}">[[${label}]]</a> + <span th:if="${sortField == field}" + th:class="${sortDirection == 'asc' ? 'fas fa-arrow-down-short-wide' : 'fas fa-arrow-down-wide-short'}"></span> +</th>
\ No newline at end of file diff --git a/src/main/resources/templates/profile.html b/src/main/resources/templates/profile.html new file mode 100644 index 0000000..aa7fb20 --- /dev/null +++ b/src/main/resources/templates/profile.html @@ -0,0 +1,84 @@ +<!doctype html> +<html lang="en" xmlns:th="http://www.thymeleaf.org"> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <title>builddb</title> + <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous"> +</head> +<body> + +<div class="container py-5"> + <div class="rounded border p-4"> + <h2 class="text-center mb-4">Profile</h2> + <hr> + + <div class="row mb-2"> + <div class="col">First Name</div> + <div class="col" th:text="${appUser.firstName}"></div> + </div> + <div class="row mb-2"> + <div class="col">Last Name</div> + <div class="col" th:text="${appUser.lastName}"></div> + </div> + <div class="row mb-2"> + <div class="col">Email</div> + <div class="col" th:text="${appUser.email}"></div> + </div> + <div class="row mb-2"> + <div class="col">Phone</div> + <div class="col" th:text="${appUser.phone}"></div> + </div> + <div class="row mb-2"> + <div class="col">Address</div> + <div class="col" th:text="${appUser.address}"></div> + </div> + <div class="row mb-2"> + <div class="col">Role</div> + <div class="col" th:text="${appUser.role}"></div> + </div> + <div class="row mb-2"> + <div class="col">Created At</div> + <div class="col" th:text="${appUser.createdAt}"></div> + </div> + + <hr> + <a href="/" class="btn btn-link">Home</a> + </div> +</div> + + +<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script> +</body> +</html> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/templates/register.html b/src/main/resources/templates/register.html new file mode 100644 index 0000000..31f240b --- /dev/null +++ b/src/main/resources/templates/register.html @@ -0,0 +1,155 @@ +<!doctype html> +<html lang="en" xmlns:th="http://www.thymeleaf.org"> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <title>builddb</title> + <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous"> +</head> +<body> + +<div class="container py-5"> + <div class="row"> + <div class="col-lg-6 mx-auto rounded border p-4"> + <h2 class="text-center mb-4">Register</h2> + <hr /> + + + + <div th:if="${success}" + class="alert alert-success alert-dismissible fade show" role="alert"> + + <strong>Account Created Successfully!</strong> + <a class="ms-2" href="/login">Login</a> + <button type="button" class="btn-close" data-bs-dismiss="alert" + aria-label="Close"></button> + </div> + + + <form method="post" th:object="${registerDto}"> + <input type="hidden" th:name="${_csrf.parameterName}" + th:value="${_csrf.token}" /> + + + + <div class="row mb-3"> + <label class="col-sm-4 col-form-label">First Name*</label> + <div class="col-sm-8"> + <input class="form-control" th:field="${registerDto.firstName}" > + <p th:if="${#fields.hasErrors('firstName')}" + th:errorclass="text-danger" + th:errors="${registerDto.firstName}" ></p> + </div> + </div> + + <div class="row mb-3"> + <label class="col-sm-4 col-form-label">Last Name*</label> + <div class="col-sm-8"> + <input class="form-control" th:field="${registerDto.lastName}" > + <p th:if="${#fields.hasErrors('lastName')}" + th:errorclass="text-danger" + th:errors="${registerDto.lastName}" ></p> + </div> + </div> + + <div class="row mb-3"> + <label class="col-sm-4 col-form-label">Email*</label> + <div class="col-sm-8"> + <input class="form-control" th:field="${registerDto.email}" > + <p th:if="${#fields.hasErrors('email')}" + th:errorclass="text-danger" + th:errors="${registerDto.email}" ></p> + </div> + </div> + + <div class="row mb-3"> + <label class="col-sm-4 col-form-label">Phone</label> + <div class="col-sm-8"> + <input class="form-control" th:field="${registerDto.phone}" > + <p th:if="${#fields.hasErrors('phone')}" + th:errorclass="text-danger" + th:errors="${registerDto.phone}" ></p> + </div> + </div> + + <div class="row mb-3"> + <label class="col-sm-4 col-form-label">Address</label> + <div class="col-sm-8"> + <input class="form-control" th:field="${registerDto.address}" > + <p th:if="${#fields.hasErrors('address')}" + th:errorclass="text-danger" + th:errors="${registerDto.address}" ></p> + </div> + </div> + + <div class="row mb-3"> + <label class="col-sm-4 col-form-label">Password*</label> + <div class="col-sm-8"> + <input class="form-control" type="password" + th:field="${registerDto.password}" > + <p th:if="${#fields.hasErrors('password')}" + th:errorclass="text-danger" + th:errors="${registerDto.password}" ></p> + </div> + </div> + + <div class="row mb-3"> + <label class="col-sm-4 col-form-label">Confirm Password*</label> + <div class="col-sm-8"> + <input class="form-control" type="password" + th:field="${registerDto.confirmPassword}" > + <p th:if="${#fields.hasErrors('confirmPassword')}" + th:errorclass="text-danger" + th:errors="${registerDto.confirmPassword}" ></p> + </div> + </div> + + <div class="row mb-3"> + <div class="offset-sm-4 col-sm-4 d-grid"> + <button type="submit" class="btn btn-primary">Submit</button> + </div> + <div class="col-sm-4 d-grid"> + <a href="/" class="btn btn-outline-primary">Cancel</a> + </div> + </div> + + </form> + </div> + </div> +</div> + + +<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script> +</body> +</html> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/templates/user.html b/src/main/resources/templates/user.html new file mode 100644 index 0000000..2791644 --- /dev/null +++ b/src/main/resources/templates/user.html @@ -0,0 +1,53 @@ +<!doctype html> +<html lang="en"> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <title>builddb</title> + <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous"> +</head> +<body> + +<div class="container py-5"> + <div class="rounded border p-4"> + <h2 class="text-center mb-4">User Page</h2> + <hr> + <a href="/" class="btn btn-link">Home</a> + </div> +</div> + + +<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script> +</body> +</html> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + |