Skip to content

Commit

Permalink
[gh-4] menu
Browse files Browse the repository at this point in the history
  • Loading branch information
youyingxiang committed May 17, 2023
1 parent 6d34561 commit 774f92c
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 43 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/public/storage
/storage/*.key
/vendor
/deploy.php
/dcat-admin
.env
.env.backup
Expand Down
37 changes: 16 additions & 21 deletions deploy.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
require 'recipe/laravel.php';

// Project name
set('application', 'hzerp');
set('application', 'discover');

// Project repository
set('repository', 'git@gitee.com:yxx2017/hzerp.git');
set('repository', 'https://github.com/youyingxiang/Discover.git');

// [Optional] Allocate tty for git clone. Default value is false.
set('git_tty', false);

//set('default_stage', 'master');
set('default_stage', 'main');

// Shared files/dirs between deploys
add('shared_files', []);
Expand All @@ -40,31 +40,19 @@
set('keep_releases', 5);
set('default_stage', 'dev');


host('dev')
->stage('dev')
->hostname('118.178.125.242')
->hostname('159.75.97.226')
->user('deployer')
// 并指定公钥的位置
->identityFile('~/.ssh/deployerkey')
->set('branch', 'master')
->set('http_user', 'nginx')
->forwardAgent(true)
->multiplexing(true)
// 指定项目部署到服务器上的哪个目录
->set('deploy_path', '/data/wwwroot/erp');

host('yxx')
->stage('yxx')
->hostname('47.106.87.22')
->user('deployer')
// 并指定公钥的位置
->identityFile('~/.ssh/deployerkey')
->set('branch', 'master')
->set('branch', 'main')
->set('http_user', 'www-data')
->forwardAgent(true)
->multiplexing(true)
// 指定项目部署到服务器上的哪个目录
->set('deploy_path', '/data/wwwroot/erp');
->set('deploy_path', '/data/wwwroot/discover');

task('artisan:cache:clear', function () {
return true;
Expand All @@ -78,15 +66,22 @@
task('artisan:view:cache', function () {
return true;
});

set('bin/php', function () {
return '/usr/bin/php7.2';
});
set('bin/composer', function () {
return '/usr/bin/php7.2 /usr/local/bin/composer7';
});
task('opcache:reload', function () {
cd('{{release_path}}');
// run('{{bin/php}} artisan optimize && {{bin/composer}} dump-autoload --optimize && {{bin/php}} artisan config:clear');
run('{{bin/php}} artisan optimize && {{bin/composer}} dump-autoload --optimize && {{bin/php}} artisan migrate && {{bin/php}} artisan db:seed --class=InitSeeder');
run('{{bin/php}} artisan optimize && {{bin/composer}} dump-autoload --optimize');
$ret = (int) run('ps -ef |grep -w laravels|grep -v grep|wc -l');
if ($ret > 0) {
run('sudo {{bin/php}} bin/laravels restart -d 1>/dev/null');
} else {
run('sudo /usr/sbin/service php7.4-fpm reload');
run('sudo /usr/sbin/service php7.2-fpm reload');
}
});
// Tasks
Expand Down
42 changes: 20 additions & 22 deletions resources/views/vendor/laravel-admin/partials/menu.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,27 @@
</a>
</li>
@else
@if($item['id'] !== 2)
@php
$active = $builder->isActive($item);
@endphp
@php
$active = $builder->isActive($item);
@endphp

<li class="nav-item has-treeview {{ $active ? 'menu-open' : '' }}">
<a href="#" class="nav-link">
{!! str_repeat('&nbsp;', $layer) !!}<i class="fa {{ $item['icon'] ?: 'feather icon-circle' }}"></i>
<p>
{{ $builder->translate($item['title']) }}
<i class="right fa fa-angle-left"></i>
</p>
</a>
<ul class="nav nav-treeview">
@foreach($item['children'] as $item)
@php
$item['layer'] = $layer + 1;
@endphp
<li class="nav-item has-treeview {{ $active ? 'menu-open' : '' }}">
<a href="#" class="nav-link">
{!! str_repeat('&nbsp;', $layer) !!}<i class="fa {{ $item['icon'] ?: 'feather icon-circle' }}"></i>
<p>
{{ $builder->translate($item['title']) }}
<i class="right fa fa-angle-left"></i>
</p>
</a>
<ul class="nav nav-treeview">
@foreach($item['children'] as $item)
@php
$item['layer'] = $layer + 1;
@endphp

@include('admin::partials.menu', $item)
@endforeach
</ul>
</li>
@endif
@include('admin::partials.menu', $item)
@endforeach
</ul>
</li>
@endif
@endif

0 comments on commit 774f92c

Please sign in to comment.