|
|
|
@ -23,6 +23,7 @@ |
|
|
|
import ConfirmDialog from "components/common/ConfirmDialog.svelte" |
|
|
|
import AppCard from "components/start/AppCard.svelte" |
|
|
|
import AppRow from "components/start/AppRow.svelte" |
|
|
|
import { AppStatus } from "constants" |
|
|
|
|
|
|
|
let layout = "grid" |
|
|
|
let appStatus = "deployed" |
|
|
|
@ -60,7 +61,11 @@ |
|
|
|
} |
|
|
|
|
|
|
|
const openApp = app => { |
|
|
|
$goto(`../../app/${app._id}`) |
|
|
|
if (appStatus === AppStatus.DEV) { |
|
|
|
$goto(`../../app/${app._id}`) |
|
|
|
} else { |
|
|
|
window.open(`/${app._id}`, '_blank'); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const exportApp = app => { |
|
|
|
@ -91,6 +96,19 @@ |
|
|
|
appToDelete = null |
|
|
|
} |
|
|
|
|
|
|
|
const releaseLock = async appId => { |
|
|
|
try { |
|
|
|
const response = await del(`/api/dev/${appId}/lock`) |
|
|
|
const json = await response.json() |
|
|
|
if (json.status !== 200) throw json.message |
|
|
|
|
|
|
|
notifications.success("Lock released") |
|
|
|
await apps.load(appStatus) |
|
|
|
} catch (err) { |
|
|
|
notifications.error(`Error releasing lock: ${err}`) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
onMount(async () => { |
|
|
|
checkKeys() |
|
|
|
await apps.load(appStatus) |
|
|
|
@ -99,41 +117,6 @@ |
|
|
|
</script> |
|
|
|
|
|
|
|
<Page wide> |
|
|
|
<<<<<<< HEAD |
|
|
|
{#if $apps.length} |
|
|
|
<Layout noPadding> |
|
|
|
<div class="title"> |
|
|
|
<Heading>Apps</Heading> |
|
|
|
<ButtonGroup> |
|
|
|
<Button secondary on:click={initiateAppImport}>Import app</Button> |
|
|
|
<Button cta on:click={initiateAppCreation}>Create new app</Button> |
|
|
|
</ButtonGroup> |
|
|
|
</div> |
|
|
|
<div class="filter"> |
|
|
|
<div class="select"> |
|
|
|
<Select |
|
|
|
bind:value={appStatus} |
|
|
|
options={[ |
|
|
|
{ label: "Deployed", value: "deployed" }, |
|
|
|
{ label: "In Development", value: "dev" }, |
|
|
|
]} |
|
|
|
/> |
|
|
|
</div> |
|
|
|
<ActionGroup> |
|
|
|
<ActionButton |
|
|
|
on:click={() => (layout = "grid")} |
|
|
|
selected={layout === "grid"} |
|
|
|
quiet |
|
|
|
icon="ClassicGridView" |
|
|
|
/> |
|
|
|
<ActionButton |
|
|
|
on:click={() => (layout = "table")} |
|
|
|
selected={layout === "table"} |
|
|
|
quiet |
|
|
|
icon="ViewRow" |
|
|
|
/> |
|
|
|
</ActionGroup> |
|
|
|
======= |
|
|
|
<Layout noPadding> |
|
|
|
<div class="title"> |
|
|
|
<Heading>Apps</Heading> |
|
|
|
@ -151,7 +134,6 @@ |
|
|
|
{ label: "In Development", value: "dev" }, |
|
|
|
]} |
|
|
|
/> |
|
|
|
>>>>>>> c3e1b1d30235b8945424cf59a41e112f92942dc6 |
|
|
|
</div> |
|
|
|
<ActionGroup> |
|
|
|
<ActionButton |
|
|
|
@ -176,7 +158,7 @@ |
|
|
|
{#each $apps as app, idx (app._id)} |
|
|
|
<svelte:component |
|
|
|
this={layout === "grid" ? AppCard : AppRow} |
|
|
|
{appStatus} |
|
|
|
{releaseLock} |
|
|
|
{app} |
|
|
|
{openApp} |
|
|
|
{exportApp} |
|
|
|
|