Make filter repo configureable
This commit is contained in:
parent
c8cb7c0199
commit
f2198994d5
1 changed files with 4 additions and 2 deletions
|
|
@ -1,5 +1,6 @@
|
|||
---
|
||||
const TOKEN = import.meta.env.PUBLIC_ACCESS_TOKEN || '';
|
||||
const REPO_FILTER = import.meta.env.PUBLIC_REPO_FILTER || '';
|
||||
---
|
||||
|
||||
<!doctype html>
|
||||
|
|
@ -41,7 +42,7 @@ const TOKEN = import.meta.env.PUBLIC_ACCESS_TOKEN || '';
|
|||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app" data-token={TOKEN}>
|
||||
<div id="app" data-token={TOKEN} data-repo-filter={REPO_FILTER}>
|
||||
<div id="loading" class="loading">
|
||||
<div class="spinner"></div>
|
||||
<p>Loading time tracking data...</p>
|
||||
|
|
@ -105,6 +106,7 @@ const TOKEN = import.meta.env.PUBLIC_ACCESS_TOKEN || '';
|
|||
<script>
|
||||
(function() {
|
||||
var TOKEN = document.getElementById('app').getAttribute('data-token') || '';
|
||||
var REPO_FILTER = document.getElementById('app').getAttribute('data-repo-filter') || '';
|
||||
var API_BASE = 'https://bitfreedom.net/code/api/v1';
|
||||
|
||||
function formatDuration(seconds) {
|
||||
|
|
@ -202,7 +204,7 @@ const TOKEN = import.meta.env.PUBLIC_ACCESS_TOKEN || '';
|
|||
for (var i = 0; i < timesData.length; i++) {
|
||||
var entry = timesData[i];
|
||||
var repoKey = entry.repository_url || (entry.issue && entry.issue.repository_url) || (entry.issue && entry.issue.repository && entry.issue.repository.full_name) || '';
|
||||
if (repoKey.indexOf('VectorSearchMedia') === -1) continue;
|
||||
if (REPO_FILTER && repoKey.indexOf(REPO_FILTER) === -1) continue;
|
||||
var timeSec = entry.time || 0;
|
||||
var created = new Date(entry.created).getTime();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue