jqh 5 lat temu
rodzic
commit
011608a832

+ 33 - 22
config/admin.php

@@ -119,7 +119,7 @@ return [
 
         'controller' => Dcat\Admin\Controllers\AuthController::class,
 
-        'login_view' => 'admin::login',
+        'login_view' => 'admin::pages.login',
 
         'guard' => 'admin',
 
@@ -200,7 +200,7 @@ return [
     'menu' => [
         'cache' => [
             // enable cache or not
-            'enable' => true,
+            'enable' => false,
             'store'  => 'file',
         ],
 
@@ -301,33 +301,44 @@ return [
     */
     'map_provider' => 'google',
 
-    /*
-    |--------------------------------------------------------------------------
-    | Application Skin
-    |--------------------------------------------------------------------------
-    |
-    | This value is the skin of admin pages.
-    | @see https://adminlte.io/docs/2.4/layout
-    |
-    | Supported:
-    |    "skin-blue-light", "skin-black", "skin-black-light".
-    |
-    */
-    'skin' => 'skin-black',
-
     /*
     |--------------------------------------------------------------------------
     | Application layout
     |--------------------------------------------------------------------------
     |
     | This value is the layout of admin pages.
-    | @see https://adminlte.io/docs/2.4/layout
-    |
-    | Supported: "fixed", "layout-boxed", "layout-top-nav", "sidebar-collapse",
-    | "sidebar-mini".
-    |
     */
-    'layout' => ['sidebar-mini', 'fixed'],
+    'layout' => [
+        // vertical, horizontal
+        'mainLayout_type' => 'vertical',
+
+        // light, dark, semi-dark
+        'theme' => 'light',
+
+        'body_class' => '',
+
+        'sidebar_collapsed' => false,
+
+        'blank_page' => false,
+
+        // bg-primary, bg-info, bg-warning, bg-success, bg-danger, bg-dark
+        'navbar_color' => '',
+
+        // floating, static, sticky
+        'horizontal_menu_type' => 'floating',
+
+        // floating, static, sticky, hidden
+        'vertical_menu_navbar_type' => 'floating',
+
+        // static, sticky, hidden
+        'footer_type' => 'static',
+
+        // default, content-left-sidebar, content-right-sidebar, content-detached-left-sidebar, content-detached-right-sidebar
+        'content_layout' => 'default',
+
+        // ltr, rtl
+        'direction' => env('MIX_CONTENT_DIRECTION', 'ltr'),
+    ],
 
     /*
     |--------------------------------------------------------------------------

+ 1 - 1
resources/views/dashboard/extensions.blade.php

@@ -32,7 +32,7 @@
     <a href="https://github.com/jqhph/dcat-admin#%E6%89%A9%E5%B1%95" target="_blank" class="uppercase">View All Extensions</a>
 </div>
 
-<script>LA.ready(function () {
+<script>Dcat.ready(function () {
     var $box = $('#extension-box');
     $box.loading();
 

+ 1 - 1
resources/views/dashboard/terminal.blade.php

@@ -1,6 +1,6 @@
 <div id="dcat-admin-terminal"></div>
 <script>
-    LA.ready(function () {
+    Dcat.ready(function () {
         var _terminal = $('#dcat-admin-terminal').lxhTerminal({!! json_encode($options) !!});
 
     });

+ 2 - 2
resources/views/filter/selectresource.blade.php

@@ -18,8 +18,8 @@
 </div>
 
 <script data-exec-on-popstate>
-LA.ready(function () {
-    LA.ResourceSelector({
+Dcat.ready(function () {
+    Dcat.ResourceSelector({
         title: '{!! ucfirst(trans('admin.choose')) !!} {!! $label !!}',
         selector: '#{{$name}}-filter-select-source',
         column: "{!! $name !!}",

+ 2 - 2
resources/views/form/file.blade.php

@@ -32,7 +32,7 @@
 </div>
 
 <script data-exec-on-popstate>
-LA.ready(function () {
+Dcat.ready(function () {
     var upload, options = {!! $options !!}, listenComplete;
 
     init();
@@ -51,7 +51,7 @@ LA.ready(function () {
             paste: '#{{$_id}} .web-uploader'
         }, opts);
 
-        upload = LA.Uploader(opts);
+        upload = Dcat.Uploader(opts);
         upload.build();
         upload.preview();
 

+ 2 - 2
resources/views/form/steps.blade.php

@@ -61,7 +61,7 @@ $lastStep = $step;
 @endphp
 
 <script>
-LA.ready(function () {
+Dcat.ready(function () {
     var form = $('#{{ $form->getElementId() }}'),
         box = form.find('.la-step-box'),
         stepInput = form.find('.current-step-input'),
@@ -240,7 +240,7 @@ LA.ready(function () {
 
     // 提交表单
     function submit(after) {
-        LA.Form({
+        Dcat.Form({
             $form: form,
             after: function (state, b, c, d) {
                 after(state, b, c, d);

+ 2 - 2
resources/views/form/tree.blade.php

@@ -24,7 +24,7 @@
     $formId = $formId ? '#'.$formId : '';
 @endphp
 <script data-exec-on-popstate>
-LA.ready(function () {
+Dcat.ready(function () {
     var $tree = $('{!!$formId !!} .{{$class}}-tree-wrapper').find('.da-tree'),
         opts = {!! $options !!},
         $input = $('{!!$formId !!} input[name="{{$name}}"]'),
@@ -45,7 +45,7 @@ LA.ready(function () {
 
         var i, selected = [];
         for (i in data.selected) {
-            if (LA.arr.in(parents, data.selected[i])) { // 过滤父节点
+            if (Dcat.arr.in(parents, data.selected[i])) { // 过滤父节点
                 continue;
             }
             selected.push(data.selected[i]);

+ 10 - 10
resources/views/helpers/scaffold.blade.php

@@ -255,7 +255,7 @@
 </template>
 
 <script>
-    LA.ready(function () {
+    Dcat.ready(function () {
         var typing = 0,
             $model = $('#inputModelName'),
             $controller = $('#inputControllerName'),
@@ -301,14 +301,14 @@
             db = val[0];
             tb = val[1];
 
-            LA.loading();
+            Dcat.loading();
             $table.val(tb);
 
             write_controller(tb);
             write_model(tb);
 
-            $.post('{{admin_url('helpers/scaffold/table')}}', {db: db, tb: tb, _token: LA.token}, function (res) {
-                LA.loading(false);
+            $.post('{{admin_url('helpers/scaffold/table')}}', {db: db, tb: tb, _token: Dcat.token}, function (res) {
+                Dcat.loading(false);
 
                 if (!res.list) return;
                 var i, list = res.list, $id = $('#inputPrimaryKey'), updated, created, soft;
@@ -332,12 +332,12 @@
                         continue;
                     }
 
-                    var c = LA.str.replace(list[i].comment, '"', '');
+                    var c = Dcat.str.replace(list[i].comment, '"', '');
                     add_field({
                         name: i,
                         lang: c,
                         type: list[i].type,
-                        default: LA.str.replace(list[i].default, '"', ''),
+                        default: Dcat.str.replace(list[i].default, '"', ''),
                         comment: c,
                         nullable: list[i].nullable != 'NO',
                     });
@@ -376,23 +376,23 @@
 
             var c;
             if (updated) {
-                c = LA.str.replace(updated.comment, '"', '');
+                c = Dcat.str.replace(updated.comment, '"', '');
                 add_field({
                     name: 'updated_at',
                     lang: c,
                     type: updated.type,
-                    default: LA.str.replace(updated.default, '"', ''),
+                    default: Dcat.str.replace(updated.default, '"', ''),
                     comment: c,
                     nullable: updated.nullable != 'NO',
                 });
             }
             if (created) {
-                c = LA.str.replace(created.comment, '"', '');
+                c = Dcat.str.replace(created.comment, '"', '');
                 add_field({
                     name: 'created_at',
                     lang: c,
                     type: created.type,
-                    default: LA.str.replace(created.default, '"', ''),
+                    default: Dcat.str.replace(created.default, '"', ''),
                     comment: c,
                     nullable: created.nullable != 'NO',
                 });

+ 2 - 2
resources/views/layouts/full-page.blade.php

@@ -1,6 +1,6 @@
 <!DOCTYPE html>
 <html lang="{{ str_replace('_', '-', app()->getLocale()) }}"
-      data-textdirection="{{ env('MIX_CONTENT_DIRECTION') === 'rtl' ? 'rtl' : 'ltr' }}">
+      data-textdirection="{{ $configData['direction'] === 'rtl' ? 'rtl' : 'ltr' }}">
 
 <head>
     <meta charset="utf-8">
@@ -42,8 +42,8 @@
 </div>
 
 {!! admin_section(\AdminSection::BODY_INNER_AFTER) !!}
+
 {!! Dcat\Admin\Admin::assets()->renderJs() !!}
 
 </body>
-
 </html>

+ 1 - 1
resources/views/layouts/page.blade.php

@@ -1,6 +1,6 @@
 <!DOCTYPE html>
 <html lang="{{ str_replace('_', '-', app()->getLocale()) }}"
-      data-textdirection="{{ env('MIX_CONTENT_DIRECTION') === 'rtl' ? 'rtl' : 'ltr' }}">
+      data-textdirection="{{ $configData['direction'] === 'rtl' ? 'rtl' : 'ltr' }}">
 
 <head>
     <meta charset="utf-8">

+ 2 - 2
resources/views/partials/menu.blade.php

@@ -4,7 +4,7 @@
             <span>{{ $item['title'] }}</span>
         </li>
     @elseif(! isset($item['children']))
-        <li class="nav-item  {!! $builder->isActive($item) ? 'active' : '' !!}">
+        <li class="nav-item {!! $builder->isActive($item) ? 'active' : '' !!}">
             <a href="{{ $builder->getUrl($item['uri']) }}">
 
                 <i class="{{$item['icon']}}"></i>
@@ -19,7 +19,7 @@
         @php
             $active = $builder->isActive($item);
         @endphp
-        <li class="{!! $active ? 'active open' : '' !!}">
+        <li class="nav-item has-sub {!! $active ? 'active open' : '' !!}">
             <a href="#">
                 <i class="fa {{ $item['icon'] }}"></i>
                 @if (Lang::has($titleTranslation = 'admin.menu_titles.' . trim(str_replace(' ', '_', strtolower($item['title'])))))

+ 2 - 2
resources/views/partials/script.blade.php

@@ -18,8 +18,8 @@ Dcat.ready = Dcat.pjaxResponded = Dcat.booting = Dcat.beforeSubmit = Dcat.submit
             return $(doc).one('pjax:done', callback);
         }
 
-        var $ = _window.$, proxy = function (e) {
-            $($('#pjax-container')).one('pjax:done', proxy);
+        var proxy = function (e) {
+            _window.$(_window.$('#pjax-container')).one('pjax:done', proxy);
 
             callback(e);
         };

+ 1 - 1
resources/views/widgets/tree.blade.php

@@ -1,7 +1,7 @@
 <div  {!! $attributes !!}><div class="da-tree"></div></div>
 
 <script>
-LA.ready(function () {
+Dcat.ready(function () {
     var opts = {!! json_encode($options) !!}, tree = $('#{{$id}}').find('.da-tree');
 
     opts.core.data = {!! json_encode($nodes) !!};

+ 21 - 14
src/Layout/Assets.php

@@ -27,7 +27,9 @@ class Assets
     /**
      * @var array
      */
-    protected $headerJs = [];
+    protected $headerJs = [
+        'vendors' => 'dcat-admin/vendors/js/vendors.min.js',
+    ];
 
     /**
      * @var array
@@ -46,7 +48,11 @@ class Assets
      * @var array
      */
     protected $baseJs = [
-
+        'menu'       => 'dcat-admin/js/core/app-menu.js',
+        'app'        => 'dcat-admin/js/core/app.js',
+        'components' => 'dcat-admin/js/scripts/components.js',
+        'customizer' => 'dcat-admin/js/scripts/customizer.js',
+        'footer'     => 'dcat-admin/js/scripts/footer.js',
     ];
 
     /**
@@ -57,29 +63,31 @@ class Assets
     /**
      * @var string
      */
-    protected $jQuery = 'vendor/dcat-admin/AdminLTE/plugins/jQuery/jQuery-2.1.4.min.js';
+    protected $fonts = 'https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,800,800i,900,900i';
 
     /**
-     * @var string
+     * @var bool
      */
-    protected $fonts = 'https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,800,800i,900,900i';
+    protected $isPjax = false;
 
     /**
      * @var bool
      */
-    protected $isPjax = false;
+    protected $usingFullPage = false;
 
     public function __construct()
     {
         $this->isPjax = request()->pjax();
     }
 
-    public function full()
+    public function full(bool $value = true)
     {
+        $this->usingFullPage = $value;
 
+        return $this;
     }
 
-    public function withName(string $name)
+    public function collect(string $name)
     {
         $this->js($this->components[$name]['js'] ?? null);
         $this->css($this->components[$name]['css'] ?? null);
@@ -138,13 +146,12 @@ class Assets
         $this->style = array_merge($this->style, (array) $style);
     }
 
-    public function jQuery()
-    {
-        return admin_asset($this->jQuery);
-    }
-
     protected function addLayoutCss()
     {
+        if ($this->usingFullPage) {
+            return;
+        }
+
         if (config('admin.layout.main_layout_type') === 'horizontal') {
             $this->baseCss[] = 'dcat-admin/css/core/menu/menu-types/horizontal-menu.css';
         }
@@ -158,7 +165,7 @@ class Assets
             return;
         }
 
-        //$this->baseCss[] = "dcat-admin/css/theme/{$theme}.min.css";
+        $this->baseCss[] = "dcat-admin/css/themes/{$theme}.css";
     }
 
     protected function addFontCss()

+ 1 - 1
src/Traits/HasAssets.php

@@ -38,7 +38,7 @@ trait HasAssets
      */
     public static function collectAssets(string $name)
     {
-        static::assets()->withName($name);
+        static::assets()->collect($name);
     }
 
     /**