diff options
author | Zach Berwaldt <zberwaldt@tutamail.com> | 2024-03-02 16:52:55 -0500 |
---|---|---|
committer | Zach Berwaldt <zberwaldt@tutamail.com> | 2024-03-02 16:52:55 -0500 |
commit | cf2113e77edabf8e3a632c7b76c769752039ba88 (patch) | |
tree | 874872f22aa63df532769de62119816748b167f8 /fe/src/app.css | |
parent | 326f186d67017f87e631a1fbcdf3f184cbc42d7d (diff) |
feat: Add API logging
Add logging to the API to keep track of specific requests and headers. Also added CORS middleware to handle OPTIONS requests.
---
The commit adds logging functionality to the API and includes a middleware function to handle CORS OPTIONS requests. This will allow us to track specific requests and headers received by the API.
[API/main.go](/api/main.go):
- Added import for the 'log' package
- Added logging statements to print the request headers and "_I am here_" message
- Removed unnecessary newlines and comments
[fe/src/app.css](/fe/src/app.css):
- Added a new style for button hover effects
[fe/src/lib/Card.svelte](/fe/src/lib/Card.svelte):
- Added a new `height` prop to the Card component
[fe/src/lib/Column.svelte](/fe/src/lib/Column.svelte):
- Added a new CSS class for column layout
- Set the width and gap using CSS variables
[fe/src/lib/DataView.svelte](/fe/src/lib/DataView.svelte):
- Updated the 'fetchData' function to also fetch 'totals' and 'userStats' data
- Added canvas references and chart variables for bar and line charts
- Added a new 'getLastSevenDays' function to calculate the labels for the charts
- Updated the 'onMount' function to initialize the bar and line charts using the canvas references and data
- Updated the 'onDestroy' function to destroy the bar and line charts
- Added a new 'addFormOpen' store and imported it
- Added a new 'onClick' handler for the Add button to open the AddForm modal
- Updated the layout and added Card components to display the bar and line charts and the JSON data
- Added a new 'fetchTotals' function to fetch data for the 'totals' section
- Added a new 'fetchStatsForUser' function to fetch data for the 'userStats' section
[fe/src/lib/Layout.svelte](/fe/src/lib/Layout.svelte):
- Added a new 'preferenceFormOpen' variable and initialized it to 'false'
- Added a new 'showPreferencesDialog' function to set 'preferenceFormOpen' to 'true'
- Added a new 'closePreferenceDialog' function to set 'preferenceFormOpen' to 'false'
- Added a new 'showAddDialog' function to open the AddForm modal
Diffstat (limited to 'fe/src/app.css')
-rw-r--r-- | fe/src/app.css | 101 |
1 files changed, 53 insertions, 48 deletions
diff --git a/fe/src/app.css b/fe/src/app.css index 0d5fa90..de19b52 100644 --- a/fe/src/app.css +++ b/fe/src/app.css | |||
@@ -1,82 +1,87 @@ | |||
1 | :root { | 1 | :root { |
2 | font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif; | 2 | font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif; |
3 | line-height: 1.5; | 3 | line-height: 1.5; |
4 | font-weight: 400; | 4 | font-weight: 400; |
5 | 5 | ||
6 | color-scheme: light dark; | 6 | color-scheme: light dark; |
7 | color: rgba(255, 255, 255, 0.87); | 7 | color: rgba(255, 255, 255, 0.87); |
8 | background-color: #242424; | 8 | background-color: #242424; |
9 | 9 | ||
10 | font-synthesis: none; | 10 | font-synthesis: none; |
11 | text-rendering: optimizeLegibility; | 11 | text-rendering: optimizeLegibility; |
12 | -webkit-font-smoothing: antialiased; | 12 | -webkit-font-smoothing: antialiased; |
13 | -moz-osx-font-smoothing: grayscale; | 13 | -moz-osx-font-smoothing: grayscale; |
14 | 14 | ||
15 | --submit: #28a745; | 15 | --submit: #28a745; |
16 | } | 16 | } |
17 | 17 | ||
18 | a { | 18 | a { |
19 | font-weight: 500; | 19 | font-weight: 500; |
20 | color: #646cff; | 20 | color: #646cff; |
21 | text-decoration: inherit; | 21 | text-decoration: inherit; |
22 | } | 22 | } |
23 | |||
23 | a:hover { | 24 | a:hover { |
24 | color: #535bf2; | 25 | color: #535bf2; |
25 | } | 26 | } |
26 | 27 | ||
27 | body { | 28 | body { |
28 | margin: 0; | 29 | margin: 0; |
29 | display: flex; | 30 | display: flex; |
30 | place-items: center; | 31 | place-items: center; |
31 | min-width: 320px; | 32 | min-width: 320px; |
32 | min-height: 100vh; | 33 | min-height: 100vh; |
33 | } | 34 | } |
34 | 35 | ||
35 | h1 { | 36 | h1 { |
36 | font-size: 3.2em; | 37 | font-size: 3.2em; |
37 | line-height: 1.1; | 38 | line-height: 1.1; |
38 | } | 39 | } |
39 | 40 | ||
40 | .card { | 41 | .card { |
41 | padding: 2em; | 42 | padding: 2em; |
42 | } | 43 | } |
43 | 44 | ||
44 | #app { | 45 | #app { |
45 | flex-grow: 2; | 46 | flex-grow: 2; |
46 | max-width: 1280px; | 47 | max-width: 1280px; |
47 | margin: 0 auto; | 48 | margin: 0 auto; |
48 | } | 49 | } |
49 | 50 | ||
50 | button { | 51 | button { |
51 | border-radius: 8px; | 52 | border-radius: 8px; |
52 | border: 1px solid transparent; | 53 | border: 1px solid transparent; |
53 | padding: 0.6em 1.2em; | 54 | padding: 0.6em 1.2em; |
54 | font-size: 1em; | 55 | font-size: 1em; |
55 | font-weight: 500; | 56 | font-weight: 500; |
56 | font-family: inherit; | 57 | font-family: inherit; |
57 | background-color: #1a1a1a; | 58 | background-color: #1a1a1a; |
58 | cursor: pointer; | 59 | cursor: pointer; |
59 | transition: border-color 0.25s; | 60 | transition: border-color 0.25s; |
60 | } | 61 | } |
62 | |||
61 | button:hover { | 63 | button:hover { |
62 | border-color: #646cff; | 64 | border-color: #646cff; |
63 | } | 65 | } |
66 | |||
64 | button:focus, | 67 | button:focus, |
65 | button:focus-visible { | 68 | button:focus-visible { |
66 | outline: 4px auto -webkit-focus-ring-color; | 69 | outline: 4px auto -webkit-focus-ring-color; |
67 | } | 70 | } |
68 | 71 | ||
69 | @media (prefers-color-scheme: light) { | 72 | @media (prefers-color-scheme: light) { |
70 | :root { | 73 | :root { |
71 | color: #213547; | 74 | color: #213547; |
72 | background-color: #ffffff; | 75 | background-color: #ffffff; |
73 | } | 76 | } |
74 | a:hover { | 77 | |
75 | color: #747bff; | 78 | a:hover { |
76 | } | 79 | color: #747bff; |
77 | button { | 80 | } |
78 | background-color: #f9f9f9; | 81 | |
79 | } | 82 | button { |
83 | background-color: #f9f9f9; | ||
84 | } | ||
80 | } | 85 | } |
81 | 86 | ||
82 | @media (prefers-color-scheme: dark) { | 87 | @media (prefers-color-scheme: dark) { |
@@ -97,7 +102,7 @@ button:focus-visible { | |||
97 | } | 102 | } |
98 | 103 | ||
99 | .form.input.group label { | 104 | .form.input.group label { |
100 | margin-bottom: .5em; | 105 | margin-bottom: .5em; |
101 | } | 106 | } |
102 | 107 | ||
103 | .form.input.group input { | 108 | .form.input.group input { |