Buh
This commit is contained in:
parent
6f17c2f17c
commit
ab9a372156
3
index.js
3
index.js
|
@ -55,7 +55,6 @@ const ntfyPublish = (data) => {
|
|||
method: 'POST',
|
||||
body: JSON.stringify(data)
|
||||
})
|
||||
console.log(data)
|
||||
}
|
||||
|
||||
// Create user
|
||||
|
@ -428,7 +427,7 @@ app.post("/ticket/:id/:action", isAuthenticated, (req, res) => {
|
|||
console.error(err);
|
||||
return res.status(500).send("Internal Server Error");
|
||||
}
|
||||
if(config.ntfy) ntfyPublish({title: `Ticket ${req.params.id} priority changed`, message: `Priority changed to ${req.body.priority}`, tags: [req.session.userData.username, new Date(Date.now()).toISOString()]});
|
||||
if(config.ntfy) ntfyPublish({title: `Ticket ${req.params.id} priority changed`, message: `Priority changed to ${req.body.priority}`, tags: [req.session.userData.username, new Date(Date.now()).toISOString()], priority: Number(req.body.priority)});
|
||||
res.redirect(`/ticket/${req.params.id}`);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -46,8 +46,8 @@
|
|||
<div class="form-group">
|
||||
<label for="priority">Priority:</label>
|
||||
<select class="form-control" id="priority" name="priority" required>
|
||||
<option value="0">0 - Minimum</option>
|
||||
<option value="1">1 - Low</option>
|
||||
<option value="1">1 - Minimum</option>
|
||||
<option value="2">2 - Low</option>
|
||||
<option value="3" selected>3 - Normal</option>
|
||||
<option value="4">4 - High</option>
|
||||
<option value="5">5 - Maximum</option>
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
<div class="text-right">
|
||||
<!--Ticket options, delete (post to /ticket/id/delete) dropdown to change status (post to /ticket/id/status?status=X) and change priority (post to /ticket/id/priority?priority=X)-->
|
||||
<form action="/ticket/<%= ticket.id %>/status" method="POST" style="display: inline;">
|
||||
<label class="form-label mt-4">Priority: </label>
|
||||
<label class="form-label mt-4">Status: </label>
|
||||
<select class="form-select" name="status" onchange="this.form.submit()">
|
||||
<option value="0" <% if (ticket.status===0) { %>selected<% } %>>Open</option>
|
||||
<option value="1" <% if (ticket.status===1) { %>selected<% } %>>In Progress</option>
|
||||
|
@ -58,11 +58,11 @@
|
|||
<p class="card-text">Updated: <%= ticket.updatedTimestamp ? new Date(ticket.updatedTimestamp).toLocaleString() : 'N/A' %></p>
|
||||
<p class="card-text">Description: <%= ticket.description %>
|
||||
</p>
|
||||
<p class="card-text">Status: <% switch (ticket.priority) { case 5: %>Very High<% break; case 4: %>High<%
|
||||
<p class="card-text">Priority: <% switch (ticket.priority) { case 5: %>Very High<% break; case 4: %>High<%
|
||||
break; case 3: %>Normal<% break; case 2: %>Low<% break; case 1: %>Minimal<% break;
|
||||
default: %>Unknown<% break; } %>
|
||||
</p>
|
||||
<p class="card-text">Priority: <% if (ticket.status===0) { %>
|
||||
<p class="card-text">Status: <% if (ticket.status===0) { %>
|
||||
Open
|
||||
<% } else if (ticket.status===1) { %>
|
||||
In Progress
|
||||
|
|
Loading…
Reference in a new issue