Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use FormPage for Create Playground page #1236

Merged
merged 1 commit into from
Jun 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 18 additions & 8 deletions packages/frontend/src/pages/PlaygroundCreate.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<script lang="ts">
import { faExclamationCircle, faInfoCircle, faPlus, faPlusCircle } from '@fortawesome/free-solid-svg-icons';
import NavPage from '../lib/NavPage.svelte';
import type { ModelInfo } from '@shared/src/models/IModelInfo';
import { modelsInfo } from '/@/stores/modelsInfo';
import Fa from 'svelte-fa';
Expand All @@ -12,7 +11,7 @@ import TasksProgress from '../lib/progress/TasksProgress.svelte';
import { tasks } from '../stores/tasks';
import { filterByLabel } from '../utils/taskUtils';
import type { Unsubscriber } from 'svelte/store';
import { Button, ErrorMessage } from '@podman-desktop/ui-svelte';
import { Button, ErrorMessage, FormPage } from '@podman-desktop/ui-svelte';

let localModels: ModelInfo[];
$: localModels = $modelsInfo.filter(model => model.file);
Expand Down Expand Up @@ -102,13 +101,24 @@ onMount(() => {
onDestroy(() => {
unsubscribeTasks?.();
});

export function goToUpPage(): void {
router.goto('/playgrounds');
}
</script>

<NavPage
lastPage="{{ name: 'Playgrounds', path: '/playgrounds' }}"
icon="{faPlus}"
<FormPage
title="New Playground environment"
searchEnabled="{false}">
breadcrumbLeftPart="Playgrounds"
breadcrumbRightPart="New Playground environment"
breadcrumbTitle="Go back to Playgrounds"
on:close="{goToUpPage}"
on:breadcrumbClick="{goToUpPage}">
<svelte:fragment slot="icon">
<div class="rounded-full w-8 h-8 flex items-center justify-center">
<Fa size="1.125x" class="text-[var(--pd-content-header-icon)]" icon="{faPlus}" />
</div>
</svelte:fragment>
<svelte:fragment slot="content">
<div class="flex flex-col w-full">
<!-- tasks tracked -->
Expand All @@ -119,7 +129,7 @@ onDestroy(() => {
{/if}

<!-- form -->
<div class="bg-charcoal-800 m-5 pt-5 space-y-6 px-8 sm:pb-6 xl:pb-8 rounded-lg h-fit">
<div class="bg-[var(--pd-content-card-bg)] m-5 pt-5 space-y-6 px-8 sm:pb-6 xl:pb-8 rounded-lg h-fit">
<div class="w-full">
<!-- playground name input -->
<label for="playgroundName" class="block mb-2 text-sm font-bold text-gray-400">Playground name</label>
Expand Down Expand Up @@ -190,4 +200,4 @@ onDestroy(() => {
</div>
</div>
</svelte:fragment>
</NavPage>
</FormPage>