fixes and stuff
This commit is contained in:
+110
-110
File diff suppressed because one or more lines are too long
Vendored
+1
File diff suppressed because one or more lines are too long
Vendored
-1
File diff suppressed because one or more lines are too long
Vendored
+2
-2
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"main.js": {
|
||||
"file": "assets/main-D9joEh0I.js",
|
||||
"file": "assets/main-BC8xx0YD.js",
|
||||
"name": "main",
|
||||
"src": "main.js",
|
||||
"isEntry": true,
|
||||
"css": [
|
||||
"assets/main-BnJW41Dx.css"
|
||||
"assets/main-BH4PSFwy.css"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -83,7 +83,11 @@
|
||||
{#if record._file?.path}
|
||||
<div class="file-table-row">
|
||||
<Preview record={record} size={record._file?.width > 0 ? "medium" : "small"}/>
|
||||
|
||||
<div>
|
||||
{#if record.status === "draft"}
|
||||
<span style="text-transform: uppercase;font-size:10px">{record.status}</span>
|
||||
{/if}
|
||||
<a
|
||||
href="{channel.lucentUrl}/records/{record.id}"
|
||||
target={inModal ? "_blank" : "_self"}
|
||||
@@ -109,6 +113,9 @@
|
||||
href="{channel.lucentUrl}/records/{record.id}"
|
||||
target={inModal ? "_blank" : "_self"}
|
||||
>
|
||||
{#if record.status === "draft"}
|
||||
<span style="text-transform: uppercase;font-size:10px">{record.status}</span>
|
||||
{/if}
|
||||
{previewTitle(channel.schemas, record, graph)}
|
||||
</a>
|
||||
{/if}
|
||||
|
||||
@@ -16,6 +16,15 @@ class SetupDatabase extends Command
|
||||
|
||||
public function handle()
|
||||
{
|
||||
|
||||
$dbConnection = config("lucent.database");
|
||||
$databasePath = config("database.connections.$dbConnection.database");
|
||||
|
||||
if(file_exists($databasePath)){
|
||||
$this->error("Database already exists.");
|
||||
return 0;
|
||||
}
|
||||
touch($databasePath);
|
||||
$this->tableUsers();
|
||||
$this->tableRecords();
|
||||
$this->tableRevisions();
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
return [
|
||||
"env" => env("LUCENT_ENV", "production"),
|
||||
"schemas_path" => env("LUCENT_SCHEMAS_PATH", "app/Lucent"),
|
||||
"schemas_path" => env("LUCENT_SCHEMAS_PATH", "resources/lucent/schemas"),
|
||||
"database" => env('LUCENT_DB_CONNECTION', env('DB_CONNECTION', "sqlite")),
|
||||
"name" => env("LUCENT_NAME", "Lucent"),
|
||||
"url" => env("LUCENT_URL", env('APP_URL')),
|
||||
|
||||
@@ -9,6 +9,7 @@ class Database
|
||||
{
|
||||
public static function make(): Connection{
|
||||
$dbConnection = config("lucent.database");
|
||||
|
||||
return DB::connection($dbConnection);
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,6 @@ class FileController extends Controller
|
||||
$validator = Validator::make($request->all(), [
|
||||
'files.*' => 'required|file|max:100000',
|
||||
]);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return fail($validator->errors()->first());
|
||||
}
|
||||
|
||||
@@ -17,7 +17,9 @@ class DatabaseSetupStep implements IStep
|
||||
|
||||
$databaseConnectionName = config("lucent.database");
|
||||
|
||||
|
||||
$databaseConfig = config('database.connections.'.$databaseConnectionName);
|
||||
|
||||
if (empty($databaseConfig)) {
|
||||
$instructions = <<<EOD
|
||||
# You need to setup a database connection for $databaseConnectionName in database.php config. You can choose either sqlite or pgsql
|
||||
@@ -35,6 +37,14 @@ EOD;
|
||||
return SetupStep::makeFail($name, $instructions);
|
||||
}
|
||||
|
||||
|
||||
if(!in_array($driver = $databaseConfig["driver"],["sqlite","pgsql"])){
|
||||
$instructions = <<<EOD
|
||||
You can choose either sqlite or pgsql. You current config is: $driver
|
||||
EOD;
|
||||
return SetupStep::makeFail($name, $instructions);
|
||||
}
|
||||
|
||||
try {
|
||||
Database::make()->table("records")->get();
|
||||
} catch (QueryException $e) {
|
||||
|
||||
Reference in New Issue
Block a user