Add nginx proxy support
This commit is contained in:
parent
5bd7d548c1
commit
48b8ac3c3d
4 changed files with 37 additions and 5 deletions
|
@ -5,6 +5,8 @@ from flask_login import LoginManager
|
|||
from flask_bootstrap import Bootstrap5
|
||||
from flask_fontawesome import FontAwesome
|
||||
|
||||
from werkzeug.middleware.proxy_fix import ProxyFix
|
||||
|
||||
from authlib.integrations.flask_client import OAuth
|
||||
|
||||
db = SQLAlchemy()
|
||||
|
@ -17,6 +19,8 @@ oauth = OAuth()
|
|||
def create_app():
|
||||
app = Flask(__name__)
|
||||
|
||||
app.wsgi_app = ProxyFix(app.wsgi_app)
|
||||
|
||||
app.config.from_pyfile('config.py')
|
||||
|
||||
db.init_app(app)
|
||||
|
|
|
@ -171,24 +171,34 @@
|
|||
$.get(`/admin/event/${id}`, (data) => {
|
||||
console.log(data)
|
||||
if (data.status == "error") {
|
||||
is_new = "yes"
|
||||
// This is a new event, do nothing!
|
||||
} else {
|
||||
name = data.name,
|
||||
description = data.description,
|
||||
loc = data.location
|
||||
|
||||
start = new Date(data.start_time)
|
||||
start_day = start.toLocaleDateString()
|
||||
start = new Date(data.start_time)
|
||||
|
||||
var day = ("0" + start.getDate()).slice(-2);
|
||||
var month = ("0" + (start.getMonth() + 1)).slice(-2);
|
||||
|
||||
start_day = start.getFullYear()+"-"+(month)+"-"+(day);
|
||||
console.log(start_day)
|
||||
start_time = start.toLocaleTimeString()
|
||||
console.log(start_time)
|
||||
end = new Date(data.end_time)
|
||||
end_day = end.toLocaleDateString()
|
||||
end_time = end.toLocaleTimeString()
|
||||
|
||||
var day = ("0" + end.getDate()).slice(-2);
|
||||
var month = ("0" + (end.getMonth() + 1)).slice(-2);
|
||||
|
||||
end_day = end.getFullYear()+"-"+(month)+"-"+(day);
|
||||
end_time = `${end.getHours()}:${end.getMinutes()}`
|
||||
}
|
||||
|
||||
modal.find('#name').val(name)
|
||||
modal.find('#location').val(loc)
|
||||
modal.find('#description').val(description)
|
||||
console.log(start_day)
|
||||
modal.find('#start_day').val(start_day)
|
||||
modal.find('#start_time').val(start_time)
|
||||
modal.find('#end_day').val(end_day)
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
<th>Created</th>
|
||||
<th>Last Login</th>
|
||||
<th>Officer?</th>
|
||||
<th>Options</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
@ -20,6 +21,22 @@
|
|||
<td>{{ u.created }}</td>
|
||||
<td>{{ u.last_login }}</td>
|
||||
<td>{{ u.is_admin }}</td>
|
||||
<td>
|
||||
<div class="dropdown">
|
||||
<a href="#" class="btn btn-primary dropdown-toggle"
|
||||
data-bs-toggle="dropdown"><span
|
||||
class="caret"></span></a>
|
||||
<ul class="dropdown-menu">
|
||||
{% if u.is_admin %}
|
||||
<li class="dropdown-item">Demote Officer</li>
|
||||
{% else %}
|
||||
<li class="dropdown-item">Promote Officer</li>
|
||||
{% endif %}
|
||||
<li class="dropdown-item">View Event Checkins</li>
|
||||
<li class="dropdown-item">Delete Member</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
|
|
|
@ -26,3 +26,4 @@ ulid==1.1
|
|||
urllib3==2.2.1
|
||||
Werkzeug==2.3.7
|
||||
WTForms==3.1.2
|
||||
flask_wtf
|
||||
|
|
Loading…
Add table
Reference in a new issue