Skip to content

Commit

Permalink
🎨 Show jobs list for all users
Browse files Browse the repository at this point in the history
  • Loading branch information
cristianpb committed Sep 18, 2024
1 parent 34baef4 commit d701b82
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/components/tools/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const routes = {
},
'/about': { component: Default, props: {title: 'À propos'}, title: 'À propos', desc: 'À propos de matchID: conditions légales données et code opensource, foire aux questions, documentation de l\'API, statistiques de consultation, ...'},
'/link': { component: Link, title: 'Appariement', desc: 'matchID permet l\'appariement de votre fichier client, jusque 1 million d\'enregistrements, au fichier des décès de l`INSEE' },
'/jobs': { auth: true, component: LinkJobs, title: 'Traitements', desc: 'page d\'administration des traitements' },
'/jobs': { component: LinkJobs, title: 'Traitements', desc: 'page d\'administration des traitements' },
'/edits': { auth: true, component: EditsList, title: 'Modifications', desc: 'page d\'administration des modifications' },
'/stats': { component: Stats, title: 'statistiques de fréquentation', desc: 'statistiques de consultation de deces.matchid.io: visiteurs uniques, appels API, ... historique depuis début 2020' },
'/explain': { component: AlgoDetails, title: 'Explication de l\'algorithme', desc: 'détails sur l\'algorithme d\'appariement' },
Expand Down
16 changes: 10 additions & 6 deletions src/components/views/LinkJobs.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{#if $admin && ready}
{#if ready}
<div class="rf-container rf-padding-top-2N">
<div class="rf-grid-row">
<div class="rf-col-xl-2 rf-col-lg-2 rf-col-md-12 rf-col-sm-12 rf-col-xs-12">
Expand Down Expand Up @@ -31,7 +31,7 @@
Math.floor(
jobs.filter(j => j.status === 'completed').map(j =>j.rows).reduce((a,b) => a+b)
/
jobs.filter(j => j.status === 'completed').map(j =>j.delay).reduce((a,b) => a+b)
jobs.filter(j => j.status === 'completed').map(j =>j.processing_time).reduce((a,b) => a+b)
)
}
label="Lignes / Seconde"/>
Expand Down Expand Up @@ -117,7 +117,7 @@
import axios from 'axios';
import Icon from './Icon.svelte';
import { admin, accessToken } from '../tools/stores.js';
import { accessToken } from '../tools/stores.js';
let jobs = [];
let ready = false;
let headers;
Expand Down Expand Up @@ -152,6 +152,12 @@
const getJobsData = async () => {
headers = {
headers: {
Authorization: `Bearer ${$accessToken}`
}
};
let response = await fetch('__BACKEND_PROXY_PATH__/queue/jobs', headers);
const tmpJobs = [];
const list = (await response.json()).jobs || [];
Expand Down Expand Up @@ -191,9 +197,7 @@
}
}
$: if ($admin) {
getJobsData();
}
$: getJobsData()
</script>

Expand Down
4 changes: 2 additions & 2 deletions src/components/views/MatchIDHeader.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,6 @@
API Key
</a>
</li>
{/if}
{#if $admin}
<li
class="rf-menu__item rf-href"
class:rf-menu__item--active={!modal && ($route.path === '/jobs')}
Expand All @@ -235,6 +233,8 @@
Appariements
</a>
</li>
{/if}
{#if $admin}
<li
class="rf-menu__item rf-href"
class:rf-menu__item--active={!modal && ($route.path === '/stats')}
Expand Down

0 comments on commit d701b82

Please sign in to comment.