wad-lab 1.2.2 → 1.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (207) hide show
  1. package/bin/index.js +472 -631
  2. package/package.json +1 -1
  3. package/templates/fullstack-springboot-vue/frontend/vue-axios-basic/src/App.vue +241 -429
  4. package/templates/fullstack-springboot-vue/frontend/vue-axios-basic/src/components/ItemFormModal.vue +183 -0
  5. package/templates/fullstack-springboot-vue/frontend/vue-axios-basic/src/components/ItemPatchModal.vue +193 -0
  6. package/templates/fullstack-springboot-vue/frontend/vue-axios-basic/src/components/ItemTable.vue +177 -0
  7. package/templates/fullstack-springboot-vue/frontend/vue-axios-pinia/src/App.vue +150 -441
  8. package/templates/fullstack-springboot-vue/frontend/vue-axios-pinia/src/components/ItemFormModal.vue +207 -0
  9. package/templates/fullstack-springboot-vue/frontend/vue-axios-pinia/src/components/ItemStats.vue +64 -0
  10. package/templates/fullstack-springboot-vue/frontend/vue-axios-pinia/src/components/ItemTable.vue +195 -0
  11. package/templates/fullstack-springboot-vue/frontend/vue-axios-router/src/App.vue +41 -90
  12. package/templates/fullstack-springboot-vue/frontend/vue-axios-router/src/components/ItemFormModal.vue +173 -0
  13. package/templates/fullstack-springboot-vue/frontend/vue-axios-router/src/components/ItemTable.vue +102 -0
  14. package/templates/fullstack-springboot-vue/frontend/vue-axios-router/src/components/NavBar.vue +57 -0
  15. package/templates/fullstack-springboot-vue/frontend/vue-axios-router/src/views/DepartmentView.vue +132 -296
  16. package/templates/fullstack-springboot-vue/frontend/vue-axios-router/src/views/EmployeeView.vue +126 -219
  17. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-children/src/components/ItemDetail.vue +115 -0
  18. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-children/src/components/ItemTable.vue +104 -0
  19. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-children/src/components/SideBar.vue +59 -0
  20. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-children/src/views/CompanyLayout.vue +2 -51
  21. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-children/src/views/DepartmentListView.vue +92 -250
  22. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-children/src/views/EmployeeDetailView.vue +59 -181
  23. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-children/src/views/EmployeeListView.vue +67 -315
  24. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia/src/App.vue +19 -70
  25. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia/src/components/ItemFormModal.vue +173 -0
  26. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia/src/components/ItemPatchModal.vue +144 -0
  27. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia/src/components/ItemTable.vue +102 -0
  28. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia/src/components/NavBar.vue +53 -0
  29. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia/src/views/DepartmentView.vue +107 -229
  30. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia/src/views/EmployeeView.vue +143 -257
  31. package/templates/game-bingo/script.js +1 -1
  32. package/templates/game-memory-cards/script.js +2 -2
  33. package/templates/game-rock-paper-scissors/index.html +3 -3
  34. package/templates/game-rock-paper-scissors/script.js +2 -2
  35. package/templates/game-tic-tac-toe/script.js +2 -2
  36. package/templates/game-whack-a-mole/index.html +9 -9
  37. package/templates/servlet-basic/WEB-INF/ItemServlet.java +13 -0
  38. package/templates/servlet-basic/WEB-INF/classes/ItemServlet.class +0 -0
  39. package/templates/servlet-flow/WEB-INF/HelloServlet.java +34 -25
  40. package/templates/servlet-flow/WEB-INF/classes/HelloServlet.class +0 -0
  41. package/templates/servlet-jdbc/WEB-INF/JdbcItemServlet.java +13 -0
  42. package/templates/servlet-jdbc/WEB-INF/classes/JdbcItemServlet.class +0 -0
  43. package/templates/snippets/mongo-queries-cheatsheet.txt +105 -0
  44. package/templates/springboot-2model-aggregation-join/.mvn/wrapper/maven-wrapper.properties +3 -0
  45. package/templates/springboot-2model-aggregation-join/mvnw +295 -0
  46. package/templates/springboot-2model-aggregation-join/mvnw.cmd +189 -0
  47. package/templates/springboot-2model-aggregation-join/pom.xml +54 -0
  48. package/templates/springboot-2model-aggregation-join/src/main/java/com/example/aggregation/AggregationApplication.java +11 -0
  49. package/templates/springboot-2model-aggregation-join/src/main/java/com/example/aggregation/controller/DepartmentController.java +65 -0
  50. package/templates/springboot-2model-aggregation-join/src/main/java/com/example/aggregation/controller/EmployeeController.java +65 -0
  51. package/templates/springboot-2model-aggregation-join/src/main/java/com/example/aggregation/dto/DepartmentStatsDTO.java +15 -0
  52. package/templates/springboot-2model-aggregation-join/src/main/java/com/example/aggregation/dto/EmployeeJoinDTO.java +19 -0
  53. package/templates/springboot-2model-aggregation-join/src/main/java/com/example/aggregation/model/Department.java +20 -0
  54. package/templates/springboot-2model-aggregation-join/src/main/java/com/example/aggregation/model/Employee.java +21 -0
  55. package/templates/springboot-2model-aggregation-join/src/main/java/com/example/aggregation/repository/DepartmentRepository.java +9 -0
  56. package/templates/springboot-2model-aggregation-join/src/main/java/com/example/aggregation/repository/EmployeeRepository.java +9 -0
  57. package/templates/springboot-2model-aggregation-join/src/main/java/com/example/aggregation/service/DepartmentService.java +81 -0
  58. package/templates/springboot-2model-aggregation-join/src/main/java/com/example/aggregation/service/EmployeeService.java +80 -0
  59. package/templates/springboot-2model-aggregation-join/src/main/resources/application.properties +2 -0
  60. package/templates/springboot-2model-aggregation-join/src/test/java/com/example/aggregation/AggregationApplicationTests.java +13 -0
  61. package/templates/vue-2model-crud-patch/README.md +64 -0
  62. package/templates/vue-2model-crud-patch/index.html +12 -0
  63. package/templates/vue-2model-crud-patch/package-lock.json +1785 -0
  64. package/templates/vue-2model-crud-patch/package.json +21 -0
  65. package/templates/vue-2model-crud-patch/src/App.vue +63 -0
  66. package/templates/vue-2model-crud-patch/src/components/AnalyticsBoard.vue +291 -0
  67. package/templates/vue-2model-crud-patch/src/components/DepartmentFormModal.vue +138 -0
  68. package/templates/vue-2model-crud-patch/src/components/DepartmentPatchModal.vue +210 -0
  69. package/templates/vue-2model-crud-patch/src/components/DepartmentTable.vue +133 -0
  70. package/templates/vue-2model-crud-patch/src/components/EmployeeFormModal.vue +177 -0
  71. package/templates/vue-2model-crud-patch/src/components/EmployeePatchModal.vue +221 -0
  72. package/templates/vue-2model-crud-patch/src/components/EmployeeTable.vue +171 -0
  73. package/templates/vue-2model-crud-patch/src/components/NavBar.vue +156 -0
  74. package/templates/vue-2model-crud-patch/src/main.js +12 -0
  75. package/templates/vue-2model-crud-patch/src/router/index.js +33 -0
  76. package/templates/vue-2model-crud-patch/src/services/api.js +64 -0
  77. package/templates/vue-2model-crud-patch/src/stores/departmentStore.js +149 -0
  78. package/templates/vue-2model-crud-patch/src/stores/employeeStore.js +143 -0
  79. package/templates/vue-2model-crud-patch/src/style.css +415 -0
  80. package/templates/vue-2model-crud-patch/src/views/AnalyticsView.vue +59 -0
  81. package/templates/vue-2model-crud-patch/src/views/DepartmentsView.vue +135 -0
  82. package/templates/vue-2model-crud-patch/src/views/EmployeesView.vue +143 -0
  83. package/templates/vue-2model-crud-patch/vite.config.js +9 -0
  84. package/templates/vue-axios/src/App.vue +255 -264
  85. package/templates/vue-axios/src/components/ItemFormModal.vue +183 -0
  86. package/templates/vue-axios/src/components/ItemPatchModal.vue +193 -0
  87. package/templates/vue-axios/src/components/ItemTable.vue +177 -0
  88. package/templates/vue-axios-basic/src/App.vue +241 -429
  89. package/templates/vue-axios-basic/src/components/ItemFormModal.vue +183 -0
  90. package/templates/vue-axios-basic/src/components/ItemPatchModal.vue +193 -0
  91. package/templates/vue-axios-basic/src/components/ItemTable.vue +177 -0
  92. package/templates/vue-axios-pinia/src/App.vue +150 -441
  93. package/templates/vue-axios-pinia/src/components/ItemFormModal.vue +207 -0
  94. package/templates/vue-axios-pinia/src/components/ItemStats.vue +64 -0
  95. package/templates/vue-axios-pinia/src/components/ItemTable.vue +195 -0
  96. package/templates/vue-axios-router/src/App.vue +41 -90
  97. package/templates/vue-axios-router/src/components/ItemFormModal.vue +173 -0
  98. package/templates/vue-axios-router/src/components/ItemTable.vue +102 -0
  99. package/templates/vue-axios-router/src/components/NavBar.vue +57 -0
  100. package/templates/vue-axios-router/src/views/DepartmentView.vue +132 -296
  101. package/templates/vue-axios-router/src/views/EmployeeView.vue +126 -219
  102. package/templates/vue-axios-router-children/src/components/ItemDetail.vue +115 -0
  103. package/templates/vue-axios-router-children/src/components/ItemTable.vue +104 -0
  104. package/templates/vue-axios-router-children/src/components/SideBar.vue +59 -0
  105. package/templates/vue-axios-router-children/src/views/CompanyLayout.vue +2 -51
  106. package/templates/vue-axios-router-children/src/views/DepartmentListView.vue +92 -250
  107. package/templates/vue-axios-router-children/src/views/EmployeeDetailView.vue +59 -181
  108. package/templates/vue-axios-router-children/src/views/EmployeeListView.vue +67 -315
  109. package/templates/vue-axios-router-pinia/src/App.vue +19 -70
  110. package/templates/vue-axios-router-pinia/src/components/ItemFormModal.vue +173 -0
  111. package/templates/vue-axios-router-pinia/src/components/ItemPatchModal.vue +144 -0
  112. package/templates/vue-axios-router-pinia/src/components/ItemTable.vue +102 -0
  113. package/templates/vue-axios-router-pinia/src/components/NavBar.vue +53 -0
  114. package/templates/vue-axios-router-pinia/src/views/DepartmentView.vue +107 -229
  115. package/templates/vue-axios-router-pinia/src/views/EmployeeView.vue +143 -257
  116. package/templates/vue-banking-app/src/components/AccountOverview.vue +75 -0
  117. package/templates/vue-banking-app/src/components/TransactionForm.vue +89 -0
  118. package/templates/vue-banking-app/src/components/TransactionTable.vue +113 -0
  119. package/templates/vue-banking-app/src/stores/bankStore.js +16 -3
  120. package/templates/vue-banking-app/src/views/DashboardView.vue +23 -71
  121. package/templates/vue-banking-app/src/views/StatementView.vue +11 -158
  122. package/templates/vue-banking-app/src/views/TransactionFormView.vue +23 -121
  123. package/templates/vue-basics/src/App.vue +105 -76
  124. package/templates/vue-basics/src/components/CounterCard.vue +107 -0
  125. package/templates/vue-basics/src/components/ItemList.vue +99 -0
  126. package/templates/vue-basics/src/components/UserForm.vue +138 -0
  127. package/templates/vue-cart-router-pinia/src/components/CartSummary.vue +139 -0
  128. package/templates/vue-cart-router-pinia/src/components/CheckoutModal.vue +149 -0
  129. package/templates/vue-cart-router-pinia/src/components/ProductCard.vue +63 -0
  130. package/templates/vue-cart-router-pinia/src/stores/cartStore.js +11 -0
  131. package/templates/vue-cart-router-pinia/src/views/CartView.vue +52 -118
  132. package/templates/vue-cart-router-pinia/src/views/CheckoutView.vue +2 -5
  133. package/templates/vue-cart-router-pinia/src/views/ProductCatalogView.vue +20 -56
  134. package/templates/vue-employee-system/src/App.vue +75 -344
  135. package/templates/vue-employee-system/src/components/DepartmentFilter.vue +108 -0
  136. package/templates/vue-employee-system/src/components/EmployeeModal.vue +183 -0
  137. package/templates/vue-employee-system/src/components/EmployeeTable.vue +91 -0
  138. package/templates/vue-employee-system/src/stores/employeeStore.js +12 -0
  139. package/templates/vue-fetch/src/App.vue +261 -285
  140. package/templates/vue-fetch/src/components/FetchFormModal.vue +183 -0
  141. package/templates/vue-fetch/src/components/FetchPatchModal.vue +193 -0
  142. package/templates/vue-fetch/src/components/FetchTable.vue +177 -0
  143. package/templates/vue-food-ordering/src/components/CartSummary.vue +134 -0
  144. package/templates/vue-food-ordering/src/components/FoodMenu.vue +126 -0
  145. package/templates/vue-food-ordering/src/components/OrderModal.vue +150 -0
  146. package/templates/vue-food-ordering/src/views/MenuView.vue +11 -132
  147. package/templates/vue-food-ordering/src/views/OrderCartView.vue +31 -164
  148. package/templates/vue-game-rps/src/App.vue +29 -88
  149. package/templates/vue-game-tictactoe/src/App.vue +23 -53
  150. package/templates/vue-game-whackamole/src/App.vue +44 -63
  151. package/templates/vue-hospital-portal/src/components/AppointmentForm.vue +144 -0
  152. package/templates/vue-hospital-portal/src/components/DoctorCard.vue +73 -0
  153. package/templates/vue-hospital-portal/src/components/PatientTable.vue +123 -0
  154. package/templates/vue-hospital-portal/src/stores/hospitalStore.js +10 -1
  155. package/templates/vue-hospital-portal/src/views/OPDRegistrationView.vue +40 -416
  156. package/templates/vue-hospital-portal/src/views/PatientListView.vue +11 -301
  157. package/templates/vue-library-system/src/components/BookForm.vue +125 -0
  158. package/templates/vue-library-system/src/components/BookTable.vue +112 -0
  159. package/templates/vue-library-system/src/components/BorrowModal.vue +131 -0
  160. package/templates/vue-library-system/src/stores/libraryStore.js +26 -1
  161. package/templates/vue-library-system/src/views/BookCatalogView.vue +34 -415
  162. package/templates/vue-memory-game/src/App.vue +36 -40
  163. package/templates/vue-memory-game/src/stores/memoryStore.js +32 -37
  164. package/templates/vue-router/src/App.vue +24 -14
  165. package/templates/vue-router/src/components/AboutCard.vue +38 -0
  166. package/templates/vue-router/src/components/HomeHero.vue +75 -0
  167. package/templates/vue-router/src/components/NavBar.vue +54 -0
  168. package/templates/vue-router/src/views/ItemsLayout.vue +17 -9
  169. package/templates/vue-router/src/views/ListView.vue +106 -18
  170. package/templates/vue-router-pinia/src/App.vue +24 -14
  171. package/templates/vue-router-pinia/src/components/ItemFormModal.vue +163 -0
  172. package/templates/vue-router-pinia/src/components/ItemTable.vue +90 -0
  173. package/templates/vue-router-pinia/src/components/NavBar.vue +54 -0
  174. package/templates/vue-router-pinia/src/stores/itemStore.js +8 -1
  175. package/templates/vue-router-pinia/src/views/ListView.vue +78 -14
  176. package/templates/vue-router-pinia-springboot/frontend/src/App.vue +25 -8
  177. package/templates/vue-router-pinia-springboot/frontend/src/components/ItemFormModal.vue +183 -0
  178. package/templates/vue-router-pinia-springboot/frontend/src/components/ItemPatchModal.vue +193 -0
  179. package/templates/vue-router-pinia-springboot/frontend/src/components/ItemTable.vue +177 -0
  180. package/templates/vue-router-pinia-springboot/frontend/src/components/NavBar.vue +54 -0
  181. package/templates/vue-router-pinia-springboot/frontend/src/views/ListView.vue +92 -76
  182. package/templates/vue-springboot-mongo-aggregation/frontend/src/App.vue +184 -193
  183. package/templates/vue-springboot-mongo-aggregation/frontend/src/components/AnalyticsCards.vue +56 -0
  184. package/templates/vue-springboot-mongo-aggregation/frontend/src/components/CategorySummaryTable.vue +71 -0
  185. package/templates/vue-springboot-mongo-aggregation/frontend/src/components/ItemTable.vue +114 -0
  186. package/templates/vue-springboot-mongo-crud/frontend/src/App.vue +228 -158
  187. package/templates/vue-springboot-mongo-crud/frontend/src/components/ItemFormModal.vue +183 -0
  188. package/templates/vue-springboot-mongo-crud/frontend/src/components/ItemPatchModal.vue +193 -0
  189. package/templates/vue-springboot-mongo-crud/frontend/src/components/ItemTable.vue +177 -0
  190. package/templates/vue-symposium-system/src/App.vue +41 -256
  191. package/templates/vue-symposium-system/src/components/AttendeeTable.vue +100 -0
  192. package/templates/vue-symposium-system/src/components/EventCard.vue +67 -0
  193. package/templates/vue-symposium-system/src/components/RegistrationForm.vue +118 -0
  194. package/templates/vue-symposium-system/src/stores/symposiumStore.js +10 -0
  195. package/templates/vue-todo-pinia/src/App.vue +40 -138
  196. package/templates/vue-todo-pinia/src/components/TodoFilter.vue +74 -0
  197. package/templates/vue-todo-pinia/src/components/TodoInput.vue +53 -0
  198. package/templates/vue-todo-pinia/src/components/TodoList.vue +101 -0
  199. package/templates/vue-todo-pinia/src/stores/todoStore.js +6 -0
  200. package/templates/vue-todo-router/src/App.vue +5 -36
  201. package/templates/vue-todo-router/src/components/TodoForm.vue +78 -0
  202. package/templates/vue-todo-router/src/components/TodoList.vue +84 -0
  203. package/templates/vue-todo-router/src/components/TodoNavBar.vue +47 -0
  204. package/templates/vue-todo-router/src/data/todoState.js +7 -0
  205. package/templates/vue-todo-router/src/views/AddTodoView.vue +7 -66
  206. package/templates/vue-todo-router/src/views/TodoDetailView.vue +15 -1
  207. package/templates/vue-todo-router/src/views/TodoListView.vue +22 -64
