2 Star 1 Fork 0

sunxy / AIroot-UISYS-RELEASE

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
Apache-2.0

| 中文 | English | 日语 |

UI-SYSTEM-LIB

UI-SYSTEM 的官方库项目

说明

  • UI-SYSTEM 是一套轻巧、高性能、静态前端系统,可以快速构建稳健的WEB服务。
    整套系统采用了混合式的开发思想,即“选择合适的技术做擅长的事,各尽其职,优势融合”。
  • UI-SYSTEM 设计思想是 “简单明了,直截了当”,让前端工程师直接进入开发状态。
  • UI-SYSTEM 在模块化设计上,采用微模块方案,你可以把他理解为DNA和氨基酸的配合,一切展现模块都是即时组合,并且在渲染上做了大量优化,能提供原生性能的渲染体验。
  • UI-SYSTEM 提供了命令行控制服务和自动配置文件两种方式部署,服务采用热更新方式,动态切换服务参数。
  • UI-SYSTEM 采用Go作为开发语言,充分利用了Go的高并发能力,很高兴选择了Go作为服务开发(之前一直使用Java,实际上GO在复杂业务上处理速度已经远远高于Java这门语言,网上很多人用JIT命中高例子和Go对比是不正确的。)

如何使用

WINDOWS

  • 方式1
  1. window系统运行uisys.exe
  2. 从example里面添加一个工程,写法如下:
pub example/v1 :80

其中:80是开启服务的端口好,也可以指定发布地址,如127.0.0.1:80
3. 打开chrome浏览器,输入:http://127.0.0.1/

  • 方式2
  1. 也可以直接将您的工程目录拖动到uisys.exe图标上。
    conv_ops
  2. 确保弹出的控制台没有端口占用错误错误。
  3. 打开chrome浏览器,输入:http://127.0.0.1/

LINUX 和 CENTOS

DARWIN

ARM

服务运行方式

UI-SYS 的服务节点运行方式,默认是以 开发(Development) 模式运行的,在此模式下,UISYS的WEB SERVER 会对扩展名为*.ui,*.es 两种文件进行实时解析,当我们要发布的时候,需要切换到静态发布模式,届时,所有的*.ui,.es都会变成.ui.hmtl这样的扩展名。 如果想了解UISYS的*.ui,*.es扩展名文件的概念可以点击这里。 静态模式命令如下:

$> pub example/v1 :80 -s

命令的格式是在原有格式后加上 -s 即可(-s 代表 static)。

我们介绍下 UISYS 平台的基本命令,包括服务控制命令项目参数设置命令。

命令解析

服务控制命令

1. help

获取帮助信息

$> --help
---------------------------------------------
    lang Language Setting.
    COMMAND: lang <zh/cn>

    pub Publishing websites.
    COMMAND: pub <path> [HTTP Service IP:PORT]

    ls Show services list.
    COMMAND: ls

    add Add services and don't use command as services name.
    COMMAND: add <Service Name> [Project Path] [HTTP Service IP:PORT]
...

2. version

获取软件版本

$> version
---------------------------------------------
    AIroot UI-SYSTEM 0.9.5beta

3. pub

发布指定目录为网站
命令格式: pub [HTTP Service IP:PORT]

$> pub example/v1
---------------------------------------------
  The [p0] setted in [E:\UISYS-RELEASE\example\v1].
  The [p0] starting at  [:80]
  WEB Server Started At: [:80]. Use protocol http

可以指定端口:

$> pub example/v1 :8888
---------------------------------------------
  The [p0] setted in [E:\UISYS-RELEASE\example\v1].
  The [p0] starting at  [:8888]
  WEB Server Started At: [:8888]. Use protocol http

可以指定绝对路径:

$> pub E:\UISYS-RELEASE\example\v1 :8888
---------------------------------------------
  The [p0] setted in [E:\UISYS-RELEASE-0.9.5BETA\example\v1].
  The [p0] starting at  [:8888]
  WEB Server Started At: [:8888]. Use protocol http

对于带空格的路径可以用引号括起来,如下:

$> pub "E:\UISYS RELEASE\example\v1" :8888
---------------------------------------------
  The [p0] setted in [E:\UISYS RELEASE\example\v1\example\v1].
  The [p0] starting at  [:8888]
  WEB Server Started At: [:8888]. Use protocol http

