Background
With the further development of internet applications, in order to provide more and more comprehensive network experience for users, in a network system of a client and server (BS) architecture, more and more elements are provided by an operator and carried by a client. In order to guide the user to operate the client correctly, detailed page help of the client is often provided in the server to introduce the content function of the client, and an interface for obtaining help information is provided in the page of the client.
The router help information function is considered from the user perspective, and the user can view the use method and related description of each function through help information in the router interface function interface. With the increase of router functions and the complexity of functions, help information becomes increasingly cumbersome. The company has a plurality of products, and the help information of the same function of different products can be different.
1) The existing products of the router of the company are K2, K2P, K3, K3C, K2T, full-house routing and the like. In these products, the routers of different products share common functions, such as the security settings of the routers. The hints of the routers for different products may also vary.
2) For each product, there is a set of unified front-end pages, and the interfaces of each product are from unified front-end codes.
3) Different help information prompts for different products are provided, each product is subjected to model differentiation, different pages are added into product models separately for different places of each product, and the pages in each model can replace the pages in the unified front-end codes during compiling.
4) The help information specific content update is updated in the language table in the server, and a specific label is generated and applied to the code.
5) And the difference of the help information is processed in the page of the machine type, and different required tags are filled in the page according to the help information requirement of the product.
The help system and the implementation method thereof as disclosed in the invention patent with publication number CN101576822A, the help system includes: the operation monitoring module is used for monitoring user operation and sending information of the user operation and help information corresponding to the user operation; the storage module is used for receiving and storing the information and the help information from the operation monitoring module; and the statistical analysis module is used for acquiring the information and the help information from the storage module and performing statistical analysis on the information and the help information. The method for realizing the help information is only suitable for one product, and the help information needs to be completely reproduced when the product is updated, so that a great amount of workload is increased for developers.
Meanwhile, in the related art, as shown in fig. 1, A, B, C, D identifies router products K2, K2P, K3, and K3C, respectively.
1) When handling help information in a page, the help information has three formats, title: function subtitle, content: functional content, summary: the function is small, the help information needs to be added with title, content and summary pairs in the page, and when the help information is numerous, a plurality of CSS element pairs appear in the page, which is tedious.
2) When adding help information, opening the same front end code, adding new code in the code
<li class="summary">{%helpStr.modeSet%}</li>
<li class="title">{%label.routerMode%}</li>
<li class="content">{%helpStr.routerMode%}</li>,
Each page is provided with a plurality of codes with the same format, and when a lot of information is newly added, the workload increased in the unified front-end code is large, and the codes increased in the product model are also large. The more code, the more error prone, the more difficult to maintain and the worse performance.
3) When there are many title, content and summary pairs in a page, help information filling is also prone to errors, and is prone to cause inconsistency with PRD. Bug easily appears in the plate sending, and the product pushing is influenced.
Therefore, under the condition that products are numerous and help information of different products is complex, how to have a method for simply maintaining and updating help information prompts of each function of the router becomes a problem to be solved by the invention.
Disclosure of Invention
Aiming at the technical problems in the prior art, the invention provides an optimization processing system and a method for router help information, the invention adds an ID which is the same as the name of a page in a page CSS code, and constructs a CSS element with a fixed format by processing the ID through a function defined in hellp.JS, and a developer for subsequent maintenance only needs to add a help information pair in hellp.js, does not need to add and delete operation in each page, and does not need to open each page for operation.
In order to achieve the technical purpose, the invention adopts the following technical scheme:
an optimization processing system of router assistance information, comprising:
the acquisition module is used for acquiring the name of the page;
the definition module is used for adding an ID which is the same as the name of the page in the CSS code of the page;
a construction module for constructing fixed format CSS elements by processing the ID through a function defined in the help.
As a preferred aspect of the present invention, the obtaining module obtains the name of the page through stateman current name.
Preferably, the definition module removes CSS codes of title, content, and summary pairs in the page, and adds < div ID ═ ID > < div > to the CSS codes of the page to increase IDs.
Preferably, the construction module processes the ID through a definition function deal ID () in the help. And forms a CSS element containing a < li title content summary > fixed format by a SetContent () function in the help.
Preferably, the system further comprises a display module, configured to insert the content constructed by the construction module into the end of the < div ID ═ ID > < div > through a function apned () when the clickshap () function is called.
A method for optimizing router help information, comprising:
s1, acquiring the name of the page;
s2, adding an ID which is the same as the name of the page in the CSS code of the page;
s3, processing the ID through a function defined in the help.
Preferably, the step S1 includes: s11, obtain the name of the page through stateman current name.
Preferably, the step S2 includes: s21, removing the CSS codes of title, content and summary pairs in the page, and adding < div ID ═ ID > < div > in the CSS codes of the page to increase the ID.
Preferably, the step S3 includes: s31, removing the CSS codes of title, content and summary pairs in the page, and adding < div ID ═ ID > < div > in the CSS codes of the page to increase the ID.
Preferably, the method further comprises: and S4, when the clickHelp () function is called, inserting the content constructed by the construction module into the end of the < div ID ═ ID > < div > through a function apend ().
The technical scheme provided by the invention can have the following beneficial effects:
1. the method is used for optimizing and displaying the router help information, the subsequent maintenance is very simple, a developer only needs to add the help information pair in the help p.js, does not need to add or delete the help information pair in each page, and does not need to open each page for operation.
2. The invention adds an ID which is the same as the name of the current page in the CSS code of the page, uses formHelpContent () to construct the CSS form of title, content and summary, loads and forms a character string with fixed format, then uses SetContent () to process each ID, forms a total character string containing < li title content summary >, defines the content of help information, and only needs to fill corresponding help information content in the title, content and summary when in subsequent maintenance.
Detailed Description
The present invention will now be described more fully hereinafter with reference to the accompanying drawings, in which embodiments of the invention are shown. This invention may, however, be embodied in many different forms and should not be construed as limited to the specific embodiments set forth herein. Rather, these embodiments are provided to convey the scope of the invention to those skilled in the art.
Unless otherwise defined, terms (including technical and scientific terms) used herein should be understood to have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. Moreover, it will be understood that terms used herein should be interpreted as having a meaning that is consistent with their meaning in the context of this specification and the relevant art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
Example 1
The technical solution of the present invention is described in detail below with reference to the accompanying drawings.
The embodiment provides an optimization processing system for router help information, as shown in fig. 2, including: the method comprises an acquisition module 100, a definition module 200 and a construction module 300, wherein the specific operation process of the scheme is as follows:
the obtaining module 100 is configured to obtain a name of a page.
When loading each function page, the obtaining module 100 obtains the ID name of each page.
A defining module 200, configured to add an ID that is the same as the name of the page in the CSS code of the page.
An ID is added in the page CSS code, and the ID is the same as the ID name of the page, so that the subsequent operation is facilitated.
A construction module 300 for constructing fixed format CSS elements by processing the ID through a function defined in the help.
The ID is processed through a function defined in the JS script file, and a fixed-format CSS element is constructed.
The prompting of the help information of different router products has difference, and technicians select to fill the help information into an inherent format according to the related function and the page corresponding to the ID when maintaining the help information, without opening each page for operation.
In summary, the optimization processing system for the router help information provided by this embodiment is used for optimizing and displaying the router help information, the subsequent maintenance is very simple, and a developer only needs to add a help information pair to a help page, does not need to add and delete a help information pair to each page, and does not need to open each page for operation.
Example 2
The present embodiment is substantially the same as embodiment 1, and includes an obtaining module 100, a defining module 200, and a constructing module 300 in embodiment 1, where the present embodiment is different from embodiment 1 in that the present embodiment further includes: as shown in fig. 3, the display module 400 of this embodiment specifically operates as follows:
the obtaining module 100 obtains the name of the page through stateman current name.
When the page is loaded, for example, when the security setting page is loaded, it can be seen that the ID of the security setting page is safeMng, and the page ID is preferably acquired through stateman current name. In short, the three parameters, namely, stateman current name, are requested to be transmitted through the network, and the page ID returned by the interface is obtained.
The definition module 200 removes the CSS codes of title, content, and summary pairs in the page, and adds < div ID ═ ID > < div > to the CSS codes of the page.
After the ID of the page is obtained, all CSS codes related to title, content and summary pairs are removed from the original page, then < div ID ═ ID' > < div > codes are added into the page, and the ID is the same as the page ID.
The construction module 300 processes the ID through a definition function deal ID () in a help script file, and defines a formHelpContent () to obtain CSS elements with fixed formats of title, content and summary; and forms a CSS element containing a < li title content summary > fixed format by a SetContent () function in the help.
Defining a function dealID () in a help script file to define information corresponding to all IDs, wherein the dealID is used for forming a final character string needing to be added;
the define function formHelpContent () is used to construct CSS form of title, content, and summary, load a character string forming a fixed format, and return the character string. formHelpContent () is used to generate a fixed-format string. Wherein the function formHelpContent () constructs separate character strings of title, content and summary.
SetContent () is used to process each ID to form a total string containing < li title content metadata >.
For example, a page may be said to represent a function, and then there may be multiple pairs of < li title content metadata > in a function, and formHelpContent () is responsible for constructing title, content, metadata; SetContent () is used to merge the contents of the formhelmontent () construct together into a total string containing < li title content summary >.
Preferably, all the content of the help information has been defined in help.js, following a format "timeZone" [ ], [ ], [ ] contained in parentheses, for example: the first middle bracket is filled with title content, the second is filled with content, and the third is filled with multiple metadata content.
The system for optimizing the router help information further comprises a display module, which is used for inserting the content constructed by the construction module 300 into the end of the < div ID ═ ID > < div > through a function apend () when the clickHelp () function is called.
In each page loaded, if the user clicks on the display help information button "? The system automatically calls the clickHelp () function, and then displays the help information of the function after a character string apend () formed by the function SetContent () is carried out to < div ID ═ ID >.
In summary, in the optimization processing system for router help information provided in this embodiment, an ID that is the same as the current page name is added to a page CSS code, a form help content () is used to construct a CSS format of title, content, and summary, a string with a fixed format is loaded and formed, a SetContent () is used to process each ID, a total string including a < li title content summary > is formed, the content of help information is defined, and during subsequent maintenance, it is only necessary to fill corresponding help information content in title, content, and summary respectively.
Example 3
The embodiment provides an optimization processing method of router help information, as shown in fig. 4, a specific flow of the method may include the following steps:
and S1, acquiring the name of the page.
And acquiring the ID names of the pages when the pages with the functions are loaded.
And S2, adding the ID same as the name of the page in the CSS code of the page.
An ID is added in the page CSS code, and the ID is the same as the ID name of the page, so that the subsequent operation is facilitated.
S3, processing the ID through a function defined in the help.
The ID is processed through a function defined in the JS script file, and a fixed-format CSS element is constructed.
The prompting of the help information of different router products has difference, and technicians select to fill the help information into an inherent format according to the related function and the page corresponding to the ID when maintaining the help information, without opening each page for operation.
In summary, the method for optimizing the router help information provided by this embodiment is used for optimizing and displaying the router help information, the subsequent maintenance is very simple, and a developer only needs to add a help information pair to a help page, does not need to add or delete a help information pair to each page, and does not need to open each page for operation.
Example 4
The present embodiment provides a method for optimizing router assist information, as shown in fig. 5, including steps S1-S3 in embodiment 3, and the specific flow thereof is as follows:
the step S1 includes: s11, obtain the name of the page through stateman current name.
When the page is loaded, for example, when the security setting page is loaded, it can be seen that the ID of the security setting page is safeMng, and the page ID is preferably acquired through stateman current name. In short, the three parameters, namely, stateman current name, are requested to be transmitted through the network, and the page ID returned by the interface is obtained.
The step S2 includes: s21, removing the CSS codes of title, content and summary pairs in the page, and adding < div ID ═ ID > < div > in the CSS codes of the page to increase the ID.
After the ID of the page is obtained, all CSS codes related to title, content and summary pairs are removed from the original page, then < div ID ═ ID' > < div > codes are added into the page, and the ID is the same as the page ID.
S31, removing the CSS codes of title, content and summary pairs in the page, and adding < div ID ═ ID > < div > in the CSS codes of the page to increase the ID.
Defining a function dealID () in a help script file to define information corresponding to all IDs, wherein the dealID is used for forming a final character string needing to be added;
the define function formHelpContent () is used to construct CSS form of title, content, and summary, load a character string forming a fixed format, and return the character string. formHelpContent () is used to generate a fixed-format string. Wherein the function formHelpContent () constructs separate character strings of title, content and summary.
SetContent () is used to process each ID to form a total string containing < li title content metadata >.
For example, a page may be said to represent a function, and then there may be multiple pairs of < li title content metadata > in a function, and formHelpContent () is responsible for constructing title, content, metadata; SetContent () is used to merge the contents of the formhelmontent () construct together into a total string containing < li title content summary >.
Preferably, all the content of the help information has been defined in help.js, following a format "timeZone" [ ], [ ], [ ] contained in parentheses, for example: the first middle bracket is filled with title content, the second is filled with content, and the third is filled with multiple metadata content.
As shown in fig. 5, A, B, C, D identifies router products K2, K2P, K3, and K3C, respectively. Firstly, establishing a file of Featrue.js in a router product, defining help information corresponding to all IDs in hellp.js, having different help information according to functions of different products for model compatibility, and if the Featrue.js has contents, covering the contents in the Featrue.js. The dealID is used to process feature.js to select which functions need to be displayed.
The help information optimization processing method of this embodiment:
<div id="ModeSwitch">
definition ID in pages
formHelpContent () of
ret+='<li class="title">'+helpStr[idList1[0][i]]+'</li>\n
ret+='<li class="content">'+helpStr[idList1[1][i]]+'</li>\n
ret+='<li class="summary">'+helpStr[idList1[2][i]]+'</li>\n'
return ret;
$("#"+name).append(ret);
The newly generated CSS style may be added to the page.
The method for optimizing the router help information further includes S4, when the clickshap () function is called, inserting the content constructed by the construction module to the end of the < div ID ═ ID >/div > through the function apend ().
In each page loaded, if the user clicks on the display help information button "? The system automatically calls the clickHelp () function, and then displays the help information of the function after a character string apend () formed by the function SetContent () is carried out to < div ID ═ ID >.
In summary, in the method for optimizing help information of a router provided in this embodiment, an ID that is the same as the name of a current page is added to a page CSS code, a form of a CSS for constructing title, content, and summary is used by formhelp content (), a character string in a fixed format is loaded and formed, and then SetContent () is used to process each ID, a total character string including < li title content summary > is formed, the content of the help information is defined, and during subsequent maintenance, only corresponding help information content needs to be filled in the title, content, and summary, so that maintenance is easy.
Other embodiments of the present disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.