Added user ips to user page

This commit is contained in:
Akif9748 2022-09-17 01:15:44 +03:00
parent 6c5f36836b
commit 16f72585a0
3 changed files with 14 additions and 9 deletions

View file

@ -34,17 +34,13 @@ Akf-forum has got an API for AJAX (fetch), other clients etc. And, you can learn
## TO-DO list
| To do | Is done? | Priority |
| ----- | -------- | -------- |
| Profile Message | 🟡 | LOW |
| IPs of users will add UserModel with select- | 🟢 | MEDIUM |
| Profile Message | ⚪ | LOW |
| Better Auth | ⚪ | MEDIUM |
- mod role, permissions
- Fix footer's location.
- upload other photos, model for it
- categories page is need a update.
| mod role, permissions | ⚪ | MEDIUM |
| upload other photos, model for it | ⚪ | MEDIUM |
| categories page is need a update | ⚪ | LOW |
- preview for send messages in markdown format.
- desp => description
- admin, view ips on user page.
## Major Version History
- V4: Caching

View file

@ -21,7 +21,7 @@ app.get("/:id/avatar", async (req, res) => {
app.get("/:id", async (req, res) => {
const user = req.user
const { id } = req.params;
const member = await UserModel.get(id, "+lastSeen");
const member = await UserModel.get(id, "+lastSeen +ips");
if (member && (user?.admin || !member.deleted)) {

View file

@ -94,6 +94,15 @@
<h2 class="box-value" style="align-self: center;">Admin</h2>
<% } %>
<% if (user?.admin) {%>
<h3 style="text-align: center;"> IPS:</h3>
<select>
<% for(const ip of member.ips) { %>
<option><%= ip %></option>
<% } %>
</select>
<% } %>
<div class="box-value" id="about" style="
margin: 10px auto;
box-shadow: 0 0 5px 0 var(--second);