CN112579076A - Method and system for separating front end and rear end of gotty - Google Patents

Method and system for separating front end and rear end of gotty Download PDF

Info

Publication number
CN112579076A
CN112579076A CN202011464832.0A CN202011464832A CN112579076A CN 112579076 A CN112579076 A CN 112579076A CN 202011464832 A CN202011464832 A CN 202011464832A CN 112579076 A CN112579076 A CN 112579076A
Authority
CN
China
Prior art keywords
module
checking
token
gotty
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
CN202011464832.0A
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.)
Inspur Cloud Information Technology Co Ltd
Original Assignee
Inspur Cloud Information Technology 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 Inspur Cloud Information Technology Co Ltd filed Critical Inspur Cloud Information Technology Co Ltd
Priority to CN202011464832.0A priority Critical patent/CN112579076A/en
Publication of CN112579076A publication Critical patent/CN112579076A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/36Software reuse
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a method and a system for separating front and back ends of a gotty, belonging to the field of database setting; the method comprises the following specific steps: s1 embedding the front end part of the gotty application into the current end of the Angular item; s2, a front-end page is newly built at the current end of Angular item, and token information transmission and self-defined parameters are added; s3, adding token verification to the rear end of the gotty application, judging the product name and checking the parameters; s4 returns the corresponding information according to the check sum; according to the method, the front end and the back end of Gotty are separated, the Gotty front end is integrated into an Angular project, the free style configuration of page display is increased, the parameters of custom transmission are increased, the transmission and verification of token are increased, the application safety of terminal access is improved, and meanwhile the control of page display is achieved.

Description

