CN116501319A - Webpage generation method, website editing method and electronic equipment - Google Patents

Webpage generation method, website editing method and electronic equipment Download PDF

Info

Publication number
CN116501319A
CN116501319A CN202310417271.6A CN202310417271A CN116501319A CN 116501319 A CN116501319 A CN 116501319A CN 202310417271 A CN202310417271 A CN 202310417271A CN 116501319 A CN116501319 A CN 116501319A
Authority
CN
China
Prior art keywords
menu
application
page
sub
configuration information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310417271.6A
Other languages
Chinese (zh)
Inventor
冯浩霖
郑宇航
罗月花
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
XFusion Digital Technologies Co Ltd
Original Assignee
XFusion Digital Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by XFusion Digital Technologies Co Ltd filed Critical XFusion Digital Technologies Co Ltd
Priority to CN202310417271.6A priority Critical patent/CN116501319A/en
Publication of CN116501319A publication Critical patent/CN116501319A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/34Graphical or visual programming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Human Computer Interaction (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Mining & Analysis (AREA)
  • Stored Programmes (AREA)

Abstract

A webpage generating method comprises the following steps: generating a first webpage based on the first configuration file; the first configuration file includes: menu configuration information of the first webpage; generating a second webpage based on a second configuration file under the condition that the first configuration file is changed into the second configuration file; the second configuration file includes: and the menu configuration information of the second webpage. The method comprises the steps of extracting a public module of a website into a main application, recording platform functions and authorities of the main application to be mounted and addresses of sub-applications to be mounted through configuration files, and modifying functions of the main application or sub-application functions of the main application when the main application or the sub-applications mounted on the main application are in a running state.

Description

Webpage generation method, website editing method and electronic equipment
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method for generating a web page, a method for editing a website, and an electronic device
Background
With the development of front-end web page technology, each front-end web page is usually developed by different front-end groups, which also causes the phenomenon that some common platform capabilities cannot be integrated and used, and repeated development is caused, so that the developed display style, animation and content are different and cannot be unified.
Disclosure of Invention
The embodiment of the application provides a webpage generating method, a website editing method and electronic equipment, which are characterized in that a common module of a website is extracted to be a platform application, and platform functions, authorities and addresses of sub-applications needing to be mounted of the platform application are recorded through a configuration file. And when the platform application or the sub-application mounted on the platform application is in a running state, modifying the functions of the platform application or the sub-application functions mounted on the platform application.
In a first aspect, an embodiment of the present application provides a method for displaying a web page, where the method includes: generating a first webpage based on the first configuration file; the first configuration file includes: menu configuration information of the first webpage; generating a second webpage based on the second configuration file under the condition that the first configuration file is changed into the second configuration file; the second configuration file includes: menu configuration information of the second web page.
The method comprises the steps of extracting a public module of a website into a platform application (main application) in advance, and recording a platform function required to be mounted by the platform application, a menu included by the platform application, configuration information of the menu and addresses of sub-applications required to be mounted by the menu through configuration files. In the process of loading the webpage, the electronic equipment acquires a first configuration file and generates the first webpage based on configuration information of a first menu stored in the first configuration file. Then, the electronic device monitors a first configuration file corresponding to the first webpage, and if the first configuration file is changed into a second configuration file, the electronic device needs to generate a second webpage according to the second configuration file and display the second webpage. By recording the menu information of the first webpage in the corresponding configuration file and allowing the configuration file to be modified in real time, the first webpage can be modified in real time in the display process of the first webpage, the flexibility of webpage deployment is improved, and the difficulty of webpage development is reduced.
In one possible implementation, the changing the first configuration file to the second configuration file includes: the menu configuration information of the first web page is changed.
That is, the menu configuration information of the first web page in the first configuration file can be modified to change the first configuration file to the second configuration file. After the first configuration file is changed into the second configuration file, the electronic device can load the second webpage based on the second configuration file so as to achieve the purpose of modifying the first webpage.
In one possible implementation, the first configuration file further includes menu information mounted by the sub-application, and the changing the first configuration file to the second configuration file includes: the sub-application downloaded from the menu of the first web page is changed.
In other words, in the web page display process, the sub-application mounted on the menu of the first web page can be downloaded by modifying the menu of the first web page, and accordingly, the menu information on which the sub-application is mounted is changed, so that the first configuration file corresponding to the second web page is changed into the second configuration file, and the thermal modification of the first web page is realized.
In one possible implementation, the menu configuration information of the first web page includes: the first webpage comprises a first-level menu name, a first-level menu address and access rights of the first-level menu; the menu information of the first webpage is changed, including: at least one item of menu configuration information of the first web page is changed.
That is, information such as a first level menu name, a first level menu address, and access rights of the first level menu of the first web page is recorded in the first configuration file. When the first webpage menu changes, the first webpage menu can be modified only by modifying the first-level menu name, the first-level menu address, the access authority of the first-level menu and the like of the first webpage recorded in the first configuration file corresponding to the first webpage, and repeated development is avoided.
In one possible implementation, the menu configuration information of the first web page further includes: the sub-application address of the first level menu mount of the first web page.
That is, the menu information of the first web page includes, in addition to the first-level menu information on the first web page, an address of a sub-application on which the first-level menu is mounted. Therefore, the content displayed by the first-level menu on the first webpage can be modified by modifying the address of the sub-application mounted by a certain first-level menu in the first configuration file.
In one possible implementation, the menu configuration information of the first web page further includes: configuration information of submenus mounted on the primary menu, hierarchical relationship between submenus and the primary menu, and hierarchical relationship between submenus; the configuration information of the submenu includes: a submenu name, a submenu address, access rights for the submenu;
The menu configuration information of the first webpage is changed, which comprises the following steps: at least one item of the sub-menu configuration information is changed, or the hierarchical relationship between the sub-menus and the first-level menu is changed, or the hierarchical relationship between the sub-menus is changed.
That is, the first configuration file corresponding to the first web page includes, in addition to configuration information of the first-level menu, further: configuration information of submenus on which the primary menu is mounted, and hierarchical relationships between submenus and primary menu, submenu and submenu. The configuration information of the submenu mounted on the primary menu in the first configuration file and the hierarchical relation among the submenu, the primary menu and the submenu are modified, so that the first configuration file is updated to be a second configuration file, and the electronic equipment generates a second webpage corresponding to the second configuration file.
In one possible implementation, the first web page includes: the menu of the first webpage is provided with a sub-application mounted on the menu; the first configuration file further includes: a storage path for the sub-application;
the generating a first web page based on the first configuration file includes:
acquiring configuration information of the sub-application based on the storage path of the sub-application;
And generating the first webpage based on the menu configuration information of the first webpage and the configuration information of the sub-application.
That is, the storage path of the sub-application mounted on the menu on the first web page is stored in the first configuration file in advance. When the first web page is generated, the electronic device may acquire configuration information of the sub-application based on the path information stored in the first configuration file. Then, the electronic device may generate the first webpage according to the acquired menu configuration information of the first webpage and the configuration information of the sub-application.
In one possible implementation, the changing the first configuration file to the second configuration file includes: responding to the first operation of the user to obtain a second configuration file; the first operation includes: and editing the menu of the first webpage in the editing page of the first webpage.
That is, after the electronic device displays the first webpage, the electronic device may modify the corresponding configuration information in the first configuration file according to the editing operation of the user on the first webpage to obtain the second configuration file. A second web page may be generated based on the second configuration file. The second webpage is a webpage obtained after responding to the editing operation of the user on the first webpage.
In one possible implementation, the editing operation includes: editing the hierarchical relationship of the menu, deleting a menu in the edited page, adding a menu in the edited page, and modifying one of the menu configuration information in the edited page.
That is, the user may edit the hierarchical relationship of the menus in the first web page on the visual display interface, or edit the number of the menus in the first web page and the configuration information of the menus, such as adding or deleting the menus. And the menu on the first webpage is edited through the visual display interface, so that the development difficulty of the webpage is reduced.
In a second aspect, an embodiment of the present application provides a method for editing a website, where the method includes: displaying an editing page of a target website; responding to the editing operation of at least one menu in the editing page, and updating configuration information corresponding to the at least one menu in a configuration file, wherein the configuration file is used for storing the configuration information of the target website; and generating a website deployment package of the target website in response to the storage operation of the editing page, wherein the website deployment package can be directly used for deploying the target website.
That is, when the configuration information of the target website in the configuration file is modified, the page of the target website which needs to be edited currently can be visually displayed. And then, modifying the page function on the visually displayed page, and storing configuration information corresponding to the modified website function in a configuration file. After the user completes editing the target website, a website deployment package of the target website can be generated according to the configuration information stored in the configuration file so as to be used by the user.
In one possible implementation, the editing operation of the at least one menu in the editing page includes: editing the hierarchical relation of at least one menu in an editing page, deleting one menu in the editing page, adding one menu in the editing page, and modifying one of configuration information of the at least one menu in the editing page.
That is, the user can make real-time modifications to the hierarchical relationship between the menus of the page, the functions corresponding to the menus, and the configuration information of the menus themselves on the edited page.
In one possible implementation, modifying configuration information of at least one menu in the edit page includes: at least one of the name, address, and authority of the at least one menu is modified in the editing page.
That is, when the configuration information of the menu itself is modified, the name, address, and authority of the menu may be modified.
In one possible implementation, before generating the website deployment package of the target website in response to the storing operation for the edit page, the method further includes: and responding to the preview operation for the editing page, and generating a preview page of the target website.
That is, after the user edits the target website, the user can generate a preview page of the target website, and the user can save the modification to the target website under the condition that the preview page has no problem, so as to ensure the editing quality of the target website.
In a third aspect, an embodiment of the present application provides a compiling system, including:
the display module is used for displaying the editing page of the target website;
the processing module is used for responding to the editing operation of at least one menu in the editing page, updating configuration information corresponding to the at least one menu in a configuration file, wherein the configuration file is used for storing the configuration information of the target website;
the processing module is further configured to generate a website deployment package of the target website in response to the storing operation for the editing page, where the website deployment package may be directly used for deploying the target website.
In a fourth aspect, embodiments of the present application provide an electronic device, which includes
A memory for storing a program;
a processor for executing the program stored in the memory, the processor being configured to perform the method described in any one of the possible implementations of the first aspect when the program stored in the memory is executed.
In a fifth aspect, embodiments of the present application provide a computer-readable medium having instructions stored therein, which when run on a computer, cause the computer to perform the method described in any one of the possible implementations of the first or second aspects.
In a sixth aspect, embodiments of the present application provide a computer program product comprising instructions which, when run on a computer, cause the computer to perform the method described in any one of the possible implementations of the first or second aspects.
It will be appreciated that the advantages of the third aspect to the fourth aspect may be referred to in the description related to the first aspect and the second aspect, and are not described herein.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1a is a schematic view of an application scenario provided in an embodiment of the present application;
fig. 1b is a schematic diagram of another application scenario provided in an embodiment of the present application;
fig. 2 is a schematic hardware structure of an electronic device according to an embodiment of the present application;
FIG. 3 is a schematic loading flow diagram of a micro front end architecture according to an embodiment of the present application;
fig. 4 is a schematic format diagram of menu information of a platform application stored in a plugin. Json file according to an embodiment of the present application;
fig. 5 is a schematic flow chart of a sub-application and platform application communication according to an embodiment of the present application;
FIG. 6 is a schematic diagram of loading a web page according to an embodiment of the present disclosure;
fig. 7 is a schematic diagram of a monitoring flow of a plugin. Json file according to an embodiment of the present application;
FIG. 8 is a schematic diagram of loading a website page according to an embodiment of the present disclosure;
FIG. 9 is a schematic diagram of a visual operation interface of a compiling system according to an embodiment of the present application;
FIG. 10 is a schematic diagram of a menu bar on a visual operation interface of a compiling system according to an embodiment of the present application;
FIG. 11 is a schematic diagram of an editing process for a menu on a visual operation interface according to an embodiment of the present application;
FIG. 12 is a schematic view of a further editing process for a menu on a visual operation interface according to an embodiment of the present application;
FIGS. 13 a-13 b are schematic views illustrating an editing process of a menu on a visual operation interface according to an embodiment of the present application;
FIGS. 14 a-14 b are schematic views illustrating an editing process of a menu on a visual operation interface according to an embodiment of the present application;
FIG. 15 is a schematic view of a further editing process for a menu on a visual operation interface according to an embodiment of the present application;
FIG. 16 is a schematic diagram of a saving process of a website edited on a visual operation interface according to an embodiment of the present application;
FIG. 17 is a flowchart of a method for loading websites according to an embodiment of the present application;
FIG. 18 is a flowchart of a method for displaying a web page according to an embodiment of the present disclosure;
FIG. 19 is a flowchart of a method for compiling websites according to an embodiment of the present application;
fig. 20 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 21 is a schematic diagram of a compiling system according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions of the embodiments of the present application will be described below with reference to the accompanying drawings.
In the description of embodiments herein, any embodiment or design that is "exemplary," "such as," or "for example" is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary," "such as" or "for example," etc., is intended to present related concepts in a concrete fashion.
Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating an indicated technical feature. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless expressly specified otherwise.
Before the present solution is described, technical terms involved in the present solution are first described.
1. Micro-services: a software architecture style is based on small functional blocks focusing on single responsibility and functions, which are combined into a complex large application program in a modularized manner, and the functional blocks communicate with each other using language-independent APIs.
2. Micro front end: the method is expanded from the micro-service concept, a large single mode is abandoned, the front end is wholly decomposed into small and simple blocks, and the blocks can be independently developed, tested and deployed, and simultaneously still be aggregated into a product to be presented to clients. It is understood that micro-front-end is an architectural style that aggregates multiple, independently deliverable small front-end applications into one whole.
3. A uniform resource locator (Uniform Resource Locator, URL), commonly referred to as a web Address, or web Address for short, is an Address (Address) of a standard resource on the internet, like a house number on a network.
4. The main application: the base application in the micro front end base mode scheme has only one main application in the micro front end framework.
5. Platform application: the host application is used as a platform, collectively referred to as a platform application.
6. Sub-applications: extended applications nested in micro-front end main application content area, sub-applications can have multiple
7. Plug-in: a computer program is provided for adding specific functions required for an application program through interaction with the application program (such as a web browser and an email client).
8. Plug-in: the application is realized in a plug-in mode to realize the functions of dynamic loading and hot updating.
9. plugin. Json: json (JavaScript Object Notation) a configuration file in a platform plugin scenario.
Next, the present embodiment will be described.
In the development process of the website, the problems that the public capability of each front-end webpage cannot be integrated as required, the public capability and the webpage display style cannot be realized, the content cannot be unified and the menu on the webpage is frequently changed often exist.
In order to solve the problems that the public capability of the front-end webpage cannot be integrated as required, cannot be used and the webpage display style and content cannot be unified. Although, strict design specifications and development specifications can be formulated to restrict designers and front-end developers, the style of web pages output by a development team is unified as much as possible, and the phenomenon of repeated development and non-uniform style can be solved to a certain extent by packaging part of common components. However, the design specifications and development specifications cannot be brought into full play, and the practitioner does not necessarily adhere to the specifications strictly. Different design teams and development teams always have detail differences in the aspect of realizing the same function, and the problem that the styles of output web pages are not uniform cannot be fundamentally solved. The method for independently packaging the common components is a method for solving the problem of different repeated workload and styles, but the method often increases additional workload, and with the development of business, old components cannot adapt to the development of new business, and at the moment, the functions of the additional components are required to be increased, even the original components are abandoned, and flexible integration and expansion cannot be realized.
In order to cope with the problem of frequent menu change in daily development. Although, the front-end developer can change the code of the menu according to the change of the requirement by independently packaging the components related to the menu, so as to develop the suitability. However, the components related to the menu are individually packaged, and are changed according to the change of the requirement, a large number of codes are often required to be changed or introduced, and new problems are easily introduced by modification, so that the problems of products occur.
In view of this, the embodiment of the application provides a loading method of a website. And recording the configuration information of the menu content, the platform function and the sub-application function of the target website in the configuration file. The configuration information of the target website stored in the configuration file can be modified in real time in the loading process of the target website. When the target website is loaded, the public webpage part of the target website is used as a main application, namely a platform application, and each sub-application can select proper platform functions to combine with the sub-application to form a new webpage according to requirements. When the target website is loaded, the public webpage part of the target website is loaded as the initial webpage of the target website, and when the follow-up website needs to introduce sub-applications, the sub-application function can be introduced based on the initial webpage of the target website to generate a new webpage, so that the problem that the public capacity of the front-end webpage cannot be integrated as required and cannot be shared is solved.
Next, the technical solution provided in the embodiments of the present application will be described.
By way of example, fig. 1a shows an application scenario in which an electronic device 100 may be included. The electronic device 100 may be used to load a target website. The electronic device 100 may receive a user operation through the display page of the target website, and update the display page of the target website according to the user operation. The page may include: address bar, menu bar, function loading area. The address bar is used for identifying the URL of the currently displayed page, the menu bar is used for identifying functions which can be provided by the website, and the function loading area is used for responding to the operation of a user on the menu bar to generate the page corresponding to the menu bar.
In one possible example, fig. 1b shows another application scenario, in which an electronic device 100 and a server 200 may be included. The electronic device 100 may receive the user's operation through the display page of the target website, obtain corresponding configuration information from the server 200 according to the user's operation, and update the display page of the target website according to the obtained configuration information. For example, after the user performs the first operation on the display page of the target website, the electronic device may send the first operation information to the server, and the server 200 may determine whether the user has the authority of the first operation, and if the user does not have the authority, the server returns the first information to the electronic device, where the first information is used to identify that the user does not have the authority of the first operation. And if the user has the authority, returning second information, wherein the second information comprises configuration information of the page to be displayed in response to the first operation.
In some embodiments, the electronic device 100 and the server 200 may be connected through a wired network (wireless network) or a wireless network (wireless network). For example, the network may be a local area network (local area networks, LAN) or a wide area network (wide area networks, WAN) (e.g., the internet). The network between the terminal device 100 and the server 200 may be implemented using any known network communication protocol, which may be various wired or wireless communication protocols, such as ethernet, universal serial bus (universal serial bus, USB), firewire (firewire), global system for mobile communications (global system for mobile communications, GSM), general packet radio service (general packet radio service, GPRS), code division multiple access (code divisionmultiple access, CDMA), wideband code division multiple access (wideband code division multiple access, WCDMA), time division multiple access (time-division code division multiple access, TD-SCDMA), long term evolution (long termevolution, LTE), new air interface (NR), bluetooth (blue) wireless fidelity (wireless fidelity, wi-Fi), etc.
By way of example, fig. 2 shows a hardware structure of the electronic device 100. The electronic device 100 may be, but is not limited to, a mobile phone, a tablet computer, a notebook computer, a PC (personal Computer, PC), a wearable device, a smart television, and other electronic devices. Exemplary embodiments of the electronic device include, but are not limited to, electronic devices that carry iOS, android, windows, hong System (Harmony OS), or other operating systems. The type of the electronic device is not particularly limited in the embodiments of the present application.
As shown in fig. 2, the electronic device 100 may include: including a processor 110, a memory 120, a display 130, a communication module 140, and an input device 150. Wherein the processor 110, the memory 120, the display 130, the communication module 140, and the input device 150 may be connected by a bus or other means.
The processor 110 is a computing core and a control core of the electronic device 100. Processor 110 may include one or more processing units.
The memory 120 may store a program that is executable by the processor 110 to cause the processor 110 to perform some or all of the methods that the electronic device 100 provided in the embodiments of the present application needs to perform. Memory 120 may also store data. The processor 110 may read the data stored in the memory 120. The memory 120 and the processor 110 may be separately provided. Optionally, the memory 120 may also be integrated in the processor 110.
The display screen 130 is used to display images, videos, and the like. For example, the display 130 may display pages that need to be displayed by a website loaded on the electronic device 100.
The communication module 140 may include a mobile communication module or other wireless communication module. Where the communication module 140 comprises a mobile communication module, the communication module 140 may provide a solution for wireless communication, including 2G/3G/4G/5G, etc., applied on the electronic device 100.
In some embodiments, the electronic device 100 may also include an input device 150. Based on the content in the page displayed on the display 130, information may be input to the electronic device 100 and/or a control instruction may be issued through the input device 150, so as to trigger the page displayed on the display 130 to be updated. By way of example, the input device 150 may be, but is not limited to, a mouse, keyboard, etc.
It is to be understood that the structure illustrated in fig. 2 of the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, electronic device 100 may include more or fewer components than shown, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The above is a description of the application scenario and the hardware structure of the electronic device 100 related to the application embodiment. Next, before introducing the loading process of the website provided by the embodiment of the present application, the loading process of the micro front end architecture provided by the embodiment of the present application is described based on the above description.
By way of example, fig. 3 illustrates a loading process of the micro front end architecture, which may be performed by a browser in the electronic device shown in fig. 2. Wherein, a front-end program such as a route management service and an application management service is run on the browser. As shown in fig. 3, the configuration file for storing the configuration values of the target website may be a plugin.
(1) And reading the configuration information of the platform application of the target website from the plugin. Json file.
In this embodiment, the configuration files of the menu content, the platform function and the sub-application function of the website that need to be loaded on the electronic device are recorded in the plugin. Json file, and simultaneously, the configuration files stored in the plugin. Json file are allowed to be modified in real time, or the menu can be edited and modified in real time on the browser interface, and the modified configuration files are stored in the plugin. Json file, so that the plugin. Json can be updated in real time, and the purpose of modifying the menu and the function of the target website in real time is achieved.
In this embodiment, the public web page portion (such as a menu) of the target website is used as a main application, that is, a platform application, and when the target website is loaded, the platform application needs to be initialized. The function specifically corresponding to a certain menu can be used as a sub-application, and the sub-application can be set according to actual needs.
In one possible example, configuration information of a menu of the target website needs to be read from the plugin. Json file at the time of initialization of the platform application. The platform application then determines the overall menu layout of the platform application, i.e., initializes the menu logic of the platform application, based on the menu information obtained from the plugin. Json file.
In one possible example, the format of the menu information of the platform application stored in the plugin. Json file is shown in fig. 4. Referring to fig. 4, the plugin. Json file is mainly divided into a header declaration, a menu configuration module, and an internationalization configuration module. The menu configuration module is further divided into a primary menu configuration module and a lower menu configuration module.
The header declaration includes version information of an application program interface (application program interface, API) of the target website and application information of the target website. Wherein the version information of the API is responsible for declaring the version of the software tool development kit (software development kit, SDK) used by the platform application. The SDK version used by the platform application requires matching of the SDK version used by the child applications installed by the platform application. If the target websites are not matched, errors are reported in the running process of the target websites. The application information of the target website is responsible for declaring a name key of the target website, wherein the name key of the target website can uniquely identify the target website.
The primary menu configuration module and the subordinate menu configuration module are similar in format and comprise names of menus, addresses of the menus, rights of the menus and subordinate nested contents. The name of the menu may be an internationalization name key corresponding to the menu, and corresponds to an internationalization name value in the internationalization configuration module. The address of the menu is a unique mark of the platform function or the sub-application function corresponding to the menu, the platform function address can be inquired through a user manual, and the sub-application address needs to fill in the corresponding address according to the specific sub-application route. The rights of the menu address are used to control which rights the user has access to the function corresponding to the current menu. The lower level nesting can be used in the primary, secondary and tertiary menus, and new menus can be nested in the primary, secondary and tertiary menus. The new embedded menu also needs to be filled with information such as name, address and rights of the new embedded menu.
The internationalization configuration module includes internationalization flag key values and corresponding internationalization name values. The platform application may support one or more internationalization schemes according to different needs of the user. In the internationalization configuration module, one internationalization flag key value may correspond to a plurality of internationalization name values. The internationalization flag key values are in one-to-one correspondence with names in the menu configuration module. It will be appreciated that a menu has only one unique identifier, i.e. internationalized flag key value, but that a menu may have different names, i.e. different internationalized name values, in different countries.
(2) And initializing platform application to generate a target network station main page.
In this embodiment, the browser obtains configuration information of the platform application from the plugin. Json file, where the configuration information includes menu information of a menu to be displayed on a main page of the target web site, and then the browser may initialize the menu according to the platform application logic, that is, initialize the menu logic through the platform application logic. Since in the platform application, the menu may be displayed in a manner of a primary menu, a secondary menu, a tertiary menu, etc. Therefore, after the menu information in the configuration information of the platform application is obtained from the plugin. Json file, the obtained menu information needs to be initialized according to the logic of the platform application, so that the initialized menu logic is matched with the logic of the platform application. After the initialization of the menu of the platform application is completed, the initialized menu is also required to be assembled on the platform application. And then, transmitting the configuration information of the assembled platform application to an application management service, so that the application management service can generate a page corresponding to the platform application of the target website according to the received configuration information of the platform application.
(3) The URL of the target web site is monitored.
In this embodiment, after loading a page corresponding to the platform application on the target website, the route distribution service provided by the target website also needs to monitor whether the URL on the browser changes in real time. If the URL on the browser is detected to change, the routing distribution service needs to acquire the changed URL and send the changed URL to the application management service.
In one possible example, a complete URL contains a schema, a user name, a password, a hostname, a port, a path, parameters, a query, and a fragment, formatted as follows:
<scheme>://<user>:<password>@<host>:<port>/<path>;<params>?<query>#<frag>
the first part of the URL is called a schema (schema) that describes the type of protocol used to access the resource. The user name and password are those used to access the web site. The hostname may be an IP address or a domain name, and the hostname and port of the URL tells the application which machine to load the resource from. The path of the URL indicates where the resource to be accessed is located at the server. The URL may also contain a number of parameters, which are used between them; "partition". The query string is used to pass parameters to the server to reduce the range of types of resources requested. URL supports the use of fragment components to represent fragments inside a resource, e.g., URL may point to a particular document or section in an HTML document.
(4) And loading the corresponding platform function or sub-application function according to the acquired URL of the target website.
In this embodiment, after the application management service obtains the URL sent by the route distribution service, the function that the page corresponding to the URL needs to be loaded needs to be determined according to the obtained URL.
In one possible example, after receiving the URL sent by the route distribution service, the application management service may obtain, according to a "query" or a "fragment" carried in the received URL, an address of a page corresponding to the URL in the configuration file. Then, the application management service may obtain, in the configuration file, configuration information corresponding to the function to be loaded on the page according to the address. For example, the application management service may load configuration information corresponding to a menu dashboard according to a segment dashboard in URL https:// support. And loading configuration information corresponding to the menu notification rule according to the segment Notification Rules in the URL https:// support.
In one possible example, the specific function that the page corresponding to the URL needs to load may be a function of the platform application or a function of a sub-application. The functions of the platform application may refer to an alarm function, a monitoring function, and the like of the target website. A sub-application may refer to a specific implementation of a certain platform application, such as a topology map of a specific application. The sub-application can be independently developed and deployed relative to the platform application, and if the page corresponding to the URL needs to be loaded with the sub-application function. At this time, the page corresponding to the sub-application needs to be mounted on the platform application, and the mounted sub-application and the platform application are not isolated but integrated.
In one possible example, a sub-application that is installed on a platform application may communicate with the platform application through an SDK. The flow of the sub-application and the platform application communicating through the SDK is shown in fig. 5. The SDK is provided by a platform application, a plurality of functional functions for communication are built in the SDK, and the sub-application needs to refer the functional functions in the SDK provided by the platform application to the items of the sub-application during development.
In the running of the sub-application, internationalization language information, SSO authentication information and the like in the platform deactivation can be obtained by calling a function method in the SDK. Then, the sub-application can synchronize information of the sub-application itself according to the information of the acquired platform application. Specifically, the sub-application may also call a function in the SDK to send a request for obtaining information to the platform application, and after the platform application receives the message of the sub-application, the platform application processes the received message and returns the information requested by the sub-application to form a closed loop.
In some possible examples, configuration information of the platform application and the sub-application, and configuration information of the sub-application mounted on the platform application are stored in a plugin. Json file. And the plugin. Json file may be modified when both the platform application and the sub-application are in the run state. When the platform application and the sub-application are in the running state, the mounting position of the sub-application on the main application can be modified in real time by modifying the content in the plugin.json file, the content is mounted, and the like, so that the plug-in of the sub-application is realized.
In one possible example, as shown in fig. 6, the website page shown in (a) in fig. 6 includes a level one menu "home page", "monitor". Wherein, "monitoring" includes a secondary menu "performance management" and "alarm configuration", and "performance management" includes a tertiary menu "index configuration", "historical KPI", "dashboard". The page shown in (a) in fig. 6 is a page corresponding to a three-level menu "dashboard", and the CPU occupancy rate, the memory occupancy rate, and the storage occupancy rate are displayed in the page in a dashboard manner. For the page shown in fig. 6 (a), the user may modify the configuration file corresponding to the "dashboard" in the plugin. Json file, for example, put the configuration file corresponding to the "dashboard" into the configuration file corresponding to the first-level menu bar, so as to obtain the page shown in fig. 6 (b). For another example, in the plugin. Json file, the configuration corresponding to the "dashboard" is placed in the configuration file corresponding to the secondary menu bar, so that the page shown in fig. 6 (c) can be obtained.
Because the configuration information in the plugin. Json file can be modified in real time when both the platform application and the sub-application are in the running state. Therefore, it is necessary to detect the plugin. Json file in real time during the running of the platform application or sub-application. In one possible example, fig. 7 shows a monitoring flow of the plugin. As shown in fig. 7, includes: step 701-step 705. Steps 701-705 may be performed by the electronic device 100.
And 701, starting a platform application, and loading a plugin. Json file to obtain a current display page of a target website.
In this embodiment, after loading the plugin.json file, the configuration information, such as a menu, of the platform application stored in the plugin.json file needs to be read; the plugin. Json file may be stored in a memory of the server 200 in communication with the electronic device 100, where the electronic device 100 obtains the plugin. Json file from the server; the plugin. Json may also be stored in the memory of the electronic device 100 itself.
Step 702, determining whether the URL corresponding to the target website changes, if so, executing step 703, otherwise, executing step 702.
In this embodiment, after the initialization of the platform application is completed, that is, after the page corresponding to the platform application is generated, it is further required to monitor whether the URL on the browser of the electronic device changes in real time. Wherein, in response to the user's operation on the current page, the front-end program running on the browser generates a new URL.
Step 703, obtaining configuration information corresponding to the changed URL from the plugin. Json file according to the changed URL, and refreshing the current display interface of the target website according to the configuration information;
The configuration information comprises menu configuration information of the current interface and sub-applications downloaded by the menus.
Illustratively, refreshing the current display interface of the target website includes: and judging whether the display interface of the platform function is loaded on the current display page of the target website or the display interface of the function of the sub-application corresponding to each level of menu is loaded according to the URL.
In this embodiment, after determining that the URL changes, the processor on the electronic device determines, according to information carried in the URL after the change, a function that needs to be loaded on the current page, where the function may be a function provided by the platform application or a function provided by a sub-application of the platform application.
In one possible example, after the processor obtains the changed URL, the processor parses the URL and obtains the location information of the configuration file of the function to be loaded in the plugin. Json file according to the "query character" field in the URL. And then, the processor acquires corresponding configuration information from the plugin. Json file according to the acquired position information, and loads the configuration information. The page displayed in the step (a) in FIG. 8 is a web page identified by the URL "https:// support. Example. Com/server-subscribers/foc-db/#/dashboard", and the web page comprises a page corresponding to a three-level menu "dashboard", and CPU occupancy rate, memory occupancy rate and storage occupancy rate are displayed in the page in a dashboard manner. After the URL of the website column is changed into https:// support, example, com/server-subscribers/foc-db/#/Notification Rules, the processor analyzes the 'https:// support, example, com/server-subscribers/foc-db/#/Notification Rules', and then obtains the corresponding configuration information from the plugin.
Step 704, determining whether the plugin. Json file corresponding to the target website changes, if so, executing step 705, otherwise executing step 704.
In this embodiment, since the plugin. Json file may be modified in real time when the website is running, the processor also needs to monitor in real time whether the plugin. Json file corresponding to the current display page changes. For example, the plugin json file may be modified in the memory of the server to obtain an updated plugin json file; the plugin. Json file may also be modified in a memory in the electronic device running the browser to obtain an updated plugin. Json file.
Step 705, refreshing the current display page of the target website according to the changed plugin. Json file.
In this embodiment, if the processor detects that the plugin. Json file corresponding to the current display page changes. The processor needs to acquire the updated configuration file from the plugin. Json file again, and regenerates a new page as a display page of the target website according to the acquired configuration file; the current display interface includes: names of the menus of each level, mounting relations among the menus of each level, or display interfaces of functions of sub-applications corresponding to the menus of each level.
It will be appreciated that the change in URL is in response to a user using the website after posting the current page. The change in the plugin json file is in response to a user operating the website modifying the plugin json file. The URL change and the plugin. Json file change are monitored, the two actions are mutually independent, and no execution sequence exists. That is, step 702 in FIG. 7 may also follow step 704, and is not particularly limited herein
In this embodiment of the present application, by extracting a common module of a website as a platform application, a storage path of a configuration file of the platform application, a storage path of a configuration file of a sub-application to be installed by the platform application, a menu configuration corresponding to the platform, an access right of each menu, and an address of each level of menu, the addresses of the sub-applications to be installed by each level of menu are all recorded by using one configuration file (plugin. Json file). When the platform application or the sub-application mounted on the platform application is in a running state, carrying out thermal modification on the configuration of the menu, the mounting path of each sub-application and a certain sub-application mounted on the menu. Such as modifying a platform menu, adding, deleting, or modifying sub-applications on a platform application.
In one embodiment, specific functions corresponding to sub-applications downloaded from each level of menu may also be modified.
The functions of the platform application and the sub-applications mounted on the platform application can be modified according to the needs of operators. The embodiment of the application also provides a compiling system which can realize visual modification of the functions of the platform application and the sub-applications mounted on the platform application.
By way of example, FIG. 9 illustrates a visual operation interface of a compilation system. As shown in fig. 9, the visual operation interface includes: identification column, operation column, menu column, information display column, function loading area. The menu bar may further include a first menu bar and a second menu bar; for example, the first menu bar may be a primary menu, and the second menu bar may be a secondary menu under the primary menu, and a tertiary menu under the secondary menu.
The identification column is used for displaying the version and the website name of the website which needs to be compiled currently. The user can modify the version and the website name in the identification column. Wherein the website name is a unique name tag of the website, and the version of the website comprises the API version of the current website. The user can select the SDK version corresponding to the current compiled website on the visual editing interface, wherein the SDK version of the main application of the compiled website is required to be consistent with the SDK version called by the sub-application of the website.
In one possible example, as shown in FIG. 9, the currently compiled website name is: the API version of the website is: 1.0.0.
the operation field is used for operating the website which is compiled currently, and comprises a preview button and a save button. When the user clicks on the preview, the compiling system may integrate the edited web pages for viewing by the user. When a user clicks for storage, the compiling system can generate a website deployment package corresponding to the webpage which is currently edited; the generated website deployment package can be stored in a path appointed by a user, and can also be directly released on the internet; it is understood that one web site deployment package corresponds to one plugin. Json file.
The information display column is used for displaying the information of the currently edited component, such as the information of the name, address, authority and the like corresponding to the component. The permission information is used for identifying which users can access the current edited component, such as the access permission of the users corresponding to the menus of all levels, the access permission of each function in the sub-application corresponding to the menus of all levels, and the like.
The menu bar is used for displaying various levels of menus of the edited website. As shown in fig. 9, the menu of the edited website may include: a primary menu, a secondary menu, a tertiary menu, etc. Wherein each primary menu may include a corresponding secondary menu and tertiary menu. The user can set the contents of the menus of each level on the visual operation interface of the compiling system. The function loading area is used for loading the functions of the sub-application of the edited website or the platform application functions of the compiled website.
In one possible example, the menu bar and the identification bar of the edited website are both public web page portions of the target website, and the menu bar and the identification bar of the edited website may be used as public web page portions, i.e., the platform application, when the website is compiled. So that the public web page part can be used as a main application, namely a platform application, when the edited website is loaded. When the edited website subsequently needs to load the sub-application, each sub-application can select a proper platform function in the platform application to combine with the sub-application to form a new webpage.
In one possible example, the hierarchical relationship between the primary menu and the secondary menu may be as shown in fig. 10, where the user clicks "primary menu 1" of the first menu bar, and the secondary menu corresponding to the primary menu 1 is displayed in the second menu bar on the current display interface of the website. By clicking on "secondary menu 1", a tertiary menu contained in secondary menu 1 is displayed in the second menu bar.
In one possible example, after a website that needs to be compiled is imported into the compiling system, a visual editing interface as shown in fig. 11 (b) may be obtained. In the visual compiling interface shown in fig. 11 (b), the menus in the first menu bar and the second menu bar in the compiled web site are in an editable state. Wherein, the menus in the first menu bar and the second menu bar are in an editable state, which means that the hierarchical relationship among the menus can be added/deleted, edited and changed in the first menu bar or the second menu bar.
In one possible example, the menu bar in the visual editing interface is in an editable state after the website to be compiled is imported into the compiling system. Any one of the menus in the menu bar on the page can be displayed by long-pressing the website, so that each menu in the menu bar is in an editable state. As shown in (a) of fig. 11, the user can make the menus in the first menu bar and the second menu bar in an editable state as shown in (b) of fig. 11 by long pressing the one-level menu 1.
In one possible example, as shown in (a) of fig. 12, in the state where the menu bar is in the editable state, by clicking "+" in the first menu bar, a new level one menu, that is, "level one menu 3", may be added in the first menu bar. When the primary menu 3 is added, the secondary menu and the tertiary menu included in the primary menu 3 are displayed by default in the second menu bar, as shown in (b) of fig. 12. The user can edit the secondary menu and the tertiary menu in the secondary menu bar by himself as required. For example, as shown in (c) of fig. 12, the user can increase the tertiary menu contained in the secondary menu 1 by clicking "+" corresponding to the secondary menu 1 in the secondary menu bar, that is, "tertiary menu 3" as shown in (d) of fig. 12 is generated.
In one possible example, the user may delete a menu in the menu bar, and as shown in (a) of fig. 13a, the user may delete a tertiary menu 3 included in the primary menu 3. After the user clicks the delete button on the tertiary menu 3, a pop-up window pops up on the display page to prompt the user whether to determine to delete the tertiary menu 3, as shown in (b) of fig. 13 a. When the user clicks "ok", the tertiary menu 3 is deleted from the second menu bar. After the user deletes the three-level menu 3, as shown in (c) of fig. 13a, the user may also click on the "preview" button of the operation bar to display a preview page of the current operation page. The preview page displayed is shown in fig. 13a (d).
In one possible example, the user may also delete a level one menu in the first menu bar when deleting a menu in the menu bar. After the user clicks the delete button on the primary menu 3 as shown in (a) of fig. 13b, a pop-up window is popped up on the display page as shown in (b) of fig. 13b to prompt the user whether to determine to delete the primary menu 3. When the user clicks "ok", the primary menu 3 is deleted from the first menu bar and the secondary and tertiary menus contained in the primary menu 3 are simultaneously deleted from the second menu bar. After the user deletes the first-level menu 3, as shown in (c) of fig. 13b, the user may also click on the "preview" button of the operation bar to display a preview page of the current operation page. The preview page displayed is shown in fig. 13b (d). Similarly, when the user clicks to delete the secondary menu, the secondary menu and the tertiary menu contained in the secondary menu are simultaneously deleted.
In one possible example, the user may also edit the order of the various menus in the menu bar. As shown in (a) of fig. 14a, the user may click on the first-level menu 3 and drag the first-level menu 3 in the direction shown by the arrow to exchange the display order of the first-level menu 3 and the first-level menu 2, resulting in the display interface shown in (b) of fig. 14 a. As shown in (c) of fig. 14a, the user may click on the tertiary menu 3 and drag the tertiary menu 3 in the direction shown by the arrow to exchange the display order of the tertiary menu 3 and the tertiary menu 1, resulting in the display interface shown in (d) of fig. 14 a.
In one possible example, the user may change the hierarchical relationship between the menus as the user edits the order of the various menus in the menu bar. As shown in (a) of fig. 14b, the user may click on the secondary menu 1 and drag the secondary menu 1 in the direction shown by the arrow. As shown in (b) of fig. 14b, the secondary menu 1 is dragged into the first menu bar to become the primary menu 4. While the tertiary menu contained in the secondary menu 1 is automatically changed to the secondary menu of the primary menu 4.
In one possible example, the user may also edit each menu in the menu bar, as shown in fig. 15 (a), and the user may edit the content displayed by the menu "dashboard" by double clicking the three-level menu "dashboard". As shown in fig. 15 (b), an information display field is displayed on the current operation interface, and information corresponding to a menu "dashboard" is displayed in the information display field. The information corresponding to the menu dashboard comprises: the menu "dashboards" correspond to names, addresses and rights. Wherein the name is internationalization flag key value; the address is a unique mark of the platform function or the sub-application function, the address can be a URL, and when the website is loaded, corresponding configuration information, such as the name of a menu corresponding to the URL address, access authority and the path of the configuration file of the sub-function mounted in the menu, can be read in the plugin.json file through the address; the permissions are permissions for access, for example, it may be set that the content of the current dashboard can only be displayed for users who have logged into the website. The user can edit the name, address and authority corresponding to the dashboard in the information display column. The editing result may be as shown in fig. 15 (c). At this time, for the configuration information corresponding to the web page in fig. 15 (c), the configuration information is already stored in the plugin. Json file (the plugin. Json may include the name, address, authority, and positional relationship of each menu in the current page, and specific menu information included in each level of menu, and the storage path of the configuration file of the sub-application corresponding to each menu), where the contents specifically stored in the plugin. Json file are: the primary menu includes: two menus of a home page and a monitor, and names, addresses and rights of the two menus; the secondary menu under the primary menu 'monitor' comprises 'performance management' and 'alarm configuration', and names, addresses and authorities of the two menus; the three-level menu under the 'performance management' of the second-level menu comprises 'index configuration', 'history KPI' and 'dashboard', and names, addresses and authorities of the three menus; the plugin. Json file further includes a storage path of a configuration file (plug-in) corresponding to the sub-application installed under each menu, for example, a storage path of a configuration file corresponding to a sub-function corresponding to the dashboard, so that when the dashboard is clicked, the browser can load the corresponding sub-function in the function loading area according to the storage path. After the user completes setting the menu "dashboard", the user may also click on the "preview" button in the operation bar, resulting in a preview interface shown in (d) of fig. 15. When the preview interface is displayed, a storage path of a configuration file stored in a plugin. Json file is searched according to an address corresponding to a dashboard, a configuration file (a function plug-in) corresponding to the dashboard is obtained, and a function corresponding to the dashboard is loaded in a function loading area according to the obtained configuration file; it can be understood that the address corresponding to the menu "dashboard" has a one-to-one correspondence with the storage path of the configuration information of the sub-application corresponding to the menu "dashboard".
It can be understood that, in fig. 15 (a), the display interface is a common web page portion of the website, that is, the platform application, and after the user clicks the dashboard, the browser for displaying the target website needs to obtain the storage path of the corresponding configuration information (that is, the configuration information of the sub-application) from the plugin. Json file according to the address of the dashboard, so as to obtain the configuration information, and combine the obtained configuration information with the platform application to generate a new web page, that is, the web page shown in fig. 15 (d).
In one possible example, after completing the compiling work of the website, as shown in fig. 16, the user may click a save button of the operation field to perform a save operation on the compiled website. After the user clicks "save", a pop-up window pops up on the operation interface to let the user determine whether to save the current page. After the user clicks 'confirm', popup window is popped up on the operation interface to inform the user whether the storage is successful. In one possible example, the names of the various levels of menus may also be modified, e.g., the "monitor" in the primary menu may be modified to "monitor", the "alarm configuration" in the secondary menu may be modified to "alarm settings", etc.
It should be noted that, in the example of modifying the menu configuration of the target website corresponding to fig. 11-16, any operation for modifying the menu, for example, the operation for deleting the "first level menu 3" corresponding to the diagram (b) in fig. 13b, updates the plugin. Json file in real time after the operation is completed and the saving is clicked, and at this time, if the server detects that the plugin. Json file is changed, the browser is reported, and the browser triggers the website to refresh; when the browser is closed and then re-opened, and the "Example Center" website is entered, there will be no "level one menu 3" at the first menu bar.
The frequency of monitoring the plugin. Json file by the server may be set, for example, 1s,15s, 1min, 5min, etc., and is not particularly limited here.
In a possible example, the browser may poll the server according to a certain period to determine whether the plugin. Json file is changed, and the polling period of the browser may be 1s,15s, 1min, 5min, or the like, which is not limited in particular herein.
In the embodiment of the application, the platform service (editing interface) with visual configuration is provided through the compiling system, and the menu can be moved randomly, the platform function can be mounted and a plurality of sub-application pages can be mounted on the visual editing interface, so that the freedom degree is higher, the service expansion is convenient, and the development difficulty is reduced.
Next, based on the above description, a website loading method provided in the embodiment of the present application is described. It will be appreciated that this approach is based on what has been described above, and that some or all of this approach may be found in the description above.
By way of example, fig. 17 shows a flow chart of a loading method of a website, which may be executed by the processor of the electronic device shown in fig. 1a or fig. 1b, or by the server shown in fig. 1b, as shown in fig. 17, and the method includes: step 1701-step 1705.
Step 1701, based on the plugin. Json file, obtaining configuration information of a main application of the target website, and initializing the target website according to the configuration information to obtain a first page of the target website.
In this embodiment, the public web page portion of the target website is used as the main application, i.e., the platform application. When a target webpage is started, firstly loading a main application of the target website, and generating a first page, namely a public page, of the target website; the display page of the main application comprises a plurality of menus corresponding to the main application, and sub-menus can be mounted under the plurality of menus, and it is understood that the configuration information of the main application can comprise menu configuration information on a first page of the display main application, such as names, addresses and access rights of all levels of menus.
When a main application of a target website is loaded, a storage path of configuration information corresponding to the application is required to be read from a plugin. Json file, the configuration information of the main application is acquired according to the storage path, the main application is loaded based on the configuration information of the main application, for example, menu information on the main application is loaded, and logic of a menu on the main application is initialized according to main application function logic. The menu information is a menu which needs to be displayed on the first page by default, and a sub-menu corresponding to the menu, such as a secondary menu, a tertiary menu and the like.
In a possible example, the configuration information corresponding to the main application is directly stored in the plugin. Json file, and the configuration information of the main application can be directly obtained from the plugin. Json file.
And taking the public webpage part of the target website as a main application. When the target website is started, the main application of the target website is firstly loaded, and a first page, namely a public page, of the target website is generated. And subsequently, when the target website needs to introduce the sub-application, each sub-application can select a corresponding menu on the first page according to the requirement, and mount the sub-application under the corresponding menu to form a new website in a combining way.
It will be appreciated that since the first page is a common page of the target website, any page subsequently generated at the target website is generated based on the first page, i.e., any page subsequently generated at the target website includes the menu bar of the first page. In one possible example, one primary menu may include a plurality of secondary menus, each of which may include a plurality of tertiary menus. When the three-level menu is the lowest-level menu, each three-level menu can be provided with a sub-application function; if the primary menu does not include the secondary menu, a sub-application may also be installed in a primary menu.
In one possible example, when determining a menu to be mounted on a sub-application, when loading a sub-application function, the processor obtains configuration information corresponding to the sub-application to be loaded from the plugin. Json file, loads a display page of a function corresponding to the sub-application according to a function loading area of the obtained configuration information on a first page, and obtains a second page. The content displayed on the second page is included in the first page. In the function loading area on the first page, the specific process of loading the function corresponding to the sub-application and obtaining a second page can refer to fig. 15.
In one possible example, the plugin. Json file stores a storage path of configuration information of the sub-application, and based on the storage path, the configuration information of the sub-application can be obtained.
Step 1702, determining whether the configuration information corresponding to the currently displayed page of the target website stored in the plugin. Json file changes, if so, executing step 1703, and if not, executing step 1702.
In this embodiment, after the initialization of the target website is completed, it is further required to monitor in real time whether the configuration information of the currently displayed page of the target website in the plugin. Json file changes. If the configuration information of the currently displayed page of the target website in the plugin. Json file changes. The processor needs to acquire the changed configuration information from the plugin. Json file, and generates a new page according to the changed configuration information. If the configuration information of the currently displayed page of the target website in the plugin. Json file is unchanged, whether the URL and the plugin. Json are changed or not needs to be judged in a recycling mode.
The configuration information in the plugin. Json file may be changed, which may be the change of the menu configuration information in the main application, the change of the menu configuration information corresponding to the sub-application, or the change of the mounting path of the sub-application.
It will be appreciated that there is no order of execution of steps 1702 and 1704 during actual operation. The method comprises the steps of monitoring whether the URL of a target website changes or not and monitoring whether the configuration information of a currently displayed page of the target website changes in a plugin. Json file, wherein the two actions can be performed simultaneously and always exist in the running process of the target website.
In some possible examples, as shown in fig. 8, the web page may also be refreshed by detecting whether the URL of the target website changes, and after detecting that the URL of the target website changes, the processor may obtain the corresponding configuration information from the plugin. Json file according to the changed URL, and reload the page of the target website. At this time, whether the plugin. Json file is changed or not, the page is newly loaded. In some possible examples, therefore, in order to save processing resources, it may not be determined if the plugin. Json file has changed if the URL has changed.
Specifically, the step of detecting whether the URL corresponding to the target website changes is:
step 1704, determining whether the URL of the first page changes, if so, executing step 1705, otherwise, executing step 1704.
In this embodiment, after loading of the web page corresponding to the platform application of the target website is completed, it is further required to monitor whether the URL of the target website changes in real time. The URL of the target website changes, which is caused by triggering a function on the current display page of the target website by the user.
Step 1705, acquiring configuration information corresponding to the changed URL from the plugin. Json file, and loading a display page corresponding to the corresponding platform function or sub-application function on the first page according to the acquired configuration information.
In this embodiment, after detecting that the URL of the first page changes, the processor analyzes the changed URL to obtain the location information of the configuration information of the platform function or the sub-application function corresponding to the URL in the plugin. Json file. And then, the processor acquires corresponding configuration information from the plugin. Json file based on the position information, and loads a display interface corresponding to the corresponding platform function or sub-application function on the first page according to the acquired configuration information.
And 1703, updating the current displayed page of the target website.
In this embodiment, whether it is detected that the URL of the target website changes or it is detected that the configuration information of the current display page of the target website in the plugin. Json file changes, the current display page of the target website needs to be updated. When the configuration information in the plugin.json file of the current display page of the target website is monitored to change, updating the current display page based on the updated plugin.json file.
In the embodiment of the application, the menu configuration of the target website to be loaded, for example, the address, the name and the access right corresponding to each level of menu, the storage path of the configuration file of the sub application function corresponding to each level of menu, is recorded in the plugin. Json file, and simultaneously, the user is allowed to modify the corresponding information stored in the plugin. Json file in real time, such as the storage path of the configuration file corresponding to each level of menu address, the mounting relationship of each level of menu, the name, the access right and the sub application; when the sub-application is running, the mounted menu of the sub-application is changed by modifying the plugin. Json file so as to achieve the purpose of modifying the menu of the target website and the mounting function of each menu in real time; for example, in the plugin. Json file, the address of the sub-application corresponding to a certain menu is modified to the address of another sub-application, and when the menu is clicked, a display interface corresponding to another sub-application is loaded in the function loading area. When the website is loaded, the public webpage part is used as a main application, namely a platform application, and each sub-application can select proper platform functions to combine with the sub-application to form a new website according to requirements, namely the sub-application is plugged, so that different sub-applications can be added, deleted and modified on the main application at will when the main application and the sub-application are in an operation state, the flexibility of the architecture is improved, the development efficiency is greatly improved, and the trouble of repeated modification and repeated deployment during the adding, deleting and modifying of the sub-application is avoided.
Based on the above description, the embodiment of the application also provides a loading method of the website. It will be appreciated that the method is set forth based on what has been described above, and that some or all of this method may be found in the description above.
By way of example, fig. 18 shows a flow chart of a method of loading a website, which method may be performed by the electronic device shown in fig. 1a, 1 b. As shown in fig. 18, the method includes steps 1801-1802.
Step 1801, generating a first web page based on a first configuration file, where the first configuration file includes: menu configuration information of the first web page.
In this embodiment, the first configuration file may be a plugin. Json file, where configuration information of the first web page is stored in the plugin. Json file. For example, a first-level menu name, a first-level menu address, an access right of the first-level menu, a sub-application address of the first-level menu mount of the first webpage, configuration information of a sub-menu of the first-level menu mount, a hierarchical relationship between the sub-menu and the first-level menu, a hierarchical relationship between the sub-menus, and the like. The configuration information of the submenu comprises: submenu name, submenu address, access rights for submenus, etc.
In one possible example, the electronic device may obtain configuration information of the platform application from a first configuration file, where the first configuration file includes configuration information of the platform application, where the configuration information of the platform application includes menu configuration information for displaying a first web page of the platform application, where the menu configuration information includes names of menus of each level, addresses of the menus of each level, access rights of the menus of each level, and hierarchical relationships of the menus of each level, and the electronic device may obtain the configuration information of the platform application based on the first configuration file, and generate the first web page of the target website.
In one possible example, after loading the first configuration file, the electronic device may generate the third web page based on a storage path of the sub-application corresponding to the menu in the first configuration file. For example, the electronic device may obtain the configuration information of the sub-application according to the storage path of the sub-application corresponding to the menu of the first webpage stored in the first configuration file. Then, the electronic device generates a third webpage based on the first webpage according to the menu configuration information and the sub-application configuration information of the first webpage.
In one possible example, the electronic device may also obtain a configuration file of the sub-application corresponding to the menu from the first configuration file.
In step 1802, when the first configuration file is changed to the second configuration file, generating a second web page based on the second configuration file, where the second configuration file includes: configuration information of the second web page.
In this embodiment, after the electronic device generates the first web page based on the first configuration file, if the first configuration file is changed to the second configuration file, the electronic device further needs to generate the second web page according to the second configuration file.
In one possible example, the menu information of the first web page is changed, so that the first configuration file corresponding to the first web page is changed into the second configuration file. The change of the menu configuration information of the first web page may mean that at least one item of the menu configuration information of the first web page is changed. For example, at least one item of the sub-menu configuration information is changed, or the hierarchical relationship between the sub-menu and the first-level menu is changed, or the hierarchical relationship between the sub-menus is changed, or the mounting address of the sub-application is changed.
In one possible example, the first configuration file corresponding to the first web page is changed to the second configuration file due to a change of the sub-application downloaded from the menu of the first web page. The change of the sub-application downloaded from the menu of the first web page may mean that the first sub-application downloaded from a certain menu of the first web page is changed to the second sub-application during the display process of the first web page.
In one possible example, the electronic device may obtain the second profile in response to a first operation by the user. Wherein the first operation may include: and editing the menu of the first webpage in the editing page of the first webpage. For example, one of editing a hierarchical relationship of menus, deleting a menu in an edited page, adding a menu in an edited page, and modifying menu configuration information in an edited page.
Based on the compiling system in the above embodiment, the embodiment of the present application further provides a website compiling method. By way of example, FIG. 19 shows a flowchart of a website compiling method. The method may be performed by a processor of the electronic device shown in fig. 1, as shown in fig. 19, the method comprising: step 1901-step 1904.
Step 1901, displaying the editing page of the target website.
In this embodiment, the user may log in to the compiling system and select a target website to be compiled at the compiling system.
In one possible example, a user may upload a website deployment package for a target website that needs to be compiled in a compilation system. The compiling system can display the corresponding websites on a visual operation interface of the compiling system according to the website deployment package uploaded by the user.
In step 1902, in response to the operation of the user on the editing page of the target website, the configuration information corresponding to the target website is updated in the plugin. Json file.
In this embodiment, after displaying the target website on the visual operation interface of the compiling system, the user may perform operations such as adding, deleting, and modifying the target website function on the visual operation interface according to the requirement.
In one possible example, the page of the target website displayed on the visual operation interface of the compiling system is shown in fig. 9. The user can select or input the SDKAPI version required to be used by the sub-application and fill in the website name in the identification column of the visual operation interface shown in fig. 9 according to the requirement.
In one possible example, when the user modifies the menu bar of the visual operation interface of the target website, the user may set the content to be placed by each menu and the display condition of each menu according to the hierarchical relationship of each menu. For example, the user can set the content to be placed in the primary menu, and the display conditions of the secondary menu and the tertiary menu. When configuring the content to be placed of each menu, the user includes the functions of configuring the internationalization flag key value and the name value of the corresponding language of each menu and the corresponding function of each menu. The functions corresponding to the menus can be platform application functions or sub-application functions.
When the platform function corresponding to the menu is configured, a user can query the instruction manual of the target website, confirm the address corresponding to the platform function required to be used, and configure the address into the plugin. Json file. The address corresponding to the platform function refers to a position information address corresponding to the platform function and is associated with the menu. When configuring the sub application functions corresponding to the menus, a user can configure the addresses of the sub application function pages to the addresses of the corresponding menus in the plugin. Json file according to the requirements.
In one possible example, the user may further add a menu to the page corresponding to the target website displayed on the visual operation interface of the compiling system according to the requirement. Wherein, the menu adding process comprises:
step 1, adding menu buttons into a menu bar according to the requirement;
step 2, the names, addresses and authorities of the menu are added in a filling manner;
step 3, generating a preview webpage according to the newly added menu;
and 4, storing the preview webpage under the condition that the preview webpage is error-free.
In one possible example, the user may also modify, as required, a menu in a page corresponding to the display target website on the visual operation interface of the compiling system. The menu modifying process includes modifying the name, address (corresponding function) and authority of the menu, and the menu modifying process includes:
Step 1, clicking a menu to be modified to obtain the name, address and authority of the menu to be modified;
step 2, modifying the name, address and authority of the acquired menu;
step 3, generating a preview webpage according to the modified menu;
and 4, storing the preview webpage under the condition that the preview webpage is error-free.
In this embodiment, when the menu is modified, the rights of the menu may be modified, and in some possible examples, the rights corresponding to the menu include all users accessible and some users accessible. For example, only the user having the administrator authority can access the content corresponding to the partial menu.
In one possible example, the user may delete the menu in the page corresponding to the display target website on the visual operation interface of the compiling system according to the requirement. The process of deleting the menu comprises the following steps:
step 1, selecting a menu to be deleted, and deleting the menu;
step 2, generating a preview webpage after confirming deletion of the deletion menu;
and 4, storing the preview webpage under the condition that the preview webpage is error-free.
Step 1903, responding to the preview operation of the user on the editing interface of the target website, and generating a preview webpage interface of the target website.
In this embodiment, after compiling the target website is completed, the user may preview the page of the target website that is currently compiled to determine whether the target website after compiling meets the requirements.
Step 1904, generating a website deployment package of the target website in response to a storage operation of the editing interface of the user for the target website.
In this embodiment, under the condition that the preview web page interface of the target website has no problem, the compiling system may generate a website deployment package of the target website, where the generated website deployment package may be saved to a path specified by the user, or may be directly published on the internet.
It will be appreciated that in some cases, there is no order of precedence between steps 1902, 1903, 1904. For example, the user can compile and store the website in the compiling process of the website, and can also compile and preview the website.
It will be appreciated that the process of compiling a target website on the visual operation interface of the compiling system may be described with reference to the embodiments corresponding to fig. 10 to 16.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not mean the order of execution, and the execution order of the processes should be determined by the functions and the internal logic, and should not be construed as limiting the implementation process of the embodiments in this application. In addition, in some possible implementations, each step in the foregoing embodiments may be selectively performed according to practical situations, and may be partially performed or may be performed entirely, which is not limited herein. All or part of any features of any of the embodiments of the present application may be freely, and arbitrarily combined without conflict. The combined technical scheme is also within the scope of the application.
Based on the method in the above embodiment, the embodiment of the application further provides a schematic structural diagram of an electronic device, and the electronic device may be used to perform the method in the above embodiment.
By way of example, fig. 20 shows a schematic structural diagram of an electronic device. As shown in fig. 20, the electronic device 2000 includes: a communication module 2010, a processing module 2020, a storage module 2030.
The communication module 2010 is for receiving a first operation of a user. Wherein the first operation may be an input operation by a user on a browser of the electronic device.
The processing module 2020 is configured to obtain, in response to the first operation, configuration information of a main application of the target website from the plugin. Json file, and display a first page of the target website according to the configuration information of the main application. The configuration information of the main application comprises menu information of the main application of the target website.
The communication module 2010 is further configured to receive a selection operation of the first menu from the user on the first page of the target website.
The processing module 2020 is further configured to, in response to a selection operation for a first menu in the first page, obtain configuration information of the sub-application from the first configuration file based on a URL of the sub-application corresponding to the first menu, generate a second page according to the obtained configuration information of the sub-application and the configuration information of the main application, and switch the first page to the second page. Wherein the second page comprises the main application and the sub-application.
The storage module 2030 is used for storing configuration information of a target website.
In one possible example, the processing module 2020 is further configured to determine, in response to a modification operation of the first configuration file by a user, whether configuration information corresponding to a page displayed by the target website stored in the first configuration file changes, and update the page displayed by the target website if the configuration information corresponding to the page displayed by the target website stored in the first configuration file changes.
By way of example, FIG. 21 shows a schematic diagram of a compilation system. As shown in fig. 21, the compiling system 2100 includes: a display module 2110, a processing module 2120, and a storage module 2130.
The display module 2110 is used for displaying the editing page of the target website.
The processing module 2120 is configured to update configuration information corresponding to at least one menu in a configuration file corresponding to a target website in response to an editing operation of the user on the at least one menu in an editing page, where the configuration file corresponding to the target website is used to store the configuration information of the target website;
the processing module 2120 is further configured to generate a website deployment package for the target website in response to the storing operation for the edit page.
The storage module 2130 user stores a configuration file corresponding to the target website.
In one possible example, the processing module 2120 is further configured to generate a preview page of the target website in response to a preview operation for an edit page of the target website.
It will be appreciated that the network device depicted in fig. 20, the embodiment of the compiling system depicted in fig. 21, is merely illustrative. For example, the division of modules is merely a logical function division, and there may be another division manner in actual implementation, for example, multiple modules or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. The functional modules in the embodiments of the present application may be integrated into one processing module, or each module may exist alone physically, or two or more modules may be integrated into one module.
Based on the method in the above embodiment, the present application provides a computer-readable storage medium storing a computer program, which when executed on a processor, causes the processor to perform the method in the above embodiment.
Based on the method in the above embodiment, the present application provides a computer program product, which is characterized in that the computer program product when run on a processor causes the processor to perform the method in the above embodiment.
The method steps in the embodiments of the present application may be implemented by hardware, or may be implemented by a processor executing software instructions. The software instructions may be comprised of corresponding software modules that may be stored in random access memory (random accessmemory, RAM), flash memory, read-only memory (ROM), programmable ROM (PROM), erasable programmable PROM (EPROM), electrically erasable programmable EPROM (EEPROM), registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor such the processor can read information from, and write information to, the storage medium. In the alternative, the storage medium may be integral to the processor. The processor and the storage medium may reside in an ASIC.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present application, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted across a computer-readable storage medium. The computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by a wired (e.g., coaxial cable, fiber optic, digital Subscriber Line (DSL)), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a Solid State Disk (SSD)), or the like.
It will be appreciated that the various numerical numbers referred to in the embodiments of the present application are merely for ease of description and are not intended to limit the scope of the embodiments of the present application.

