full working version

This commit is contained in:
rnsrk 2023-11-15 01:53:03 +01:00
parent 2178db78f5
commit 308e21941a
22 changed files with 1434 additions and 366 deletions

View file

@ -1,56 +1,88 @@
{# wisski_cloud_account_manager/templates/wisski_cloud_account_manager_account_managing_page.html.twig #}
<div>
{% if healthCheck %}
<div>
<p class="{{ healthCheck.success ? 'text-success' : 'text-error' }}">{{ healthCheck.message }}</p>
</div>
{% endif %}
{% if accounts is not empty %}
<table id="wcam--table" class="wcam--table">
<table id="wcam--table" class="table">
<thead>
<tr>
<th>Id</th>
<th>Person name</th>
<th>Email</th>
<th>Username</th>
<th>Subdomain</th>
<th>Valid</th>
<th>Provisioned</th>
<th>Options</th>
<th scope="col">AID</th>
<th scope="col">UID</th>
<th scope="col">Person name</th>
<th scope="col">Organisation</th>
<th scope="col">Email</th>
<th scope="col">Username</th>
<th scope="col">Subdomain</th>
<th scope="col">Valid</th>
<th scope="col">Provisioned</th>
<th scope="col">Options</th>
</tr>
{% for item in accounts.data %}
<tr class="wcam--table--row">
<td class="wcam--row--item-id">{{ item._id }}</td>
<td>{{ item.personName }}</td>
<td>{{ item.email }}</td>
<td>{{ item.username }}</td>
<td>{{ item.subdomain }}</td>
</thead>
{% for item in accounts %}
<tr class="wcam--table--row {% if item.status is null %}table-danger{% endif %}">
<td class="wcam--row--account-id" scope="row"> {{ item.aid }} </td>
<td>{{ item.uid }} {% if item.status is null %}<span class="align-bottom material-icons" title="Drupal user does not exist, please contact cloud admin!">error_outline</span>{% endif %}</td>
<td>{{ item.person_name }}</td>
<td>{{ item.organisation }}</td>
<td>
<a href="mailto:{{ item.mail }}">{{ item.mail }}</a>
</td>
<td>{{ item.name }}</td>
<td>
{% if item.provisioned == 2 %}
<a href="https://{{ item.subdomain }}.wisski.cloud" target="_blank">{{ item.subdomain }}.wisski.cloud</a>
{% else %}
{{ item.subdomain }}.wisski.cloud
{% endif %}
</td>
<td class="valid">
{% if item.valid == 1 %}
{% if item.status is same as("1") %}
yes
{% elseif item.valid == 0 %}
{% elseif item.status is same as("0") %}
no
{% else %}
unknown
{% endif %}
</td>
<td class="provisioned">{% if item.provisioned == 1 %}
ongoing
<td id="provision-status--row--aid-{{ item.aid }}" class="provisioned">
{% if item.provisioned == 1 %}
<div id="process-idle-animation--aid-{{ item.aid }}" class="spinner-border" role="status">
<span id="provision-status--aid-{{ item.aid }}" class="visually-hidden">ongoing</span>
</div>
{% elseif item.provisioned == 2 %}
yes
{% elseif item.provisioned == 3 %}
{% elseif item.provisioned == 0 %}
no
{% else %}
unknown
<div id="process-idle-animation--aid-{{ item.aid }}" class="spinner-border" role="status">
<span id="provision-status--aid-{{ item.aid }}" class="visually-hidden">unknown</span>
</div>
{% endif %}</td>
<td><label for="wcam--account-edit--{{ item._id }}"></label>
<select class="wcam--select" name="account-edit" id="wcam--account-edit--{{ item._id }}">
<td><label for="wcam--account-edit--account-{{ item.aid }}"></label>
<select class="wcam--select" name="account-edit" id="wcam--account-edit--account-{{ item.aid }}">
<option value="">select...</option>
<option value="edit">edit</option>
{% if item.valid == 0 %}
<option value="validate">validate</option>
{% if item.status is not null %}
<option title="Edit account data." value="edit">edit</option>
{% if item.status == 0 %}
<option title="Validates the account." value="validate">validate</option>
{% endif %}
{% if item.provisioned == 0 %}
<option value="provise">provise</option>
<option title="Create a new WissKI Cloud Instance with provided account data." value="provise">provise</option>
{% endif %}
<option value="delete">delete</option>
{% endif %}
{% if item.provisioned >= 2 %}
<option title="Deletes only the WissKI Cloud instance, user and account remain." value="delete">delete</option>
{% endif %}
<option title="Deletes everything, nothing will remain." value="purge">purge</option>
</select></td>
</tr>
{% endfor %}
</table>
{% else %}
<p>No accounts found. Go get some friends.</p>
{% endif %}
</div>

View file

@ -0,0 +1,27 @@
{# wisski_cloud_account_manager/templates/wisski_cloud_account_manager_validation_page.html.twig #}
<div>
<table class="table">
<thead>
<tr>
<th scope="col">Check</th>
<th scope="col">Values</th>
<th scope="col">Test</th>
<th scope="col">Result</th>
</tr>
</thead>
<tbody>
{% if healthCheck %}
<tr>
<td>healthCheck</td>
<td>-</td>
<td>
<form action="/wisski-cloud-account-manager/health-check" method="get">
<button type="submit">Check Health</button>
</form>
</td>
<td id="health-check-result"></td>
</tr>
{% endif %}
</tbody>
</table>
</div>

View file

@ -0,0 +1,10 @@
<div>
<p>Hi {{ personName }},</p>
<p>Thank you for registering to our site.</p>
<p>Please validate your account by clicking on this
<a href="{{ validationLink }}" target="_blank">link</a> or copy this to the address bar of your browser:
</p>
<p>{{ validationLink }}</p>
<p>You have 24 hours to validate your account.</p>
</div>

View file

@ -1,52 +1,58 @@
{# wisski_cloud_account_manager/templates/wisski_cloud_account_manager_validation_page.html.twig #}
<div>
{% if account is not empty %}
<table class="wisski-cloud-account-manager-table">
<table class="table">
<thead>
<tr>
<th>Person name</th>
<th>Email</th>
<th>Username</th>
<th>Subdomain</th>
<th>Valid</th>
<th>Provisioned</th>
<th scope="col">Account ID</th>
<th scope="col">Person name</th>
<th scope="col">Organisation</th>
<th scope="col">Email</th>
<th scope="col">Username</th>
<th scope="col">Subdomain</th>
<th scope="col">Valid</th>
<th scope="col">Provisioned</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ account.data.personName }}</td>
<td>{{ account.data.email }}</td>
<td>{{ account.data.username }}</td>
<td>{{ account.data.subdomain }}</td>
<th scope="row"> {{ account.aid }} </th>
<td>{{ account.person_name }}</td>
<td>{{ account.organisation }}</td>
<td>{{ account.mail }}</td>
<td>{{ account.name }}</td>
<td>{{ account.subdomain }}</td>
<td class="valid">
{% if account.data.valid == 1 %}
{% if account.status == 1 %}
yes
{% elseif account.data.valid == 0 %}
{% elseif account.status == 0 %}
no
{% else %}
unknown
{% endif %}
</td>
<td class="provisioned">{% if account.data.provisioned == 1 %}
<td class="provisioned">{% if account.provisioned == 1 %}
ongoing
{% elseif account.data.provisioned == 2 %}
{% elseif account.provisioned == 2 %}
yes
{% elseif account.data.provisioned == 3 %}
failed
{% else %}
{% elseif account.provisioned == 3 %}
unknown
{% endif %}</td>
</tr>
</tbody>
</table>
<hr>
<div class="wisski-cloud-account-manager-center">
{% if account.data.valid == 1 and account.data.provisioned == 2 %}
<p class="wisski-cloud-account-manager-success"><strong> Your account is valid and provisioned. You can now log in to your account at <a href="https://{{ account.data.subdomain }}.wisski.cloud">https://{{ account.data.subdomain }}.wisski.cloud</a>.</strong></p>
{% elseif account.data.valid == 1 and (account.data.provisioned == 0 or account.data.provisioned == 3)%}
<p class="wisski-cloud-account-manager-error"><strong>Your account is valid but the provision failed or the state is unknown. Please refresh this site and if the state persists contact <a href="mailto:info@wiss-ki.eu">cloud@wiss-ki.eu</a> to resolve this issue.</strong></p>
{% elseif account.data.valid == 1 and account.data.provisioned == 1 %}
<p class="wisski-cloud-account-manager-warning"><strong>Your account is valid and the provision of your WissKI Cloud instance has started. Please wait a few minutes and refresh this page.</strong></p>
{% elseif account.data.valid == 0 %}
<p class="wisski-cloud-account-manager-error"><strong>Your account is not valid. Please contact <a href="mailto:info@wiss-ki.eu">info@wiss-ki.eu</a> to resolve this issue.</strong></p>
<div class="d-flex justify-content-center">
{% if account.status == 1 and account.provisioned == 2 %}
<p class="text-success"><strong> Your account is valid and provisioned. You can now log in to your account at <a href="https://{{ account.subdomain }}.wisski.cloud">https://{{ account.subdomain }}.wisski.cloud</a>.</strong></p>
{% elseif account.status == 1 and (account.provisioned == 0 or account.provisioned == 3)%}
<p class="text-warning"><strong>Your account is valid but the provision failed or the state is unknown. Please refresh this site and if the state persists contact <a href="mailto:info@wiss-ki.eu">cloud@wiss-ki.eu</a> to resolve this issue.</strong></p>
{% elseif account.status == 1 and account.provisioned == 1 %}
<p class="text-info"><strong>Your account is valid and the provision of your WissKI Cloud instance has started. Please wait a few minutes and refresh this page.</strong></p>
{% elseif account.status == 0 %}
<p class="text-warning"><strong>Your account is not valid. Please contact <a href="mailto:info@wiss-ki.eu">info@wiss-ki.eu</a> to resolve this issue.</strong></p>
{% else %}
<p class="wisski-cloud-account-manager-error"><strong>Something went wrong. Please contact <a href="mailto:info@wiss-ki.eu">info@wiss-ki.eu</a> to resolve this issue.</strong></p>
<p class="text-warning"><strong>Something went wrong. Please contact <a href="mailto:info@wiss-ki.eu">info@wiss-ki.eu</a> to resolve this issue.</strong></p>
{% endif %}
</div>