代码整理

This commit is contained in:
暮光:城中城
2018-12-08 14:59:26 +08:00
parent 67c584761d
commit 6465d3c412
80 changed files with 2043 additions and 882 deletions

View File

@@ -97,7 +97,7 @@ label{font-weight: normal;}
.param-box .param-table tbody td:nth-child(3){border-left: 0;padding: 0 10px 0 0;width: 10px;}
.param-box .param-table tbody td:nth-child(3) i{cursor: pointer;color: #ccc;}
.param-box .param-table tbody td:nth-child(3) i:hover{color: #888;}
.param-box .param-table tbody tr.base td:last-child{display: none;}
.param-box .param-table tbody tr.base td:last-child i{display: none;}
#bulkEditHeaderCheck{margin-left: 10px;}
#bulkEditHeader,#bulkEditForm{display: none;}

View File

@@ -100,22 +100,23 @@ $(document).ready(function(){
paramSendToServer.method = options;
ajaxTemp("swagger-mg-ui/http/request", "post", "json", paramSendToServer, function(result){
//console.log(result);
var requestObj = result.data;
setStorage('p-request-obj-' + docUrl, storeRequestParam);
var afterSendTime = new Date().getTime();
$("#httpRequestStatus").text(result.status);
$("#httpRequestStatus").text(requestObj.status);
$("#httpRequestTime").text((afterSendTime - beforSendTime) + "ms");
try {
var htmlStr = Formatjson.processObjectToHtmlPre(JSON.parse(result.data), 0, false, false, false, false);
var htmlStr = Formatjson.processObjectToHtmlPre(JSON.parse(requestObj.data), 0, false, false, false, false);
$("#responseBodyJsonDiv").html(htmlStr);
} catch (e) {
$("#responseBodyJsonDiv").html("<iframe id='responseBodyJsonIframe'></iframe>");
setTimeout(function(){
$("#responseBodyJsonIframe").contents().find("body").html(result.data);
$("#responseBodyJsonIframe").contents().find("body").html(requestObj.data);
}, 300);
}
$("#tabResponseHeader table tbody").empty();
$("#tabResponseCookie table tbody").empty();
var headers = result.header||[];
var headers = requestObj.header||[];
for (var i = 0; i < headers.length; i++) {
var name = getNotEmptyStr(headers[i].name);
var value = getNotEmptyStr(headers[i].value);
@@ -123,7 +124,7 @@ $(document).ready(function(){
'<tr>'+'<td>'+name+'</td>' + '<td>'+value+'</td>'+'</tr>'
);
}
var cookies = result.cookie||[];
var cookies = requestObj.cookie||[];
for (var i = 0; i < cookies.length; i++) {
var name = getNotEmptyStr(cookies[i].name);
var value = getNotEmptyStr(cookies[i].value);

View File

@@ -1,8 +1,8 @@
/**
* swagger-mg-ui是swagger-ui的一个前端实现使用简单、解析速度快、走心的设计
* zyplayer-doc-swagger是swagger-ui的一个前端实现使用简单、解析速度快、走心的设计
* 支持多项目同时展示,多种文档目录的展示方案,多种自定义配置,满足各种使用习惯。
* 使用中您有任何的意见和建议都可到源码地址处反馈哦!
* git地址https://gitee.com/zyplayer/swagger-mg-ui
* git地址https://gitee.com/zyplayer/zyplayer-doc-swagger
* @author 暮光:城中城
* @since 2018年5月20日
*/
@@ -873,11 +873,11 @@ function changeContentWidth(width) {
$("#leftContent").css("width", width + 'px');
$("#resizebleLeftRight").css("left", width + 'px');
$("#rightContent").css("left", width + 'px');
var logoText = "swagger-mg-ui";
if(width < 270 && width > 140){
logoText = "mg-ui";
} else if(width < 140){
logoText = "mui";
var logoText = "zyplayer-doc-swagger";
if(width < 370 && width > 290){
logoText = "zyplayer-doc";
} else if(width < 290){
logoText = "doc";
}
$("#logoText").text(logoText);
userSettings.prevWNow = width;