fixes
This commit is contained in:
@@ -0,0 +1 @@
|
||||
LUCENT_AUTH=lucent // or lunar
|
||||
@@ -39,10 +39,6 @@
|
||||
dispatch("uploadComplete", data);
|
||||
}
|
||||
isLoading = false;
|
||||
})
|
||||
.catch((error) => {
|
||||
isLoading = false;
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -8,8 +8,9 @@
|
||||
</script>
|
||||
|
||||
<div class="top-nav">
|
||||
<a class="top-nav-item" href="{channel.lucentUrl}/members">Members</a>
|
||||
|
||||
{#if channel.auth == "lucent"}
|
||||
<a class="top-nav-item" href="{channel.lucentUrl}/members">Members</a>
|
||||
{/if}
|
||||
{#if channel.commands.length > 0}
|
||||
<Dropdown>
|
||||
<div slot="button">Actions</div>
|
||||
@@ -27,7 +28,11 @@
|
||||
<!-- class="form-control" required/>-->
|
||||
<!-- </form>-->
|
||||
<!-- </div>-->
|
||||
<a href="{channel.lucentUrl}/profile">
|
||||
{#if channel.auth == "lucent"}
|
||||
<a href="{channel.lucentUrl}/profile">
|
||||
<Avatar side="28" name={user.name} />
|
||||
</a>
|
||||
{:else}
|
||||
<Avatar side="28" name={user.name} />
|
||||
</a>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
@@ -1,39 +1,21 @@
|
||||
<script>
|
||||
import NavbarMenu from "./NavbarMenu.svelte";
|
||||
import {getContext} from "svelte";
|
||||
import { getContext } from "svelte";
|
||||
|
||||
export let schema;
|
||||
const channel = getContext("channel");
|
||||
const readableSchemas = getContext("readableSchemas");
|
||||
|
||||
const fileSchemas = readableSchemas.filter((sc) => sc.type === "files");
|
||||
const otherSchemas = readableSchemas.filter((sc) => !sc.isEntry && sc.type === "collection");
|
||||
|
||||
</script>
|
||||
|
||||
<div class="sidebar-top">
|
||||
<a class="logo" href="{channel.lucentUrl}">{channel.name}</a>
|
||||
<a class="nav-item" href="{channel.lucentUrl}/profile">
|
||||
</a>
|
||||
<a class="logo" href={channel.lucentUrl}>{channel.name}</a>
|
||||
<a class="nav-item" href="{channel.lucentUrl}/profile"> </a>
|
||||
</div>
|
||||
<div class="sidebar">
|
||||
|
||||
|
||||
<NavbarMenu
|
||||
title="Content"
|
||||
schemas={ readableSchemas.filter((sc) => sc.isEntry)}
|
||||
schema={schema}
|
||||
expanded={true}
|
||||
/>
|
||||
|
||||
<NavbarMenu
|
||||
title="Files"
|
||||
schemas={ fileSchemas}
|
||||
schema={schema}
|
||||
/>
|
||||
|
||||
<NavbarMenu
|
||||
title="Other"
|
||||
schemas={ otherSchemas}
|
||||
schema={schema}
|
||||
title="Content"
|
||||
schemas={readableSchemas.filter((sc) => sc.isEntry)}
|
||||
{schema}
|
||||
expanded={true}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
}
|
||||
|
||||
function uploadComplete(e) {
|
||||
records = e.detail;
|
||||
// value = [...value, e.detail];
|
||||
}
|
||||
|
||||
function openBrowseModal(e) {
|
||||
|
||||
@@ -4,7 +4,8 @@ namespace Lucent\Channel;
|
||||
|
||||
use Lucent\Channel\Data\UserCommand;
|
||||
use Lucent\Primitive\Collection;
|
||||
use Lucent\Schema\Schema;
|
||||
use Lucent\Data\Schema;
|
||||
use Lucent\Data\ChannelAuth;
|
||||
|
||||
final class Channel
|
||||
{
|
||||
@@ -18,6 +19,7 @@ final class Channel
|
||||
*/
|
||||
function __construct(
|
||||
public string $name,
|
||||
public ChannelAuth $auth,
|
||||
public string $url,
|
||||
public string $previewTarget,
|
||||
public Collection $commands,
|
||||
@@ -27,7 +29,6 @@ final class Channel
|
||||
) {
|
||||
$this->lucentUrl = $url . "/lucent";
|
||||
$this->filesUrl = $this->makeFilesUrl();
|
||||
|
||||
$this->previewTargetUrl = $url . "/" . $previewTarget;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace Lucent\Channel;
|
||||
|
||||
use Lucent\Channel\Data\UserCommand;
|
||||
use Lucent\Data\ChannelAuth;
|
||||
use Lucent\Primitive\Collection;
|
||||
use Lucent\Data\Schema;
|
||||
use Lucent\Schema\SchemaService;
|
||||
@@ -34,6 +35,10 @@ final class ChannelService
|
||||
|
||||
$channel = new Channel(
|
||||
name: config("lucent.name") ?? "",
|
||||
auth: match (config("lucent.auth")) {
|
||||
"lunar" => ChannelAuth::LUNAR,
|
||||
default => ChannelAuth::LUCENT,
|
||||
},
|
||||
url: rtrim(config("lucent.url") ?? "", "/"),
|
||||
previewTarget: rtrim(config("lucent.previewTarget") ?? "", "/"),
|
||||
commands: Collection::make($userCommands),
|
||||
|
||||
+5
-4
@@ -2,10 +2,11 @@
|
||||
|
||||
return [
|
||||
"env" => env("LUCENT_ENV", "production"),
|
||||
"auth" => env("LUCENT_AUTH", "lucent"),
|
||||
"schemas_path" => env("LUCENT_SCHEMAS_PATH", "resources/lucent/schemas"),
|
||||
"database" => env('LUCENT_DB_CONNECTION', env('DB_CONNECTION', "sqlite")),
|
||||
"database" => env("LUCENT_DB_CONNECTION", env("DB_CONNECTION", "sqlite")),
|
||||
"name" => env("LUCENT_NAME", "Lucent"),
|
||||
"url" => env("LUCENT_URL", env('APP_URL')),
|
||||
"url" => env("LUCENT_URL", env("APP_URL")),
|
||||
"previewTarget" => env("LUCENT_PREVIEW_TARGET", "previewTarget"),
|
||||
/*
|
||||
* Make available laravel artisan commands for admin users
|
||||
@@ -44,6 +45,6 @@ return [
|
||||
\Lucent\Schema\Ui\Rich::class,
|
||||
\Lucent\Schema\Ui\Slug::class,
|
||||
\Lucent\Schema\Ui\Text::class,
|
||||
\Lucent\Schema\Ui\Textarea::class
|
||||
]
|
||||
\Lucent\Schema\Ui\Textarea::class,
|
||||
],
|
||||
];
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Lucent\Data;
|
||||
|
||||
enum ChannelAuth: string
|
||||
{
|
||||
case LUNAR = "lunar";
|
||||
case LUCENT = "lucent";
|
||||
}
|
||||
@@ -10,16 +10,16 @@ use Intervention\Image\ImageManager;
|
||||
use Lucent\Account\AuthService;
|
||||
use Lucent\Account\AuthServiceLunar;
|
||||
use Lucent\Account\UserRepo;
|
||||
use Lucent\Account\UserRepoLucent;
|
||||
use Lucent\Account\UserRepoLunar;
|
||||
use Lucent\Channel\ChannelService;
|
||||
use Lucent\Commands\CompileSchemas;
|
||||
use Lucent\Commands\GenerateCollectionSchema;
|
||||
use Lucent\Commands\GenerateFileSchema;
|
||||
use Lucent\Commands\LiveLink;
|
||||
use Lucent\Commands\RebuildThumbnails;
|
||||
use Lucent\Commands\RemoveOrphanEdges;
|
||||
use Lucent\Commands\SetupDatabase;
|
||||
use Lucent\Commands\UpgradeFiles122;
|
||||
use Lucent\Data\ChannelAuth;
|
||||
use Lucent\File\FileService;
|
||||
use Lucent\Query\DatabaseGraph\DatabaseGraph;
|
||||
use Lucent\Query\DatabaseGraph\PgsqlDatabaseGraph;
|
||||
@@ -43,8 +43,11 @@ class LucentServiceProvider extends ServiceProvider
|
||||
return new PgsqlDatabaseGraph();
|
||||
});
|
||||
|
||||
$this->app->bind(UserRepo::class, function () {
|
||||
return new UserRepoLunar();
|
||||
$this->app->bind(UserRepo::class, function ($app) {
|
||||
return match ($app->make(ChannelService::class)->channel->auth) {
|
||||
ChannelAuth::LUNAR => new UserRepoLunar(),
|
||||
ChannelAuth::LUCENT => new UserRepoLucent(),
|
||||
};
|
||||
});
|
||||
|
||||
$this->app->bind(AuthService::class, function ($app) {
|
||||
|
||||
Reference in New Issue
Block a user