Method and system for separating front end and rear end of gotty
Technical Field
The invention discloses a method and a system for separating front and back ends of a gotty, and relates to the technical field of database setting.
Background
With the rapid development of internet technology, networks are more and more important in daily life of people. Under the current background of cloud computing and big data, data of modern enterprises and governments are developing towards a large capacity direction, and with the development of emerging technologies of big data platforms, the information obtaining modes of people are more and more abundant. When the database operation is complex and the page operation is not supported, people tend to operate the most direct data, namely logging in the database through a terminal (TTY) and directly operating through a command line tool; when the command of the database instance needing to be operated on the cloud environment is complex, the processing for facilitating the operation of the user becomes more complex;
angular is a strong front-end framework, and is mainly strong in binding static pages with dynamic data. The method is characterized by bidirectional binding of data, modularization of codes, encapsulation of labels, attributes and annotations, strong dependence injection and the like; the NG-ZORRO is a front-end UI component library constructed by developers of different departments such as the Ali computing platform division, the Ali cloud and the like on the basis of original business components, and the NG-ZORRO is used for many reasons, such as rich component types, ecology combined with ant-design, the Ali experience in the project, fast version updating iteration, beautiful interfaces and the like.
Gotty is currently a simple Go language-based command line tool that can share terminals (TTY) as web programs; it will convert the command line tool into a web program; it uses the Chrome OS's terminal emulator (xterm) to execute JavaScript based terminals on the Web browser; the existing page display is completely limited by Gotty rear-end configuration, the flexibility is weak, the front-end page display style, format and distinctive setting cannot be freely configured, the user experience of the page and the reading of complex data are limited by the current display mode, more convenient, faster and more attentive service cannot be obtained, the experience is poor, and the system is complex to use, so that the method and the system for separating the front end from the rear end of the Gotty are invented to solve the problems.
Disclosure of Invention
The invention provides a method and a system for separating front and rear ends of a gotty, aiming at the problems in the prior art, and the adopted technical scheme is as follows: a separation method of front and back ends of gotty comprises the following specific steps:
s1 embedding the front end part of the gotty application into the current end of the Angular item;
s2, a front-end page is newly built at the current end of Angular item, and token information transmission and self-defined parameters are added;
s3, adding token verification to the rear end of the gotty application, judging the product name and checking the parameters;
and S4 returns corresponding information according to the check sum check result.
The S2 creates a front-end page at the current end of Angular item, and the specific steps of increasing token information transmission and self-defining parameters include:
s201, creating a html file, and adding a div element with a terminal element name;
s202, adding a sidebar which comprises a connection button and a new window opening button;
s203 adds help description.
The specific steps of the S3, namely adding the token verification to the rear end of the gotty application, judging the product name and checking the parameters, comprise:
s301, iam is integrated, the token is checked by Keycoakclient.ValidateToken, and for tokens which do not conform to the check, information of 'no operation authority of current user' is returned;
s302, adding checking and verification of the product name by using a processWSConn method;
s303, compiling a dockerfile file, constructing a rear-end mirror image, and deploying.
The concrete steps of the processWSConn method in S302 include:
s3021, reading the connection information, and returning to the websocket connection failure when an error is reported;
s3022, comparing the message types, and returning an illegal message type when the message types are inconsistent;
s3023, converting the format of the connection information message, wherein error returning to websocket connection failure occurs in the conversion process;
s3024, checking token and error, and returning no operation authority of the current user;
s3025, acquiring parameter information, and checking through an ice method if the product application is ice, and checking through a mysql method if the product application is mysql;
s3026, converting the arguments parameter, and returning failure of converting the parameter when an error is reported;
s3027 creates a related resource and returns result information.
A separation system of front and back ends of a gotty comprises a front-end processing module, a front-end setting module, a back-end processing module and an information feedback module:
a front-end processing module: embedding the front end part of the gotty application into the current end of the Angular item;
the front end is provided with a module: a front-end page is newly built at the current end of Angular item, and the transmission and self-defining parameters of token information are increased;
a back-end processing module: adding token verification to the rear end of the gotty application, judging the product name and checking the parameters;
an information feedback module: and returning corresponding information according to the check sum check result.
The front end setting module specifically comprises a file establishing module, a button adding module and a description adding module:
a file establishing module: creating an html file, and adding a div element with the element name of terminal;
the button adds the module: adding a side bar which comprises a connecting button and a new window opening button;
describing an add-on module: and adding help description.
The back-end processing module specifically comprises a check addition module, a name check module and a mirror addition module:
checking the added module: the integration iam, the token is checked by adding the verification to the token through Keyloakclient. ValidateToken, and for the token which is not in accordance with the verification, the information of 'no operation authority of the current user' is returned;
a name checking module: the method of processWSConn is used for increasing the checking and verification of the product name;
mirror image add module: and compiling a dockerfile, constructing a back-end mirror image and deploying.
The name checking module specifically comprises a reading module, a comparing module, a converting module, an authority module, a parameter module, a converting module and a creating module:
a reading module: reading the connection information, and returning to the websocket connection failure when an error is reported;
a comparison module: comparing the message types, and returning an illegal message type when the message types are inconsistent;
a conversion module: converting the format of the connection information message, wherein error returning websocket connection failure occurs in the conversion process;
an authority module: returning to the current user without operation authority when checking token and error;
a parameter module: acquiring parameter information, and checking by using an ice method if the product application is ice, or checking by using a mysql method if the product application is mysql;
a conversion module: converting the arguments parameter, and returning the failure of converting the parameter when an error is reported;
a creation module: and creating related resources and returning result information.
The invention has the beneficial effects that: the application discloses a method for separating front and back ends of a gotty, which is used for displaying a terminal on a web browser; transmitting the output of the terminal to the client, receiving the input from the client, and forwarding the input to the terminal; the token check can be added to the separated gotty according to the requirement, so that the access security is improved; transfer parameters can be added or deleted according to requirements, and the use expandability is improved; when a user uses the system to operate the terminal, only the actual operation content needs to be concerned, the information that the token check does not pass is returned for unsafe access, and the information that the parameter transmission is wrong and the check is requested is returned for the parameter which does not meet the requirement, so that the convenience of using the user is ensured, and the requirement of using the system by the user is met; meanwhile, the invention has high reusability, and a user only needs to ensure the Angular environment and the NG-ZORRO component library and directly uses the logic of the invention without additional operation, thereby improving the reusability and ensuring the execution accuracy.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is a flow chart of the method of the present invention; FIG. 2 is a schematic diagram of the system of the present invention; FIG. 3 is a flow diagram of front-end processing of an embodiment of the present invention; fig. 4 is a flow chart of a back-end process of an embodiment of the present invention.
Detailed Description
The present invention is further described below in conjunction with the following figures and specific examples so that those skilled in the art may better understand the present invention and practice it, but the examples are not intended to limit the present invention.
The first embodiment is as follows:
a separation method of front and back ends of gotty comprises the following specific steps:
s1 embedding the front end part of the gotty application into the current end of the Angular item;
s2, a front-end page is newly built at the current end of Angular item, and token information transmission and self-defined parameters are added;
s3, adding token verification to the rear end of the gotty application, judging the product name and checking the parameters;
s4 returns the corresponding information according to the check sum;
when using the method of the invention to separate the front and back of gotty, the front part of the gotty application is first embedded into the current end of Angular item according to S1:
copying a js/src directory under the Gotty item into a webshell-ui component of a front-end item, wherein the path is webshell-ui/js/src/;
then, the content of js/src/main.ts is put into a ts file corresponding to a front-end page, namely webshell-ui.component.ts;
and then, according to S2, a front-end page is newly built at the current end of the Angular item, the transmission and self-defining parameters of token information are added, and the content of the front end is modified:
json adds the dependency of xterm and hterm in the package, and the version number of the xterm is 2.7.0;
adding a token parameter in the initialized WebTTY parameter, and obtaining the token parameter from the cookie;
customizing args parameters by self, modifying the arg parameters according to the needs of products or projects, and transmitting the arg parameters as parameters when WebTTY is initialized;
modifying the access address of ws into a rear-end deployment address;
modifying the content in webshell-ui.component.ts according to the Angular coding rule, then starting the application, and testing the connection;
then, adding token verification to the rear end of the gotty application according to S3, judging the product name, checking the parameters, and returning corresponding information according to the verification and checking result according to S4;
according to the method, the front end and the back end of Gotty are separated, the Gotty front end is integrated into an Angular project, the free style configuration of page display is increased, the parameters of custom transmission are increased, the transmission and verification of token are increased, the application safety of terminal access is improved, and meanwhile the control of page display is realized; according to the method, the front end and the back end are separated, the front end and the back end check are added, the self-defined parameter transmission is realized, the page display style is controlled, compared with a method of directly using Gotty, the rapidness, convenience and adaptability of data reading are improved, the execution difficulty of complex data operation of a user is reduced, and therefore the product using efficiency and the rapidness and the comfort of the product use of the user are improved;
further, the step S2 of creating a front-end page at the current end of Angular, and the specific step of adding token information transmission and custom parameters includes:
s201, creating a html file, and adding a div element with a terminal element name;
s202, adding a sidebar which comprises a connection button and a new window opening button;
s203, adding help description;
further, the specific steps of the S3, adding token verification to the rear end of the gotty application, judging the product name, and checking the parameter include:
s301, iam is integrated, the token is checked by Keycoakclient.ValidateToken, and for tokens which do not conform to the check, information of 'no operation authority of current user' is returned;
s302, adding checking and verification of the product name by using a processWSConn method;
s303, compiling a dockerfile file, constructing a rear-end mirror image, and deploying.
Still further, the specific steps of the processWSConn method in S302 include:
s3021, reading the connection information, and returning to the websocket connection failure when an error is reported;
s3022, comparing the message types, and returning an illegal message type when the message types are inconsistent;
s3023, converting the format of the connection information message, wherein error returning to websocket connection failure occurs in the conversion process;
s3024, checking token and error, and returning no operation authority of the current user;
s3025, acquiring parameter information, and checking through an ice method if the product application is ice, and checking through a mysql method if the product application is mysql;
s3026, converting the arguments parameter, and returning failure of converting the parameter when an error is reported;
s3027 creates a related resource and returns result information.
Example two:
a separation system of front and back ends of a gotty comprises a front-end processing module, a front-end setting module, a back-end processing module and an information feedback module:
a front-end processing module: embedding the front end part of the gotty application into the current end of the Angular item;
the front end is provided with a module: a front-end page is newly built at the current end of Angular item, and the transmission and self-defining parameters of token information are increased;
a back-end processing module: adding token verification to the rear end of the gotty application, judging the product name and checking the parameters;
an information feedback module: returning corresponding information according to the check sum check result;
when the system of the invention is used for separating the front end and the back end of the gotty, firstly, a front end processing module is used for embedding the front end part of the gotty application into the current end of the Angular item:
copying a js/src directory under the Gotty item into a webshell-ui component of a front-end item, wherein the path is webshell-ui/js/src/;
then, the content of js/src/main.ts is put into a ts file corresponding to a front-end page, namely webshell-ui.component.ts;
then, a front-end page is newly built at the current end of Angular item by utilizing a front-end setting module, the transmission and self-defining parameters of token information are increased, and the content of the front end is modified:
json adds the dependency of xterm and hterm in the package, and the version number of the xterm is 2.7.0;
adding a token parameter in the initialized WebTTY parameter, and obtaining the token parameter from the cookie;
customizing args parameters by self, modifying the arg parameters according to the needs of products or projects, and transmitting the arg parameters as parameters when WebTTY is initialized;
modifying the access address of ws into a rear-end deployment address;
modifying the content in webshell-ui.component.ts according to the Angular coding rule, then starting the application, and testing the connection;
then, adding token verification to the rear end of the gotty application through a rear-end processing module, judging the product name, checking the parameters, and returning corresponding information according to the verification and checking result through an information feedback module;
according to the system, the front end and the back end of Gotty are separated, the Gotty front end is integrated into an Angular project, the free style configuration of page display is increased, the parameters of custom transmission are increased, the transmission and verification of token are increased, the application safety of terminal access is improved, and meanwhile the control of page display is realized; according to the method, the front end and the back end are separated, the front end and the back end check are added, the self-defined parameter transmission is realized, the page display style is controlled, compared with a method of directly using Gotty, the rapidness, convenience and adaptability of data reading are improved, the execution difficulty of complex data operation of a user is reduced, and therefore the product using efficiency and the rapidness and the comfort of the product use of the user are improved;
further, the front-end setting module specifically includes a file establishing module, a button adding module and a description adding module:
a file establishing module: creating an html file, and adding a div element with the element name of terminal;
the button adds the module: adding a side bar which comprises a connecting button and a new window opening button;
describing an add-on module: adding help description;
further, the back-end processing module specifically includes a check addition module, a name check module, and a mirror addition module:
checking the added module: the integration iam, the token is checked by adding the verification to the token through Keyloakclient. ValidateToken, and for the token which is not in accordance with the verification, the information of 'no operation authority of the current user' is returned;
a name checking module: the method of processWSConn is used for increasing the checking and verification of the product name;
mirror image add module: and compiling a dockerfile, constructing a back-end mirror image and deploying.
Still further, the name checking module specifically comprises a reading module, a comparing module, a converting module, an authority module, a parameter module, a converting module and a creating module:
a reading module: reading the connection information, and returning to the websocket connection failure when an error is reported;
a comparison module: comparing the message types, and returning an illegal message type when the message types are inconsistent;
a conversion module: converting the format of the connection information message, wherein error returning websocket connection failure occurs in the conversion process;
an authority module: returning to the current user without operation authority when checking token and error;
a parameter module: acquiring parameter information, and checking by using an ice method if the product application is ice, or checking by using a mysql method if the product application is mysql;
a conversion module: converting the arguments parameter, and returning the failure of converting the parameter when an error is reported;
a creation module: and creating related resources and returning result information.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (8)

