首页 \ 问答 \ Swagger UI无法正常显示(Swagger UI doesn't display properly)

Swagger UI无法正常显示(Swagger UI doesn't display properly)

使用JHipster(和swagger-ui 2.1.5)我想访问“API”选项卡。

然而,它似乎没有正确显示,我在控制台中得到以下错误:

index.html:8 GET http://localhost:8080/swagger-ui/css/typography.css
index.html:10 GET http://localhost:8080/swagger-ui/css/screen.css 
index.html:15 GET http://localhost:8080/swagger-ui/lib/jquery.slideto.min.js 
index.html:14 GET http://localhost:8080/swagger-ui/lib/jquery-1.8.0.min.js 
index.html:16 GET http://localhost:8080/swagger-ui/lib/jquery.wiggle.min.js 
index.html:18 GET http://localhost:8080/swagger-ui/lib/handlebars-2.0.0.js 
index.html:17 GET http://localhost:8080/swagger-ui/lib/jquery.ba-bbq.min.js 
index.html:19 GET http://localhost:8080/swagger-ui/lib/lodash.min.js 
index.html:21 GET http://localhost:8080/swagger-ui/lib/swagger-ui.min.js 
index.html:13 GET http://localhost:8080/swagger-ui/lib/object-assign-pollyfill.js 
index.html:22 GET http://localhost:8080/swagger-ui/lib/highlight.9.1.0.pack.js 
index.html:20 GET http://localhost:8080/swagger-ui/lib/backbone-min.js 
index.html:24 GET http://localhost:8080/swagger-ui/lib/jsoneditor.min.js 
index.html:25 GET http://localhost:8080/swagger-ui/lib/marked.js 
index.html:23 GET http://localhost:8080/swagger-ui/lib/highlight.9.1.0.pack_extended.js 
index.html:26 GET http://localhost:8080/swagger-ui/lib/swagger-oauth.js 
index.html:9 GET http://localhost:8080/swagger-ui/css/reset.css 
index.html:12 GET http://localhost:8080/swagger-ui/css/print.css 
index.html:14 GET http://localhost:8080/swagger-ui/lib/jquery-1.8.0.min.js 
index.html:15 GET http://localhost:8080/swagger-ui/lib/jquery.slideto.min.js 
index.html:16 GET http://localhost:8080/swagger-ui/lib/jquery.wiggle.min.js 
index.html:17 GET http://localhost:8080/swagger-ui/lib/jquery.ba-bbq.min.js 
index.html:18 GET http://localhost:8080/swagger-ui/lib/handlebars-2.0.0.js 
index.html:19 GET http://localhost:8080/swagger-ui/lib/lodash.min.js 
index.html:20 GET http://localhost:8080/swagger-ui/lib/backbone-min.js 
index.html:21 GET http://localhost:8080/swagger-ui/lib/swagger-ui.min.js 
index.html:22 GET http://localhost:8080/swagger-ui/lib/highlight.9.1.0.pack.js 
index.html:23 GET http://localhost:8080/swagger-ui/lib/highlight.9.1.0.pack_extended.js 
index.html:24 GET http://localhost:8080/swagger-ui/lib/jsoneditor.min.js 
index.html:25 GET http://localhost:8080/swagger-ui/lib/marked.js 
index.html:26 GET http://localhost:8080/swagger-ui/lib/swagger-oauth.js
index.html:34 Uncaught ReferenceError: $ is not defined
    at index.html:34

在这里输入图像描述

我使用的是Eclipse(STS发行版),我担心它可能是一个项目配置问题,但由于我相当新,所以我一直无法找出问题的根源。

编辑:

我正在使用Maven,并且错误仍然发生,我通过STS或命令行启动应用程序。

该项目与我想要测试的一项服务不同。

此外,我刚生成一个新的JHipster应用程序,错误依然存在。

编辑':

在我可以访问服务的Edge上,显示效果确实更好。

我还注意到,未改变的应用在Edge上显示效果良好。

在这里输入图像描述


Using JHipster (and swagger-ui 2.1.5) I wanted to access the "API" tab.

However it doesn't seem to properly display and I get the following errors in the console :

index.html:8 GET http://localhost:8080/swagger-ui/css/typography.css
index.html:10 GET http://localhost:8080/swagger-ui/css/screen.css 
index.html:15 GET http://localhost:8080/swagger-ui/lib/jquery.slideto.min.js 
index.html:14 GET http://localhost:8080/swagger-ui/lib/jquery-1.8.0.min.js 
index.html:16 GET http://localhost:8080/swagger-ui/lib/jquery.wiggle.min.js 
index.html:18 GET http://localhost:8080/swagger-ui/lib/handlebars-2.0.0.js 
index.html:17 GET http://localhost:8080/swagger-ui/lib/jquery.ba-bbq.min.js 
index.html:19 GET http://localhost:8080/swagger-ui/lib/lodash.min.js 
index.html:21 GET http://localhost:8080/swagger-ui/lib/swagger-ui.min.js 
index.html:13 GET http://localhost:8080/swagger-ui/lib/object-assign-pollyfill.js 
index.html:22 GET http://localhost:8080/swagger-ui/lib/highlight.9.1.0.pack.js 
index.html:20 GET http://localhost:8080/swagger-ui/lib/backbone-min.js 
index.html:24 GET http://localhost:8080/swagger-ui/lib/jsoneditor.min.js 
index.html:25 GET http://localhost:8080/swagger-ui/lib/marked.js 
index.html:23 GET http://localhost:8080/swagger-ui/lib/highlight.9.1.0.pack_extended.js 
index.html:26 GET http://localhost:8080/swagger-ui/lib/swagger-oauth.js 
index.html:9 GET http://localhost:8080/swagger-ui/css/reset.css 
index.html:12 GET http://localhost:8080/swagger-ui/css/print.css 
index.html:14 GET http://localhost:8080/swagger-ui/lib/jquery-1.8.0.min.js 
index.html:15 GET http://localhost:8080/swagger-ui/lib/jquery.slideto.min.js 
index.html:16 GET http://localhost:8080/swagger-ui/lib/jquery.wiggle.min.js 
index.html:17 GET http://localhost:8080/swagger-ui/lib/jquery.ba-bbq.min.js 
index.html:18 GET http://localhost:8080/swagger-ui/lib/handlebars-2.0.0.js 
index.html:19 GET http://localhost:8080/swagger-ui/lib/lodash.min.js 
index.html:20 GET http://localhost:8080/swagger-ui/lib/backbone-min.js 
index.html:21 GET http://localhost:8080/swagger-ui/lib/swagger-ui.min.js 
index.html:22 GET http://localhost:8080/swagger-ui/lib/highlight.9.1.0.pack.js 
index.html:23 GET http://localhost:8080/swagger-ui/lib/highlight.9.1.0.pack_extended.js 
index.html:24 GET http://localhost:8080/swagger-ui/lib/jsoneditor.min.js 
index.html:25 GET http://localhost:8080/swagger-ui/lib/marked.js 
index.html:26 GET http://localhost:8080/swagger-ui/lib/swagger-oauth.js
index.html:34 Uncaught ReferenceError: $ is not defined
    at index.html:34

enter image description here

I am using Eclipse (STS distribution) and I fear it might be a project configuration problem but as I am fairly new to it I haven't been able to pinpoint the source of the issue.

EDIT:

I am using Maven and the error still occurs wether I launch the app via STS or command line.

The project is as generated except one service that I wanted to test out.

Furthermore I just generated a new JHipster app and the errors remain.

EDIT':

The display is indeed better on Edge where I have access to the services.

I also noted that the unchanged app displays well on Edge.

enter image description here


原文:https://stackoverflow.com/questions/41426124
更新时间:2022-03-16 21:03

最满意答案

只需添加

 margin-right: -50px;

去.element

更多解释:您要么为.element赋予一个负边限,要么为.element2赋予一个负边限


just add

 margin-right: -50px;

to .element

more explanation : you an either give a negative margin-right to .element or give a negative margin-left to .element2

相关问答

更多
  • 只需添加 margin-right: -50px; 去.element 更多解释:您要么为.element赋予一个负边限,要么为.element2赋予一个负边限 just add margin-right: -50px; to .element more explanation : you an either give a negative margin-right to .element or give a negative margin-left to .element2
  • 默认情况下,图像将其底边与文本的基线对齐。 你看到的那个空间是基线以下的空间,被q,p,y等下行器使用(事实上你没有文字是无关紧要的 - 它们的空间仍然是保留的。) 你可以像这样摆脱它: img { /* Or a suitable class, etc. */ vertical-align: bottom; } By default, images align their bottom edges with the baseline of the text. That space you're ...
  • 将button放在柔性容器中并给出.btn类margin:2px (以2px为例)& padding:0; (然后根据需要用button.btn margin调整它们之间的空间) /* added flex container */ .container { border: 1px solid lightgray; display: flex; flex-flow: row wrap; justify-content: center; /* comment fixed wid ...
  • 以Peter的答案作为开始,下面的问题解决了这个问题: img { vertical-align: bottom } 这个原理的工作原理是vertical-align的默认值是baseline ,这相当于“悬于线上”的文本部分,其中悬挂比特的位置(小写字母g,q等全部低于此基线)。 所以为了留下空间,这些悬垂物留下了4px的空间。 希望这是有道理的。 编辑:从源网站的视觉援助 替代文字http://www.brightlemon.com/web-design/blog/images/typography/ ...
  • GWT使用CSS2样式(以及空白图像内容)实现剪切图像,如下例所示: width: 300px; height: 300px; background: url("/team.png") no-repeat scroll -5px -5px transparent; 不幸的是,CSS2不支持缩放背景(url提供的)图像,所以没有一种自然的方式来使用内置的GWT库来缩放剪裁的图像。 一种选择是使用画布,并将图像加载到其中,如下所述: http://code.google.com/p/google-web-t ...
  • 这可能是ul的余量引起的。 .sb-con ul { padding:0; margin:0; } 可能会产生预期的效果。 li可能也会影响布局; 但我们无法从您提供的代码中判断出来。 您的“全部捕获”重置会删除默认的边距/填充; 因此为什么它看起来不错。 编辑 - 您的.sb-title h3也可能需要删除底部边距,因为它看起来像是使用固定高度(60px)但默认边距会增加额外高度。 这可以通过firebug或Chrome的网络检查器轻松调试,并可以直观地显示间距的来源。 It's likely the ...
  • 在这里看演示 。 这是您可以使用的功能: function changeBodyBackground() { var images = ['http://goo.gl/tQl3t', 'http://goo.gl/6t3lG', 'http://goo.gl/HDzqs'] var imagesWidth = 260; var screenWidthToCover = ...
  • 尝试这个。 删除它们之间的线条。 DisclosureDisclosure2Disclosure3 或者修补css。 img { padding: 0; margin: 0; } try this. Remove the lines betw ...
  • 你需要的是容器元素的负边距: http://jsfiddle.net/LYhum/ .container { margin: -10px 0 0 -10px; } .container .image { margin: 10px 0 0 10px; /* either floated or set to inline-block */ } 如果你的容器有响应(即你不知道它有多宽),那么flexbox值得一看: http://jsfiddle.net/LYhum/4/ (对没有Fl ...
  • 用作行背景的图像是: http://myperfume.ir/images/2_02.png 哪个已被剪裁,因此您需要更改它。 The image that is being used as the row's background is this: http://myperfume.ir/images/2_02.png Which is already clipped, so you'll need to change it.

相关文章

更多

最新问答

更多
  • h2元素推动其他h2和div。(h2 element pushing other h2 and div down. two divs, two headers, and they're wrapped within a parent div)
  • 创建一个功能(Create a function)
  • 我投了份简历,是电脑编程方面的学徒,面试时说要培训三个月,前面
  • PDO语句不显示获取的结果(PDOstatement not displaying fetched results)
  • Qt冻结循环的原因?(Qt freezing cause of the loop?)
  • TableView重复youtube-api结果(TableView Repeating youtube-api result)
  • 如何使用自由职业者帐户登录我的php网站?(How can I login into my php website using freelancer account? [closed])
  • SQL Server 2014版本支持的最大数据库数(Maximum number of databases supported by SQL Server 2014 editions)
  • 我如何获得DynamicJasper 3.1.2(或更高版本)的Maven仓库?(How do I get the maven repository for DynamicJasper 3.1.2 (or higher)?)
  • 以编程方式创建UITableView(Creating a UITableView Programmatically)
  • 如何打破按钮上的生命周期循环(How to break do-while loop on button)
  • C#使用EF访问MVC上的部分类的自定义属性(C# access custom attributes of a partial class on MVC with EF)
  • 如何获得facebook app的publish_stream权限?(How to get publish_stream permissions for facebook app?)
  • 如何防止调用冗余函数的postgres视图(how to prevent postgres views calling redundant functions)
  • Sql Server在欧洲获取当前日期时间(Sql Server get current date time in Europe)
  • 设置kotlin扩展名(Setting a kotlin extension)
  • 如何并排放置两个元件?(How to position two elements side by side?)
  • 如何在vim中启用python3?(How to enable python3 in vim?)
  • 在MySQL和/或多列中使用多个表用于Rails应用程序(Using multiple tables in MySQL and/or multiple columns for a Rails application)
  • 如何隐藏谷歌地图上的登录按钮?(How to hide the Sign in button from Google maps?)
  • Mysql左连接旋转90°表(Mysql Left join rotate 90° table)
  • dedecms如何安装?
  • 在哪儿学计算机最好?
  • 学php哪个的书 最好,本人菜鸟
  • 触摸时不要突出显示表格视图行(Do not highlight table view row when touched)
  • 如何覆盖错误堆栈getter(How to override Error stack getter)
  • 带有ImageMagick和许多图像的GIF动画(GIF animation with ImageMagick and many images)
  • USSD INTERFACE - > java web应用程序通信(USSD INTERFACE -> java web app communication)
  • 电脑高中毕业学习去哪里培训
  • 正则表达式验证SMTP响应(Regex to validate SMTP Responses)