mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-12-01 20:45:57 +03:00
show a banner for repos with https remotes informing the user to create an ssh key
This commit is contained in:
parent
d767728350
commit
14bee31cc3
6
src/lib/config/perpetualConfig.ts
Normal file
6
src/lib/config/perpetualConfig.ts
Normal file
@ -0,0 +1,6 @@
|
||||
import { persisted, type Persisted } from '@square/svelte-store';
|
||||
|
||||
export function projectHttpsWarningBannerDismissed(projectId: string): Persisted<boolean> {
|
||||
const key = 'projectHttpsWarningBannerDismissed_';
|
||||
return persisted(false, key + projectId);
|
||||
}
|
@ -19,6 +19,7 @@
|
||||
import { getFetchesStore } from '$lib/stores/fetches';
|
||||
import { Code } from '$lib/ipc';
|
||||
import Resizer from '$lib/components/Resizer.svelte';
|
||||
import { projectHttpsWarningBannerDismissed } from '$lib/config/perpetualConfig';
|
||||
|
||||
export let data: PageData;
|
||||
let { projectId, remoteBranchNames, project, cloud } = data;
|
||||
@ -58,6 +59,8 @@
|
||||
baseBranchStore
|
||||
);
|
||||
|
||||
const httpsWarningBannerDismissed = projectHttpsWarningBannerDismissed(projectId);
|
||||
|
||||
$: sessionId = $sessionsStore?.at(-1)?.id;
|
||||
$: updateDeltasStore(sessionId); // has to come before `getVirtualBranchStore`
|
||||
|
||||
@ -132,6 +135,30 @@
|
||||
remoteUrl={$baseBranchStore?.remoteUrl}
|
||||
remoteBranches={$remoteBranchStore}
|
||||
/> -->
|
||||
|
||||
{#if $baseBranchStore?.remoteUrl.startsWith('https') && !$httpsWarningBannerDismissed}
|
||||
<div class="flex items-center bg-yellow-200/70 px-2 py-1 dark:bg-yellow-700/70">
|
||||
<div class="flex flex-grow">
|
||||
HTTPS remote detected. In order to push & fetch, you may need to
|
||||
<a target="_blank" rel="noreferrer" class="font-bold" href="/user">
|
||||
set up
|
||||
</a> an SSH key (
|
||||
<a
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
class="font-bold"
|
||||
href="https://docs.gitbutler.com/features/virtual-branches/pushing-and-fetching#the-ssh-keys"
|
||||
>
|
||||
docs
|
||||
</a>
|
||||
|
||||
<IconExternalLink class="h-4 w-4" />
|
||||
).
|
||||
</div>
|
||||
|
||||
<button on:click={() => httpsWarningBannerDismissed.set(true)}>Dismiss</button>
|
||||
</div>
|
||||
{/if}
|
||||
<div
|
||||
class="lane-scroll flex flex-grow gap-1 overflow-x-auto overflow-y-hidden overscroll-none bg-light-300 dark:bg-dark-1100"
|
||||
>
|
||||
|
Loading…
Reference in New Issue
Block a user