mirror of
https://github.com/PhyreApps/PhyrePanel.git
synced 2024-11-21 23:20:24 +00:00
update
This commit is contained in:
parent
d8d95fe007
commit
3ba3f1e904
4 changed files with 28 additions and 10 deletions
|
@ -6,6 +6,7 @@ use App\ModulePostInstall;
|
|||
|
||||
class PostInstall extends ModulePostInstall
|
||||
{
|
||||
public $supportLog = true;
|
||||
public function run()
|
||||
{
|
||||
$installDockerShellFile = base_path('Modules/Docker/shell-scripts/install-docker.sh');
|
||||
|
|
|
@ -7,6 +7,7 @@ use Modules\Microweber\Filament\Clusters\Microweber\Pages\Version;
|
|||
|
||||
class PostInstall extends ModulePostInstall
|
||||
{
|
||||
public $supportLog = false;
|
||||
public function run()
|
||||
{
|
||||
$version = new Version();
|
||||
|
|
|
@ -100,21 +100,31 @@ class Modules extends Page
|
|||
try {
|
||||
$postInstall = app()->make('Modules\\' . $module . '\\PostInstall');
|
||||
if (method_exists($postInstall, 'run')) {
|
||||
|
||||
$postInstall->setLogFile($this->installLogFilePath);
|
||||
|
||||
if ($postInstall->isSupportLog()) {
|
||||
$postInstall->setLogFile($this->installLogFilePath);
|
||||
}
|
||||
|
||||
$postInstall->run();
|
||||
|
||||
$this->dispatch('open-modal', id: 'install-module-modal', props: ['module' => $module]);
|
||||
if ($postInstall->isSupportLog()) {
|
||||
$this->dispatch('open-modal', id: 'install-module-modal', props: ['module' => $module]);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
} catch(\Exception $e) {
|
||||
$newModule = new Module();
|
||||
$newModule->name = $module;
|
||||
$newModule->namespace = 'Modules\\' . $module;
|
||||
$newModule->installed = 1;
|
||||
$newModule->save();
|
||||
|
||||
$this->installLogPulling = false;
|
||||
// dd($e->getMessage());
|
||||
}
|
||||
|
||||
$newModule = new Module();
|
||||
$newModule->name = $module;
|
||||
$newModule->namespace = 'Modules\\' . $module;
|
||||
$newModule->installed = 1;
|
||||
$newModule->save();
|
||||
|
||||
$this->installLogPulling = false;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,6 +4,12 @@ namespace App;
|
|||
|
||||
abstract class ModulePostInstall
|
||||
{
|
||||
public $supportLog = false;
|
||||
|
||||
public function isSupportLog()
|
||||
{
|
||||
return $this->supportLog;
|
||||
}
|
||||
public function setLogFile($logFile)
|
||||
{
|
||||
$this->logFile = $logFile;
|
||||
|
|
Loading…
Reference in a new issue