Skip to content

Commit

Permalink
Merge pull request #286 from sebadob/ext_auth_provider_foundation
Browse files Browse the repository at this point in the history
Upstream Auth Providers Part 1
  • Loading branch information
sebadob authored Mar 15, 2024
2 parents a7b3ac1 + 826b2f3 commit fc4d39b
Show file tree
Hide file tree
Showing 23 changed files with 1,408 additions and 696 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ The most important thing to compile the code is obviously `rust` and `cargo`. Th
- `docker` available, if you want to build images
- [just](https://github.com/casey/just) installed
- BASH (no cmd.exe or powershell) - when you are on windows, you can use something like Git BASH
- For building the UI `just build-ui`, you need [sd](https://crates.io/crates/sd): `cargo install sd`

### Get it up and running

Expand Down
328 changes: 164 additions & 164 deletions frontend/package-lock.json

Large diffs are not rendered by default.

32 changes: 24 additions & 8 deletions frontend/src/components/admin/AdminMain.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
import ApiKeys from "./api_keys/ApiKeys.svelte";
import EventsArchive from "./events/EventsArchive.svelte";
import IconBellAlert from "$lib/icons/IconBellAlert.svelte";
import IconCloud from "$lib/icons/IconCloud.svelte";
import Providers from "./providers/Providers.svelte";
export let selected = 'Users';
Expand Down Expand Up @@ -97,6 +99,11 @@
title = 'ApiKeys';
break;
}
case 'Providers': {
window.history.pushState('Providers', '', '/auth/v1/admin/providers');
title = 'Providers';
break;
}
case 'Config': {
window.history.pushState('Config', '', '/auth/v1/admin/config');
title = 'Config';
Expand All @@ -114,13 +121,10 @@
}
onMount(() => {
window.addEventListener('popstate', (event) => {
selected = event.state;
});
window.addEventListener('popstate', setSelected);
calcWidths(window.innerWidth);
return () => window.removeEventListener('popstate');
return () => window.removeEventListener('popstate', setSelected);
});
function calcWidths(innerWidth) {
Expand All @@ -129,6 +133,10 @@
eventsWide = innerWidth > 1450;
}
function setSelected(event) {
selected = event.state;
}
</script>

<svelte:window bind:innerWidth/>
Expand Down Expand Up @@ -183,11 +191,15 @@
</NavEntry>

<NavEntry label="Blacklist">
<IconStop width={24} />
<IconStop width={24}/>
</NavEntry>

<NavEntry label="ApiKeys">
<IconKey />
<IconKey/>
</NavEntry>

<NavEntry label="Providers">
<IconCloud/>
</NavEntry>

<NavEntry label="Config">
Expand Down Expand Up @@ -245,6 +257,10 @@
<ContentWrapper bind:eventsWide bind:eventsCollapsed>
<ApiKeys/>
</ContentWrapper>
{:else if 'Providers' === selected}
<ContentWrapper bind:eventsWide bind:eventsCollapsed>
<Providers/>
</ContentWrapper>
{:else if 'Config' === selected}
<ContentWrapper bind:eventsWide bind:eventsCollapsed>
<Config/>
Expand All @@ -256,7 +272,7 @@
{/if}

{#if innerWidth !== undefined }
<Events collapsed={eventsCollapsed} wide={eventsWide} />
<Events collapsed={eventsCollapsed} wide={eventsWide}/>
{/if}
</div>
</main>
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/admin/AdminMainPre.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
if (resAdmin.ok) {
sessionInfo = body;
isAdmin = true;
} else if (resAdmin.status === 406 ) {
} else if (resAdmin.status === 406) {
mfaReqErr = true;
sessionInfo = {};
} else {
Expand Down Expand Up @@ -60,7 +60,7 @@
<Button on:click={() => window.location.href = '/auth/v1/'}>GO BACK</Button>
</div>
{:else}
<AdminMain bind:sessionInfo bind:selected/>
<AdminMain bind:selected/>
{/if}
</BrowserCheck>

Expand Down
Loading

0 comments on commit fc4d39b

Please sign in to comment.