Improve mobile layout and redesign admin interface (#665)

This commit is contained in:
Thomas Durieux
2026-04-15 06:04:43 +02:00
committed by GitHub
parent 6de9e1c1e2
commit 1d97c76e7e
15 changed files with 1882 additions and 1518 deletions
+186 -280
View File
@@ -1,290 +1,196 @@
<div class="container page">
<div class="row">
<div class="border-bottom color-border-secondary py-3 w-100">
<div class="d-flex flex-items-start w-100">
<form class="w-100" aria-label="Conferences" accept-charset="UTF-8">
<div class="d-flex flex-column flex-lg-row flex-auto">
<div class="mb-1 mb-md-0 mr-md-3">
<input
type="search"
id="search"
class="form-control"
aria-label="Find a conference…"
placeholder="Find a conference…"
autocomplete="off"
ng-model="query.search"
/>
</div>
<!-- Admin Navigation -->
<nav class="admin-nav">
<a href="/admin/">
<i class="fas fa-code-branch"></i> Repositories
</a>
<a href="/admin/users">
<i class="fas fa-users"></i> Users
</a>
<a href="/admin/conferences" class="active">
<i class="fas fa-chalkboard-teacher"></i> Conferences
</a>
<a href="/admin/queues">
<i class="fas fa-tasks"></i> Queues
</a>
</nav>
<div class="mb-1 mb-md-0 mr-md-3 col-2 input-group">
<input
type="number"
id="page"
class="form-control"
autocomplete="off"
ng-model="query.page"
min="1"
max="{{totalPage}}"
/>
<div class="input-group-append">
<span class="input-group-text">/{{totalPage}}</span>
</div>
</div>
<!-- Summary Stats -->
<div class="admin-stats">
<div class="admin-stat-card">
<div class="stat-value" ng-bind="total >= 0 ? (total | number) : '...'"></div>
<div class="stat-label">Total Conferences</div>
</div>
<div class="admin-stat-card">
<div class="stat-value">{{query.page}}/{{totalPage || '...'}}</div>
<div class="stat-label">Current Page</div>
</div>
</div>
<div class="d-flex flex-wrap">
<div class="dropdown mt-1 mt-lg-0 mr-1">
<button
class="btn btn-secondary dropdown-toggle"
type="button"
id="dropdownSort"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false"
>
Sort
</button>
<div class="dropdown-menu" aria-labelledby="dropdownSort">
<h6 class="dropdown-header">Select order</h6>
<div class="form-check dropdown-item">
<input
class="form-check-input"
type="radio"
name="sort"
id="sortFullName"
value="source.conferenceName"
ng-model="query.sort"
/>
<label class="form-check-label" for="sortFullName">
Conference
</label>
</div>
<div class="form-check dropdown-item">
<input
class="form-check-input"
type="radio"
name="sort"
id="sortAnonymizeDate"
value="anonymizeDate"
ng-model="query.sort"
/>
<label class="form-check-label" for="sortAnonymizeDate">
Anonymize Date
</label>
</div>
<div class="form-check dropdown-item">
<input
class="form-check-input"
type="radio"
name="sort"
id="sortStatus"
value="status"
ng-model="query.sort"
/>
<label class="form-check-label" for="sortStatus">
Status
</label>
</div>
<div class="form-check dropdown-item">
<input
class="form-check-input"
type="radio"
name="sort"
id="sortLastView"
value="lastView"
ng-model="query.sort"
/>
<label class="form-check-label" for="sortLastView">
Last View
</label>
</div>
<div class="form-check dropdown-item">
<input
class="form-check-input"
type="radio"
name="sort"
id="sortPageView"
value="pageView"
ng-model="query.sort"
/>
<label class="form-check-label" for="sortPageView">
Page View
</label>
</div>
</div>
</div>
<!-- Toolbar -->
<div class="admin-toolbar">
<input
type="search"
class="form-control"
aria-label="Search conferences..."
placeholder="Search conferences..."
autocomplete="off"
ng-model="query.search"
/>
<div class="dropdown mt-1 mt-lg-0 mr-1">
<button
class="btn btn-secondary dropdown-toggle"
type="button"
id="dropdownStatus"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false"
>
Status
</button>
<div class="dropdown-menu" aria-labelledby="dropdownStatus">
<h6 class="dropdown-header">Select status</h6>
<div class="form-check dropdown-item">
<input
class="form-check-input"
type="checkbox"
name="sort"
id="statusReady"
value="ready"
ng-model="query.ready"
/>
<label class="form-check-label" for="statusReady">
Ready
</label>
</div>
<div class="form-check dropdown-item">
<input
class="form-check-input"
type="checkbox"
name="sort"
id="statusExpired"
value="expired"
ng-model="query.expired"
/>
<label class="form-check-label" for="statusExpired">
Expired
</label>
</div>
<div class="form-check dropdown-item">
<input
class="form-check-input"
type="checkbox"
name="sort"
id="statusExpired"
value="expired"
ng-model="query.preparing"
/>
<label class="form-check-label" for="statusExpired">
Preparing
</label>
</div>
<div class="form-check dropdown-item">
<input
class="form-check-input"
type="checkbox"
name="sort"
id="statusRemoved"
value="removed"
ng-model="query.removed"
/>
<label class="form-check-label" for="statusRemoved">
Removed
</label>
</div>
<div class="form-check dropdown-item">
<input
class="form-check-input"
type="checkbox"
name="sort"
id="statusRemoved"
value="removed"
ng-model="query.error"
/>
<label class="form-check-label" for="statusRemoved">
Error
</label>
</div>
</div>
</div>
</div>
</div>
</form>
<div class="pagination-compact">
<button class="btn btn-sm" ng-click="query.page = Math.max(1, query.page - 1)" ng-disabled="query.page <= 1">
<i class="fas fa-chevron-left"></i>
</button>
<input
type="number"
class="form-control form-control-sm"
ng-model="query.page"
min="1"
max="{{totalPage}}"
/>
<span>/{{totalPage}}</span>
<button class="btn btn-sm" ng-click="query.page = Math.min(totalPage, query.page + 1)" ng-disabled="query.page >= totalPage">
<i class="fas fa-chevron-right"></i>
</button>
</div>
<div class="dropdown">
<button
class="btn btn-sm dropdown-toggle"
type="button"
id="dropdownSort"
data-toggle="dropdown"
>
<i class="fas fa-sort"></i> Sort
</button>
<div class="dropdown-menu" aria-labelledby="dropdownSort">
<h6 class="dropdown-header">Sort by</h6>
<a class="dropdown-item" href="#" ng-click="query.sort = 'source.conferenceName'">
<i class="fas fa-check" ng-show="query.sort == 'source.conferenceName'"></i> Conference
</a>
<a class="dropdown-item" href="#" ng-click="query.sort = 'anonymizeDate'">
<i class="fas fa-check" ng-show="query.sort == 'anonymizeDate'"></i> Anonymize Date
</a>
<a class="dropdown-item" href="#" ng-click="query.sort = 'status'">
<i class="fas fa-check" ng-show="query.sort == 'status'"></i> Status
</a>
<a class="dropdown-item" href="#" ng-click="query.sort = 'lastView'">
<i class="fas fa-check" ng-show="query.sort == 'lastView'"></i> Last View
</a>
<a class="dropdown-item" href="#" ng-click="query.sort = 'pageView'">
<i class="fas fa-check" ng-show="query.sort == 'pageView'"></i> Page Views
</a>
</div>
</div>
<ul class="p-0 m-0 w-100">
<li
class="col-12 d-flex px-0 py-3 border-bottom color-border-secondary"
ng-class="{'expired': conference.status == 'expired','removed': conference.status == 'removed','error': conference.status == 'error' }"
ng-repeat="conference in conferences| filter:conferenceFiler| orderBy:orderBy as filteredConferences"
<div class="dropdown">
<button
class="btn btn-sm dropdown-toggle"
type="button"
id="dropdownStatus"
data-toggle="dropdown"
>
<div class="w-100">
<div class="">
<h3>
<a
ng-href="/conference/{{conference.conferenceID}}"
ng-bind="conference.name"
></a>
<span
class="badge"
ng-class="{'badge-warning': conference.status == 'removed' || conference.status == 'expired', 'badge-success': conference.status == 'ready', 'badge-danger': ''}"
ng-bind="conference.status | title"
></span>
</h3>
<span class="color-text-secondary mb-1 ng-binding">
Conference ID: '{{conference.conferenceID}}'
</span>
</div>
<div class="color-text-secondary mt-2">
<span
class="ml-0 mr-3"
title="# conference: {{conference.nbConference || 0 | number}}"
data-toggle="tooltip"
data-placement="bottom"
>
<i class="fas fa-table"></i>
{{::conference.repositories.length || 0 | number}}</span
>
<span class="ml-0 mr-3">
<i class="fas fa-euro-sign"></i>
Total: {{conference.price || 0 | number}} €
</span>
<span class="ml-0 mr-3">
<i class="fas fa-calendar-alt"></i>
From {{conference.startDate | date}} to {{conference.endDate |
date}}</span
>
</div>
<i class="fas fa-filter"></i> Status
</button>
<div class="dropdown-menu" aria-labelledby="dropdownStatus">
<h6 class="dropdown-header">Filter by status</h6>
<label class="dropdown-item mb-0">
<input type="checkbox" ng-model="query.ready" /> Ready
</label>
<label class="dropdown-item mb-0">
<input type="checkbox" ng-model="query.preparing" /> Preparing
</label>
<label class="dropdown-item mb-0">
<input type="checkbox" ng-model="query.expired" /> Expired
</label>
<label class="dropdown-item mb-0">
<input type="checkbox" ng-model="query.removed" /> Removed
</label>
<label class="dropdown-item mb-0">
<input type="checkbox" ng-model="query.error" /> Error
</label>
</div>
</div>
</div>
<!-- Conference List -->
<div
class="admin-list-item"
ng-repeat="conference in conferences | filter:conferenceFiler | orderBy:orderBy as filteredConferences"
>
<div class="item-main">
<div class="item-title">
<a
ng-href="/conference/{{conference.conferenceID}}"
ng-bind="conference.name"
></a>
<span
class="status-badge"
ng-class="'status-' + conference.status"
>{{conference.status | title}}</span>
</div>
<div class="item-meta">
<span>
<i class="fas fa-fingerprint"></i> ID: {{conference.conferenceID}}
</span>
<span>
<i class="fas fa-table"></i> {{::conference.repositories.length || 0 | number}} repos
</span>
<span>
<i class="fas fa-euro-sign"></i> {{conference.price || 0 | number}} &euro;
</span>
<span>
<i class="fas fa-calendar-alt"></i>
{{conference.startDate | date}} &ndash; {{conference.endDate | date}}
</span>
</div>
</div>
<div class="item-actions">
<div class="dropdown">
<button
class="btn dropdown-toggle btn-sm"
type="button"
data-toggle="dropdown"
>
Actions
</button>
<div class="dropdown-menu dropdown-menu-right">
<a class="dropdown-item" href="/conference/{{conference.conferenceID}}/edit">
<i class="far fa-edit"></i> Edit
</a>
<a class="dropdown-item" href="/conference/{{conference.conferenceID}}/">
<i class="fa fa-eye"></i> View
</a>
<div class="dropdown-divider"></div>
<a
class="dropdown-item text-danger"
href="#"
ng-show="conference.status != 'removed'"
ng-click="removeConference(conference)"
>
<i class="fas fa-trash-alt"></i> Remove
</a>
</div>
<div class="d-flex">
<div class="dropdown">
<button
class="btn black_border dropdown-toggle btn-sm"
type="button"
id="dropdownMenuButton"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false"
>
Actions
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a
class="dropdown-item"
href="/conference/{{conference.conferenceID}}/edit"
>
<i class="far fa-edit" aria-hidden="true"></i> Edit
</a>
<a
class="dropdown-item"
href="#"
ng-show="conference.status != 'removed'"
ng-click="removeConference(conference)"
>
<i class="fas fa-trash-alt"></i> Remove
</a>
<a
class="dropdown-item"
href="/conference/{{conference.conferenceID}}/"
>
<i class="fa fa-eye" aria-hidden="true"></i> View conference
</a>
</div>
</div>
</div>
</li>
<li
class="col-12 d-flex px-0 py-3 border-bottom color-border-secondary"
ng-if="filteredConferences.length == 0"
>
There is no conference to display.
</li>
</ul>
</div>
</div>
</div>
<div class="empty-state" ng-if="filteredConferences.length == 0">
<i class="fas fa-chalkboard-teacher"></i>
No conferences match the current filters.
</div>
<!-- Bottom pagination -->
<div class="admin-toolbar" ng-if="totalPage > 1" style="justify-content: center; border-bottom: none;">
<div class="pagination-compact">
<button class="btn btn-sm" ng-click="query.page = Math.max(1, query.page - 1)" ng-disabled="query.page <= 1">
<i class="fas fa-chevron-left"></i> Previous
</button>
<span>Page {{query.page}} of {{totalPage}}</span>
<button class="btn btn-sm" ng-click="query.page = Math.min(totalPage, query.page + 1)" ng-disabled="query.page >= totalPage">
Next <i class="fas fa-chevron-right"></i>
</button>
</div>
</div>
</div>
+192 -223
View File
@@ -1,226 +1,195 @@
<div class="container page">
<div class="row">
<h1>Download jobs</h1>
<ul class="p-0 m-0 w-100">
<li
class="col-12 d-flex px-0 py-3 border-bottom color-border-secondary"
ng-repeat="job in downloadJobs as filteredDownloadJobs"
>
<div class="w-100">
<div class="">
<h3>
<a target="__blank" ng-href="/r/{{job.id}}" ng-bind="job.id"></a>
<span class="badge" ng-bind="job.progress.status | title"></span>
</h3>
</div>
<div class="color-text-secondary mb-1">
<span ng-if="job.timestamp">
Created on:
<span ng-bind="job.timestamp | humanTime"></span>
</span>
<span ng-if="job.finishedOn">
Finished on:
<span ng-bind="job.finishedOn | humanTime"></span>
</span>
<span ng-if="job.processedOn">
Processed on:
<span ng-bind="job.processedOn | humanTime"></span>
</span>
</div>
<div>
<pre
ng-repeat="stack in job.stacktrace track by $index"
><code ng-bind="stack"></code></pre>
</div>
</div>
<div class="d-flex">
<div class="dropdown">
<button
class="btn black_border dropdown-toggle btn-sm"
type="button"
id="dropdownMenuButton"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false"
>
Actions
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a
class="dropdown-item"
href="#"
ng-click="removeJob('download', job)"
>
<i class="fas fa-trash-alt"></i> Remove
</a>
<a
class="dropdown-item"
href="#"
ng-click="retryJob('download', job)"
>
<i class="fas fa-sync"></i> Retry
</a>
<a class="dropdown-item" href="/anonymize/{{job.id}}">
<i class="far fa-edit" aria-hidden="true"></i> Edit
</a>
</div>
</div>
</div>
</li>
<li
class="col-12 d-flex px-0 py-3 border-bottom color-border-secondary"
ng-if="filteredDownloadJobs.length == 0"
>
There is no job to display.
</li>
</ul>
<h1>Remove jobs</h1>
<ul class="p-0 m-0 w-100">
<li
class="col-12 d-flex px-0 py-3 border-bottom color-border-secondary"
ng-repeat="job in removeJobs as filteredRemoveJobs"
>
<div class="w-100">
<div class="">
<h3>
<a target="__blank" ng-href="/r/{{job.id}}" ng-bind="job.id"></a>
<span class="badge" ng-bind="job.progress.status | title"></span>
</h3>
</div>
<div class="color-text-secondary mb-1">
<span ng-if="job.timestamp">
Created on:
<span ng-bind="job.timestamp | humanTime"></span>
</span>
<span ng-if="job.finishedOn">
Finished on:
<span ng-bind="job.finishedOn | humanTime"></span>
</span>
<span ng-if="job.processedOn">
Processed on:
<span ng-bind="job.processedOn | humanTime"></span>
</span>
</div>
<div>
<pre
ng-repeat="stack in job.stacktrace track by $index"
><code ng-bind="stack"></code></pre>
</div>
</div>
<div class="d-flex">
<div class="dropdown">
<button
class="btn black_border dropdown-toggle btn-sm"
type="button"
id="dropdownMenuButton"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false"
>
Actions
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a
class="dropdown-item"
href="#"
ng-click="removeJob('remove', job)"
>
<i class="fas fa-trash-alt"></i> Remove
</a>
<a
class="dropdown-item"
href="#"
ng-click="retryJob('remove', job)"
>
<i class="fas fa-sync"></i> Retry
</a>
<a class="dropdown-item" href="/anonymize/{{job.id}}">
<i class="far fa-edit" aria-hidden="true"></i> Edit
</a>
</div>
</div>
</div>
</li>
<li
class="col-12 d-flex px-0 py-3 border-bottom color-border-secondary"
ng-if="filteredRemoveJobs.length == 0"
>
There is no job to display.
</li>
</ul>
<h1>Remove Cache</h1>
<ul class="p-0 m-0 w-100">
<li
class="col-12 d-flex px-0 py-3 border-bottom color-border-secondary"
ng-repeat="job in removeCaches as filteredRemoveCache"
>
<div class="w-100">
<div class="">
<h3>
<a target="__blank" ng-href="/r/{{job.id}}" ng-bind="job.id"></a>
<span class="badge" ng-bind="job.progress.status | title"></span>
</h3>
</div>
<div class="color-text-secondary mb-1">
<span ng-if="job.timestamp">
Created on:
<span ng-bind="job.timestamp | humanTime"></span>
</span>
<span ng-if="job.finishedOn">
Finished on:
<span ng-bind="job.finishedOn | humanTime"></span>
</span>
<span ng-if="job.processedOn">
Processed on:
<span ng-bind="job.processedOn | humanTime"></span>
</span>
</div>
<div>
<pre
ng-repeat="stack in job.stacktrace track by $index"
><code ng-bind="stack"></code></pre>
</div>
</div>
<div class="d-flex">
<div class="dropdown">
<button
class="btn black_border dropdown-toggle btn-sm"
type="button"
id="dropdownMenuButton"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false"
>
Actions
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a
class="dropdown-item"
href="#"
ng-click="removeJob('cache', job)"
>
<i class="fas fa-trash-alt"></i> Remove
</a>
<a
class="dropdown-item"
href="#"
ng-click="retryJob('cache', job)"
>
<i class="fas fa-sync"></i> Retry
</a>
<a class="dropdown-item" href="/anonymize/{{job.id}}">
<i class="far fa-edit" aria-hidden="true"></i> Edit
</a>
</div>
</div>
</div>
</li>
<li
class="col-12 d-flex px-0 py-3 border-bottom color-border-secondary"
ng-if="filteredRemoveCache.length == 0"
>
There is no job to display.
</li>
</ul>
<!-- Admin Navigation -->
<nav class="admin-nav">
<a href="/admin/">
<i class="fas fa-code-branch"></i> Repositories
</a>
<a href="/admin/users">
<i class="fas fa-users"></i> Users
</a>
<a href="/admin/conferences">
<i class="fas fa-chalkboard-teacher"></i> Conferences
</a>
<a href="/admin/queues" class="active">
<i class="fas fa-tasks"></i> Queues
</a>
</nav>
<!-- Summary Stats -->
<div class="admin-stats">
<div class="admin-stat-card">
<div class="stat-value">{{downloadJobs.length || 0}}</div>
<div class="stat-label">Download Jobs</div>
</div>
<div class="admin-stat-card">
<div class="stat-value">{{removeJobs.length || 0}}</div>
<div class="stat-label">Remove Jobs</div>
</div>
<div class="admin-stat-card">
<div class="stat-value">{{removeCaches.length || 0}}</div>
<div class="stat-label">Cache Jobs</div>
</div>
</div>
<!-- Download Jobs -->
<div class="admin-section-header">
<h2><i class="fas fa-download mr-1"></i> Download Jobs</h2>
<span class="section-count">{{downloadJobs.length || 0}}</span>
</div>
<div
class="queue-job-card"
ng-repeat="job in downloadJobs as filteredDownloadJobs"
>
<div class="job-header">
<div class="job-id">
<a target="_blank" ng-href="/r/{{job.id}}" ng-bind="job.id"></a>
<span
class="status-badge"
ng-class="'status-' + job.progress.status"
>{{job.progress.status | title}}</span>
</div>
</div>
<div class="job-timestamps">
<span ng-if="job.timestamp">
<i class="fas fa-clock"></i> Created: {{job.timestamp | humanTime}}
</span>
<span ng-if="job.processedOn">
<i class="fas fa-cog"></i> Processed: {{job.processedOn | humanTime}}
</span>
<span ng-if="job.finishedOn">
<i class="fas fa-check"></i> Finished: {{job.finishedOn | humanTime}}
</span>
</div>
<div ng-if="job.stacktrace.length">
<pre
ng-repeat="stack in job.stacktrace track by $index"
style="font-size: 0.8rem; max-height: 100px; overflow: auto; margin: 6px 0 0 0"
><code ng-bind="stack"></code></pre>
</div>
<div class="job-actions">
<button class="btn btn-sm" ng-click="retryJob('download', job)">
<i class="fas fa-sync"></i> Retry
</button>
<button class="btn btn-sm" ng-click="removeJob('download', job)">
<i class="fas fa-trash-alt"></i> Remove
</button>
<a class="btn btn-sm" href="/anonymize/{{job.id}}">
<i class="far fa-edit"></i> Edit
</a>
</div>
</div>
<div class="empty-state" ng-if="filteredDownloadJobs.length == 0" style="padding: 20px">
<i class="fas fa-check-circle"></i>
No download jobs in the queue.
</div>
<!-- Remove Jobs -->
<div class="admin-section-header">
<h2><i class="fas fa-trash mr-1"></i> Remove Jobs</h2>
<span class="section-count">{{removeJobs.length || 0}}</span>
</div>
<div
class="queue-job-card"
ng-repeat="job in removeJobs as filteredRemoveJobs"
>
<div class="job-header">
<div class="job-id">
<a target="_blank" ng-href="/r/{{job.id}}" ng-bind="job.id"></a>
<span
class="status-badge"
ng-class="'status-' + job.progress.status"
>{{job.progress.status | title}}</span>
</div>
</div>
<div class="job-timestamps">
<span ng-if="job.timestamp">
<i class="fas fa-clock"></i> Created: {{job.timestamp | humanTime}}
</span>
<span ng-if="job.processedOn">
<i class="fas fa-cog"></i> Processed: {{job.processedOn | humanTime}}
</span>
<span ng-if="job.finishedOn">
<i class="fas fa-check"></i> Finished: {{job.finishedOn | humanTime}}
</span>
</div>
<div ng-if="job.stacktrace.length">
<pre
ng-repeat="stack in job.stacktrace track by $index"
style="font-size: 0.8rem; max-height: 100px; overflow: auto; margin: 6px 0 0 0"
><code ng-bind="stack"></code></pre>
</div>
<div class="job-actions">
<button class="btn btn-sm" ng-click="retryJob('remove', job)">
<i class="fas fa-sync"></i> Retry
</button>
<button class="btn btn-sm" ng-click="removeJob('remove', job)">
<i class="fas fa-trash-alt"></i> Remove
</button>
<a class="btn btn-sm" href="/anonymize/{{job.id}}">
<i class="far fa-edit"></i> Edit
</a>
</div>
</div>
<div class="empty-state" ng-if="filteredRemoveJobs.length == 0" style="padding: 20px">
<i class="fas fa-check-circle"></i>
No remove jobs in the queue.
</div>
<!-- Cache Jobs -->
<div class="admin-section-header">
<h2><i class="fas fa-broom mr-1"></i> Cache Cleanup Jobs</h2>
<span class="section-count">{{removeCaches.length || 0}}</span>
</div>
<div
class="queue-job-card"
ng-repeat="job in removeCaches as filteredRemoveCache"
>
<div class="job-header">
<div class="job-id">
<a target="_blank" ng-href="/r/{{job.id}}" ng-bind="job.id"></a>
<span
class="status-badge"
ng-class="'status-' + job.progress.status"
>{{job.progress.status | title}}</span>
</div>
</div>
<div class="job-timestamps">
<span ng-if="job.timestamp">
<i class="fas fa-clock"></i> Created: {{job.timestamp | humanTime}}
</span>
<span ng-if="job.processedOn">
<i class="fas fa-cog"></i> Processed: {{job.processedOn | humanTime}}
</span>
<span ng-if="job.finishedOn">
<i class="fas fa-check"></i> Finished: {{job.finishedOn | humanTime}}
</span>
</div>
<div ng-if="job.stacktrace.length">
<pre
ng-repeat="stack in job.stacktrace track by $index"
style="font-size: 0.8rem; max-height: 100px; overflow: auto; margin: 6px 0 0 0"
><code ng-bind="stack"></code></pre>
</div>
<div class="job-actions">
<button class="btn btn-sm" ng-click="retryJob('cache', job)">
<i class="fas fa-sync"></i> Retry
</button>
<button class="btn btn-sm" ng-click="removeJob('cache', job)">
<i class="fas fa-trash-alt"></i> Remove
</button>
<a class="btn btn-sm" href="/anonymize/{{job.id}}">
<i class="far fa-edit"></i> Edit
</a>
</div>
</div>
<div class="empty-state" ng-if="filteredRemoveCache.length == 0" style="padding: 20px">
<i class="fas fa-check-circle"></i>
No cache cleanup jobs in the queue.
</div>
</div>
+250 -360
View File
@@ -1,370 +1,260 @@
<div class="container page">
<div class="row">
<div class="border-bottom color-border-secondary py-3 w-100">
<div class="d-flex flex-items-start w-100">
<form class="w-100" aria-label="Repositories" accept-charset="UTF-8">
<div class="d-flex flex-column flex-lg-row flex-auto">
<div class="mb-1 mb-md-0 mr-md-3">
<input
type="search"
id="search"
class="form-control"
aria-label="Find a repository…"
placeholder="Find a repository…"
autocomplete="off"
ng-model="query.search"
/>
</div>
<!-- Admin Navigation -->
<nav class="admin-nav">
<a href="/admin/" class="active">
<i class="fas fa-code-branch"></i> Repositories
</a>
<a href="/admin/users">
<i class="fas fa-users"></i> Users
</a>
<a href="/admin/conferences">
<i class="fas fa-chalkboard-teacher"></i> Conferences
</a>
<a href="/admin/queues">
<i class="fas fa-tasks"></i> Queues
</a>
</nav>
<div class="mb-1 mb-md-0 mr-md-3 col-2 input-group">
<input
type="number"
id="page"
class="form-control"
autocomplete="off"
ng-model="query.page"
min="1"
max="{{totalPage}}"
/>
<div class="input-group-append">
<span class="input-group-text">/{{totalPage}}</span>
</div>
</div>
<!-- Summary Stats -->
<div class="admin-stats">
<div class="admin-stat-card">
<div class="stat-value" ng-bind="total >= 0 ? (total | number) : '...'"></div>
<div class="stat-label">Total Repos</div>
</div>
<div class="admin-stat-card">
<div class="stat-value">{{query.page}}/{{totalPage || '...'}}</div>
<div class="stat-label">Current Page</div>
</div>
</div>
<div class="d-flex flex-wrap">
<div class="dropdown mt-1 mt-lg-0 mr-1">
<button
class="btn btn-secondary dropdown-toggle"
type="button"
id="dropdownSort"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false"
>
Sort
</button>
<div class="dropdown-menu" aria-labelledby="dropdownSort">
<h6 class="dropdown-header">Select order</h6>
<div class="form-check dropdown-item">
<input
class="form-check-input"
type="radio"
name="sort"
id="sortFullName"
value="source.repositoryName"
ng-model="query.sort"
/>
<label class="form-check-label" for="sortFullName">
Repository
</label>
</div>
<div class="form-check dropdown-item">
<input
class="form-check-input"
type="radio"
name="sort"
id="sortAnonymizeDate"
value="anonymizeDate"
ng-model="query.sort"
/>
<label class="form-check-label" for="sortAnonymizeDate">
Anonymize Date
</label>
</div>
<div class="form-check dropdown-item">
<input
class="form-check-input"
type="radio"
name="sort"
id="sortStatus"
value="status"
ng-model="query.sort"
/>
<label class="form-check-label" for="sortStatus">
Status
</label>
</div>
<div class="form-check dropdown-item">
<input
class="form-check-input"
type="radio"
name="sort"
id="sortLastView"
value="lastView"
ng-model="query.sort"
/>
<label class="form-check-label" for="sortLastView">
Last View
</label>
</div>
<div class="form-check dropdown-item">
<input
class="form-check-input"
type="radio"
name="sort"
id="sortPageView"
value="pageView"
ng-model="query.sort"
/>
<label class="form-check-label" for="sortPageView">
Page View
</label>
</div>
</div>
</div>
<!-- Toolbar -->
<div class="admin-toolbar">
<input
type="search"
class="form-control"
aria-label="Search repositories..."
placeholder="Search repositories..."
autocomplete="off"
ng-model="query.search"
/>
<div class="dropdown mt-1 mt-lg-0 mr-1">
<button
class="btn btn-secondary dropdown-toggle"
type="button"
id="dropdownStatus"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false"
>
Status
</button>
<div class="dropdown-menu" aria-labelledby="dropdownStatus">
<h6 class="dropdown-header">Select status</h6>
<div class="form-check dropdown-item">
<input
class="form-check-input"
type="checkbox"
name="sort"
id="statusReady"
value="ready"
ng-model="query.ready"
/>
<label class="form-check-label" for="statusReady">
Ready
</label>
</div>
<div class="form-check dropdown-item">
<input
class="form-check-input"
type="checkbox"
name="sort"
id="statusExpired"
value="expired"
ng-model="query.expired"
/>
<label class="form-check-label" for="statusExpired">
Expired
</label>
</div>
<div class="form-check dropdown-item">
<input
class="form-check-input"
type="checkbox"
name="sort"
id="statusExpired"
value="expired"
ng-model="query.preparing"
/>
<label class="form-check-label" for="statusExpired">
Preparing
</label>
</div>
<div class="form-check dropdown-item">
<input
class="form-check-input"
type="checkbox"
name="sort"
id="statusRemoved"
value="removed"
ng-model="query.removed"
/>
<label class="form-check-label" for="statusRemoved">
Removed
</label>
</div>
<div class="form-check dropdown-item">
<input
class="form-check-input"
type="checkbox"
name="sort"
id="statusRemoved"
value="removed"
ng-model="query.error"
/>
<label class="form-check-label" for="statusRemoved">
Error
</label>
</div>
</div>
</div>
</div>
</div>
</form>
<div class="pagination-compact">
<button class="btn btn-sm" ng-click="query.page = Math.max(1, query.page - 1)" ng-disabled="query.page <= 1">
<i class="fas fa-chevron-left"></i>
</button>
<input
type="number"
class="form-control form-control-sm"
ng-model="query.page"
min="1"
max="{{totalPage}}"
/>
<span>/{{totalPage}}</span>
<button class="btn btn-sm" ng-click="query.page = Math.min(totalPage, query.page + 1)" ng-disabled="query.page >= totalPage">
<i class="fas fa-chevron-right"></i>
</button>
</div>
<div class="dropdown">
<button
class="btn btn-sm dropdown-toggle"
type="button"
id="dropdownSort"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false"
>
<i class="fas fa-sort"></i> Sort
</button>
<div class="dropdown-menu" aria-labelledby="dropdownSort">
<h6 class="dropdown-header">Sort by</h6>
<a class="dropdown-item" href="#" ng-click="query.sort = 'source.repositoryName'">
<i class="fas fa-check" ng-show="query.sort == 'source.repositoryName'"></i> Repository
</a>
<a class="dropdown-item" href="#" ng-click="query.sort = 'anonymizeDate'">
<i class="fas fa-check" ng-show="query.sort == 'anonymizeDate'"></i> Anonymize Date
</a>
<a class="dropdown-item" href="#" ng-click="query.sort = 'status'">
<i class="fas fa-check" ng-show="query.sort == 'status'"></i> Status
</a>
<a class="dropdown-item" href="#" ng-click="query.sort = 'lastView'">
<i class="fas fa-check" ng-show="query.sort == 'lastView'"></i> Last View
</a>
<a class="dropdown-item" href="#" ng-click="query.sort = 'pageView'">
<i class="fas fa-check" ng-show="query.sort == 'pageView'"></i> Page Views
</a>
</div>
</div>
<ul class="p-0 m-0 w-100">
<li
class="col-12 d-flex px-0 py-3 border-bottom color-border-secondary"
ng-class="{'expired': repo.status == 'expired','removed': repo.status == 'removed','error': repo.status == 'error' }"
ng-repeat="repo in repositories| filter:repoFiler| orderBy:orderBy as filteredRepositories"
<div class="dropdown">
<button
class="btn btn-sm dropdown-toggle"
type="button"
id="dropdownStatus"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false"
>
<div class="w-100">
<div class="">
<h3>
<a
target="__blank"
ng-href="/r/{{repo.repoId}}"
ng-bind="repo.repoId"
></a>
<span
class="badge"
ng-class="{'badge-warning': repo.status == 'removed' || repo.status == 'expired' || repo.status == 'removing' || repo.status == 'expiring', 'badge-info': repo.status == 'preparing' || repo.status == 'download', 'badge-success': repo.status == 'ready', 'badge-danger': repo.status == 'error'}"
><span ng-bind="repo.status | title"></span>
<span
ng-if="repo.status == 'error'"
ng-bind="': ' + repo.statusMessage"
></span
></span>
</h3>
<span class="color-text-secondary mb-1">
<span class="repository">
<i class="fab fa-github" aria-hidden="true"></i>
<a
href="https://github.com/{{repo.source.repositoryName}}/"
class="fullName"
ng-bind="repo.source.repositoryName"
></a>
</span>
<span class="branch" ng-if="repo.options.update">
<i class="fas fa-code-branch" aria-hidden="true"></i>
<a
href="https://github.com/{{repo.source.fullName}}/tree/{{repo.source.branch}}"
class="branch"
ng-bind="repo.source.branch"
></a>
</span>
<span class="commit" ng-if="!repo.options.update">
@<a
href="https://github.com/{{repo.source.fullName}}/tree/{{repo.source.commit}}"
class="commit"
ng-bind="repo.source.commit.substring(0, 8)"
></a>
</span>
anonymized {{repo.anonymizeDate | humanTime}}
</span>
</div>
<div class="color-text-secondary mt-2">
<span class="ml-0 mr-3" ng-if="::repo.conference">
<i class="fas fa-chalkboard-teacher"></i>
{{repo.conference}}
</span>
<span
class="ml-0 mr-3"
class="terms"
title="Terms: {{::repo.options.terms.join(', ')}}"
data-toggle="tooltip"
data-placement="bottom"
>
<i class="fas fa-shield-alt"></i>
{{::repo.options.terms.length | number}}
</span>
<span
class="ml-0 mr-3"
title="Size: {{::repo.size.storage | humanFileSize}}"
data-toggle="tooltip"
data-placement="bottom"
>
<i class="fas fa-database"></i> {{::repo.size.storage |
humanFileSize}}</span
>
<span
class="ml-0 mr-3"
title="View: {{::repo.pageView || 0 | number}}"
data-toggle="tooltip"
data-placement="bottom"
>
<i class="far fa-eye" aria-hidden="true"></i>
{{::repo.pageView || 0 | number}}
</span>
<span
class="ml-0 mr-3"
title="Last view: {{::repo.lastView | date}}"
data-toggle="tooltip"
data-placement="bottom"
>
<i class="far fa-calendar-alt" aria-hidden="true"></i>
Last view: {{::repo.lastView | humanTime}}</span
>
<span
class="ml-0 mr-3"
ng-if="repo.options.expirationMode!='never' && repo.status == 'ready'"
>
<i class="far fa-clock" aria-hidden="true"></i>
Expire: {{repo.options.expirationDate | humanTime}}</span
>
</div>
<i class="fas fa-filter"></i> Status
</button>
<div class="dropdown-menu" aria-labelledby="dropdownStatus">
<h6 class="dropdown-header">Filter by status</h6>
<label class="dropdown-item mb-0">
<input type="checkbox" ng-model="query.ready" /> Ready
</label>
<label class="dropdown-item mb-0">
<input type="checkbox" ng-model="query.preparing" /> Preparing
</label>
<label class="dropdown-item mb-0">
<input type="checkbox" ng-model="query.expired" /> Expired
</label>
<label class="dropdown-item mb-0">
<input type="checkbox" ng-model="query.removed" /> Removed
</label>
<label class="dropdown-item mb-0">
<input type="checkbox" ng-model="query.error" /> Error
</label>
</div>
</div>
</div>
<!-- Repository List -->
<div
class="admin-list-item"
ng-repeat="repo in repositories | filter:repoFiler | orderBy:orderBy as filteredRepositories"
>
<div class="item-main">
<div class="item-title">
<a target="_blank" ng-href="/r/{{repo.repoId}}" ng-bind="repo.repoId"></a>
<span
class="status-badge"
ng-class="'status-' + repo.status"
>{{repo.status | title}}</span>
<span
ng-if="repo.status == 'error'"
style="font-size: 0.8rem; color: #dc3545;"
ng-bind="repo.statusMessage"
></span>
</div>
<div class="item-meta">
<span>
<i class="fab fa-github"></i>
<a
href="https://github.com/{{repo.source.repositoryName}}/"
ng-bind="repo.source.repositoryName"
></a>
</span>
<span ng-if="repo.options.update">
<i class="fas fa-code-branch"></i>
<a
href="https://github.com/{{repo.source.fullName}}/tree/{{repo.source.branch}}"
ng-bind="repo.source.branch"
></a>
</span>
<span ng-if="!repo.options.update">
@<a
href="https://github.com/{{repo.source.fullName}}/tree/{{repo.source.commit}}"
ng-bind="repo.source.commit.substring(0, 8)"
></a>
</span>
<span>anonymized {{repo.anonymizeDate | humanTime}}</span>
</div>
<div class="item-meta" style="margin-top: 4px">
<span ng-if="::repo.conference">
<i class="fas fa-chalkboard-teacher"></i> {{repo.conference}}
</span>
<span title="Terms: {{::repo.options.terms.join(', ')}}">
<i class="fas fa-shield-alt"></i> {{::repo.options.terms.length | number}} terms
</span>
<span title="Size: {{::repo.size.storage | humanFileSize}}">
<i class="fas fa-database"></i> {{::repo.size.storage | humanFileSize}}
</span>
<span>
<i class="far fa-eye"></i> {{::repo.pageView || 0 | number}} views
</span>
<span>
<i class="far fa-calendar-alt"></i> Last: {{::repo.lastView | humanTime}}
</span>
<span ng-if="repo.options.expirationMode != 'never' && repo.status == 'ready'">
<i class="far fa-clock"></i> Expire: {{repo.options.expirationDate | humanTime}}
</span>
</div>
</div>
<div class="item-actions">
<div class="dropdown">
<button
class="btn dropdown-toggle btn-sm"
type="button"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false"
>
Actions
</button>
<div class="dropdown-menu dropdown-menu-right">
<a class="dropdown-item" href="/anonymize/{{repo.repoId}}">
<i class="far fa-edit"></i> Edit
</a>
<a class="dropdown-item" href="/r/{{repo.repoId}}/">
<i class="fa fa-eye"></i> View Repo
</a>
<a
class="dropdown-item"
href="/w/{{repo.repoId}}/"
target="_self"
ng-if="repo.options.page && repo.status == 'ready'"
>
<i class="fas fa-globe"></i> View Page
</a>
<div class="dropdown-divider"></div>
<a
class="dropdown-item"
href="#"
ng-show="repo.status == 'ready' || repo.status == 'error'"
ng-click="updateRepository(repo)"
>
<i class="fas fa-sync"></i> Force Update
</a>
<a
class="dropdown-item"
href="#"
ng-show="repo.status == 'removed'"
ng-click="updateRepository(repo)"
>
<i class="fas fa-check-circle"></i> Enable
</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#" ng-click="removeCache(repo)">
<i class="fas fa-broom"></i> Remove Cache
</a>
<a
class="dropdown-item text-danger"
href="#"
ng-show="repo.status == 'ready'"
ng-click="removeRepository(repo)"
>
<i class="fas fa-trash-alt"></i> Remove
</a>
</div>
<div class="d-flex">
<div class="dropdown">
<button
class="btn black_border dropdown-toggle btn-sm"
type="button"
id="dropdownMenuButton"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false"
>
Actions
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="#" ng-click="removeCache(repo)">
<i class="fas fa-trash-alt"></i> Remove Cache
</a>
<a class="dropdown-item" href="/anonymize/{{repo.repoId}}">
<i class="far fa-edit" aria-hidden="true"></i> Edit
</a>
<a
class="dropdown-item"
href="#"
ng-show="repo.status == 'ready' || repo.status == 'error'"
ng-click="updateRepository(repo)"
>
<i class="fas fa-sync"></i> Force update
</a>
<a
class="dropdown-item"
href="#"
ng-show="repo.status == 'removed'"
ng-click="updateRepository(repo)"
>
<i class="fas fa-check-circle"></i>
Enable
</a>
<a
class="dropdown-item"
href="#"
ng-show="repo.status == 'ready'"
ng-click="removeRepository(repo)"
>
<i class="fas fa-trash-alt"></i> Remove
</a>
<a class="dropdown-item" href="/r/{{repo.repoId}}/">
<i class="fa fa-eye" aria-hidden="true"></i> View Repo
</a>
<a
class="dropdown-item"
href="/w/{{repo.repoId}}/"
target="_self"
ng-if="repo.options.page && repo.status == 'ready'"
>
<i class="fas fa-globe"></i> View Page
</a>
</div>
</div>
</div>
</li>
<li
class="col-12 d-flex px-0 py-3 border-bottom color-border-secondary"
ng-if="filteredRepositories.length == 0"
>
There is no repository to display.
</li>
</ul>
</div>
</div>
</div>
<div class="empty-state" ng-if="filteredRepositories.length == 0">
<i class="fas fa-code-branch"></i>
No repositories match the current filters.
</div>
<!-- Bottom pagination -->
<div class="admin-toolbar" ng-if="totalPage > 1" style="justify-content: center; border-bottom: none;">
<div class="pagination-compact">
<button class="btn btn-sm" ng-click="query.page = Math.max(1, query.page - 1)" ng-disabled="query.page <= 1">
<i class="fas fa-chevron-left"></i> Previous
</button>
<span>Page {{query.page}} of {{totalPage}}</span>
<button class="btn btn-sm" ng-click="query.page = Math.min(totalPage, query.page + 1)" ng-disabled="query.page >= totalPage">
Next <i class="fas fa-chevron-right"></i>
</button>
</div>
</div>
</div>
+253 -335
View File
@@ -1,356 +1,274 @@
<div class="container page">
<div class="row">
<h1>
<!-- Admin Navigation -->
<nav class="admin-nav">
<a href="/admin/">
<i class="fas fa-code-branch"></i> Repositories
</a>
<a href="/admin/users" class="active">
<i class="fas fa-users"></i> Users
</a>
<a href="/admin/conferences">
<i class="fas fa-chalkboard-teacher"></i> Conferences
</a>
<a href="/admin/queues">
<i class="fas fa-tasks"></i> Queues
</a>
</nav>
<!-- User Detail Card -->
<div class="user-detail-card" ng-if="userInfo">
<div class="user-header">
<img
ng-src="{{userInfo.photo}}"
ng-if="userInfo.photo"
width="30"
height="30"
class="rounded-circle ng-scope"
width="48"
height="48"
/>
{{userInfo.username}}
<span class="badge"><span ng-bind="userInfo.status | title"></span></span>
</h1>
<div class="row mb-3 m-0 py-2 border">
<div class="col-2 font-weight-bold">ID</div>
<div class="col-10">{{userInfo._id}}</div>
<div>
<h1>
{{userInfo.username}}
<span
class="status-badge"
ng-class="'status-' + userInfo.status"
>{{userInfo.status | title}}</span>
<span
class="status-badge status-active"
ng-if="userInfo.isAdmin"
>Admin</span>
</h1>
</div>
</div>
<div class="col-2 font-weight-bold">Email</div>
<div class="col-10">{{userInfo.emails[0].email}}</div>
<div class="user-detail-grid">
<div class="detail-label">ID</div>
<div class="detail-value">{{userInfo._id}}</div>
<div class="col-2 font-weight-bold">accessTokens</div>
<div class="col-10">{{userInfo.accessTokens.github}}</div>
<div class="detail-label">Email</div>
<div class="detail-value">{{userInfo.emails[0].email}}</div>
<div class="col-2 font-weight-bold">Github</div>
<div class="col-10">
<a ng-href="https://github.com/{{userInfo.username}}"
>{{userInfo.username}}</a
<div class="detail-label">Access Token</div>
<div class="detail-value" style="font-family: monospace; font-size: 0.85rem;">{{userInfo.accessTokens.github}}</div>
<div class="detail-label">GitHub</div>
<div class="detail-value">
<a ng-href="https://github.com/{{userInfo.username}}" target="_blank">
<i class="fab fa-github"></i> {{userInfo.username}}
</a>
</div>
<div class="detail-label">GitHub Repos</div>
<div class="detail-value">
{{userInfo.repositories.length}} repositories
<button
class="btn btn-sm ml-2"
ng-click="showRepos = !showRepos"
>
{{showRepos ? 'Hide' : 'Show'}}
</button>
<button
class="btn btn-primary btn-sm ml-1"
ng-click="getGitHubRepositories()"
>
<i class="fas fa-sync"></i> Refresh
</button>
</div>
</div>
<div class="col-2 font-weight-bold">Github Repositories</div>
<div class="col-10" ng-click="showRepos =!showRepos">
{{userInfo.repositories.length}}
<!-- GitHub repos expandable list -->
<div ng-if="showRepos" style="margin-top: 16px">
<div
class="admin-list-item"
ng-repeat="repo in userInfo.repositories"
>
<div class="item-main">
<div class="item-title" style="font-size: 0.9rem">{{repo.name}}</div>
<div class="item-meta">
<span title="Size">
<i class="fas fa-database"></i> {{::repo.size | humanFileSize}}
</span>
</div>
</div>
</div>
</div>
</div>
<!-- Repositories Section -->
<div class="admin-section-header">
<h2><i class="fas fa-code-branch mr-1"></i> Anonymized Repositories</h2>
<span class="section-count">{{repositories.length}}</span>
</div>
<!-- Toolbar -->
<div class="admin-toolbar">
<input
type="search"
class="form-control"
aria-label="Search repositories..."
placeholder="Search repositories..."
autocomplete="off"
ng-model="search"
/>
<div class="dropdown">
<button
class="btn btn-primary m-1 mx-3"
ng-click="getGitHubRepositories()"
class="btn btn-sm dropdown-toggle"
type="button"
id="dropdownSort"
data-toggle="dropdown"
>
Regresh Repositories
<i class="fas fa-sort"></i> Sort
</button>
<ul class="m-0 col-12" ng-if="showRepos">
<li
class="col-12 d-flex px-0 py-3 border-bottom color-border-secondary"
ng-repeat="repo in userInfo.repositories"
>
<div class="w-100">
<div class="">
{{repo.name}}
</div>
<div class="color-text-secondary mt-2">
<span
class="ml-0 mr-3"
title="Size: {{::repo.size | humanFileSize}}"
data-toggle="tooltip"
data-placement="bottom"
>
<i class="fas fa-database"></i> {{::repo.size |
humanFileSize}}</span
>
</div>
</div>
</li>
</ul>
</div>
<h3>Repositories {{repositories.length}}</h3>
<div class="border-bottom color-border-secondary py-3 w-100">
<div class="d-flex flex-items-start w-100">
<form class="w-100" aria-label="Repositories" accept-charset="UTF-8">
<div class="d-flex flex-column flex-lg-row flex-auto">
<div class="mb-1 mb-md-0 mr-md-3">
<input
type="search"
id="search"
class="form-control"
aria-label="Find repositories"
placeholder="Find repositories"
autocomplete="off"
ng-model="search"
/>
</div>
<div class="d-flex flex-wrap">
<div class="dropdown mt-1 mt-lg-0 mr-1">
<button
class="btn btn-secondary dropdown-toggle"
type="button"
id="dropdownSort"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false"
>
Sort
</button>
<div class="dropdown-menu" aria-labelledby="dropdownSort">
<h6 class="dropdown-header">Select order</h6>
<div class="form-check dropdown-item">
<input
class="form-check-input"
type="radio"
name="sort"
id="anonymizeDate"
value="-anonymizeDate"
ng-model="orderBy"
/>
<label class="form-check-label" for="anonymizeDate">
Anonymize Date
</label>
</div>
<div class="form-check dropdown-item">
<input
class="form-check-input"
type="radio"
name="sort"
id="sortID"
value="repoId"
ng-model="orderBy"
/>
<label class="form-check-label" for="sortID"> ID </label>
</div>
<div class="form-check dropdown-item">
<input
class="form-check-input"
type="radio"
name="sort"
id="sortStatus"
value="-status"
ng-model="orderBy"
/>
<label class="form-check-label" for="sortStatus">
Status
</label>
</div>
</div>
</div>
<div class="dropdown mt-1 mt-lg-0 mr-1">
<button
class="btn btn-secondary dropdown-toggle"
type="button"
id="dropdownStatus"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false"
>
Status
</button>
<div class="dropdown-menu" aria-labelledby="dropdownStatus">
<h6 class="dropdown-header">Select status</h6>
<div class="form-check dropdown-item">
<input
class="form-check-input"
type="checkbox"
name="sort"
id="statusReady"
value="ready"
ng-model="filters.status.ready"
/>
<label class="form-check-label" for="statusReady">
Ready
</label>
</div>
<div class="form-check dropdown-item">
<input
class="form-check-input"
type="checkbox"
name="sort"
id="statusExpired"
value="expired"
ng-model="filters.status.expired"
/>
<label class="form-check-label" for="statusExpired">
Expired
</label>
</div>
<div class="form-check dropdown-item">
<input
class="form-check-input"
type="checkbox"
name="sort"
id="statusRemoved"
value="removed"
ng-model="filters.status.removed"
/>
<label class="form-check-label" for="statusRemoved">
Removed
</label>
</div>
</div>
</div>
</div>
</div>
</form>
<div
class="d-none d-md-flex flex-md-items-center flex-md-justify-end"
></div>
<div class="dropdown-menu" aria-labelledby="dropdownSort">
<h6 class="dropdown-header">Sort by</h6>
<a class="dropdown-item" href="#" ng-click="orderBy = '-anonymizeDate'">
<i class="fas fa-check" ng-show="orderBy == '-anonymizeDate'"></i> Anonymize Date
</a>
<a class="dropdown-item" href="#" ng-click="orderBy = 'repoId'">
<i class="fas fa-check" ng-show="orderBy == 'repoId'"></i> ID
</a>
<a class="dropdown-item" href="#" ng-click="orderBy = '-status'">
<i class="fas fa-check" ng-show="orderBy == '-status'"></i> Status
</a>
</div>
</div>
<ul class="p-0 m-0 w-100">
<li
class="col-12 d-flex px-0 py-3 border-bottom color-border-secondary"
ng-class="{'expired': repo.status == 'expired','removed': repo.status == 'removed' }"
ng-repeat="repo in repositories| filter:repoFiler| orderBy:orderBy as filteredRepositories"
<div class="dropdown">
<button
class="btn btn-sm dropdown-toggle"
type="button"
id="dropdownStatus"
data-toggle="dropdown"
>
<div class="w-100">
<div class="">
<h3>
<a ng-href="/r/{{repo.repoId}}" ng-bind="repo.repoId"></a>
<span
class="badge"
ng-class="{'badge-warning': repo.status == 'removed' || repo.status == 'expired', 'badge-success': repo.status == 'ready', 'badge-danger': ''}"
ng-bind="repo.status | title"
></span>
</h3>
<span class="color-text-secondary mb-1">
<span class="repository">
<i class="fab fa-github" aria-hidden="true"></i>
<a
href="https://github.com/{{repo.source.fullName}}/"
class="fullName"
ng-bind="repo.source.fullName"
></a>
</span>
<span class="branch" ng-if="repo.options.update">
<i class="fas fa-code-branch" aria-hidden="true"></i>
<a
href="https://github.com/{{repo.source.fullName}}/tree/{{repo.source.branch}}"
class="branch"
ng-bind="repo.source.branch"
></a>
</span>
<span class="commit" ng-if="!repo.options.update">
@<a
href="https://github.com/{{repo.source.fullName}}/tree/{{repo.source.commit}}"
class="commit"
ng-bind="repo.source.commit.substring(0, 8)"
></a>
</span>
anonymized {{repo.anonymizeDate | humanTime}}
</span>
</div>
<div class="color-text-secondary mt-2">
<span
class="ml-0 mr-3"
class="terms"
title="Terms: {{::repo.options.terms.join(', ')}}"
data-toggle="tooltip"
data-placement="bottom"
>
<i class="fas fa-shield-alt"></i>
{{::repo.options.terms.length | number}}
</span>
<span
class="ml-0 mr-3"
title="Size: {{::repo.size | humanFileSize}}"
data-toggle="tooltip"
data-placement="bottom"
>
<i class="fas fa-database"></i> {{::repo.size.storage |
humanFileSize}}</span
>
<span
class="ml-0 mr-3"
title="View: {{::repo.pageView | number}}"
data-toggle="tooltip"
data-placement="bottom"
>
<i class="far fa-eye" aria-hidden="true"></i>
{{::repo.pageView | number}}
</span>
<span
class="ml-0 mr-3"
title="Last view: {{::repo.lastView | date}}"
data-toggle="tooltip"
data-placement="bottom"
>
<i class="far fa-calendar-alt" aria-hidden="true"></i>
Last view: {{::repo.lastView | humanTime}}</span
>
<span
class="ml-0 mr-3"
ng-if="repo.options.expirationMode!='never' && repo.status == 'ready'"
>
<i class="far fa-clock" aria-hidden="true"></i>
Expire: {{repo.options.expirationDate | humanTime}}</span
>
</div>
<i class="fas fa-filter"></i> Status
</button>
<div class="dropdown-menu" aria-labelledby="dropdownStatus">
<label class="dropdown-item mb-0">
<input type="checkbox" ng-model="filters.status.ready" /> Ready
</label>
<label class="dropdown-item mb-0">
<input type="checkbox" ng-model="filters.status.expired" /> Expired
</label>
<label class="dropdown-item mb-0">
<input type="checkbox" ng-model="filters.status.removed" /> Removed
</label>
</div>
</div>
</div>
<!-- Repository List -->
<div
class="admin-list-item"
ng-repeat="repo in repositories | filter:repoFiler | orderBy:orderBy as filteredRepositories"
>
<div class="item-main">
<div class="item-title">
<a ng-href="/r/{{repo.repoId}}" ng-bind="repo.repoId"></a>
<span
class="status-badge"
ng-class="'status-' + repo.status"
>{{repo.status | title}}</span>
</div>
<div class="item-meta">
<span>
<i class="fab fa-github"></i>
<a
href="https://github.com/{{repo.source.fullName}}/"
ng-bind="repo.source.fullName"
></a>
</span>
<span ng-if="repo.options.update">
<i class="fas fa-code-branch"></i>
<a
href="https://github.com/{{repo.source.fullName}}/tree/{{repo.source.branch}}"
ng-bind="repo.source.branch"
></a>
</span>
<span ng-if="!repo.options.update">
@<a
href="https://github.com/{{repo.source.fullName}}/tree/{{repo.source.commit}}"
ng-bind="repo.source.commit.substring(0, 8)"
></a>
</span>
<span>anonymized {{repo.anonymizeDate | humanTime}}</span>
</div>
<div class="item-meta" style="margin-top: 4px">
<span title="Terms: {{::repo.options.terms.join(', ')}}">
<i class="fas fa-shield-alt"></i> {{::repo.options.terms.length | number}}
</span>
<span title="Size">
<i class="fas fa-database"></i> {{::repo.size.storage | humanFileSize}}
</span>
<span>
<i class="far fa-eye"></i> {{::repo.pageView | number}}
</span>
<span>
<i class="far fa-calendar-alt"></i> Last: {{::repo.lastView | humanTime}}
</span>
<span ng-if="repo.options.expirationMode != 'never' && repo.status == 'ready'">
<i class="far fa-clock"></i> Expire: {{repo.options.expirationDate | humanTime}}
</span>
</div>
</div>
<div class="item-actions">
<div class="dropdown">
<button
class="btn dropdown-toggle btn-sm"
type="button"
data-toggle="dropdown"
>
Actions
</button>
<div class="dropdown-menu dropdown-menu-right">
<a class="dropdown-item" href="/anonymize/{{repo.repoId}}">
<i class="far fa-edit"></i> Edit
</a>
<a class="dropdown-item" href="/r/{{repo.repoId}}/">
<i class="fa fa-eye"></i> View Repo
</a>
<a
class="dropdown-item"
href="/w/{{repo.repoId}}/"
target="_self"
ng-if="repo.options.page && repo.status == 'ready'"
>
<i class="fas fa-globe"></i> View Page
</a>
<div class="dropdown-divider"></div>
<a
class="dropdown-item"
href="#"
ng-show="repo.status == 'ready' || repo.status == 'error'"
ng-click="updateRepository(repo)"
>
<i class="fas fa-sync"></i> Force Update
</a>
<a
class="dropdown-item"
href="#"
ng-show="repo.status == 'removed'"
ng-click="updateRepository(repo)"
>
<i class="fas fa-check-circle"></i> Enable
</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#" ng-click="removeCache(repo)">
<i class="fas fa-broom"></i> Remove Cache
</a>
<a
class="dropdown-item text-danger"
href="#"
ng-show="repo.status == 'ready'"
ng-click="removeRepository(repo)"
>
<i class="fas fa-trash-alt"></i> Remove
</a>
</div>
<div class="d-flex">
<div class="dropdown">
<button
class="btn black_border dropdown-toggle btn-sm"
type="button"
id="dropdownMenuButton"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false"
>
Actions
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="#" ng-click="removeCache(repo)">
<i class="fas fa-trash-alt"></i> Remove Cache
</a>
<a class="dropdown-item" href="/anonymize/{{repo.repoId}}">
<i class="far fa-edit" aria-hidden="true"></i> Edit
</a>
<a
class="dropdown-item"
href="#"
ng-show="repo.status == 'ready' || repo.status == 'error'"
ng-click="updateRepository(repo)"
>
<i class="fas fa-sync"></i> Force update
</a>
<a
class="dropdown-item"
href="#"
ng-show="repo.status == 'removed'"
ng-click="updateRepository(repo)"
>
<i class="fas fa-check-circle"></i>
Enable
</a>
<a
class="dropdown-item"
href="#"
ng-show="repo.status == 'ready'"
ng-click="removeRepository(repo)"
>
<i class="fas fa-trash-alt"></i> Remove
</a>
<a class="dropdown-item" href="/r/{{repo.repoId}}/">
<i class="fa fa-eye" aria-hidden="true"></i> View Repo
</a>
<a
class="dropdown-item"
href="/w/{{repo.repoId}}/"
target="_self"
ng-if="repo.options.page && repo.status == 'ready'"
>
<i class="fas fa-globe"></i> View Page
</a>
</div>
</div>
</div>
</li>
<li
class="col-12 d-flex px-0 py-3 border-bottom color-border-secondary"
ng-if="filteredRepositories.length == 0"
>
There is no repository to display.
</li>
</ul>
</div>
</div>
</div>
<div class="empty-state" ng-if="filteredRepositories.length == 0">
<i class="fas fa-code-branch"></i>
No repositories to display.
</div>
</div>
+160 -204
View File
@@ -1,213 +1,169 @@
<div class="container page">
<div class="row">
<div class="border-bottom color-border-secondary py-3 w-100">
<div class="d-flex flex-items-start w-100">
<form class="w-100" aria-label="Users" accept-charset="UTF-8">
<div class="d-flex flex-column flex-lg-row flex-auto">
<div class="mb-1 mb-md-0 mr-md-3">
<input
type="search"
id="search"
class="form-control"
aria-label="Find a user…"
placeholder="Find a user…"
autocomplete="off"
ng-model="query.search"
/>
</div>
<!-- Admin Navigation -->
<nav class="admin-nav">
<a href="/admin/">
<i class="fas fa-code-branch"></i> Repositories
</a>
<a href="/admin/users" class="active">
<i class="fas fa-users"></i> Users
</a>
<a href="/admin/conferences">
<i class="fas fa-chalkboard-teacher"></i> Conferences
</a>
<a href="/admin/queues">
<i class="fas fa-tasks"></i> Queues
</a>
</nav>
<div class="mb-1 mb-md-0 mr-md-3 col-2 input-group">
<input
type="number"
id="page"
class="form-control"
autocomplete="off"
ng-model="query.page"
min="1"
max="{{totalPage}}"
/>
<div class="input-group-append">
<span class="input-group-text">/{{totalPage}}</span>
</div>
</div>
<!-- Summary Stats -->
<div class="admin-stats">
<div class="admin-stat-card">
<div class="stat-value" ng-bind="total >= 0 ? (total | number) : '...'"></div>
<div class="stat-label">Total Users</div>
</div>
<div class="admin-stat-card">
<div class="stat-value">{{query.page}}/{{totalPage || '...'}}</div>
<div class="stat-label">Current Page</div>
</div>
</div>
<div class="d-flex flex-wrap">
<div class="dropdown mt-1 mt-lg-0 mr-1">
<button
class="btn btn-secondary dropdown-toggle"
type="button"
id="dropdownSort"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false"
>
Sort
</button>
<div class="dropdown-menu" aria-labelledby="dropdownSort">
<h6 class="dropdown-header">Select order</h6>
<div class="form-check dropdown-item">
<input
class="form-check-input"
type="radio"
name="sort"
id="username"
value="username"
ng-model="query.sort"
/>
<label class="form-check-label" for="username">
Username
</label>
</div>
</div>
</div>
<!-- Toolbar -->
<div class="admin-toolbar">
<input
type="search"
class="form-control"
aria-label="Search users..."
placeholder="Search users..."
autocomplete="off"
ng-model="query.search"
/>
<div class="dropdown mt-1 mt-lg-0 mr-1">
<button
class="btn btn-secondary dropdown-toggle"
type="button"
id="dropdownStatus"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false"
>
Status
</button>
<div class="dropdown-menu" aria-labelledby="dropdownStatus">
<h6 class="dropdown-header">Select status</h6>
<div class="form-check dropdown-item">
<input
class="form-check-input"
type="checkbox"
name="sort"
id="statusReady"
value="ready"
ng-model="query.ready"
/>
<label class="form-check-label" for="statusReady">
Active
</label>
</div>
<div class="form-check dropdown-item">
<input
class="form-check-input"
type="checkbox"
name="sort"
id="statusExpired"
value="expired"
ng-model="query.expired"
/>
<label class="form-check-label" for="statusExpired">
Expired
</label>
</div>
<div class="form-check dropdown-item">
<input
class="form-check-input"
type="checkbox"
name="sort"
id="statusExpired"
value="expired"
ng-model="query.preparing"
/>
<label class="form-check-label" for="statusExpired">
Preparing
</label>
</div>
<div class="form-check dropdown-item">
<input
class="form-check-input"
type="checkbox"
name="sort"
id="statusRemoved"
value="removed"
ng-model="query.removed"
/>
<label class="form-check-label" for="statusRemoved">
Removed
</label>
</div>
<div class="form-check dropdown-item">
<input
class="form-check-input"
type="checkbox"
name="sort"
id="statusRemoved"
value="removed"
ng-model="query.error"
/>
<label class="form-check-label" for="statusRemoved">
Error
</label>
</div>
</div>
</div>
</div>
</div>
</form>
<div class="pagination-compact">
<button class="btn btn-sm" ng-click="query.page = Math.max(1, query.page - 1)" ng-disabled="query.page <= 1">
<i class="fas fa-chevron-left"></i>
</button>
<input
type="number"
class="form-control form-control-sm"
ng-model="query.page"
min="1"
max="{{totalPage}}"
/>
<span>/{{totalPage}}</span>
<button class="btn btn-sm" ng-click="query.page = Math.min(totalPage, query.page + 1)" ng-disabled="query.page >= totalPage">
<i class="fas fa-chevron-right"></i>
</button>
</div>
<div class="dropdown">
<button
class="btn btn-sm dropdown-toggle"
type="button"
id="dropdownSort"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false"
>
<i class="fas fa-sort"></i> Sort
</button>
<div class="dropdown-menu" aria-labelledby="dropdownSort">
<h6 class="dropdown-header">Sort by</h6>
<a class="dropdown-item" href="#" ng-click="query.sort = 'username'">
<i class="fas fa-check" ng-show="query.sort == 'username'"></i> Username
</a>
</div>
</div>
<ul class="p-0 m-0 w-100">
<li
class="col-12 d-flex px-0 py-3 border-bottom color-border-secondary"
ng-class="{'expired': user.status == 'expired','removed': user.status == 'removed','error': user.status == 'error' }"
ng-repeat="user in users| filter:userFiler| orderBy:orderBy as filteredUsers"
>
<div class="w-100">
<div class="">
<h3>
<a ng-href="/admin/users/{{user.username}}" ng-bind="user.username"></a>
<span
class="badge"
ng-class="{'badge-warning': user.status == 'removed' || user.status == 'expired' || user.status == 'removing' || user.status == 'expiring', 'badge-info': user.status == 'preparing' || user.status == 'download', 'badge-success': user.status == 'active', 'badge-danger': user.status == 'error'}"
><span ng-bind="user.status | title"></span>
</span>
</h3>
</div>
<div class="color-text-secondary mt-2"></div>
</div>
<!-- User List -->
<div
class="admin-list-item"
ng-repeat="u in users | filter:userFiler | orderBy:orderBy as filteredUsers"
>
<div class="item-main">
<div class="item-title">
<a ng-href="/admin/users/{{u.username}}">
<img
ng-src="{{u.photo}}"
ng-if="u.photo"
width="20"
height="20"
class="rounded-circle mr-1"
style="vertical-align: text-bottom"
/>
{{u.username}}
</a>
<span
class="status-badge"
ng-class="'status-' + u.status"
>{{u.status | title}}</span>
<span
class="status-badge status-active"
ng-if="u.isAdmin"
>Admin</span>
</div>
<div class="item-meta">
<span ng-if="u.emails[0].email">
<i class="fas fa-envelope"></i> {{u.emails[0].email}}
</span>
<span>
<i class="fab fa-github"></i>
<a ng-href="https://github.com/{{u.username}}" target="_blank">{{u.username}}</a>
</span>
</div>
</div>
<div class="item-actions">
<div class="dropdown">
<button
class="btn dropdown-toggle btn-sm"
type="button"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false"
>
Actions
</button>
<div class="dropdown-menu dropdown-menu-right">
<a class="dropdown-item" href="/admin/users/{{u.username}}">
<i class="far fa-eye"></i> View Details
</a>
<div class="dropdown-divider"></div>
<a
class="dropdown-item"
href="#"
ng-show="u.status == 'active'"
ng-click="banUser(u)"
>
<i class="fas fa-ban"></i> Ban
</a>
<a
class="dropdown-item"
href="#"
ng-show="u.status == 'removed' || u.status == 'banned'"
ng-click="activateUser(u)"
>
<i class="fas fa-check-circle"></i> Activate
</a>
</div>
<div class="d-flex">
<div class="dropdown">
<button
class="btn black_border dropdown-toggle btn-sm"
type="button"
id="dropdownMenuButton"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false"
>
Actions
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="/admin/user/{{user._id}}">
<i class="far fa-edit" aria-hidden="true"></i> Edit
</a>
<a
class="dropdown-item"
href="#"
ng-show="user.status == 'ready' || user.status == 'error'"
ng-click="banUser(user)"
>
<i class="fas fa-sync"></i> Ban
</a>
<a
class="dropdown-item"
href="#"
ng-show="user.status == 'removed'"
ng-click="activateUser(user)"
>
<i class="fas fa-check-circle"></i>
Activate
</a>
</div>
</div>
</div>
</li>
<li
class="col-12 d-flex px-0 py-3 border-bottom color-border-secondary"
ng-if="filteredUsers.length == 0"
>
There is no user to display.
</li>
</ul>
</div>
</div>
</div>
<div class="empty-state" ng-if="filteredUsers.length == 0">
<i class="fas fa-users"></i>
No users match the current filters.
</div>
<!-- Bottom pagination -->
<div class="admin-toolbar" ng-if="totalPage > 1" style="justify-content: center; border-bottom: none;">
<div class="pagination-compact">
<button class="btn btn-sm" ng-click="query.page = Math.max(1, query.page - 1)" ng-disabled="query.page <= 1">
<i class="fas fa-chevron-left"></i> Previous
</button>
<span>Page {{query.page}} of {{totalPage}}</span>
<button class="btn btn-sm" ng-click="query.page = Math.min(totalPage, query.page + 1)" ng-disabled="query.page >= totalPage">
Next <i class="fas fa-chevron-right"></i>
</button>
</div>
</div>
</div>