1. A separation method of front and rear ends of gotty is characterized by comprising the following specific steps:
s1 embedding the front end part of the gotty application into the current end of the Angular item;
s2, a front-end page is newly built at the current end of Angular item, and token information transmission and self-defined parameters are added;
s3, adding token verification to the rear end of the gotty application, judging the product name and checking the parameters;
and S4 returns corresponding information according to the check sum check result.
2. The method as claimed in claim 1, wherein the step S2 of creating a front-end page at the current end of Angular, and the specific step of adding token information transmission and custom parameters includes:
s201, creating a html file, and adding a div element with a terminal element name;
s202, adding a sidebar which comprises a connection button and a new window opening button;
s203 adds help description.
3. The method as claimed in claim 2, wherein the step S3 of adding token check to the backend of the gotty application, determining the product name, and checking the parameters includes:
s301, iam is integrated, the token is checked by Keycoakclient.ValidateToken, and for tokens which do not conform to the check, information of 'no operation authority of current user' is returned;
s302, adding checking and verification of the product name by using a processWSConn method;
s303, compiling a dockerfile file, constructing a rear-end mirror image, and deploying.
4. The method as claimed in claim 3, wherein the concrete steps of the processWSConn method in S302 include:
s3021, reading the connection information, and returning to the websocket connection failure when an error is reported;
s3022, comparing the message types, and returning an illegal message type when the message types are inconsistent;
s3023, converting the format of the connection information message, wherein error returning to websocket connection failure occurs in the conversion process;
s3024, checking token and error, and returning no operation authority of the current user;
s3025, acquiring parameter information, and checking through an ice method if the product application is ice, and checking through a mysql method if the product application is mysql;
s3026, converting the arguments parameter, and returning failure of converting the parameter when an error is reported;
s3027 creates a related resource and returns result information.
5. A separation system of front and back ends of a gotty is characterized by specifically comprising a front-end processing module, a front-end setting module, a back-end processing module and an information feedback module:
a front-end processing module: embedding the front end part of the gotty application into the current end of the Angular item;
the front end is provided with a module: a front-end page is newly built at the current end of Angular item, and the transmission and self-defining parameters of token information are increased;
a back-end processing module: adding token verification to the rear end of the gotty application, judging the product name and checking the parameters;
an information feedback module: and returning corresponding information according to the check sum check result.
6. The system of claim 5, wherein the front-end setup module specifically comprises a file creation module, a button add-on module, and a description add-on module:
a file establishing module: creating an html file, and adding a div element with the element name of terminal;
the button adds the module: adding a side bar which comprises a connecting button and a new window opening button;
describing an add-on module: and adding help description.
7. The system of claim 6, wherein the back-end processing module comprises in particular a check add-on module, a name check module and a mirror add-on module:
checking the added module: the integration iam, the token is checked by adding the verification to the token through Keyloakclient. ValidateToken, and for the token which is not in accordance with the verification, the information of 'no operation authority of the current user' is returned;
a name checking module: the method of processWSConn is used for increasing the checking and verification of the product name;
mirror image add module: and compiling a dockerfile, constructing a back-end mirror image and deploying.
8. The system of claim 7, wherein the name checking module specifically comprises a reading module, a comparing module, a converting module, a permission module, a parameter module, a converting module, and a creating module:
a reading module: reading the connection information, and returning to the websocket connection failure when an error is reported;
a comparison module: comparing the message types, and returning an illegal message type when the message types are inconsistent;
a conversion module: converting the format of the connection information message, wherein error returning websocket connection failure occurs in the conversion process;
an authority module: returning to the current user without operation authority when checking token and error;
a parameter module: acquiring parameter information, and checking by using an ice method if the product application is ice, or checking by using a mysql method if the product application is mysql;
a conversion module: converting the arguments parameter, and returning the failure of converting the parameter when an error is reported;
a creation module: and creating related resources and returning result information.
CN202011464832.0A 2020-12-14 2020-12-14 Method and system for separating front end and rear end of gotty Pending CN112579076A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011464832.0A CN112579076A (en) 2020-12-14 2020-12-14 Method and system for separating front end and rear end of gotty

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011464832.0A CN112579076A (en) 2020-12-14 2020-12-14 Method and system for separating front end and rear end of gotty

