1 Star 5 Fork 0

LHY / iframe-tabs

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

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

Update it

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

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

Config

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
            'layer_path' => 'vendor/laravel-admin-ext/iframe-tabs/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' => ['/auth/logout', '/auth/lock'],
            // When login session state of a tab-page was expired , force top-level window goto login page .
            //登录超时是是否强制整体跳转到登录页面,设为false的话只在触发超时登录的页面跳转,最大程度保留已打开页面。
            'force_login_in_top' => true,
            // tabs left offset
            'tabs_left'  => 42,
            // bind click event of table actions [edit / view / create]  
            'bind_urls' => 'popup', //[ popup / new_tab / none]
            //table actions dom selecter, [view / edit / create]buttons ,and any thing has class pupop : <a class="pupop" popw="400px" poph="200px" href="someurl">mylink</a>
            'bind_selecter' => 'a.grid-row-view,a.grid-row-edit,.column-__actions__ ul.dropdown-menu a,.box-header .pull-right .btn-success,.popup',
            //layer popup size
            'layer_size' => '1100px,98%',
            // if run web in `cli` mode ,for example `swoole` ,set it to true,如果是以命令行方式运行网站,如`swoole` 就设置为 true
            'web_in_cli' => false
        ]
    ],

If bind_urls set to popup or new_tab , recommend disableView and disableList in form /Admin/bootstrap.php :

    Encore\Admin\Form::init(function ($form) {
        $form->tools(function ($tools) {
            $tools->disableDelete();
            $tools->disableView();
            $tools->disableList();
        });
    });

See https://laravel-admin.org/docs/zh/model-form-init

And disableEdit and disableList in show :

   $show->panel()
   ->tools(function ($tools) {
       $tools->disableEdit();
       $tools->disableList();
       $tools->disableDelete();
   });;

Lang

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' => '滚动到当前',
    'goto_login' => '登录超时,正在跳转登录页面...'
],

Usage

Open http://your-host/admin

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

License


Licensed under The MIT License (MIT).

此扩展基本稳定了,除非laravel-admin的UI有较大变化。鉴于本人实际中使用laravel-admin不是太多,后续不提供新的功能特性,只修复bug。

广告

使用tp框架的小伙伴可以尝试一下我新的后台开发框架:https://gitee.com/ichynul/myadmin

参照laravel-admih封装了form,table

The MIT License (MIT) Copyright (c) 2015 Jens Segers Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

laravel-admin使用iframe-tab打开多页面 展开 收起
JavaScript 等 3 种语言
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
JavaScript
1
https://gitee.com/ichynul/iframe-tabs.git
git@gitee.com:ichynul/iframe-tabs.git
ichynul
iframe-tabs
iframe-tabs
master

搜索帮助