Setup the UI for marketplace Hostname & Proxying

This commit is contained in:
MotorTruck1221 2024-10-18 04:29:36 -06:00
parent ab37a135af
commit b4e4252d5c
No known key found for this signature in database
GPG key ID: 08F417E2B8B61EA4
2 changed files with 47 additions and 0 deletions

View file

@ -2,6 +2,7 @@
"name": "nebula-astro", "name": "nebula-astro",
"type": "module", "type": "module",
"version": "9.0.0", "version": "9.0.0",
"private": true,
"scripts": { "scripts": {
"dev": "concurrently \"astro dev\" \"tsx --watch server/server.ts\"", "dev": "concurrently \"astro dev\" \"tsx --watch server/server.ts\"",
"start": "node server/server.js", "start": "node server/server.js",

View file

@ -7,6 +7,7 @@ import SettingsLayout from "@layouts/SettingsLayout.astro";
import SettingsSection from "@layouts/SettingsSection.astro"; import SettingsSection from "@layouts/SettingsSection.astro";
import { getLangFromUrl, useTranslations } from "../../../i18n/utils"; import { getLangFromUrl, useTranslations } from "../../../i18n/utils";
const origin = Astro.url.origin;
const lang = getLangFromUrl(Astro.url); const lang = getLangFromUrl(Astro.url);
const t = useTranslations(lang); const t = useTranslations(lang);
export function getStaticPaths() { export function getStaticPaths() {
@ -34,8 +35,53 @@ export const prerender = true;
] ]
}} }}
/> />
<SettingsCard
title="Proxy Catalog"
description="Whether or not to proxy the Catalog"
input={{input: false}}
button={{name: 'Set', id: 'setmp' }}
select={{
select: true,
name: 'mp',
options: [
{name: 'False', value: 'false', disabled: false},
{name: 'True', value: 'true', disabled: false}
]
}}
/>
<SettingsCard
title="Catalog URL"
description="Change which marketplace your using"
input={{
input: true,
required: true,
placeholder: `${origin}/api/catalog-assets`
}}
button={{name: 'Change', id: 'setcataloghostname' }}
select={{select: false}}
/>
</SettingsSection> </SettingsSection>
</SettingsLayout> </SettingsLayout>
<ToastWrapper client:load>
<Toast toastProp={{
toastType: 'success',
text: 'Catalog is now proxied',
class: 'mpMessage'
}}
client:load />
<Toast toastProp={{
toastType: 'success',
text: 'Catalog URL set!',
class: 'cataloghostnameSuccess'
}}
client:load />
<Toast toastProp={{
toastType: 'error',
text: "Catalog doesn't exist!",
class: 'cataloghosnameError'
}}
client:load/>
</ToastWrapper>
<script> <script>
import { toast } from "@utils/toast.ts"; import { toast } from "@utils/toast.ts";
import { settings, Settings as SettingsEnum } from "@utils/settings/index"; import { settings, Settings as SettingsEnum } from "@utils/settings/index";