Publications (1)

Publication Number Publication Date
CN112579076A true CN112579076A (en) 2021-03-30

Family

ID=75131892

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011464832.0A Pending CN112579076A (en) 2020-12-14 2020-12-14 Method and system for separating front end and rear end of gotty

Country Status (1)

Country Link
CN (1) CN112579076A (en)

Similar Documents

Publication Publication Date Title
US10108535B2 (en) Web application test script generation to test software functionality
CN109739478B (en) Front-end project automatic construction method and device, storage medium and electronic equipment
US6868454B1 (en) Distributed-object development system and computer-readable recording medium recorded with program for making computer execute distributed-object development
US8201143B2 (en) Dynamic mating of a modified user interface with pre-modified user interface code library
US6615253B1 (en) Efficient server side data retrieval for execution of client side applications
US7289964B1 (en) System and method for transaction services patterns in a netcentric environment
US8370859B2 (en) Creating web services from an existing web site
US10599447B2 (en) System construction assistance system and method, and storage medium
AU2005200852A1 (en) System and method for building wireless applications with intelligent mapping between user interface and data components
CN111324833A (en) Page display method, device, electronic design and computer readable medium
WO2022247594A1 (en) Page rendering method and apparatus, electronic device, computer-readable storage medium, and computer program product
CN110389755B (en) Code processing method and device, electronic equipment and computer readable storage medium
Rischpater JavaScript JSON Cookbook
CN111176629A (en) Application development method and device
CN110750243A (en) Project code development method and system
US10353700B1 (en) Code base sharing between standalone and web-based versions of an application via an emulated network communication channel
CN114217789A (en) Function component expansion method, device, equipment, storage medium and program product
Miravet et al. Framework for the declarative implementation of native mobile applications
CN112579076A (en) Method and system for separating front end and rear end of gotty
Frost Learning WML & WMLScript
CN113641359A (en) Data processing method and device
CN113791778A (en) Software project generation method and device, electronic equipment and storage medium
CN117555645B (en) Data processing method, device, equipment and medium based on multi-terminal application platform
Gupta Accelerated GWT: Building Enterprise Google Web Toolkit Applications
EP1674991A2 (en) System and method for creating web services from an existing web site

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