Commit aad0c784 authored by Medicean's avatar Medicean

(Enhance:Setting) 「默认设置」新增「数据管理」设置

parent f701cbb1
...@@ -8,6 +8,20 @@ ...@@ -8,6 +8,20 @@
* 修复 download multipart 发包时 download 发包为空的问题 (asunescape 功能引起) * 修复 download multipart 发包时 download 发包为空的问题 (asunescape 功能引起)
### 数据管理
* 「添加数据」时自动载入「默认设置」中「数据管理」全局配置内容
![adefault_shellmanager_2.png](https://i.loli.net/2019/04/30/5cc83fb205051.png)
### 其它
* 「默认设置」新增「数据管理」设置, 可配置「是否忽略HTTPS证书」、「默认请求超时时长」、「默认 HTTP Header」和「默认 HTTP Body」
> 该配置项仅在「添加数据」时生效,不影响已有配置的 Shell。在添加数据界面修改相应的值, 仅对当前 Shell 配置产生影响,不会影响到默认配置
![adefault_shellmanager_1.png](https://i.loli.net/2019/04/30/5cc83fafdf0d8.png)
## 2019/04/27 `v(2.1.1)` ## 2019/04/27 `v(2.1.1)`
### 核心模块 ### 核心模块
......
{ {
"name": "antsword", "name": "antsword",
"version": "2.1.1", "version": "2.1.1.2",
"description": "中国蚁剑是一款跨平台的开源网站管理工具", "description": "中国蚁剑是一款跨平台的开源网站管理工具",
"main": "app.js", "main": "app.js",
"dependencies": { "dependencies": {
......
...@@ -835,6 +835,71 @@ Hot Keys: ...@@ -835,6 +835,71 @@ Hot Keys:
success: 'Edit success' success: 'Edit success'
} }
}, },
},
shellmanager: {
title: 'ShellManager',
header: {
title: 'Default HTTP Headers',
nodata: 'No HTTP Header data, click the right mouse button add',
grid: {
name: 'Name',
value: 'Vaule',
},
bmenu: {
add: 'Add HTTP Header',
del: 'Del HTTP Header'
},
add: {
title: 'Add HTTP Header',
success: 'Add success',
namedup: 'The name cannot be duplicated',
name_invalid: 'Name is invalid',
addbtn: 'Confirm'
},
del: {
title: 'Delete HTTP Header',
confirm: (num) => antSword.noxss(`Are you sure to delete ${typeof (num) === 'number' ? num + ' Headers' : num + " "}?`),
success: 'Delete success'
},
edit: {
namedup: 'The name cannot be duplicated',
name_invalid: 'Name is invalid',
success: 'Edit success'
}
},
body: {
title: 'Default HTTP Body',
nodata: 'No HTTP Body data, click the right mouse button add',
grid: {
name: 'Name',
value: 'Value',
},
bmenu: {
add: 'Add HTTP Body',
del: 'Del HTTP Body'
},
add: {
title: 'Add HTTP Body',
success: 'Add success',
namedup: 'The name cannot be duplicated',
name_invalid: 'Name is invalid',
addbtn: 'Confirm'
},
del: {
title: 'Delete HTTP Body',
confirm: (num) => antSword.noxss(`Are you sure to delete ${typeof (num) === 'number' ? num + ' HTTP Body' : num + " "}?`),
success: 'Delete success'
},
edit: {
namedup: 'The name cannot be duplicated',
name_invalid: 'Name is invalid',
success: 'Edit success'
}
},
other: {
nohttps: 'Ignore HTTPS certificate',
requestTimeout: 'Request timeout',
}
} }
} }
}, },
......
...@@ -837,6 +837,71 @@ module.exports = { ...@@ -837,6 +837,71 @@ module.exports = {
success: '更新成功' success: '更新成功'
} }
}, },
},
shellmanager: {
title: '数据管理',
header: {
title: '默认请求头',
nodata: '暂无全局请求头, 请单击右键添加',
grid: {
name: '名称',
value: '值',
},
bmenu: {
add: '添加请求头',
del: '删除请求头'
},
add: {
title: '添加默认请求头',
success: '添加成功',
namedup: '名称不能重复',
name_invalid: '名称不合法',
addbtn: '确定'
},
del: {
title: '删除默认请求头',
confirm: (num) => antSword.noxss(`你确定要删除 ${typeof (num) === 'number' ? num + ' 个请求头' : num + " "}吗?`),
success: '删除成功'
},
edit: {
namedup: '名称不能重复',
name_invalid: '名称不合法',
success: '更新成功'
}
},
body: {
title: '默认请求 Body',
nodata: '暂无默认Body, 请单击右键添加',
grid: {
name: '名称',
value: '值',
},
bmenu: {
add: '添加Body',
del: '删除Body'
},
add: {
title: '添加默认请求Body',
success: '添加成功',
namedup: '名称不能重复',
name_invalid: '名称不合法',
addbtn: '确定'
},
del: {
title: '删除默认请求头Body',
confirm: (num) => antSword.noxss(`你确定要删除 ${typeof (num) === 'number' ? num + ' 个请求Body' : num + " "}吗?`),
success: '删除成功'
},
edit: {
namedup: '名称不能重复',
name_invalid: '名称不合法',
success: '更新成功'
}
},
other: {
nohttps: '忽略HTTPS证书',
requestTimeout: '请求超时',
}
} }
} }
}, },
......
...@@ -836,6 +836,71 @@ module.exports = { ...@@ -836,6 +836,71 @@ module.exports = {
success: '更新成功' success: '更新成功'
} }
}, },
},
shellmanager: {
title: '數據管理',
header: {
title: '默認請求頭',
nodata: '暫無全局請求頭, 請單擊右鍵添加',
grid: {
name: '名稱',
value: '值',
},
bmenu: {
add: '添加請求頭',
del: '刪除請求頭'
},
add: {
title: '添加默認請求頭',
success: '添加成功',
namedup: '名稱不能重複',
name_invalid: '名稱不合法',
addbtn: '確定'
},
del: {
title: '刪除默認請求頭',
confirm: (num) => antSword.noxss(`你確定要刪除 ${typeof (num) === 'number' ? num + ' 個請求頭' : num + " "}嗎?`),
success: '刪除成功'
},
edit: {
namedup: '名稱不能重複',
name_invalid: '名稱不合法',
success: '更新成功'
}
},
body: {
title: '默認請求 Body',
nodata: '暫無默認Body, 請單擊右鍵添加',
grid: {
name: '名稱',
value: '值',
},
bmenu: {
add: '添加Body',
del: '刪除Body'
},
add: {
title: '添加默認請求Body',
success: '添加成功',
namedup: '名稱不能重複',
name_invalid: '名稱不合法',
addbtn: '確定'
},
del: {
title: '刪除默認請求頭Body',
confirm: (num) => antSword.noxss(`你確定要刪除 ${typeof (num) === 'number' ? num + ' 個請求Body' : num + " "}嗎?`),
success: '刪除成功'
},
edit: {
namedup: '名稱不能重複',
name_invalid: '名稱不合法',
success: '更新成功'
}
},
other: {
nohttps: '忽略HTTPS證書',
requestTimeout: '請求超時',
}
} }
} }
}, },
......
...@@ -836,6 +836,71 @@ module.exports = { ...@@ -836,6 +836,71 @@ module.exports = {
success: '更新成功' success: '更新成功'
} }
}, },
},
shellmanager: {
title: '數據管理',
header: {
title: '默認請求頭',
nodata: '暫無全局請求頭, 請單擊右鍵添加',
grid: {
name: '名稱',
value: '值',
},
bmenu: {
add: '添加請求頭',
del: '刪除請求頭'
},
add: {
title: '添加默認請求頭',
success: '添加成功',
namedup: '名稱不能重複',
name_invalid: '名稱不合法',
addbtn: '確定'
},
del: {
title: '刪除默認請求頭',
confirm: (num) => antSword.noxss(`你確定要刪除 ${typeof (num) === 'number' ? num + ' 個請求頭' : num + " "}嗎?`),
success: '刪除成功'
},
edit: {
namedup: '名稱不能重複',
name_invalid: '名稱不合法',
success: '更新成功'
}
},
body: {
title: '默認請求 Body',
nodata: '暫無默認Body, 請單擊右鍵添加',
grid: {
name: '名稱',
value: '值',
},
bmenu: {
add: '添加Body',
del: '刪除Body'
},
add: {
title: '添加默認請求Body',
success: '添加成功',
namedup: '名稱不能重複',
name_invalid: '名稱不合法',
addbtn: '確定'
},
del: {
title: '刪除默認請求頭Body',
confirm: (num) => antSword.noxss(`你確定要刪除 ${typeof (num) === 'number' ? num + ' 個請求Body' : num + " "}嗎?`),
success: '刪除成功'
},
edit: {
namedup: '名稱不能重複',
name_invalid: '名稱不合法',
success: '更新成功'
}
},
other: {
nohttps: '忽略HTTPS證書',
requestTimeout: '請求超時',
}
} }
} }
}, },
......
This diff is collapsed.
...@@ -190,11 +190,24 @@ class ContextMenu { ...@@ -190,11 +190,24 @@ class ContextMenu {
* 添加数据 * 添加数据
*/ */
addData() { addData() {
let config = {
headers: {},
bodys: {},
others: {},
};
let shellmanager_setting = JSON.parse(antSword['storage']("adefault_shellmanager", false, JSON.stringify(config)));
let args = {
httpConf: {
headers: shellmanager_setting.headers,
body: shellmanager_setting.bodys,
},
otherConf: shellmanager_setting.others || {},
};
new Form({ new Form({
title: LANG['list']['add']['title'], title: LANG['list']['add']['title'],
icon: 'plus-circle', icon: 'plus-circle',
text: LANG['list']['add']['toolbar']['add'] text: LANG['list']['add']['toolbar']['add']
}, {}, (data) => { }, args, (data) => {
return new Promise((res, rej) => { return new Promise((res, rej) => {
// 获取当前分类 // 获取当前分类
data['base']['category'] = antSword.modules.shellmanager.category.sidebar.getActiveItem(); data['base']['category'] = antSword.modules.shellmanager.category.sidebar.getActiveItem();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment