Skip to content

Commit 212bc43

Browse files
committed
Oracle Connection Pooling Added
1 parent 579bf8f commit 212bc43

File tree

5 files changed

+142
-168
lines changed

5 files changed

+142
-168
lines changed

Dockerfile

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,13 @@
11
FROM ghcr.io/oracle/oraclelinux:8
22

3-
RUN yum install -y oracle-release-el8 \
4-
&& yum-config-manager --enable ol8_oracle_instantclient \
5-
&& yum install -y oracle-instantclient19.10-basic
6-
7-
83
RUN dnf -y module disable python36 && \
94
dnf -y module enable python39 && \
105
dnf -y install python39 python39-pip python39-setuptools python39-wheel && \
116
rm -rf /var/cache/dnf
127

13-
RUN yum install -y postgresql-devel
14-
15-
RUN yum install -y gcc \
16-
&& yum install -y libaio-devel
17-
18-
ADD requirements.txt .
19-
COPY requirements.txt ./requirements.txt
8+
WORKDIR /myapp
9+
COPY requirements.txt main.py key.pem cert.pem add_employee.html get_employees.html update_employee.html confirm_delete_employee.html crud_options.html search_employee.html employee_not_found.html /myapp
2010
RUN pip3 install -r requirements.txt
2111

2212

23-
# Set the environment variable for LD_LIBRARY_PATH
24-
ENV LD_LIBRARY_PATH /usr/lib/oracle/19.10/client64/lib/
25-
26-
ADD main.py .
27-
28-
ADD key.pem .
29-
30-
ADD cert.pem .
31-
32-
ADD add_employee.html .
33-
34-
ADD get_employees.html .
35-
36-
ADD update_employee.html .
37-
38-
ADD confirm_delete_employee.html .
39-
40-
ADD crud_options.html .
41-
42-
ADD search_employee.html .
43-
44-
ADD employee_not_found.html .
45-
4613
CMD ["python3", "./main.py"]

crud_options.html

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,30 @@
44
<title>EMS Main Page</title>
55
<!-- Use Bootstrap for styling -->
66
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
7+
<style>
8+
.search-container {
9+
position: fixed;
10+
top: 20px;
11+
right: 10px;
12+
display: flex;
13+
align-items: center;
14+
}
15+
16+
.search-container .search-icon {
17+
cursor: pointer;
18+
}
19+
20+
.search-container .search-input {
21+
display: none;
22+
margin-right: 20px;
23+
transition: width 0.5s ease-in-out;
24+
}
25+
26+
.search-container .search-input.visible {
27+
display: block;
28+
width: 300px;
29+
}
30+
</style>
731
<script>
832
function updateEmployee() {
933
var id = prompt("Enter ID:");
@@ -19,15 +43,28 @@
1943
}
2044
}
2145

46+
function toggleSearchBar() {
47+
var searchBar = document.querySelector('.search-input');
48+
searchBar.classList.toggle('visible');
49+
searchBar.focus();
50+
}
51+
2252
function searchEmployee() {
23-
var id = prompt("Enter ID:");
24-
if (id != null) {
25-
window.location.href = "/api/search_employee/" + id;
53+
var search_query = document.querySelector('.search-input').value;
54+
if (search_query) {
55+
window.location.href = "/api/search_employee?search_query=" + encodeURIComponent(search_query);
2656
}
2757
}
2858
</script>
2959
</head>
3060
<body>
61+
<div class="search-container">
62+
<span class="search-icon" onclick="toggleSearchBar()">
63+
<img src="https://img.icons8.com/small/16/000000/search.png" alt="Search">
64+
</span>
65+
<input type="text" class="search-input" onkeydown="if (event.key === 'Enter') searchEmployee()" placeholder="Search (ID, Name, Email, or Department)">
66+
</div>
67+
3168
<!-- Create a banner -->
3269
<div class="jumbotron">
3370
<h1 class="display-4">Employee Management System</h1>
@@ -50,11 +87,6 @@ <h1 class="display-4">Employee Management System</h1>
5087
<button class="btn btn-primary btn-block" onclick="deleteEmployee()">Delete</button>
5188
</div>
5289
</div>
53-
<div class="row mt-3">
54-
<div class="col-md-3">
55-
<button class="btn btn-primary btn-block" onclick="searchEmployee()">Search</button>
56-
</div>
57-
</div>
5890
</div>
5991
</body>
6092
</html>

crud_options.html.bak

Lines changed: 0 additions & 55 deletions
This file was deleted.

0 commit comments

Comments
 (0)