Claims (10)

1. A method for generating a web page, the method comprising:
generating a first webpage based on the first configuration file; the first configuration file includes: menu configuration information of the first webpage;
generating a second webpage based on a second configuration file under the condition that the first configuration file is changed into the second configuration file; the second configuration file includes: and the menu configuration information of the second webpage.
2. The method of claim 1, wherein changing the first profile to the second profile comprises:
and the menu configuration information of the first webpage is changed.
3. The method of claim 2, wherein the menu configuration information of the first web page comprises: the first webpage comprises a first-level menu name, a first-level menu address, access rights of the first-level menu and addresses of sub-applications mounted on the first-level menu;
the menu information of the first webpage is changed, including: at least one item of menu configuration information of the first webpage is changed.
4. A method according to claim 2 or 3, wherein the menu configuration information of the first web page further comprises: configuration information of submenus mounted on the primary menu, hierarchical relations between submenus and the primary menu and hierarchical relations between submenus; the configuration information of the submenu comprises: the sub-menu name, the sub-menu address and the access authority of the sub-menu;
the menu configuration information of the first webpage is changed, including: at least one item of the sub-menu configuration information is changed, or the hierarchical relationship between the sub-menu and the primary menu is changed, or the hierarchical relationship between the sub-menus is changed.
5. The method of any of claims 1-4, wherein altering the first profile to the second profile comprises:
responding to the first operation of the user to obtain a second configuration file; the first operation includes:
and editing the menu of the first webpage in the editing page of the first webpage.
6. The method of claim 5, wherein the editing operation comprises: editing the hierarchical relation of the menus, deleting one menu in the editing page, adding one menu in the editing page, and modifying one menu configuration information in the editing page.
7. A method for editing a website, comprising:
displaying an editing page of a target website;
responding to the editing operation of at least one menu in the editing page, and updating configuration information corresponding to the at least one menu in a configuration file, wherein the configuration file is used for storing the configuration information of the target website;
and generating a website deployment package of the target website in response to the storage operation of the editing page, wherein the website deployment package is used for deploying the target website.
8. The method of claim 7, wherein editing operations on at least one menu in the editing page comprise: editing the hierarchical relation of the at least one menu in the editing page, deleting one menu in the editing page, adding one menu in the editing page, and modifying one of the configuration information of the at least one menu in the editing page.
9. An electronic device, comprising
A memory for storing a program;
a processor for executing the memory-stored program, which processor is adapted to perform the method of any of claims 1-8 when the memory-stored program is executed.
10. A computer readable storage medium having instructions stored therein, which when run on a computer, cause the computer to perform the method of any of claims 1-8.
CN202310417271.6A 2023-04-17 2023-04-17 Webpage generation method, website editing method and electronic equipment Pending CN116501319A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310417271.6A CN116501319A (en) 2023-04-17 2023-04-17 Webpage generation method, website editing method and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310417271.6A CN116501319A (en) 2023-04-17 2023-04-17 Webpage generation method, website editing method and electronic equipment