@@ -1,257 +1,143 @@
1
- <template>
2
- <div class="employee-view">
3
- <h2>Employees Management</h2>
4
-
5
- <section class="card">
6
- <h3>Add Employee</h3>
7
- <form @submit.prevent="handleSubmit" class="form">
8
- <div class="form-group">
9
- <label for="emp-name">Full Name</label>
10
- <input
11
- id="emp-name"
12
- v-model="form.name"
13
- type="text"
14
- required
15
- placeholder="e.g. Jane Doe"
16
- />
17
- </div>
18
- <div class="form-group">
19
- <label for="emp-email">Email Address</label>
20
- <input
21
- id="emp-email"
22
- v-model="form.email"
23
- type="email"
24
- required
25
- placeholder="e.g. jane@example.com"
26
- />
27
- </div>
28
- <div class="form-group">
29
- <label for="emp-dept">Department</label>
30
- <select id="emp-dept" v-model="form.departmentId" required>
31
- <option value="" disabled>Select Department</option>
32
- <option v-for="dept in companyStore.departments" :key="dept.id" :value="dept.id">
33
- {{ dept.name }} ({{ dept.code }})
34
- </option>
35
- </select>
36
- </div>
37
- <div class="form-group">
38
- <label for="emp-salary">Salary</label>
39
- <input
40
- id="emp-salary"
41
- v-model.number="form.salary"
42
- type="number"
43
- min="0"
44
- step="any"
45
- required
46
- placeholder="e.g. 75000"
47
- />
48
- </div>
49
- <button type="submit" class="btn btn-primary">Add Employee</button>
50
- </form>
51
- </section>
52
-
53
- <section class="card table-card">
54
- <h3>Employee List</h3>
55
- <div class="table-wrapper">
56
- <table>
57
- <thead>
58
- <tr>
59
- <th>ID</th>
60
- <th>Name</th>
61
- <th>Email</th>
62
- <th>Department</th>
63
- <th>Salary</th>
64
- <th>Action</th>
65
- </tr>
66
- </thead>
67
- <tbody>
68
- <tr v-if="companyStore.employees.length === 0">
69
- <td colspan="6" class="empty">No employees found</td>
70
- </tr>
71
- <tr v-for="emp in companyStore.employees" :key="emp.id">
72
- <td>{{ emp.id }}</td>
73
- <td>{{ emp.name }}</td>
74
- <td>{{ emp.email }}</td>
75
- <td>{{ companyStore.getDepartmentName(emp.departmentId) }}</td>
76
- <td>${{ Number(emp.salary).toLocaleString() }}</td>
77
- <td>
78
- <button @click="handlePatchEmployee(emp.id, emp.salary)" class="btn btn-warning">Patch</button>
79
- <button @click="handleDelete(emp.id)" class="btn btn-danger">Delete</button>
80
- </td>
81
- </tr>
82
- </tbody>
83
- </table>
84
- </div>
85
- </section>
86
- </div>
87
- </template>
88
-
89
- <script setup>
90
- import { reactive, onMounted } from 'vue'
91
- import { useCompanyStore } from '../stores/companyStore'
92
-
93
- const companyStore = useCompanyStore()
94
-
95
- const form = reactive({
96
- name: '',
97
- email: '',
98
- departmentId: '',
99
- salary: ''
100
- })
101
-
102
- const handleSubmit = async () => {
103
- await companyStore.addEmployee({
104
- name: form.name,
105
- email: form.email,
106
- departmentId: Number(form.departmentId),
107
- salary: Number(form.salary)
108
- })
109
- form.name = ''
110
- form.email = ''
111
- form.departmentId = ''
112
- form.salary = ''
113
- }
114
-
115
- const handleDelete = async (id) => {
116
- await companyStore.deleteEmployee(id)
117
- }
118
-
119
- const handlePatchEmployee = async (id, salary) => {
120
- const newSalary = prompt('New salary:', salary)
121
- if (newSalary !== null && newSalary !== '') {
122
- await companyStore.patchEmployee(id, { salary: Number(newSalary) })
123
- }
124
- }
125
-
126
- onMounted(() => {
127
- companyStore.fetchEmployees()
128
- companyStore.fetchDepartments()
129
- })
130
- </script>
131
-
132
- <style scoped>
133
- .employee-view h2 {
134
- font-size: 22px;
135
- margin-bottom: 20px;
136
- color: #1a1a1a;
137
- }
138
-
139
- .card {
140
- background: #ffffff;
141
- border: 1px solid #e1e4e8;
142
- border-radius: 8px;
143
- padding: 20px;
144
- margin-bottom: 24px;
145
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
146
- }
147
-
148
- .card h3 {
149
- font-size: 16px;
150
- margin-bottom: 16px;
151
- color: #333333;
152
- }
153
-
154
- .form {
155
- display: flex;
156
- flex-direction: column;
157
- gap: 12px;
158
- max-width: 400px;
159
- }
160
-
161
- .form-group {
162
- display: flex;
163
- flex-direction: column;
164
- gap: 4px;
165
- }
166
-
167
- .form-group label {
168
- font-size: 13px;
169
- font-weight: 600;
170
- color: #444444;
171
- }
172
-
173
- .form-group input,
174
- .form-group select {
175
- padding: 8px 10px;
176
- border: 1px solid #cccccc;
177
- border-radius: 4px;
178
- font-size: 14px;
179
- background-color: #ffffff;
180
- }
181
-
182
- .form-group input:focus,
183
- .form-group select:focus {
184
- outline: none;
185
- border-color: #0066cc;
186
- }
187
-
188
- .btn {
189
- padding: 8px 14px;
190
- border: none;
191
- border-radius: 4px;
192
- cursor: pointer;
193
- font-size: 13px;
194
- font-weight: 600;
195
- }
196
-
197
- .btn-primary {
198
- background-color: #0066cc;
199
- color: #ffffff;
200
- align-self: flex-start;
201
- }
202
-
203
- .btn-primary:hover {
204
- background-color: #0052a3;
205
- }
206
-
207
- .btn-danger {
208
- background-color: #d9383a;
209
- color: #ffffff;
210
- padding: 4px 8px;
211
- font-size: 12px;
212
- }
213
-
214
- .btn-danger:hover {
215
- background-color: #b8282a;
216
- }
217
-
218
- .btn-warning {
219
- background-color: #f0ad4e;
220
- color: #ffffff;
221
- padding: 4px 8px;
222
- font-size: 12px;
223
- margin-right: 6px;
224
- }
225
-
226
- .btn-warning:hover {
227
- background-color: #ec971f;
228
- }
229
-
230
- .table-wrapper {
231
- overflow-x: auto;
232
- }
233
-
234
- table {
235
- width: 100%;
236
- border-collapse: collapse;
237
- font-size: 13px;
238
- }
239
-
240
- th, td {
241
- text-align: left;
242
- padding: 8px 10px;
243
- border-bottom: 1px solid #eeeeee;
244
- }
245
-
246
- th {
247
- background-color: #fafbfc;
248
- color: #555555;
249
- font-weight: 600;
250
- }
251
-
252
- .empty {
253
- text-align: center;
254
- color: #888888;
255
- padding: 16px;
256
- }
257
- </style>
1
+ <script setup>
2
+ import { ref, onMounted } from 'vue'
3
+ import { useCompanyStore } from '../stores/companyStore'
4
+ import ItemTable from '../components/ItemTable.vue'
5
+ import ItemFormModal from '../components/ItemFormModal.vue'
6
+ import ItemPatchModal from '../components/ItemPatchModal.vue'
7
+
8
+ const store = useCompanyStore()
9
+ const isFormModalOpen = ref(false)
10
+ const isPatchModalOpen = ref(false)
11
+ const selectedEmp = ref(null)
12
+
13
+ const columns = [
14
+ { key: 'id', label: 'ID' },
15
+ { key: 'name', label: 'Name' },
16
+ { key: 'email', label: 'Email' },
17
+ {
18
+ key: 'departmentId',
19
+ label: 'Department',
20
+ format: (val) => {
21
+ const dept = store.departments.find(d => d.id === val)
22
+ return dept ? dept.name : (val ? 'Dept #' + val : 'N/A')
23
+ }
24
+ },
25
+ {
26
+ key: 'salary',
27
+ label: 'Salary',
28
+ format: (val) => '$' + Number(val || 0).toLocaleString()
29
+ }
30
+ ]
31
+
32
+ const formFields = ref([])
33
+
34
+ function prepareFormFields() {
35
+ formFields.value = [
36
+ { key: 'name', label: 'Full Name', required: true, placeholder: 'e.g. John Doe' },
37
+ { key: 'email', label: 'Email', type: 'email', required: true, placeholder: 'john@example.com' },
38
+ {
39
+ key: 'departmentId',
40
+ label: 'Department',
41
+ type: 'select',
42
+ required: true,
43
+ options: store.departments.map(d => ({ label: d.name + ' (' + d.code + ')', value: d.id }))
44
+ },
45
+ { key: 'salary', label: 'Salary ($)', type: 'number', required: true, placeholder: '60000' }
46
+ ]
47
+ }
48
+
49
+ function openAddEmployee() {
50
+ prepareFormFields()
51
+ isFormModalOpen.value = true
52
+ }
53
+
54
+ async function handleCreate(data) {
55
+ await store.createEmployee({
56
+ name: data.name,
57
+ email: data.email,
58
+ departmentId: Number(data.departmentId),
59
+ salary: Number(data.salary)
60
+ })
61
+ isFormModalOpen.value = false
62
+ }
63
+
64
+ function handleOpenPatch(emp) {
65
+ selectedEmp.value = emp
66
+ isPatchModalOpen.value = true
67
+ }
68
+
69
+ async function handleApplyPatch(newSalary) {
70
+ if (selectedEmp.value && newSalary) {
71
+ await store.patchEmployee(selectedEmp.value.id, { salary: Number(newSalary) })
72
+ }
73
+ isPatchModalOpen.value = false
74
+ }
75
+
76
+ async function handleDelete(id) {
77
+ if (confirm('Delete this employee?')) {
78
+ await store.deleteEmployee(id)
79
+ }
80
+ }
81
+
82
+ onMounted(() => {
83
+ store.fetchDepartments()
84
+ store.fetchEmployees()
85
+ })
86
+ </script>
87
+
88
+ <template>
89
+ <div class="view-container">
90
+ <div class="view-header">
91
+ <h2>Employee Management (Pinia)</h2>
92
+ <button type="button" class="btn btn-primary" @click="openAddEmployee">Add Employee</button>
93
+ </div>
94
+
95
+ <ItemTable
96
+ :columns="columns"
97
+ :items="store.employees"
98
+ :loading="store.loading"
99
+ @patch="handleOpenPatch"
100
+ @delete="handleDelete"
101
+ />
102
+
103
+ <ItemFormModal
104
+ :show="isFormModalOpen"
105
+ title="Create Employee"
106
+ :fields="formFields"
107
+ @close="isFormModalOpen = false"
108
+ @submit="handleCreate"
109
+ />
110
+
111
+ <ItemPatchModal
112
+ :show="isPatchModalOpen"
113
+ title="Patch Employee Salary"
114
+ field-label="New Salary ($)"
115
+ :initial-value="selectedEmp ? selectedEmp.salary : ''"
116
+ @close="isPatchModalOpen = false"
117
+ @submit="handleApplyPatch"
118
+ />
119
+ </div>
120
+ </template>
121
+
122
+ <style scoped>
123
+ .view-container {
124
+ display: flex;
125
+ flex-direction: column;
126
+ gap: 16px;
127
+ }
128
+
129
+ .view-header {
130
+ display: flex;
131
+ justify-content: space-between;
132
+ align-items: center;
133
+ }
134
+
135
+ .btn-primary {
136
+ background: #0284c7;
137
+ color: #fff;
138
+ border: none;
139
+ padding: 8px 14px;
140
+ border-radius: 6px;
141
+ cursor: pointer;
142
+ }
143
+ </style>
@@ -113,6 +113,6 @@ function checkBingo() {
113
113
 
114
114
  if (displayLines >= 5 && !isWon) {
115
115
  isWon = true;
116
- document.getElementById("winBanner").textContent = "🎉 BINGO! You won! 🎉";
116
+ document.getElementById("winBanner").textContent = "BINGO! You won!";
117
117
  }
118
118
  }
