Code Monkey home page Code Monkey logo

iframe-tabs's Introduction

laravel-admin iframe-tabs

Installation

Run :

$ composer require ichynul/iframe-tabs

Then run:

$ php artisan vendor:publish --tag=iframe-tabs

$ php artisan admin:import iframe-tabs

1.0.28

新版本1.0.28布局改动较大,更新版本后记得强制发布资源

The layout of the new version 1.0.28 has changed a lot. After updating the version, remember to force release resources.

Update it

(本扩展依赖一些 js 和 css 文件,composer update 若版本号有变请强制发布资源,可能是更新了某些样式)

After composer update , if version of this extension changed :

Run

php artisan vendor:publish --tag=iframe-tabs --force

This will override css and js fiels to /public/vendor/laravel-admin-ext/iframe-tabs/

Or you can and a script in composer.json :

"scripts": {
    "post-update-cmd": "php artisan vendor:publish --tag=iframe-tabs --force",
}

Usage

Add a config in config/admin.php:

    'extensions' => [
        'iframe-tabs' => [
           // Set to `false` if you want to disable this extension
            'enable' => true,
            // The controller and action of dashboard page `/admin/dashboard`
            'home_action' => App\Admin\Controllers\HomeController::class . '@index',
            // Default page tab-title
            'home_title' => 'Home',
            // Default page tab-title icon
            'home_icon' => 'fa-home',
            // Whether show icon befor titles for all tab
            'use_icon' => true,
            // dashboard css 
            'tabs_css' =>'vendor/laravel-admin-ext/iframe-tabs/dashboard.css',
            // layer.js path , if you do not use laravel-admin-ext\cropper , set another one
            'layer_path' => 'vendor/laravel-admin-ext/cropper/layer/layer.js',
            /**
             * href links do not open in tab .
             * selecter : .sidebar-menu li a,.navbar-nav>li a,.sidebar .user-panel a,.sidebar-form .dropdown-menu li a
             * if(href.indexOf(pass_urls[i]) > -1) //pass
             */
            'pass_urls' => ['/admin/auth/logout', '/admin/auth/lock'],
            // When login session state of a tab-page was expired , force top-level window goto login page .
            'force_login_in_top' => true,
            // tabs left offset
            'tabs_left'  => 42,
        ]
    ],

Add a lang config in resources/lang/{zh-CN}/admin.php

'iframe_tabs' => [
    'oprations' => '页签操作',
    'refresh_current' => '刷新当前',
    'close_current' => '关闭当前',
    'close_all' => '关闭全部',
    'close_other' => '关闭其他',
    'open_in_new' => '新窗口打开',
    'open_in_pop' => '弹出窗打开',
    'scroll_left' => '滚动到最左',
    'scroll_right' => '滚动到最右',
    'scroll_current' => '滚动到当前'
],

Usage

Open http://your-host/admin

Thanks to https://github.com/bswsfhcw/AdminLTE-With-Iframe

License


Licensed under The MIT License (MIT).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.