可以指定https服务

$> pub "E:\UISYS-RELEASE\example\v1" https://:80
---------------------------------------------
  The [p0] starting at  [https://:80]
  WEB Server Started At: [:80]. Use protocol https

可以全部制定:

$> pub "E:\UISYS-RELEASE\example\v1" https://10.110.10.34:80
---------------------------------------------
  The [p0] starting at  [https://10.110.10.34:80]
  WEB Server Started At: [10.110.10.34:80]. Use protocol https

4. ls

列出当前存在的服务节点。

$> ls
---------------------------------------------
  0. p1 Running 2019-07-10 23:43:28     D:\UISYS-RELEASE\example\v1       http://0.0.0.0:80/
  1. a2 Stopping        2019-07-10 23:43:43     D:\UISYS-RELEASE\example\v2     http:///
  ----list over----

5. add

Add services and don't use command as services name.
添加服务节点,用于挂在被发布的工程。
注意:服务名称不能使用add作为服务的名字。

  • 命令格式: add <Service Name> [Project Path] [HTTP Service IP:PORT]
$> add a0 example/v1 :80
---------------------------------------------
  The [a0] setted in [E:\UISYS-RELEASE\example\v1].
  The [a0] starting at  [:80]
  WEB Server Started At: [:80]. Use protocol http

也可以只创建服务节点,但是不挂在项目:

$> add a0
---------------------------------------------
  The [a0] added successfully.

如果需要挂在节点,可以通过 stp(set project)命令挂在项目目录:

$> a0 stp example/v1
---------------------------------------------
  The [a0] setted in [C:\Users\Administrator\Desktop\UISYS-RELEASE-0.9.5BETA\example\v1].

此时,我们只是挂在了项目,如果要运行需要使用 run 命令:

$> run a0 :80
---------------------------------------------
  The [a0] starting at  [:80]
  WEB Server Started At: [:80]. Use protocol http

6. run

Start service.
运行服务节点

  • 命令格式: run <Service Name> [IP:PORT], For Example:run test 127.0.0.1:1511
$> run a0
---------------------------------------------
  The [a2] starting at  [:80]
  WEB Server Started At: [:80]. Use protocol http

可以指定端口

$> run a0 :80
---------------------------------------------
  The [a2] starting at  [:80]
  WEB Server Started At: [:80]. Use protocol http

可以指定IP

$> run a0 10.110.10.34:80
---------------------------------------------
  The [a2] starting at  [10.110.10.34:80]
  WEB Server Started At: [10.110.10.34:80]. Use protocol http

可以指定https服务

$> run a0 https://:80
---------------------------------------------
  The [a2] starting at  [https://:80]
  WEB Server Started At: [:80]. Use protocol https

可以全部制定:

$> run a0 https://10.110.10.34:80
---------------------------------------------
  The [a2] starting at  [https://10.110.10.34:80]
  WEB Server Started At: [10.110.10.34:80]. Use protocol https

7. stop

停止服务

  • 命令格式: stop <Service Name>
$> stop a0
---------------------------------------------
  a0 Stop [a0]
  status: [:80]http: Server closed.
  [:80]JUS Server END.

8. rm

移除服务

  • 命令格式: rm <Service Name>
$> rm a0
---------------------------------------------
  [a0] remove success.
  status: [:80]http: Server closed.
  [:80]JUS Server END.

9. nat

实现端口穿透功能。

  • 命令格式: nat <-add/-remove> <本机端口> <映射机器IP:端口号>
    例如,我们希望将本机的12000端口映射到10.110.10.28的3389端口。
    3389 端口是window服务器的远程桌面服务端口,这样就可以暴露本机的12000端口来对外提供服务。
    写法如下:
$> nat -add desktop :12000 10.110.10.28:3389
---------------------------------------------
  The [desktop] starting at  [:12000-->10.110.10.28:3389]
  ----list over----

查看本平台用了多少个对外映射可以:

$> nat
---------------------------------------------
  desktop       [:12000-->127.0.0.1:3389]       Running 0
  ----list over----

如果要删除这个映射服务可以用一下命令:

$> nat -remove desktop
---------------------------------------------
>> accept tcp [::]:12000: use of closed network connection
desktop Close havs error:  close tcp [::]:12000: use of closed network connection
  ----list over----

10. -c

关闭控制台(Console)的输入功能。

$> -c
---------------------------------------------
  Console Input Method Unabled.

11. webc

启动Web版的服务器命令窗口。该功能默认以https发布。

  • 命令格式: webc [HTTP Service IP:PORT]
$> webc
---------------------------------------------
Web Control Server Started At: [:3690]. Use protocol https

如果自己设定服务端口,可以用:

$> webc :10000
---------------------------------------------
Web Control Server Started At: [:10000]. Use protocol https

12. bat

执行批处理命令,可以指定多个批处理文件。

  • 命令格式:bat [batch file Name...]
    UI-SYSTEM 可以运行多个WEB服务,因此如果每次服务重启都要手工重新敲击一边太慢了。 我们可以将经常重服务输入的命令写在一个文件或多个文件里。

例如,我们编写一个“config.conf”,如下:

#发布example/v1工程到80端口
pub example/v1 :80
#发布example/v2工程到90端口
pub example/v2 :90

然后保存到uisys.exe 可以访问的目录,例如,放到uisys目录下。 然后再uisys控制台输入命令:

$> bat config.conf
---------------------------------------------
#发布example/v1工程到80端口
  The [p0] setted in [C:\UISYS-RELEASE\example\v1].
  The [p0] starting at  [:80]
#发布example/v2工程到90端口
  WEB Server Started At: [:80]. Use protocol http
  The [p1] setted in [C:\UISYS-RELEASE\example\v2].
  The [p1] starting at  [:90]
  WEB Server Started At: [:90]. Use protocol http

bat 多个执行多个命令文件,如下:

$> bat config.conf config1.conf "E:/uisys conf/config2.conf"
---------------------------------------------
  ...

13. stat

get application status,for example time and so on. 获取平台的运行状态,用以显示当前平台的起始时间和运行时间。

$> stat
---------------------------------------------
    Date 2019-07-13 23:27:45
    Now  2019-07-13 23:33:20

14. exit

Exit. 退出服务

项目参数设置

1. ctp

create project dir. 创建一个UI交互工程目录,ctp 是 create project 的缩写。 COMMAND: ctp <Project Path> 命令格式:ctp <项目路径>
说明:被创建的工程平台会直接帮您挂在到一个临时服务节点上。

$> ctp D:\uisys\project01
---------------------------------------------
  create project [D:\uisys\project01].

  The [a0] added successfully.
  The [a0] setted in [D:\uisys\project01].
  The project mount at[a0] server.

2. stp

set project dir.
重新设置一个服务节点的工程目录,stp 是 set project 的缩写。
COMMAND: stp <Service Name> 例如,如果平台已有一个服务节点a0,可以重新让其指向"D:\uisys\project01"的路径。

$> stp a0 D:\uisys\project01
---------------------------------------------
  The [a0] setted in [D:\uisys\project01].

3. ctf

create module file.
COMMAND: ctf [-Create Method(-h|m|s|r)] <Service Name> For Example:ctf test component.Test ctf test -hr component.Test

4. release

release project. 发布工程为原生工程,以便其他服务器可以使用。
COMMAND: release <Service Name> [Project Path]

$> release a0 D:\uisys\project-release\
---------------------------------------------
  ----Release Complete----

5. send

push data to Service by websocket.
通过UI-System自建的websocket数据服务,推送数据到WEB客户端。
COMMAND: send <Service Name> <User ID> <UUID> <Value>

6. lw

display websocket list of Service
查看服务节点提供的websocket服务被多少个WEB客户端连接。
COMMAND: lw <Service Name> [-h]

7. info

The project infomation
显示项目信息
COMMAND: rm <Service Name>

8. set

Set project attributes.
设置WEB工程的属性
COMMAND: set <Service Name> <AttributeName> <Value> [Value...]

9. ret

Remove project attributes.
COMMAND: ret <Service Name> <AttributeName>

Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

简介

精简的WEB前端模块化工具,UI 引擎可以充分的发挥HTML“语义化”的思想,把开发人员的思想有效的转化为代码。 展开 收起
JavaScript
Apache-2.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
JavaScript
1
https://gitee.com/uucckk/AIroot-UISYS-LIB.git
git@gitee.com:uucckk/AIroot-UISYS-LIB.git
uucckk
AIroot-UISYS-LIB
AIroot-UISYS-RELEASE
master

搜索帮助