Skip to content

Commit 55ba6b7

Browse files
awolfdenAdam Wolfman
andauthored
Update UI components (#25)
Co-authored-by: Adam Wolfman <[email protected]>
1 parent 4932539 commit 55ba6b7

File tree

4 files changed

+77
-45
lines changed

4 files changed

+77
-45
lines changed

python-flask-audit-logs-example/app.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def index():
3737
return render_template(
3838
"send_events.html",
3939
organization_id=session["organization_id"],
40+
org_name=session["organization_name"],
4041
)
4142
except KeyError:
4243
return render_template("login.html")
@@ -49,6 +50,9 @@ def set_org():
4950
organization_set = workos.client.audit_logs.create_event(
5051
organization_id, user_organization_set
5152
)
53+
org = workos.client.organizations.get_organization(organization_id)
54+
org_name = org["name"]
55+
session["organization_name"] = org_name
5256
return redirect("/")
5357

5458

@@ -70,7 +74,11 @@ def send_event():
7074
@app.route("/export_events", methods=["POST", "GET"])
7175
def export_events():
7276
organization_id = session["organization_id"]
73-
return render_template("export_events.html", organization_id=organization_id)
77+
return render_template(
78+
"export_events.html",
79+
organization_id=organization_id,
80+
org_name=session["organization_name"],
81+
)
7482

7583

7684
@app.route("/get_events", methods=["POST", "GET"])

python-flask-audit-logs-example/static/login.css

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,24 @@ a:visited {
3232
bottom: 10px;
3333
}
3434

35+
.card {
36+
border: 1px solid #9a9999;
37+
border-radius: 10px;
38+
margin: 0px 15px 0px 15px;
39+
padding: 25px 50px;
40+
margin-bottom: 20px;
41+
}
42+
3543
.flex {
3644
display: flex;
3745
justify-content: center;
3846
align-items: center;
3947
}
4048

49+
.flex-start {
50+
justify-content: start;
51+
}
52+
4153
.flex_column {
4254
display: flex;
4355
flex-direction: column;
@@ -77,6 +89,10 @@ a:visited {
7789
margin: 30px 0px;
7890
}
7991

92+
.margin-b-25 {
93+
margin-bottom: 25px;
94+
}
95+
8096
.container_success {
8197
display: flex;
8298
flex-direction: column;

python-flask-audit-logs-example/templates/export_events.html

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ <h2 class="home-hero-gradient">Enterprise Ready</h2>
3838
</div>
3939
</div>
4040
<div class="logged_in_div_right">
41-
<div class="flex width-40vw space-between margin-y-30">
41+
<div class="flex flex-start width-40vw">
42+
<div><h1>{{org_name}}</h1></div>
43+
</div>
44+
<div class="flex card width-40vw space-between ">
4245
<div>
4346
<code class="org-id">{{organization_id}}</code>
4447
</div>
@@ -47,9 +50,9 @@ <h2 class="home-hero-gradient">Enterprise Ready</h2>
4750
<a href="/"><button class="button">Go Back</button></a>
4851
</div>
4952
</div>
50-
<hr style="height:0.5px;width:40vw;">
53+
5154
<form action="{{ url_for('get_events') }}" method="POST">
52-
<div class="flex margin-y-15">
55+
<div class="flex card">
5356
<div class="flex">
5457
<button class="box" name="event" id="generate_csv" value="generate_csv" type="submit">
5558
<div class="flex width-100p">

python-flask-audit-logs-example/templates/send_events.html

Lines changed: 46 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -38,55 +38,60 @@ <h2 class="home-hero-gradient">Enterprise Ready</h2>
3838
</div>
3939
</div>
4040
<div class="logged_in_div_right">
41-
<div class="flex_column">
42-
<div class="flex width-40vw space-between margin-y-30">
41+
<div class="flex flex-start width-40vw">
42+
<div><h1>{{org_name}}</h1></div>
43+
</div>
44+
<div class="flex_column width-40vw ">
45+
<div class="flex card width-40vw space-between ">
4346
<code class="org-id">{{organization_id}}</code>
4447
<a href="/logout"><button class="button">Change Org</button></a>
4548
</div>
46-
<hr style="height:0.5px;width:100%;">
47-
<div class="flex space-evenly width-40vw">
48-
<div>
49-
<div class="button button-outline width-15vw">
50-
<a href="https://workos.com/docs/audit-logs" target="_blank"><p>Audit Logs Docs</p></a>
51-
</div>
52-
</div>
53-
<div>
54-
<a href="{{ url_for('export_events') }}">
55-
<div class="button button-outline width-15vw">
56-
<p>Export Events</p>
57-
</div>
58-
</a>
59-
</div>
60-
</div>
61-
<hr style="height:0.5px;width:100%;">
62-
<form action="{{ url_for('send_event') }}" method="POST">
63-
<div class="flex margin-y-15">
49+
<div class="card width-40vw">
50+
<div class="flex space-evenly width-40vw margin-b-25">
6451
<div>
65-
<button class="box" name="event" id="user_signed_in" value="0" type="submit">
66-
<div class="flex width-100p">
67-
<p>User Signed In</p>
68-
</div>
69-
</button>
70-
<button class="box" name="event" id="user_logged_out" value="1" type="submit">
71-
<div class="flex width-100p">
72-
<p>User Logged Out</p>
73-
</div>
74-
</button>
52+
<div class="button button-outline width-15vw">
53+
<a href="https://workos.com/docs/audit-logs" target="_blank"><p>Audit Logs Docs</p></a>
54+
</div>
7555
</div>
7656
<div>
77-
<button class="box" name="event" id="user_org_deleted" value="2" type="submit">
78-
<div class="flex width-100p">
79-
<p>User Organization Deleted</p>
80-
</div>
81-
</button>
82-
<button class="box" name="event" id="user_connection_deleted" value="3" type="submit">
83-
<div class="flex width-100p">
84-
<p>User Connection Deleted</p>
85-
</div>
86-
</button>
57+
<a href="{{ url_for('export_events') }}">
58+
<div class="button button-outline width-15vw">
59+
<p>Export Events</p>
60+
</div>
61+
</a>
8762
</div>
8863
</div>
89-
</form>
64+
<hr style="height:0.5px;width:100%;">
65+
<form action="{{ url_for('send_event') }}" method="POST">
66+
<div class="flex margin-y-15">
67+
<div>
68+
<button class="box" name="event" id="user_signed_in" value="0" type="submit">
69+
<div class="flex width-100p">
70+
<p>User Signed In</p>
71+
</div>
72+
</button>
73+
<button class="box" name="event" id="user_logged_out" value="1" type="submit">
74+
<div class="flex width-100p">
75+
<p>User Logged Out</p>
76+
</div>
77+
</button>
78+
</div>
79+
<div>
80+
<button class="box" name="event" id="user_org_deleted" value="2" type="submit">
81+
<div class="flex width-100p">
82+
<p>User Organization Deleted</p>
83+
</div>
84+
</button>
85+
<button class="box" name="event" id="user_connection_deleted" value="3" type="submit">
86+
<div class="flex width-100p">
87+
<p>User Connection Deleted</p>
88+
</div>
89+
</button>
90+
</div>
91+
</div>
92+
</form>
93+
</div>
94+
9095
</div>
9196
</div>
9297
</div>

0 commit comments

Comments
 (0)