mirror of
https://github.com/pelican-dev/panel.git
synced 2025-11-09 18:19: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}
|
{author}
|
||||||
{--description=}
|
{--description=}
|
||||||
{--url=}
|
{--url=}
|
||||||
|
{--updateUrl=}
|
||||||
{--panels=}
|
{--panels=}
|
||||||
{--category=}';
|
{--category=}';
|
||||||
|
|
||||||
@ -48,17 +49,18 @@ class CreatePluginCommand extends Command
|
|||||||
$this->info('Creating Plugin "' . $name . '" (' . $id . ') by ' . $author);
|
$this->info('Creating Plugin "' . $name . '" (' . $id . ') by ' . $author);
|
||||||
|
|
||||||
$description = $this->option('description') ?? $this->ask('Description');
|
$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', [
|
$category = $this->option('category') ?? $this->choice('Category', [
|
||||||
'plugin' => 'Plugin',
|
'plugin' => 'Plugin',
|
||||||
'theme' => 'Theme',
|
'theme' => 'Theme',
|
||||||
'language' => 'Language Pack',
|
'language' => 'Language Pack',
|
||||||
], 'plugin');
|
], '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
|
// Create base directory
|
||||||
$this->filesystem->makeDirectory(plugin_path($id));
|
$this->filesystem->makeDirectory(plugin_path($id));
|
||||||
@ -75,13 +77,13 @@ class CreatePluginCommand extends Command
|
|||||||
'author' => $author,
|
'author' => $author,
|
||||||
'version' => '1.0.0',
|
'version' => '1.0.0',
|
||||||
'description' => $description,
|
'description' => $description,
|
||||||
|
'category' => $category,
|
||||||
'url' => $url,
|
'url' => $url,
|
||||||
|
'update_url' => $updateUrl,
|
||||||
'namespace' => $namespace,
|
'namespace' => $namespace,
|
||||||
'class' => $class,
|
'class' => $class,
|
||||||
'panels' => !is_array($panels) ? explode(',', $panels) : $panels,
|
'panels' => !is_array($panels) ? explode(',', $panels) : $panels,
|
||||||
'panel_version' => config('app.version') === 'canary' ? null : config('app.version'),
|
'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));
|
], JSON_THROW_ON_ERROR | JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
|
||||||
|
|
||||||
// Create src directory and create main class
|
// Create src directory and create main class
|
||||||
|
|||||||
@ -16,13 +16,13 @@ use Sushi\Sushi;
|
|||||||
* @property string $author
|
* @property string $author
|
||||||
* @property string $version
|
* @property string $version
|
||||||
* @property string|null $description
|
* @property string|null $description
|
||||||
|
* @property string $category
|
||||||
* @property string|null $url
|
* @property string|null $url
|
||||||
|
* @property string|null $update_url
|
||||||
* @property string $namespace
|
* @property string $namespace
|
||||||
* @property string $class
|
* @property string $class
|
||||||
* @property string|null $panels
|
* @property string|null $panels
|
||||||
* @property string|null $panel_version
|
* @property string|null $panel_version
|
||||||
* @property string $category
|
|
||||||
* @property string|null $update_url
|
|
||||||
* @property PluginStatus $status
|
* @property PluginStatus $status
|
||||||
* @property string|null $status_message
|
* @property string|null $status_message
|
||||||
* @property int $load_order
|
* @property int $load_order
|
||||||
@ -48,13 +48,13 @@ class Plugin extends Model implements HasPluginSettings
|
|||||||
'author' => 'string',
|
'author' => 'string',
|
||||||
'version' => 'string',
|
'version' => 'string',
|
||||||
'description' => 'string',
|
'description' => 'string',
|
||||||
|
'category' => 'string',
|
||||||
'url' => 'string',
|
'url' => 'string',
|
||||||
|
'update_url' => 'string',
|
||||||
'namespace' => 'string',
|
'namespace' => 'string',
|
||||||
'class' => 'string',
|
'class' => 'string',
|
||||||
'panels' => 'string',
|
'panels' => 'string',
|
||||||
'panel_version' => 'string',
|
'panel_version' => 'string',
|
||||||
'category' => 'string',
|
|
||||||
'update_url' => 'string',
|
|
||||||
'status' => 'string',
|
'status' => 'string',
|
||||||
'status_message' => 'string',
|
'status_message' => 'string',
|
||||||
'load_order' => 'integer',
|
'load_order' => 'integer',
|
||||||
@ -68,13 +68,13 @@ class Plugin extends Model implements HasPluginSettings
|
|||||||
* author: string,
|
* author: string,
|
||||||
* version: string,
|
* version: string,
|
||||||
* description: string,
|
* description: string,
|
||||||
|
* category: string,
|
||||||
* url: string,
|
* url: string,
|
||||||
|
* update_url: string,
|
||||||
* namespace: string,
|
* namespace: string,
|
||||||
* class: string,
|
* class: string,
|
||||||
* panels: string,
|
* panels: string,
|
||||||
* panel_version: string,
|
* panel_version: string,
|
||||||
* category: string,
|
|
||||||
* update_url: string,
|
|
||||||
* status: string,
|
* status: string,
|
||||||
* status_message: string,
|
* status_message: string,
|
||||||
* load_order: int
|
* load_order: int
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user