diff --git a/app/Console/Commands/NexusUpdate.php b/app/Console/Commands/NexusUpdate.php index ced9247d..0c59603d 100644 --- a/app/Console/Commands/NexusUpdate.php +++ b/app/Console/Commands/NexusUpdate.php @@ -50,15 +50,7 @@ class NexusUpdate extends Command if ($includeComposer) { $includes[] = 'composer'; } - if ($tag !== null) { - if ($tag === 'dev') { - $url = "https://github.com/xiaomlove/nexusphp/archive/refs/heads/php8.zip"; - } else { - $url = "https://api.github.com/repos/xiaomlove/nexusphp/tarball/v$tag"; - } - $this->doLog("Specific tag: '$tag', download from '$url' and extra code, includes: " . implode(', ', $includes)); - $tmpPath = $this->update->downAndExtractCode($url, $includes); - } + //Step 1 $step = $this->update->currentStep(); $log = sprintf('Step %s, %s...', $step, $this->update->getStepName($step)); @@ -73,6 +65,28 @@ class NexusUpdate extends Command } $this->update->gotoStep(++$step); + //Download + if ($tag !== null) { + if ($tag === 'dev') { + $url = "https://github.com/xiaomlove/nexusphp/archive/refs/heads/php8.zip"; + } else { + $url = "https://api.github.com/repos/xiaomlove/nexusphp/tarball/v$tag"; + } + $this->doLog("Specific tag: '$tag', download from '$url' and extra code, includes: " . implode(', ', $includes)); + $tmpPath = $this->update->downAndExtractCode($url, $includes); + } + if ($includeComposer) { + $requireCommand = 'composer'; + if (!command_exists($requireCommand)) { + $this->doLog("Error: require $requireCommand"); + return 0; + } + $command = "composer install"; + $log = "Running $command ..."; + $this->doLog($log); + $this->update->executeCommand($command); + } + //Step 2 $log = sprintf('Step %s, %s, cli skip...', $step, $this->update->getStepName($step)); $this->doLog($log); diff --git a/app/Filament/Resources/System/SettingResource/Pages/EditSetting.php b/app/Filament/Resources/System/SettingResource/Pages/EditSetting.php index 0b6bcedb..79b49777 100644 --- a/app/Filament/Resources/System/SettingResource/Pages/EditSetting.php +++ b/app/Filament/Resources/System/SettingResource/Pages/EditSetting.php @@ -119,7 +119,6 @@ class EditSetting extends Page implements Forms\Contracts\HasForms ])->columns(2); $tabs = apply_filter('nexus_setting_tabs', $tabs); -// return $tabs; return $tabs; } diff --git a/nexus/Install/Update.php b/nexus/Install/Update.php index 05600a6f..3456cfb2 100644 --- a/nexus/Install/Update.php +++ b/nexus/Install/Update.php @@ -322,6 +322,10 @@ class Update extends Install public function downAndExtractCode($url, array $includes = []): string { + $requireCommand = 'rsync'; + if (!command_exists($requireCommand)) { + throw new \RuntimeException("command: $requireCommand not exists!"); + } $arr = explode('/', $url); $basename = last($arr); $isZip = false; diff --git a/public/ddlevelsfiles/ddlevelsmenu.js b/public/ddlevelsfiles/ddlevelsmenu.js index 18f4d6b4..c7658662 100644 --- a/public/ddlevelsfiles/ddlevelsmenu.js +++ b/public/ddlevelsfiles/ddlevelsmenu.js @@ -19,7 +19,7 @@ arrowpointers:{ }, hideinterval: 200, //delay in milliseconds before entire menu disappears onmouseout. effects: {enableswipe: true, enableslide: true, enablefade: true, duration: 200}, -httpsiframesrc: "blank.htm", //If menu is run on a secure (https) page, the IFRAME shim feature used by the script should point to an *blank* page *within* the secure area to prevent an IE security prompt. Specify full URL to that page on your server (leave as is if not applicable). +httpsiframesrc: "about:blank", //If menu is run on a secure (https) page, the IFRAME shim feature used by the script should point to an *blank* page *within* the secure area to prevent an IE security prompt. Specify full URL to that page on your server (leave as is if not applicable). ///No need to edit beyond here//////////////////// @@ -315,7 +315,7 @@ animatemobilesubmenu:function(targetul, beforeleft, afterleft){ targetul.style.left = beforeleft window.getComputedStyle(targetul).left // force layout reflow this.css(targetul, 'notransition', 'remove') - targetul.style.left = afterleft + targetul.style.left = afterleft }, @@ -323,7 +323,7 @@ togglemobilemenu:function(mainmenuid, xoffset, yoffset){ var toggler = document.getElementById(mainmenuid + '-mobiletoggle') var mobilemenu = document.getElementById(mainmenuid + '-mobile') if (mobilemenu){ - if (!ddlevelsmenu.css(mobilemenu, 'open', 'check')){ + if (!ddlevelsmenu.css(mobilemenu, 'open', 'check')){ ddlevelsmenu.css(mobilemenu, 'open', 'add') if (toggler) ddlevelsmenu.css(toggler, 'open', 'add') @@ -551,7 +551,7 @@ init:function(mainmenuid, dir, mobile){ }, "touchstart") this.addEvent(shelldiv, function(e){ // 3.03 code ddlevelsmenu.hidemenu(this) - }, "click") + }, "click") var arrowclass=(dir=="sidebar")? "rightarrowpointer" : "downarrowpointer" var arrowpointer=(dir=="sidebar")? this.arrowpointers.rightarrow : this.arrowpointers.downarrow if (this.arrowpointers.showarrow.toplevel) @@ -600,4 +600,4 @@ setup:function(mainmenuid, dir){ }) } -} \ No newline at end of file +}