Publications (1)

Publication Number Publication Date
CN116501319A true CN116501319A (en) 2023-07-28

Family

ID=87327764

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310417271.6A Pending CN116501319A (en) 2023-04-17 2023-04-17 Webpage generation method, website editing method and electronic equipment

Country Status (1)

Country Link
CN (1) CN116501319A (en)

Similar Documents

Publication Publication Date Title
US11119755B2 (en) Systems and methods for application program and application program update deployment to a mobile device
EP3229148B1 (en) Website access method and device, and website system
EP3732566B1 (en) Dynamically deploying a component in an application
CN109308284B (en) Report menu generation method and device, computer equipment and storage medium
US20170063611A1 (en) User Configuration Mechanism for Internet-of-Things (IOT)
CN110324169B (en) Interface management method and device
CN109639749B (en) Cloud desktop access method, device, equipment and storage medium
US9047308B2 (en) Methods and apparatus for providing unified access to various data resources using virtualized services
WO2023093414A1 (en) Micro-application development method and apparatus, and device, storage medium and program product
CN101944032A (en) Microware updating method, client, server and system
US11327724B2 (en) System and method that support application software development
KR20160061306A (en) Method and apparatus for firmware virtualization
WO2022267175A1 (en) Information processing method and apparatus, and computer device and storage medium
US20210250244A1 (en) Internet of things system topology generation
CN113961463A (en) Application environment switching method and system, storage medium and electronic equipment
CN114968406B (en) Plug-in management method and device, electronic equipment and storage medium
CN114422436A (en) Gateway, gateway control method, gateway control device, electronic equipment and storage medium
US20220342742A1 (en) Graphical management of big data pipelines
CN111382953A (en) Dynamic process generation method and device
CN116501319A (en) Webpage generation method, website editing method and electronic equipment
CN115878860A (en) Menu generation method, device, server equipment and medium
US11372627B2 (en) System and method for providing integrated development environment (IDE) for programmable software system
CN114915565A (en) Method and system for debugging network
KR20220108967A (en) Method for generating application for controlling external electronic device and electronic apparatus for supporting the same
CN114077501A (en) Method, electronic device, and computer-readable medium for managing a microservice architecture system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination