diff --git a/config/jfadmin.php b/config/jfadmin.php
index 3c48f4d..cf9bd25 100755
--- a/config/jfadmin.php
+++ b/config/jfadmin.php
@@ -35,4 +35,9 @@
'middleware' => ['web', 'jfadmin'],
'domain' => env('JFA_ROUTE_DOMAIN'),
],
+
+ 'view' => [
+ 'directory' => resource_path('views/jfadmin'),
+ 'namespace' => 'jfadmin',
+ ],
];
diff --git a/resources/assets/jfadmin/jfadmin.css b/resources/assets/jfadmin/jfadmin.css
index f7ee9e7..e959462 100755
--- a/resources/assets/jfadmin/jfadmin.css
+++ b/resources/assets/jfadmin/jfadmin.css
@@ -1,23 +1,3 @@
-#side-menu .fa {
- width: 13px;
-}
-
-.wrapper-content {
- padding: 5px 0;
-}
-
-.p-l-n {
- padding-left: 0;
-}
-
-.p-l-m {
- padding-left: 20px;
-}
-
-.p-r-n {
- padding-right: 0;
-}
-
.golden-table thead th {
white-space: nowrap;
}
@@ -30,8 +10,8 @@
}
.golden-table tbody tr td.td-break {
- overflow: inherit;
- text-overflow: inherit;
+ /*overflow: inherit;*/
+ /*text-overflow: inherit;*/
white-space: inherit;
word-wrap: break-word;
word-break: break-all;
diff --git a/resources/assets/jfadmin/jfadmin.js b/resources/assets/jfadmin/jfadmin.js
old mode 100755
new mode 100644
diff --git a/resources/assets/jfadmin/plugins/sweetalert2/dist/sweetalert2.all.min.js b/resources/assets/jfadmin/plugins/sweetalert2/dist/sweetalert2.all.min.js
old mode 100755
new mode 100644
diff --git a/resources/views/home/index.blade.php b/resources/views/home/index.blade.php
deleted file mode 100755
index d774a75..0000000
--- a/resources/views/home/index.blade.php
+++ /dev/null
@@ -1,8 +0,0 @@
-@extends('jfadmin::layouts.base')
-
-@section('title', '首页')
-
-@section('content')
-
-
-@endsection
diff --git a/src/Console/InstallCommand.php b/src/Console/InstallCommand.php
index 9cf2f7c..6437312 100755
--- a/src/Console/InstallCommand.php
+++ b/src/Console/InstallCommand.php
@@ -63,16 +63,27 @@ protected function initDatabase()
protected function initDirectory()
{
$directory = config('jfadmin.directory');
+ $view_directory = config('jfadmin.view.directory');
$this->makeDir($directory);
$this->makeDir("{$directory}/Controllers");
+ $this->makeDir("{$view_directory}/home");
+
+ $this->makeDir("{$view_directory}/layouts");
+
$this->createFile("{$directory}/routes.php", 'routes');
$this->createFile("{$directory}/Controllers/HomeController.php", 'HomeController', function ($content) {
return str_replace('DummyNamespace', config('jfadmin.route.namespace'), $content);
});
+
+ $this->createFile("{$view_directory}/layouts/base.blade.php", 'base.blade');
+
+ $this->createFile("{$view_directory}/layouts/pagination.blade.php", 'pagination.blade');
+
+ $this->createFile("{$view_directory}/home/index.blade.php", 'index.blade');
}
protected function makeDir($path = '')
@@ -93,7 +104,7 @@ protected function createFile($path, $stub, $callback = null)
$file = str_replace(base_path(), '', $path);
if (file_exists($path)) {
$this->comment("file \"{$file}\" already init");
- // return false;
+ return false;
}
$file_content = $this->getStub($stub);
diff --git a/src/Console/UninstallCommand.php b/src/Console/UninstallCommand.php
index a2feb80..3a788df 100755
--- a/src/Console/UninstallCommand.php
+++ b/src/Console/UninstallCommand.php
@@ -52,6 +52,8 @@ public function handle()
$this->delDir(public_path('vendor/jfadmin'));
+ $this->delDir(config('jfadmin.view.directory'));
+
$this->info('uninstall successfully');
}
diff --git a/src/Console/stubs/HomeController.stub b/src/Console/stubs/HomeController.stub
index dd455f0..d860516 100755
--- a/src/Console/stubs/HomeController.stub
+++ b/src/Console/stubs/HomeController.stub
@@ -1,6 +1,6 @@
'PHP version', 'value' => PHP_VERSION],
+ ['name' => 'Laravel version', 'value' => app()->version()],
+ ['name' => 'CGI', 'value' => php_sapi_name()],
+ ['name' => 'Uname', 'value' => php_uname()],
+ ['name' => 'Server', 'value' => array_get($_SERVER, 'SERVER_SOFTWARE')],
+
+ ['name' => 'Cache driver', 'value' => config('cache.default')],
+ ['name' => 'Session driver', 'value' => config('session.driver')],
+ ['name' => 'Queue driver', 'value' => config('queue.default')],
+
+ ['name' => 'Timezone', 'value' => config('app.timezone')],
+ ['name' => 'Locale', 'value' => config('app.locale')],
+ ['name' => 'Env', 'value' => config('app.env')],
+ ['name' => 'URL', 'value' => config('app.url')],
+ ];
+ $json = file_get_contents(base_path('composer.json'));
+ $dependencies = json_decode($json, true)['require'];
$nav_id = 'home.index';
- return view('jfadmin::home.index', compact('nav_id'));
+ return view('jfadmin::home.index', compact('envs', 'dependencies', 'nav_id'));
}
}
diff --git a/resources/views/layouts/base.blade.php b/src/Console/stubs/base.blade.stub
similarity index 98%
rename from resources/views/layouts/base.blade.php
rename to src/Console/stubs/base.blade.stub
index b3603ef..527b7f5 100755
--- a/resources/views/layouts/base.blade.php
+++ b/src/Console/stubs/base.blade.stub
@@ -119,7 +119,7 @@
@yield('content')
diff --git a/src/Console/stubs/index.blade.stub b/src/Console/stubs/index.blade.stub
new file mode 100755
index 0000000..8840784
--- /dev/null
+++ b/src/Console/stubs/index.blade.stub
@@ -0,0 +1,80 @@
+@extends('jfadmin::layouts.base')
+
+@section('title', '首页')
+
+@section('content')
+
+
+
+
+
+
+
+
+
+
+ 参数名称 |
+ 参数值 |
+
+
+
+ @foreach($envs as $item)
+
+ {{ $item['name'] }} |
+ {{ $item['value'] }} |
+
+ @endforeach
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 名称 |
+ 版本 |
+
+
+
+ @foreach($dependencies as $key => $item)
+
+ {{ $key }} |
+ {{ $item }} |
+
+ @endforeach
+
+
+
+
+
+
+
+
+@endsection
diff --git a/resources/views/layouts/pagination.blade.php b/src/Console/stubs/pagination.blade.stub
similarity index 100%
rename from resources/views/layouts/pagination.blade.php
rename to src/Console/stubs/pagination.blade.stub
diff --git a/src/JFAdminServiceProvider.php b/src/JFAdminServiceProvider.php
index a5c978a..d4a4aa8 100755
--- a/src/JFAdminServiceProvider.php
+++ b/src/JFAdminServiceProvider.php
@@ -34,13 +34,15 @@ class JFAdminServiceProvider extends ServiceProvider
*/
public function boot()
{
- $this->loadViewsFrom(__DIR__ . '/../resources/views', 'jfadmin');
+ $this->loadViewsFrom(__DIR__ . '/../resources/views', config('jfadmin.view.namespace'));
if (file_exists($routes = config('jfadmin.directory') . '/routes.php')) {
$this->loadRoutesFrom($routes);
}
- View::composer('jfadmin::*', function ($view) {
+ View::addNamespace('jfadmin', config('jfadmin.view.directory'));
+
+ View::composer(config('jfadmin.view.namespace') . '::*', function ($view) {
$view->with('admin_user', Auth::guard('admin_user')->user());
});