tangled
alpha
login
or
join now
kacaii.dev
/
sigo
0
fork
atom
๐ฉโ๐ Firefighters API written in Gleam!
lustre
gleam
0
fork
atom
overview
issues
pulls
pipelines
:dizzy: add loading state feedback by changing the cursor
kacaii.dev
1 week ago
4e0d8c81
605af83f
verified
This commit was signed with the committer's
known signature
.
kacaii.dev
SSH Key Fingerprint:
SHA256:n9v7QGNWHCUv1x/483hCtPUvTsVabU5PzC5CSJMUNtI=
+28
-5
3 changed files
expand all
collapse all
unified
split
client
src
client
page
login.gleam
signup.gleam
justfile
+7
-2
client/src/client/page/login.gleam
···
103
let attributes = [
104
class("flex gap-2 justify-center items-center"),
105
class("p-2 text-white rounded-md bg-secondary"),
106
-
class("hover:cursor-pointer hover:bg-accent hover:text-primary"),
107
108
class("disabled:text-primary disabled:placeholder:text-surface"),
109
class("disabled:bg-surface"),
110
class("disabled:cursor-not-allowed"),
111
112
-
attr.disabled(model.email == "" || model.password == "" || model.loading),
0
0
0
0
0
113
event.on_click(UserSentRequest),
114
]
115
···
103
let attributes = [
104
class("flex gap-2 justify-center items-center"),
105
class("p-2 text-white rounded-md bg-secondary"),
106
+
class("hover:bg-accent hover:text-primary"),
107
108
class("disabled:text-primary disabled:placeholder:text-surface"),
109
class("disabled:bg-surface"),
110
class("disabled:cursor-not-allowed"),
111
112
+
case model.loading {
113
+
True -> class("hover:cursor-progress")
114
+
False -> class("hover:cursor-point")
115
+
},
116
+
117
+
attr.disabled(model.email == "" || model.password == ""),
118
event.on_click(UserSentRequest),
119
]
120
+7
-3
client/src/client/page/signup.gleam
···
167
]
168
169
let disabled =
170
-
model.loading
171
-
|| model.user_password != model.user_confirm_password
172
|| list.any(required_fields, string.is_empty)
173
174
let icon = case model.loading {
···
180
class("p-2 font-bold text-white rounded-md bg-secondary"),
181
class("flex gap-2 justify-center items-center"),
182
183
-
class("hover:cursor-pointer hover:bg-accent hover:text-primary"),
184
185
class("disabled:cursor-not-allowed"),
186
class("disabled:text-primary disabled:bg-surface"),
0
0
0
0
0
187
188
event.on_click(UserSentRequest),
189
attr.disabled(disabled),
···
167
]
168
169
let disabled =
170
+
model.user_password != model.user_confirm_password
0
171
|| list.any(required_fields, string.is_empty)
172
173
let icon = case model.loading {
···
179
class("p-2 font-bold text-white rounded-md bg-secondary"),
180
class("flex gap-2 justify-center items-center"),
181
182
+
class("hover:bg-accent hover:text-primary"),
183
184
class("disabled:cursor-not-allowed"),
185
class("disabled:text-primary disabled:bg-surface"),
186
+
187
+
case model.loading {
188
+
True -> class("hover:cursor-progress")
189
+
False -> class("hover:cursor-point")
190
+
},
191
192
event.on_click(UserSentRequest),
193
attr.disabled(disabled),
+14
justfile
···
52
just init-database
53
just build-backend
54
just init-backend
0
55
0
56
down:
57
podman pod stop {{ pod_name }}
58
podman pod rm {{ pod_name }}
···
64
{{ pg_health_cmd }} {{ pg_health_conf }} {{ pg_health_start_period }} \
65
{{ pg_volume }} {{ pg_image }}
66
0
67
[group("podman")]
68
@init-backend:
69
podman run -d \
···
72
-e DATABASE_URL -e SECRET_KEY \
73
backend
74
0
75
[group("podman")]
76
@build-backend:
77
podman build -t backend .
78
0
79
[group("podman")]
80
@create-pod:
0
81
podman pod create \
82
--name {{ pod_name }} \
83
-p 8000:8000
0
0
0
0
0
0
0
0
···
52
just init-database
53
just build-backend
54
just init-backend
55
+
@echo {{ GREEN }}"Listening on http://0.0.0.0:8000"{{ NORMAL }}
56
57
+
[group("podman")]
58
down:
59
podman pod stop {{ pod_name }}
60
podman pod rm {{ pod_name }}
···
66
{{ pg_health_cmd }} {{ pg_health_conf }} {{ pg_health_start_period }} \
67
{{ pg_volume }} {{ pg_image }}
68
69
+
# Init the application container
70
[group("podman")]
71
@init-backend:
72
podman run -d \
···
75
-e DATABASE_URL -e SECRET_KEY \
76
backend
77
78
+
# Build application container
79
[group("podman")]
80
@build-backend:
81
podman build -t backend .
82
83
+
# Create pod
84
[group("podman")]
85
@create-pod:
86
+
podman pod exists {{ pod_name }} ||\
87
podman pod create \
88
--name {{ pod_name }} \
89
-p 8000:8000
90
+
91
+
# Creates a pod exposing the Database port
92
+
[group("podman"), group("dev")]
93
+
@create-pod-expose-db:
94
+
podman pod exists {{ pod_name }} ||\
95
+
podman pod create \
96
+
--name {{ pod_name }} \
97
+
-p 5432:5432