mirror of
https://github.com/pelican-dev/panel.git
synced 2025-11-08 10:39:27 +01:00
add command option for update_url and move some stuff around in the json
This commit is contained in:
parent
7ac298ffd5
commit
2ee4df8139
@ -13,6 +13,7 @@ class CreatePluginCommand extends Command
|
||||
{author}
|
||||
{--description=}
|
||||
{--url=}
|
||||
{--updateUrl=}
|
||||
{--panels=}
|
||||
{--category=}';
|
||||
|
||||
@ -48,17 +49,18 @@ class CreatePluginCommand extends Command
|
||||
$this->info('Creating Plugin "' . $name . '" (' . $id . ') by ' . $author);
|
||||
|
||||
$description = $this->option('description') ?? $this->ask('Description');
|
||||
$url = $this->option('url') ?? $this->ask('URL', 'https://github.com/' . $author . '/' . $id);
|
||||
$panels = $this->option('panels') ?? $this->choice('Panels', [
|
||||
'admin' => 'Admin Area',
|
||||
'server' => 'Client Area',
|
||||
'app' => 'Server List',
|
||||
], 'admin,server', multiple: true);
|
||||
$category = $this->option('category') ?? $this->choice('Category', [
|
||||
'plugin' => 'Plugin',
|
||||
'theme' => 'Theme',
|
||||
'language' => 'Language Pack',
|
||||
], 'plugin');
|
||||
$url = $this->option('url') ?? $this->ask('URL', 'https://github.com/' . $author . '/' . $id);
|
||||
$updateUrl = $this->option('updateUrl') ?? $this->ask('Update URL', 'https://raw.githubusercontent.com/' . $author . '/' . $id . '/refs/heads/main/update.json');
|
||||
$panels = $this->option('panels') ?? $this->choice('Panels', [
|
||||
'admin' => 'Admin Area',
|
||||
'server' => 'Client Area',
|
||||
'app' => 'Server List',
|
||||
], 'admin,server', multiple: true);
|
||||
|
||||
// Create base directory
|
||||
$this->filesystem->makeDirectory(plugin_path($id));
|
||||
@ -75,13 +77,13 @@ class CreatePluginCommand extends Command
|
||||
'author' => $author,
|
||||
'version' => '1.0.0',
|
||||
'description' => $description,
|
||||
'category' => $category,
|
||||
'url' => $url,
|
||||
'update_url' => $updateUrl,
|
||||
'namespace' => $namespace,
|
||||
'class' => $class,
|
||||
'panels' => !is_array($panels) ? explode(',', $panels) : $panels,
|
||||
'panel_version' => config('app.version') === 'canary' ? null : config('app.version'),
|
||||
'category' => $category,
|
||||
'update_url' => null,
|
||||
], JSON_THROW_ON_ERROR | JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
|
||||
|
||||
// Create src directory and create main class
|
||||
|
||||
@ -16,13 +16,13 @@ use Sushi\Sushi;
|
||||
* @property string $author
|
||||
* @property string $version
|
||||
* @property string|null $description
|
||||
* @property string $category
|
||||
* @property string|null $url
|
||||
* @property string|null $update_url
|
||||
* @property string $namespace
|
||||
* @property string $class
|
||||
* @property string|null $panels
|
||||
* @property string|null $panel_version
|
||||
* @property string $category
|
||||
* @property string|null $update_url
|
||||
* @property PluginStatus $status
|
||||
* @property string|null $status_message
|
||||
* @property int $load_order
|
||||
@ -48,13 +48,13 @@ class Plugin extends Model implements HasPluginSettings
|
||||
'author' => 'string',
|
||||
'version' => 'string',
|
||||
'description' => 'string',
|
||||
'category' => 'string',
|
||||
'url' => 'string',
|
||||
'update_url' => 'string',
|
||||
'namespace' => 'string',
|
||||
'class' => 'string',
|
||||
'panels' => 'string',
|
||||
'panel_version' => 'string',
|
||||
'category' => 'string',
|
||||
'update_url' => 'string',
|
||||
'status' => 'string',
|
||||
'status_message' => 'string',
|
||||
'load_order' => 'integer',
|
||||
@ -68,13 +68,13 @@ class Plugin extends Model implements HasPluginSettings
|
||||
* author: string,
|
||||
* version: string,
|
||||
* description: string,
|
||||
* category: string,
|
||||
* url: string,
|
||||
* update_url: string,
|
||||
* namespace: string,
|
||||
* class: string,
|
||||
* panels: string,
|
||||
* panel_version: string,
|
||||
* category: string,
|
||||
* update_url: string,
|
||||
* status: string,
|
||||
* status_message: string,
|
||||
* load_order: int
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user