API key working, CORS working, SocketIO working (but no JWT), Chat client v1, Session implemented (server side)
This commit is contained in:
@@ -8,6 +8,7 @@ import logging.config
|
||||
|
||||
from common.extensions import db, migrate, bootstrap, security, mail, login_manager, cors, kms_client
|
||||
from common.models.user import User, Role, Tenant, TenantDomain
|
||||
import common.models.interaction
|
||||
from config.logging_config import LOGGING
|
||||
from common.utils.security import set_tenant_session_data
|
||||
from .errors import register_error_handlers
|
||||
@@ -29,7 +30,6 @@ def create_app(config_file=None):
|
||||
pass
|
||||
|
||||
logging.config.dictConfig(LOGGING)
|
||||
print(__name__)
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
logger.info("eveai_app starting up")
|
||||
@@ -38,12 +38,12 @@ def create_app(config_file=None):
|
||||
|
||||
register_extensions(app)
|
||||
|
||||
# Check GCloud availability
|
||||
kms_client.check_kms_access_and_latency()
|
||||
|
||||
app.celery = make_celery(app.name, app.config)
|
||||
init_celery(app.celery, app)
|
||||
|
||||
print(app.celery.conf.broker_url)
|
||||
print(app.celery.conf.result_backend)
|
||||
|
||||
# Setup Flask-Security-Too
|
||||
user_datastore = SQLAlchemyUserDatastore(db, User, Role)
|
||||
security.init_app(app, user_datastore)
|
||||
@@ -69,6 +69,8 @@ def create_app(config_file=None):
|
||||
# Register API
|
||||
register_api(app)
|
||||
|
||||
app.logger.info("EveAI App Server Started Successfully")
|
||||
app.logger.info("-------------------------------------------------------------------------------------------------")
|
||||
return app
|
||||
|
||||
|
||||
|
||||
@@ -3,43 +3,42 @@
|
||||
|
||||
{% block title %}Tenant Selection{% endblock %}
|
||||
|
||||
{% block content_title %}Select a Tenant{% endblock %}
|
||||
{% block content_title %}Select a Tenant{% endblock %}
|
||||
{% block content_description %}Select the active tenant for the current session{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<form method="POST" action="{{ url_for('user_bp.handle_tenant_selection') }}">
|
||||
{{ render_selectable_table(headers=["Tenant ID", "Tenant Name","Website"], rows=tenants, selectable=True, id="tenantsTable") }}
|
||||
{{ render_selectable_table(headers=["Tenant ID", "Tenant Name", "Website"], rows=tenants, selectable=True, id="tenantsTable") }}
|
||||
<div class="form-group mt-3">
|
||||
<button type="submit" name="action" value="select_tenant" class="btn btn-primary">Set Session Tenant</button>
|
||||
<button type="submit" name="action" value="view_users" class="btn btn-secondary">View Users</button>
|
||||
<button type="submit" name="action" value="edit_tenant" class="btn btn-secondary">Edit Tenant</button>
|
||||
<!-- Add more buttons as needed -->
|
||||
</div>
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
||||
{% block scripts %}
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#tenantsTable').DataTable({
|
||||
'columnDefs': [{
|
||||
'targets': 0,
|
||||
'searchable': false,
|
||||
'orderable': false,
|
||||
'className': 'dt-body-center',
|
||||
'render': function (data, type, full, meta){
|
||||
return '<input type="radio" name="user_id" value="' + $('<div/>').text(data).html() + '">';
|
||||
'columnDefs': [
|
||||
{
|
||||
'targets': 0,
|
||||
'searchable': false,
|
||||
'orderable': false,
|
||||
'className': 'dt-body-center',
|
||||
},
|
||||
{
|
||||
'targets': 1,
|
||||
'orderable': true
|
||||
},
|
||||
{
|
||||
'targets': 2,
|
||||
'orderable': true
|
||||
}
|
||||
},
|
||||
{
|
||||
'targets': 1,
|
||||
'orderable': true
|
||||
},
|
||||
{
|
||||
'targets': 2,
|
||||
'orderable': true
|
||||
}],
|
||||
],
|
||||
'order': [[1, 'asc']]
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user