xms Management System Framework

repository·master·Indexed 19 days ago

https://github.com/migomiddle/xms

A cross-platform, .NET Core-based management system framework designed for rapid application development in e-commerce, enterprise software, SaaS backends, and mobile app management. It aims for a 'near-zero-code' experience and includes common modules, UEditor integration for content management, and support for SQL Server 2008 R2 or higher.

Tokens
2.8K
Snippets
7
Records
9
Agent score
67%

What's inside xms

  1. What is xms

    master
    xms is a cross-platform application framework based on .NET Core. It is designed to be highly extensible and easy to use, functioning as an 'x(extensible/arbitrary) m(management) s(system)'. It includes numerous common modules and aims to provide a 'near-zero-code' development experience, allowing developers to focus on business logic rather than infrastructure.
  2. Run and deploy xms

    master

    To run xms, ensure your environment meets the following requirements:

    Prerequisites

    • .NET Core SDK 3
    • SQL Server 2008 R2 or higher

    Deployment Steps

    1. Database Setup: Attach the databases found in the db folder to your SQL Server instance. The project uses three specific databases:
      • XMS_CONFIG: The data center/configuration database.
      • XSM_Empty: A business database with no demo data.
      • XMS_Standar: A business database containing demo data.
    2. Execution: Run the deploy.bat file to publish the application.
    3. Initial Configuration: On the first run, you will be directed to an initialization interface where you must:
      • Configure the Data Center database (XMS_CONFIG).
      • Configure the Business database.
    4. Default Login Credentials:
      • Username: admin
      • Password: 888888
    deploy.bat
  3. Configure UEditor base URL

    master

    UEditor requires a base path to locate its resource files (like dialogs and themes). You can set this globally before the editor is instantiated by defining window.UEDITOR_HOME_URL. It is strongly recommended to use a relative path starting with a slash (e.g., /myProject/ueditor/) to avoid path resolution issues. If not explicitly set, the editor attempts to calculate the path automatically using getUEBasePath().

    // Set the base path at the top of your page before instantiating the editor
    window.UEDITOR_HOME_URL = "/your/project/path/ueditor/";
  4. Configure chart types and plot options in chart.config.js

    master

    The chart.config.js file defines a collection of configuration presets (typeConfig) for different chart types used within the UEditor charts dialog. Each object in the typeConfig array specifies a chart.type and associated plotOptions to customize behavior such as data labels, mouse tracking, and visual styles for specific chart categories (line, area, bar, column, and pie).

    var typeConfig = [
        {
            chart: {
                type: 'line'
            },
            plotOptions: {
                line: {
                    dataLabels: {
                        enabled: false
                    },
                    enableMouseTracking: true
                }
            }
        }, 
        // ... other configurations
        {
            chart: {
                type: 'pie'
            },
            plotOptions: {
                pie: {
                    allowPointSelect: true,
                    cursor: 'pointer',
                    dataLabels: {
                        enabled: true,
                        color: '#000000',
                        connectorColor: '#000000',
                        formatter: function () {
                            return '<b>' + this.point.name + '</b>: ' + (Math.round(this.point.percentage * 100) / 100) + ' %';
                        }
                    }
                }
            }
        }
    ];
  5. Configure UEditor toolbars

    master

    The toolbars option in window.UEDITOR_CONFIG defines the buttons and dropdowns available in the editor's toolbar. It accepts an array of arrays, where each inner array represents a row of tools. You can customize the toolbar by including or excluding specific command names. This can also be overridden during the instantiation of a specific editor instance.

    window.UEDITOR_CONFIG = {
        toolbars: [[
            'fullscreen', 'source', '|', 'undo', 'redo', '|',
            'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|',
            'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc', '|',
            'rowspacingtop', 'rowspacingbottom', 'lineheight', '|',
            'customstyle', 'paragraph', 'fontfamily', 'fontsize', '|',
            'directionalityltr', 'directionalityrtl', 'indent', '|',
            'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|', 'touppercase', 'tolowercase', '|',
            'link', 'unlink', 'anchor', '|', 'imagenone', 'imageleft', 'imageright', 'imagecenter', '|',
            'emotion', 'scrawl', 'insertvideo', 'music', 'attachment', 'map', 'gmap', 'insertframe', 'insertcode', 'pagebreak', 'template', 'background', '|',
            'horizontal', 'date', 'time', 'spechars', 'snapscreen', 'wordimage', '|',
            'inserttable', 'deletetable', 'insertparagraphbeforetable', 'insertrow', 'deleterow', 'insertcol', 'deletecol', 'mergecells', 'mergeright', 'mergedown', 'splittocells', 'splittorows', 'splittocols', 'charts', '|',
            'print', 'preview', 'searchreplace', 'drafts', 'help'
        ]]
    };
  6. Configure UEditor XSS filtering and whitelist

    master

    UEditor provides built-in XSS (Cross-Site Scripting) protection. You can enable or disable these filters and define a custom whitelist of allowed tags and attributes in window.UEDITOR_CONFIG.

    Key security settings:

    • xssFilterRules: Enables/disables XSS filtering for insertHtml operations.
    • inputXssFilter: Enables/disables XSS filtering for input.
    • outputXssFilter: Enables/disables XSS filtering for output.
    • whitList: An object mapping HTML tags to an array of allowed attributes (e.g., a: ['target', 'href', 'title', 'class', 'style']).
    window.UEDITOR_CONFIG = {
        xssFilterRules: true,
        inputXssFilter: true,
        outputXssFilter: true,
        whitList: {
            iframe: ['frameborder', 'border', 'marginwidth', 'marginheight', 'width', 'height', 'src', 'id'],
            a: ['target', 'href', 'title', 'class', 'style'],
            img: ['src', 'alt', 'title', 'width', 'height', 'id', '_src', '_url', 'loadingclass', 'class', 'data-latex'],
            // ... other tags
        }
    };
  7. Configure UEditor language and themes

    master

    You can customize the language and visual theme of the editor via window.UEDITOR_CONFIG:

    • lang: Sets the language (default is zh-cn). You can provide a string or use a dynamic value from navigator.language.
    • langPath: The path to the language files (e.g., URL + 'lang/').
    • theme: Sets the visual theme (default is default).
    • themePath: The path to the theme files (e.g., URL + 'themes/').
    window.UEDITOR_CONFIG = {
        lang: 'zh-cn',
        langPath: URL + 'lang/',
        theme: 'default',
        themePath: URL + 'themes/'
    };
  8. Configure UEditor editor behavior and appearance

    master

    The following options control the core behavior and UI of the editor instance:

    KeyDescription
    serverUrlThe unified request interface path for server-side operations (e.g., file uploads).
    initialContentThe content to initialize the editor with.
    textareaThe name/ID of the textarea used for form submission.
    readonlyIf true, the editor area is read-only.
    fullscreenIf true, the editor starts in fullscreen mode.
    enableAutoSaveEnables automatic saving of content.
    saveIntervalThe interval for auto-saving in milliseconds.
    wordCountEnables word count statistics.
    maximumWordsThe maximum allowed character count for word count statistics.
    autoHeightEnabledIf true, the editor height adjusts automatically.
    scaleEnabledIf true, allows manual resizing of the editor (disables autoHeightEnabled).
    elementPathEnabledEnables/disables the element path display.
    imagePopupControls the visibility of the image operation popup.
  9. Reference available chart type configurations

    master

    The following chart configurations are defined in typeConfig:

    • Line Chart (No Labels): type: 'line', dataLabels.enabled: false, enableMouseTracking: true.
    • Line Chart (With Labels): type: 'line', dataLabels.enabled: true, enableMouseTracking: false.
    • Area Chart: type: 'area'.
    • Bar Chart: type: 'bar'.
    • Column Chart: type: 'column'.
    • Pie Chart: type: 'pie', includes allowPointSelect: true, cursor: 'pointer', and a custom formatter for data labels showing percentage values.
    // Available chart types in typeConfig:
    // 'line'
    // 'area'
    // 'bar'
    // 'column'
    // 'pie'