@@ -1,4 +1,4 @@
1
- const symbols = ["🐶", "🐱", "🐭", "🐹", "🐰", "🦊"];
1
+ const symbols = ["A", "B", "C", "D", "E", "F"];
2
2
  let cards = [];
3
3
  let flippedCards = [];
4
4
  let matchedCount = 0;
@@ -73,7 +73,7 @@ function checkMatch() {
73
73
 
74
74
  if (matchedCount === symbols.length) {
75
75
  setTimeout(function () {
76
- alert("Congratulations! You won in " + moves + " moves! 🎉");
76
+ alert("Congratulations! You won in " + moves + " moves!");
77
77
  }, 300);
78
78
  }
79
79
  } else {
@@ -18,9 +18,9 @@
18
18
  </div>
19
19
 
20
20
  <div class="controls">
21
- <button type="button" class="btn" onclick="playGame('Rock')">✊ Rock</button>
22
- <button type="button" class="btn" onclick="playGame('Paper')">✋ Paper</button>
23
- <button type="button" class="btn" onclick="playGame('Scissors')">✌ Scissors</button>
21
+ <button type="button" class="btn" onclick="playGame('Rock')">Rock</button>
22
+ <button type="button" class="btn" onclick="playGame('Paper')">Paper</button>
23
+ <button type="button" class="btn" onclick="playGame('Scissors')">Scissors</button>
24
24
  </div>
25
25
 
26
26
  <div class="results-box">
@@ -22,11 +22,11 @@ function playGame(playerChoice) {
22
22
  (playerChoice === "Paper" && computerChoice === "Rock") ||
23
23
  (playerChoice === "Scissors" && computerChoice === "Paper")
24
24
  ) {
25
- result = "You Win! 🎉";
25
+ result = "You Win!";
26
26
  playerScore++;
27
27
  document.getElementById("playerScore").textContent = playerScore;
28
28
  } else {
29
- result = "Computer Wins! 💻";
29
+ result = "Computer Wins!";
30
30
  computerScore++;
31
31
  document.getElementById("computerScore").textContent = computerScore;
32
32
  }
@@ -54,14 +54,14 @@ function checkResult() {
54
54
  }
55
55
 
56
56
  if (roundWon) {
57
- document.getElementById("status").textContent = "Player " + currentPlayer + " Wins! 🎉";
57
+ document.getElementById("status").textContent = "Player " + currentPlayer + " Wins!";
58
58
  gameActive = false;
59
59
  return;
60
60
  }
61
61
 
62
62
  const roundDraw = !board.includes("");
63
63
  if (roundDraw) {
64
- document.getElementById("status").textContent = "Game Draw! 🤝";
64
+ document.getElementById("status").textContent = "Game Draw!";
65
65
  gameActive = false;
66
66
  return;
67
67
  }
@@ -19,15 +19,15 @@
19
19
  <button type="button" class="btn-start" id="startBtn" onclick="startGame()">Start Game</button>
20
20
 
21
21
  <div class="grid">
22
- <div class="hole" data-index="0"><div class="mole" onclick="whackMole(this)">🐹</div></div>
23
- <div class="hole" data-index="1"><div class="mole" onclick="whackMole(this)">🐹</div></div>
24
- <div class="hole" data-index="2"><div class="mole" onclick="whackMole(this)">🐹</div></div>
25
- <div class="hole" data-index="3"><div class="mole" onclick="whackMole(this)">🐹</div></div>
26
- <div class="hole" data-index="4"><div class="mole" onclick="whackMole(this)">🐹</div></div>
27
- <div class="hole" data-index="5"><div class="mole" onclick="whackMole(this)">🐹</div></div>
28
- <div class="hole" data-index="6"><div class="mole" onclick="whackMole(this)">🐹</div></div>
29
- <div class="hole" data-index="7"><div class="mole" onclick="whackMole(this)">🐹</div></div>
30
- <div class="hole" data-index="8"><div class="mole" onclick="whackMole(this)">🐹</div></div>
22
+ <div class="hole" data-index="0"><div class="mole" onclick="whackMole(this)">[TARGET]</div></div>
23
+ <div class="hole" data-index="1"><div class="mole" onclick="whackMole(this)">[TARGET]</div></div>
24
+ <div class="hole" data-index="2"><div class="mole" onclick="whackMole(this)">[TARGET]</div></div>
25
+ <div class="hole" data-index="3"><div class="mole" onclick="whackMole(this)">[TARGET]</div></div>
26
+ <div class="hole" data-index="4"><div class="mole" onclick="whackMole(this)">[TARGET]</div></div>
27
+ <div class="hole" data-index="5"><div class="mole" onclick="whackMole(this)">[TARGET]</div></div>
28
+ <div class="hole" data-index="6"><div class="mole" onclick="whackMole(this)">[TARGET]</div></div>
29
+ <div class="hole" data-index="7"><div class="mole" onclick="whackMole(this)">[TARGET]</div></div>
30
+ <div class="hole" data-index="8"><div class="mole" onclick="whackMole(this)">[TARGET]</div></div>
31
31
  </div>
32
32
  </div>
33
33
  </body>
@@ -1,3 +1,16 @@
1
+ /*
2
+ COMPILE FROM INSIDE WEB-INF DIRECTORY:
3
+ Linux: javac -cp "../../../lib/*" -d classes ItemServlet.java
4
+ Windows: javac -cp "../../../lib/*" -d classes ItemServlet.java
5
+
6
+ RUN TOMCAT:
7
+ Linux: ../../../bin/startup.sh
8
+ Windows: ..\..\..\bin\startup.bat
9
+
10
+ URL:
11
+ http://localhost:8080/servlet-basic/index.html
12
+ */
13
+
1
14
  import java.io.IOException;
2
15
  import java.io.PrintWriter;
3
16
  import javax.servlet.ServletException;
@@ -1,26 +1,35 @@
1
- import java.io.IOException;
2
- import java.io.PrintWriter;
3
-
4
-
5
- import javax.servlet.*;
6
- import javax.servlet.http.*;
7
-
8
-
9
-
10
-
11
- public class HelloServlet extends HttpServlet{
12
- @Override
13
- protected void doPost(HttpServletRequest request,HttpServletResponse response)
14
- throws IOException,ServletException{
15
- String name=request.getParameter("name");
16
- response.setContentType("text/html");
17
- PrintWriter pw = response.getWriter();
18
- pw.println("<h3>Hello " + name + "!!</h3>");
19
- pw.close();
20
- }
21
- @Override
22
- protected void doGet(HttpServletRequest request,HttpServletResponse response)
23
- throws IOException,ServletException{
24
- doPost(request,response);
25
- }
1
+ /*
2
+ COMPILE FROM INSIDE WEB-INF DIRECTORY:
3
+ Linux: javac -cp "../../../lib/*" -d classes HelloServlet.java
4
+ Windows: javac -cp "../../../lib/*" -d classes HelloServlet.java
5
+
6
+ RUN TOMCAT:
7
+ Linux: ../../../bin/startup.sh
8
+ Windows: ..\..\..\bin\startup.bat
9
+
10
+ URL:
11
+ http://localhost:8080/servlet-flow/index.html
12
+ */
13
+
14
+ import java.io.IOException;
15
+ import java.io.PrintWriter;
16
+ import javax.servlet.*;
17
+ import javax.servlet.http.*;
18
+
19
+ public class HelloServlet extends HttpServlet {
20
+ @Override
21
+ protected void doPost(HttpServletRequest request, HttpServletResponse response)
22
+ throws IOException, ServletException {
23
+ String name = request.getParameter("name");
24
+ response.setContentType("text/html");
25
+ PrintWriter pw = response.getWriter();
26
+ pw.println("<h3>Hello " + name + "!!</h3>");
27
+ pw.close();
28
+ }
29
+
30
+ @Override
31
+ protected void doGet(HttpServletRequest request, HttpServletResponse response)
32
+ throws IOException, ServletException {
33
+ doPost(request, response);
34
+ }
26
35
  }
@@ -1,3 +1,16 @@
1
+ /*
2
+ COMPILE FROM INSIDE WEB-INF DIRECTORY:
3
+ Linux: javac -cp "../../../lib/*" -d classes JdbcItemServlet.java
4
+ Windows: javac -cp "../../../lib/*" -d classes JdbcItemServlet.java
5
+
6
+ RUN TOMCAT:
7
+ Linux: ../../../bin/startup.sh
8
+ Windows: ..\..\..\bin\startup.bat
9
+
10
+ URL:
11
+ http://localhost:8080/servlet-jdbc/index.html
12
+ */
13
+
1
14
  import java.io.IOException;
2
15
  import java.io.PrintWriter;
3
16
  import java.sql.Connection;