Skip to content
This repository has been archived by the owner on Oct 6, 2022. It is now read-only.
/ PMS-Console Public archive

πŸŽ› Web management console for PMS

License

Notifications You must be signed in to change notification settings

PonomareVlad/PMS-Console

Repository files navigation

List of Console methods:

Main methods (/console):

  • /getUserData - current user ID Return: {userId: ID of current user}
  • /auth - Authorize user by credentials: Request: login: [email protected], password: password Return: {userId: ID of current user}
  • /reg - Registration new user with credentials: Request: login: [email protected], password: password Return: {userId: ID of current user}
  • /logout - Destroy current session Return: {status: Status of operation}
  • /getHosts - List of hosts Return:
{
    hostsData: [
        {id: 1, domain: "ponomarevlad.ru", state: 1},
        ...
    ]
}
  • /getHostData - Data of selected host: Request: id: 1 Return:
{
    id:1, 
    domain: "ponomarevlad.ru", 
    state: 1 
}
  • /getModules - List of available Modules: Request: hostId: 1 Return:
{
    modulesData: [
        {
            id: "ID модуля", 
            title: "НазваниС модуля",
            menu_item_title: "НазваниС элСмСнта мСню",
            menu_item_type: "Π’ΠΈΠΏ элСмСнта мСню"
        },
        ...
    ]
}
  • /getModuleData - Data of selected Module: Request: hostId: 1, moduleId: siteStructure Return:
{
    id: "ID модуля", 
    title: "НазваниС модуля",
    menu_item_title: "НазваниС элСмСнта мСню",
    menu_item_type: "Π’ΠΈΠΏ элСмСнта мСню"
    init: "Π˜ΡΠΏΠΎΠ»Π½ΡΠ΅ΠΌΡ‹ΠΉ ΠΊΠΎΠ΄",
}

Host actions methods (/host):

  • /getDir - List of directory content Request: hostId: 1, dirId: 1 Return:
{
    dirData:{
        id: 'root', 
        parent_dir: false, 
        path: '/path', 
        title: 'ΠšΠΎΡ€Π½Π΅Π²Π°Ρ дирСктория',
        plugin_init: 'ΠŸΡ€ΠΈΠ²ΡΠ·ΠΊΠ° Π΄ΠΈΡ€Π΅ΠΊΡ‚ΠΎΡ€ΠΈΠΈ ΠΊ ΠΏΠ»Π°Π³ΠΈΠ½Ρƒ'
        contents:{
            dirs:[
                {
                    id: 1, 
                    parent_dir: 'root', 
                    path: '/path', 
                    title: 'Π—Π°Π³ΠΎΠ»ΠΎΠ²ΠΎΠΊ Π΄ΠΈΡ€Π΅ΠΊΡ‚ΠΎΡ€ΠΈΠΈ',
                    plugin_init: 'ΠŸΡ€ΠΈΠ²ΡΠ·ΠΊΠ° Π΄ΠΈΡ€Π΅ΠΊΡ‚ΠΎΡ€ΠΈΠΈ ΠΊ ΠΏΠ»Π°Π³ΠΈΠ½Ρƒ'
                },
                ...
            ],
            files:[
                {
                    id: 1, 
                    parent_dir: 'root',
                    path: 'index.php',
                    title: 'НазваниС страницы',
                    template_id: 'ID шаблона'
                },
                ...
            ]
        }
    }
}

Page actions methods (/page):

  • /getPageData - page elements list and other data Request: hostId: 1, pageId: 1 Return:
{
    pageData:{
        id: 1, 
        path: 'index.php', 
        parent_dirs: [
            {id: 1, path: '/', title: 'Π—Π°Π³ΠΎΠ»ΠΎΠ²ΠΎΠΊ Π΄ΠΈΡ€Π΅ΠΊΡ‚ΠΎΡ€ΠΈΠΈ'},
            ...
        ],
        title: 'НазваниС страницы',
        template_id: 'ID шаблона'
        elements: [
            {
                container: 'html_description',
                type: 'html',
            },
            ...
        ]
    }
}
  • /getPageKeywords - page keywords list Request: hostId: 1, pageId: 1 Return:
{
    pageKeywords:[
        {
            id: 1,
            title: 'ΠŸΠΎΠΈΡΠΊΠΎΠ²Ρ‹ΠΉ запрос',
        },
        ...
    ]
}
  • /getPageElement - page element data Request: hostId: 1, pageId: 1, containerId: html_description Return:
{
    elementData:{
        container: 'html_description',
        type: 'html',
        content: '<p>ВСкст страницы</p>',
    }
}
  • /getKeywordData - page Keyword data Request: hostId: 1, pageId: 1, keywordId: 2 Return:
{
    keywordData:{
        id: 2,
        title: 'ΠŸΠΎΠΈΡΠΊΠΎΠ²Ρ‹ΠΉ запрос',
        data: {
            title:{
                length:{
                    average:100,
                    min:50,
                    max:150,
                },
                cs:{
                    average:100,
                    min:50,
                    max:150,
                }
            },
            h3:{
                length:{
                    average:100,
                    min:50,
                    max:150,
                }
            }
            ...
        }
    }
}
  • /savePageElement - save element data Request: hostId: 1, pageId: 1, containerId: html_description, content: 'New content' Return: {status: Status of operation}

  • /createKeyword - create new keyword for page Request: hostId: 1, pageId: 1, keyword: keyword Return:

{
    keywords:{
        'keyword_title': 'keyword_id',
        ...
    }
}