Dcat-plus Admin
repository·master·Indexed 40 days ago
https://github.com/ycookies/dcat-plus-adminA high-performance backend management system builder based on Dcat Admin and Laravel. It enables the rapid construction of admin panels using built-in components and an API. Requires PHP >= 7.4.0 and Laravel 8.0 ~ 12.*.
What's inside Dcat-plus Admin
- CodeMirror is a JavaScript component designed to provide a code editor interface within a web browser. It supports syntax highlighting (coloring code) and indentation assistance for various programming languages, provided that the corresponding mode is available.
Editor.md Features and Supported Syntax
masterEditor.md is a full-featured Markdown editor with the following capabilities:
- Markdown Standards: Supports Standard Markdown, CommonMark, and GFM (GitHub Flavored Markdown).
- Extended Syntax: Supports Table of Contents (ToC), Emojis, Task lists, and @Links.
- Scientific & Diagramming: Supports TeX (LaTeX expressions via KaTeX), Flowcharts, and Sequence Diagrams.
- Core Editor Features: Real-time preview, image upload (cross-domain), code syntax highlighting, code folding, search/replace, and read-only mode.
- Extensibility: Supports AMD/CMD module loaders (Require.js & Sea.js) and custom plugins. It also allows for custom HTML tag decoding and filtering for security.
Install Dcat-plus Admin
masterDcat-plus Admin is a backend system building tool based on
Dcat Admin. To install it, you must first have a Laravel project set up and your.envfile configured with correct database credentials.1. Install Laravel
If you haven't installed Laravel yet, run:
composer create-project --prefer-dist laravel/laravel 项目名称 10.*2. Configure Database
Update your
.envfile with your database settings:DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=dcat-admin DB_USERNAME=root DB_PASSWORD=3. Install Dcat-plus Admin
Run the following command to require the package:
composer require dcat-plus/laravel-adminOr specify a version:
composer require dcat-plus/laravel-admin:1.4.34. Publish Resources and Install
Publish the configuration files:
php artisan admin:publishThen, run the installation command:
php artisan admin:installNote: If you encounter the error
Specified key was too long ... 767 bytes, add\[Schema::defaultStringLength(191);to thebootmethod inapp/Providers/AppServiceProvider.php, delete all existing database tables, and runphp artisan admin:installagain.composer require dcat-plus/laravel-admin php artisan admin:publish php artisan admin:installSet Directory Permissions and Ownership
masterProper directory permissions are critical for Dcat-plus Admin to function correctly. Navigate to your Laravel project root and apply the following permissions:
Set Directory Permissions
chmod -R 775 storage/ chmod -R 775 bootstrap/cache/ chmod -R 775 lang/ chmod -R 755 public/Set File Ownership
Depending on your web server user (e.g.,
nginxorapache), run:For Nginx:
chown -R nginx:nginx .For Apache:
chown -R apache:apache .chmod -R 775 storage/ chmod -R 775 bootstrap/cache/ chmod -R 775 lang/ chmod -R 755 public/ chown -R nginx:nginx .Run WebUploader examples
masterTo view and test the WebUploader examples, download the entire Git package and place it on a PHP-enabled server. The default example files are written in PHP. Once hosted, you can navigate to theexamplespage to see the implementation in action.Where to place TinyMCE language files
masterTinyMCE language files for the Dcat Plus Admin plugin should be placed within the
resources/assets/dcat/plugins/tinymce/langs/directory.Important: Do not translate these files directly. To ensure proper updates and maintainability, use the official Transifex service for translations: https://www.transifex.com/projects/p/tinymce/
Access the Admin Dashboard
masterOnce the service is started, you can access the admin interface at:
http://localhost/adminDefault Credentials:
- Username:
admin - Password:
admin
- Username:
Install Editor.md
masterEditor.md can be installed via Bower or by downloading the source from GitHub. It is an embeddable online Markdown editor based on CodeMirror, jQuery, and Marked.
bower install editor.mdInitialize Editor.md in HTML and JavaScript
masterTo use Editor.md, include the
editormd.min.cssstylesheet and a container element (like adiv). You can optionally place atextareainside the container to provide initial content; if not provided, Editor.md can auto-append a<textarea>tag.Initialize the editor using the
editormd()function. You must specify thepathoption, which points to the directory containing dependent libraries (likecodemirrorandmarked) for autoloading.<!-- 1. HTML Setup --> <link rel="stylesheet" href="editormd.min.css" /> <div id="editormd"> <textarea style="display:none;">### Hello Editor.md !</textarea> </div> <!-- 2. JavaScript Initialization --> <script src="jquery.min.js"></script> <script src="editormd.min.js"></script> <script type="text/javascript"> $(function() { var editor = editormd("editormd", { path : "../lib/" // Path to dependent libs like codemirror, marked, etc. }); }); </script>Configure Web Server for Dcat-plus Admin
masterAfter installation, you must configure your web server to point to the
publicdirectory. If you are using Nginx, you must also include the following pseudo-static (rewrite) configuration to ensure Laravel routes work correctly:location / { try_files $uri $uri/ /index.php?$query_string; }Editor.md Dependencies
masterEditor.md relies on several libraries to provide its full feature set. Ensure these are available in the path specified in your configuration:
- Core:
jQuery,CodeMirror,marked - Styling:
FontAwesome,github-markdown.css,Prefixes.scss - Math & Diagrams:
KaTeX,flowchart.js,sequence-diagram.js,Rephael.js - Syntax Highlighting:
prettify.js
- Core:
WebUploader file structure and variants
masterThe WebUploader plugin provides several JavaScript builds depending on your required runtime (Flash vs. HTML5) and feature set (e.g., image processing).
- Standard builds:
webuploader.js(full version) orwebuploader.min.js(minified). - Flash-specific:
webuploader.flashonly.jsrequiresUploader.swfto function. - HTML5-specific:
webuploader.html5only.jsfor modern browsers without Flash. - No Image Processing:
webuploader.noimage.jsremoves image handling logic for both HTML5 and Flash. - Mobile/Custom:
webuploader.custom.jsis a custom build optimized for mobile use.
├── Uploader.swf # SWF文件,当使用Flash运行时需要引入。 ├ ├── webuploader.js # 完全版本。 ├── webuploader.min.js # min版本 ├── webuploader.flashonly.js # 只有Flash实现的版本。 ├── webuploader.flashonly.min.js # min版本 ├── webuploader.html5only.js # 只有Html5实现的版本。 ├── webuploader.html5only.min.js # min版本 ├── webuploader.noimage.js # 去除图片处理的版本,包括HTML5和FLASH. ├── webuploader.noimage.min.js # min版本 ├── webuploader.custom.js # 自定义打包方案,请查看 Gruntfile.js,满足移动端使用。 └── webuploader.custom.min.js # min版本- Standard builds: