Files
Assetmanager/app/templates/setup_analyzer_profiles.html

112 lines
5.9 KiB
HTML
Executable File

{% extends 'base.html' %}
{% block content %}
<div class="toolbar">
<div>
<h1>{{ t('setup_profiles.title') }}</h1>
<p class="muted">{{ t('setup_profiles.subtitle') }}</p>
</div>
<div class="setup-analyzer-actions">
<a class="button button-secondary" href="/software/setup-analyzer">{{ t('setup_profiles.back') }}</a>
<a class="button button-secondary" href="/software/packages">{{ t('software_packages.title') }}</a>
</div>
</div>
<section class="panel">
<h2>{{ t('setup_profiles.import_title') }}</h2>
<p class="muted">{{ t('setup_profiles.import_help') }}</p>
<form method="post" action="/software/setup-analyzer/profiles/import" enctype="multipart/form-data" class="setup-analyzer-form">
<label for="analyzer-profile-import-file">{{ t('setup_profiles.file') }}</label>
<div class="localized-file-picker" data-file-picker>
<input class="localized-file-picker-input" id="analyzer-profile-import-file" type="file" name="profile_file" accept=".amprofile,.zip" required data-file-picker-input>
<button class="button button-secondary localized-file-picker-button" type="button" data-file-picker-button aria-controls="analyzer-profile-import-file">{{ t('common.choose_file') }}</button>
<span class="localized-file-picker-name" data-file-picker-name data-empty-text="{{ t('common.no_file_selected') }}" aria-live="polite">{{ t('common.no_file_selected') }}</span>
</div>
<label>{{ t('setup_profiles.source') }}
<select name="source">
<option value="community">{{ t('setup_profiles.source.community') }}</option>
<option value="local">{{ t('setup_profiles.source.local') }}</option>
</select>
</label>
<button class="button" type="submit">{{ t('setup_profiles.import_button') }}</button>
</form>
</section>
<section class="panel">
<h2>{{ t('setup_profiles.installed_title') }}</h2>
<div class="table-scroll management-table-scroll">
<table class="data-table" data-storage-key="setup-analyzer-profiles">
<thead>
<tr>
<th>{{ t('setup_profiles.name') }}</th>
<th>{{ t('setup_profiles.id') }}</th>
<th>{{ t('setup_analyzer.version') }}</th>
<th>{{ t('setup_profiles.kind') }}</th>
<th>{{ t('setup_profiles.stage') }}</th>
<th>{{ t('setup_profiles.source') }}</th>
<th>{{ t('software_packages.status') }}</th>
<th>{{ t('jobs.actions') }}</th>
</tr>
</thead>
<tbody>
{% for profile in profiles %}
<tr>
<td><strong>{{ profile.name }}</strong></td>
<td><code>{{ profile.id }}</code></td>
<td>{{ profile.version }}</td>
<td>{{ profile.kind }}</td>
<td>{{ profile.stage }}</td>
<td>{{ t('setup_profiles.source.' ~ profile.source) }}</td>
<td>{% if profile.enabled %}<span class="job-status job-status-success">{{ t('software_packages.enabled') }}</span>{% else %}<span class="job-status">{{ t('software_packages.disabled') }}</span>{% endif %}</td>
<td>
<div class="software-package-row-actions">
<a class="button button-secondary button-small" href="/software/setup-analyzer/profiles/{{ profile.id }}/export">{{ t('setup_profiles.export_button') }}</a>
<form class="inline-form" method="post" action="/software/setup-analyzer/profiles/{{ profile.id }}/toggle">
<input type="hidden" name="enabled" value="{{ '0' if profile.enabled else '1' }}">
<button class="button button-secondary button-small" type="submit">{{ t('setup_profiles.disable') if profile.enabled else t('setup_profiles.enable') }}</button>
</form>
{% if profile.source != 'system' %}
<form class="inline-form" method="post" action="/software/setup-analyzer/profiles/{{ profile.id }}/delete" onsubmit="return confirm({{ t('setup_profiles.delete_confirm', profile=profile.name)|tojson }});">
<button class="button button-danger button-small" type="submit">{{ t('software_packages.delete_button_short') }}</button>
</form>
{% endif %}
</div>
</td>
</tr>
{% else %}
<tr><td colspan="8">{{ t('setup_profiles.none') }}</td></tr>
{% endfor %}
</tbody>
</table>
</div>
</section>
<section class="panel">
<h2>{{ t('setup_profiles.repository_title') }}</h2>
{% if repository.url %}
<p class="muted">{{ t('setup_profiles.repository_url') }} <code>{{ repository.url }}</code></p>
{% if not request.query_params.get('repository') %}
<a class="button button-secondary" href="/software/setup-analyzer/profiles?repository=1">{{ t('setup_profiles.repository_load') }}</a>
{% elif repository_error %}
<div class="notice error">{{ repository_error }}</div>
{% else %}
<div class="table-scroll management-table-scroll">
<table class="data-table" data-storage-key="setup-analyzer-repository">
<thead><tr><th>{{ t('setup_profiles.name') }}</th><th>{{ t('setup_analyzer.version') }}</th><th>{{ t('setup_profiles.id') }}</th><th>{{ t('jobs.actions') }}</th></tr></thead>
<tbody>
{% for item in repository.profiles %}
<tr>
<td>{{ item.name or item.id }}</td><td>{{ item.version or '—' }}</td><td><code>{{ item.id }}</code></td>
<td><form method="post" action="/software/setup-analyzer/profiles/repository/install"><input type="hidden" name="profile_id" value="{{ item.id }}"><button class="button button-small" type="submit">{{ t('setup_profiles.repository_install') }}</button></form></td>
</tr>
{% else %}<tr><td colspan="4">{{ t('setup_profiles.repository_empty') }}</td></tr>{% endfor %}
</tbody>
</table>
</div>
{% endif %}
{% else %}
<p class="muted">{{ t('setup_profiles.repository_not_configured') }}</p>
<p><code>ANALYZER_PROFILE_REPOSITORY_URL=https://.../index.json</code></p>
{% endif %}
</section>
{% endblock %}