应用声明文件
- 声明文件,位于应用根路径:
manifest.json
json
{
"name": "fine-example",
"nickname": "案例",
"version": "1.0",
"filename": "example-1.0",
"type": "app",
"source": "static",
"system": "window",
"author": "凡图科技",
"description": "案例应用,用于文档演示",
"createTime": "2024-07-11 00:00:00",
"logo": "http://www.finemap.cn/logo.svg"
}完整配置
json
// 以springcloud应用作为示例的完整配置
{
"name": "fine-example",
"nickname": "案例",
"version": "1.0",
"filename": "example-1.0",
"type": "app",
"source": "springcloud",
"system": "window",
"author": "作者",
"description": "描述",
"createTime": "2024-07-11 00:00:00",
"logo": "http://www.finemap.cn/logo.svg",
"isRunning": true,
"startup":"bin\\restart.bat",
"shutdown":"bin\\progress.bat",
"progress":"bin\\startup.bat",
"status":"bin\\shutdown.bat",
"restart":"bin\\status.bat",
"url": [
{
"name": "fine-example",
"nickname": "案例",
"logo": "http://www.finemap.cn/logo.svg",
"show": false,
"location": "location /fine-example { \n proxy_pass http://127.0.0.1:83/fine-example; \n proxy_connect_timeout 60s; \n proxy_read_timeout 180s; \n} "
},
{
"name": "example",
"nickname": "案例",
"logo": "http://www.finemap.cn/logo.svg",
"show": false,
"location": "location /example { \n alias ../../webapps/example-1.0/static/; \n index index.html; \n try_files $uri $uri/ /example/index.html; \n} ",
"type":"dialog",
"isEdit":true,
"attribute":{
"type":"iframe",
"width":800,
"height": 600,
"maxWidth": 1000,
"maxheight": 800,
"minWidth": 600,
"minheight": 400,
"offset": ["100px", "50px"],
"shade": true,
"fullscreen": true,
"resize": true,
"draggable": true,
}
}
],
"data":{
"mysql": {
"name": "fine-example",
"install": {
"2.2.3": "mysql-schema.sql"
},
"update": {
"2.2.2": "mysql-schema-update-2.2.2.sql",
"2.2.3": "mysql-schema-update-2.2.3.sql"
}
},
"nacos": {
"dataId": "",
"group": "DEFAULT_GROUP",
"format": "yaml",
"file": "application.yaml"
}
}
}基础结构
| 名称 | 必填 | 属性 | 作用 |
|---|---|---|---|
| name | String | 应用名称(英文,单词用‘-’分隔) 1. 应用唯一标识 2. 文件路径默认前缀 3. 作为应用服务名称 | |
| nickname | String | 应用昵称(可以是中文) | |
| version | String | 版本号(1.0.0:主版本.次版本.修订版本) | |
| filename | String | 文件路径(在应用中的文件夹名称) | |
| type | String | 应用类型(lib | app对应webapps) | |
| source | String | 应用来源(static | springboot | springcloud | other) | |
| system | String | Array | 运行系统(window | linux | [window,linux]) | |
| author | String | 应用作者 | |
| description | String | 应用描述 | |
| createTime | String | 创建时间 | |
| logo | String | 应用logo链接(读取资源文件logo) | |
| extend | Object | 应用扩展属性 | |
| isRunning | Boolean(true) | 应用是否需要运行 | |
| startup | String | 应用启动程序 | |
| shutdown | String | 应用关闭程序 | |
| progress | String | 应用进程检查 | |
| status | String | 应用启动状态 | |
| restart | String | 应用重启程序 | |
| property | - | Object | 应用属性(系统运行属性) |
| url | Array | 应用链接 | |
| tool | Array | 应用组件 | |
| data | Object | 初始化数据 |
扩展属性
| 名称 | 属性 | 作用 |
|---|---|---|
| getRoleList | String | 应用角色列表接口 |
| getPermissionList | String | 应用权限列表接口 |
脚本
| 文件 | 作用 |
|---|---|
| bin/startup | 启动程序 |
| bin/shutdown | 关闭程序 |
| bin/progress | 进程检查 |
| bin/status | 启动状态 |
| bin/restart | 重启程序 |
应用属性
应用属性提示
- 系统属性,应用创建过程中,不可使用该属性。
系统属性
| 名称 | 必填 | 属性 | 默认值 | 作用 |
|---|---|---|---|---|
| isSystem | Boolean | false | 是否系统必带应用(true:不能卸载) | |
| isStartup | Boolean | null | 是否可以用户自己启动(false:不能自己启动) | |
| isShutdown | Boolean | null | 是否可以用户自己关闭(false:不能自己关闭) | |
| isRestart | Boolean | null | 是否可以用户自己重启(false:不能自己重启) |
运行属性
| 名称 | 必填 | 属性 | 默认值 | 作用 |
|---|---|---|---|---|
| installTime | String | - | 应用安装时间 | |
| startTime | String | - | 应用启动时间 | |
| processTime | String | - | 应用运行时间(启动成功) | |
| closingTime | String | - | 应用关闭时间 |
应用链接
| 名称 | 必填 | 属性 | 默认值 | 作用 |
|---|---|---|---|---|
| name | String | 基础结构name | 应用名称 | |
| nickname | String | 基础结构nickname | 应用昵称(可以是中文) | |
| logo | String | - | 应用logo链接(读取静态文件logo) | |
| show | Boolean | true | 是否显示到应用列表中 | |
| location | String | - | 路径映射(nginx,location块规则) | |
| type | String | dialog | 打开方式 (dialog,_blank,_self) | |
| isEdit | Boolean | true | 是否可以编辑 | |
| attribute | Object | - | 应用扩展属性 |
扩展属性
| 名称 | 必填 | 属性 | 默认值 | 作用 |
|---|---|---|---|---|
| type | String | iframe | 打开方式( iframe | web ) | |
| width | String | Number | - | 应用对话框宽度 | |
| height | String | Number | - | 应用对话框高度 | |
| maxWidth | String | Number | - | 应用对话框最大宽度 | |
| maxheight | String | Number | - | 应用对话框最大高度 | |
| minWidth | String | Number | - | 应用对话框最小宽度 | |
| minheight | String | Number | - | 应用对话框最小高度 | |
| offset | String | Array | - | 应用对话框显示位置:['100px', '50px'] | |
| shade | Boolean | true | 应用对话框是否有遮罩 | |
| fullscreen | Boolean | true | 应用对话框是否可以全屏 | |
| resize | Boolean | true | 应用对话框是否允许拉伸 | |
| draggable | Boolean | true | 应用对话框是否可以拖拽 |
静态文件
json
{
"url": [
{
"name": "example",
"nickname": "案例",
"logo":"http://www.finemap.cn/logo.svg",
"show": true,
"location": "location /example {
alias ../../webapps/example-1.0/static/;
index index.html;
try_files $uri $uri/ /example/index.html;
}"
//"location": "location /example { \n alias ../../webapps/example-1.0/static/; \n index index.html; \n try_files $uri $uri/ /example/index.html; \n} "
}
]
}反向代理
json
{
"url": [
{
"name": "fine-example",
"nickname": "案例",
"logo":"http://www.finemap.cn/logo.svg",
"show": false,
"location": "location /fine-example {
proxy_pass http://127.0.0.1:81/fine-example;
proxy_connect_timeout 60s;
proxy_read_timeout 180s;
try_files $uri $uri/ /fine-example/index.html;
}"
//"location": "location /fine-example { \n proxy_pass http://127.0.0.1:81/fine-example; \n proxy_connect_timeout 60s; \n proxy_read_timeout 180s; \n try_files $uri $uri/ /fine-example/index.html; \n} "
}
]
}应用组件
| 名称 | 必填 | 属性 | 默认值 | 作用 |
|---|---|---|---|---|
| name | String | 基础结构name | 组件名称(名称使用英文) | |
| nickname | String | 基础结构nickname | 组件昵称(可以是中文) | |
| size | String | 1x1 | 组件大小 (nxn:高x宽) | |
| tagAttr | Object | - | 组件标签属性({"name":"value"}) | |
| type | String | - (为空:不打开) | 打开方式 (,dialog,_blank,_self) | |
| url | String | - | 打开链接 (可以来源于location) | |
| attribute | Object | - | 组件扩展属性,同应用扩展属性 | |
| content | Object | - | 组件内容 | |
| iframe | String | - | iframe组件链接(content为空使用iframe) |
组件内容
| 名称 | 必填 | 属性 | 默认值 | 作用 |
|---|---|---|---|---|
| html | String | - | 组件文本链接 | |
| css | String | Array | - | 组件样式链接 | |
| js | String | Array | - | 组件js链接 | |
| callback | String | - | 组件加载完成回调函数名称 默认参数(event,node) |
初始化数据
mysql数据
- 数据库初始化: 在安装过程中,会将sql运行到对应的mysql数据库中
| 名称 | 必填 | 属性 | 作用 |
|---|---|---|---|
| name | String | 应用名称(英文,单词用‘-’分隔) | |
| install | String | Object | 安装文件(文件或者列表) | |
| update | Object | 更新文件 |
mysql数据库配置
json
{
"data":{
"mysql": {
"name": "fine-example",
"install": {
"2.2.3": "fine-example.sql"
},
"update": {
"2.2.2": "fine-example-update-2.2.2.sql",
"2.2.3": "fine-example-update-2.2.3.sql"
}
}
}
}nacos配置
- nacos配置: 在安装过程中,会将配置文件配置到对应的Nacos(如果为多条数据,可以使用数组)
| 名称 | 必填 | 属性 | 作用 |
|---|---|---|---|
| dataId | String | Nacos配置标识符 | |
| group | String | Nacos配置分组 | |
| format | String | Nacos配置格式 | |
| file | String | Nacos配置格式文件 |
json
{
"data":{
"nacos": {
"dataId": "",
"group": "DEFAULT_GROUP",
"format": "yaml",
"file": "application.yaml"
}
}
}案例
静态应用
静态应用-声明文件
json
// static应用完整配置示例
{
"name": "fine-example",
"nickname": "案例",
"version": "1.0",
"filename": "example-1.0",
"type": "app",
"source": "static",
"system": "window",
"author": "作者",
"description": "描述",
"createTime": "2024-07-11 00:00:00",
"isRunning": true,
"logo": "http://www.finemap.cn/logo.svg",
"url": [
{
"name": "example",
"nickname": "案例",
"logo": "http://www.finemap.cn/logo.svg",
"show": true,
"location": "location /example { \n alias ../../webapps/example-1.0/static/; \n index index.html; \n try_files $uri $uri/ /example/index.html; \n} ",
"type":"dialog",
"isEdit":true,
"attribute":{
"type":"iframe",
"width":800,
"height": 600,
"maxWidth": 1000,
"maxheight": 800,
"minWidth": 600,
"minheight": 400,
"offset": ["100px", "50px"],
"shade": true,
"fullscreen": true,
"resize": true,
"draggable": true,
}
}
]
}springboot应用
单例应用-声明文件
json
//springboot应用完整配置示例
{
"name": "fine-example",
"nickname": "案例",
"version": "1.0",
"filename": "example-1.0",
"type": "app",
"source": "springboot",
"system": "window",
"author": "作者",
"description": "描述",
"createTime": "2024-07-11 00:00:00",
"logo": "http://www.finemap.cn/logo.svg",
"isRunning": true,
"startup":"bin\\restart.bat",
"shutdown":"bin\\progress.bat",
"progress":"bin\\startup.bat",
"status":"bin\\shutdown.bat",
"restart":"bin\\status.bat",
"url": [
{
"name": "fine-example",
"nickname": "案例",
"logo": "http://www.finemap.cn/logo.svg",
"show": false,
"location": "location /fine-example { \n proxy_pass http://127.0.0.1:83/fine-example; \n proxy_connect_timeout 60s; \n proxy_read_timeout 180s; \n} "
},
{
"name": "example",
"nickname": "案例",
"logo": "http://www.finemap.cn/logo.svg",
"show": true,
"location": "location /example { \n alias ../../webapps/example-1.0/static/; \n index index.html; \n try_files $uri $uri/ /example/index.html; \n} ",
"type":"dialog",
"isEdit":true,
"attribute":{
"type":"iframe",
"width":800,
"height": 600,
"maxWidth": 1000,
"maxheight": 800,
"minWidth": 600,
"minheight": 400,
"offset": ["100px", "50px"],
"shade": true,
"fullscreen": true,
"resize": true,
"draggable": true,
}
}
],
"data":{
"mysql": {
"name": "fine-example",
"install": {
"2.2.3": "mysql-schema.sql"
},
"update": {
"2.2.2": "mysql-schema-update-2.2.2.sql",
"2.2.3": "mysql-schema-update-2.2.3.sql"
}
}
}
}springcloud应用
微服务应用-声明文件
json
// springcloud应用完整配置示例
{
"name": "fine-example",
"nickname": "案例",
"version": "1.0",
"filename": "example-1.0",
"type": "app",
"source": "springcloud",
"system": "window",
"author": "作者",
"description": "描述",
"createTime": "2024-07-11 00:00:00",
"logo": "http://www.finemap.cn/logo.svg",
"isRunning": true,
"startup":"bin\\restart.bat",
"shutdown":"bin\\progress.bat",
"progress":"bin\\startup.bat",
"status":"bin\\shutdown.bat",
"restart":"bin\\status.bat",
"url": [
{
"name": "fine-example",
"nickname": "案例",
"logo": "http://www.finemap.cn/logo.svg",
"show": false,
"location": "location /fine-example { \n proxy_pass http://127.0.0.1:83/fine-example; \n proxy_connect_timeout 60s; \n proxy_read_timeout 180s; \n} "
},
{
"name": "example",
"nickname": "案例",
"logo": "http://www.finemap.cn/logo.svg",
"show": true,
"location": "location /example { \n alias ../../webapps/example-1.0/static/; \n index index.html; \n try_files $uri $uri/ /example/index.html; \n} ",
"type":"dialog",
"isEdit":true,
"attribute":{
"type":"iframe",
"width":800,
"height": 600,
"maxWidth": 1000,
"maxheight": 800,
"minWidth": 600,
"minheight": 400,
"offset": ["100px", "50px"],
"shade": true,
"fullscreen": true,
"resize": true,
"draggable": true,
}
}
],
"data":{
"mysql": {
"name": "fine-example",
"install": {
"2.2.3": "mysql-schema.sql"
},
"update": {
"2.2.2": "mysql-schema-update-2.2.2.sql",
"2.2.3": "mysql-schema-update-2.2.3.sql"
}
},
"nacos": {
"name": "",
"install": {},
"update": {}
}
}
}应用组件
应用中-声明文件
json
// static+组件 应用完整配置示例
{
"name": "fine-example",
"nickname": "案例",
"version": "1.0",
"filename": "example-1.0",
"type": "app",
"source": "static",
"system": "window",
"author": "作者",
"description": "描述",
"createTime": "2024-07-11 00:00:00",
"isRunning": true,
"logo": "http://www.finemap.cn/logo.svg",
"url": [
{
"name": "example",
"nickname": "案例",
"logo": "http://www.finemap.cn/logo.svg",
"show": true,
"location": "location /example { \n alias ../../webapps/example-1.0/static/; \n index index.html; \n try_files $uri $uri/ /example/index.html; \n} ",
"type":"dialog",
"isEdit":true,
"attribute":{
"type":"iframe",
"width":800,
"height": 600,
"maxWidth": 1000,
"maxheight": 800,
"minWidth": 600,
"minheight": 400,
"offset": ["100px", "50px"],
"shade": true,
"fullscreen": true,
"resize": true,
"draggable": true,
}
}
],
"tool": [
{
"name":"example-weather-middle",
"nickname":"天气组件",
"size":"2x2",
"tagAttr":{
"id":"cbaf79e3-13d4-45d7-8f06-f8e63a0c5fa8"
},
"type":"dialog",
"url":"/example",
"attribute":{
"type":"iframe",
"width":800,
"height": 600,
"maxWidth": 1000,
"maxheight": 800,
"minWidth": 600,
"minheight": 400,
"offset": ["100px", "50px"],
"shade": true,
"fullscreen": true,
"resize": true,
"draggable": true,
},
"content":{
"html":"/example/2x2/weather-middle.html",
"css":"/example/2x2/weather-middle.css",
"js":"/example/2x2/weather-middle.js"
}
},
{
"name":"example-weather-big",
"nickname":"天气组件",
"size":"2x4",
"iframe":"/example/weather-big.html"
}
]
}