添加“粘贴屏幕截图”; Mantis bugtracker 的选项

发布于 2024-07-27 15:03:20 字数 315 浏览 5 评论 0 原文

我们正在使用基于 PHP 的 Mantis bugtracker(版本 1.1.8)。 为了简化添加错误的工作流程,我们希望添加一个选项,将剪贴板中的屏幕截图直接粘贴到“新错误表单”中。

屏幕截图使错误报告对开发人员来说更有价值,因此我希望尽可能轻松地添加它们。 最好不使用外部应用程序,而是直接在浏览器中进行。

我已经到处寻找添加此内容的方法,但没有运气。 其他人是如何做到这一点的? 我错过了一些明显的东西吗?

编辑:bugtracker 是一个私人的,在一家小公司,所以我愿意接受 Java 小程序等带来的安全风险。

We're using the Mantis bugtracker (version 1.1.8), which is based on PHP. To ease the workflow of adding bugs we'd like to add an option to paste screenshots from the clipboard directly into the 'new bug form'.

Screenshots make bugreports much more valuable for developers, so I'd like to make adding them as easy as possible. Preferably without using an external application, but right in the browser.

I've looked all over for a way to add this, but no luck. How do other people do this? Am I missing something obvious?

edit: The bugtracker is a private one, in a small company, so I'd be willing to accept the security risks that for example Java applets present.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

骄兵必败 2024-08-03 15:03:20

除了在客户端使用 ActiveX、applet 或 Flash 类型的技术之外,没有真正的方法可以做到这一点。 即便如此,仍然存在许多安全障碍。 浏览器没有简单的方法可以将剪贴板中的内容转换为合适的格式以上传到网站,即使可以,也会存在安全问题。 例如,页面中的恶意代码可能会从剪贴板复制敏感信息并将其发送到该页面的站点,而您甚至不知道它正在发生。

更新:有一个独立屏幕捕获实用程序,声称可以与Mantis(以及一大堆其他错误跟踪器)。 这可能是您最好的选择。

There isn't really a way to do this short of using ActiveX, applet or Flash-type technology on the client. Even then, there are numerous security roadblocks. A browser has no easy way to convert stuff from the clipboard into a suitable format for upload to a website, and even if it did there would be security concerns. For example, malicious code in a page could copy sensitive information from your clipboard and send it to the page's site without you even knowing it was happening.

Update: There is a standalone screen capture utility which claims to work with Mantis (and a whole bunch of other bug-trackers). This is probably your best option.

箹锭⒈辈孓 2024-08-03 15:03:20

Atlassian Confluence 有一个拖放图像附件 Java 小程序,它具有您需要的功能。 它仅支持 Confluence,但由于 BSD 下的源代码是免费提供的,因此您应该能够根据您的需求对其进行自定义。

忘记链接了:
http://confluence.atlassian.com/display/ CONFEXT/拖+放+图像+附件+插件

There is a drag n drop image attacher Java applet for Atlassian Confluence which has the functionality you need. It only supports Confluence but as the sourcecode is freely available under BSD you should be able to customize it to your needs.

Forgot the link:
http://confluence.atlassian.com/display/CONFEXT/Drag+and+Drop+Image+Attacher+Plugin

为人所爱 2024-08-03 15:03:20

我已经成功构建了自己的解决方案,效果非常好。 它将一个 Java 文件上传小程序放置在您想要附加屏幕截图的页面上。 该小程序有两个按钮:

  1. “粘贴屏幕截图”,它将剪贴板中的图像粘贴到
  2. “上传屏幕截图”小程序中,该小程序将粘贴的图像上传到 Mantis 服务器上的 /tmp 目录,并使用 JavaScript 回调来放置自动生成的文件名将上传的图像添加到表单字段中。

提交表单后,Mantis 中的一个新函数会使用表单字段中的文件名将图像从 /tmp 移动到最终位置,并像其他附件一样处理图像。 如果表单从未提交,则上传的文件将保留在 /tmp 中,并最终被服务器清除。

它运行良好,但有一个我无法避免的缺点:我使用 Java 来访问客户端的剪贴板,但这需要破坏 JVM 沙箱。 显然,如果您对小程序进行数字签名,就可以做到这一点,这需要向 Verisign 这样的公司每年支付相当昂贵的费用(大约 500 美元)(目前像 cacert.org 这样的免费选项的实用性仍然有限)。

允许 Java 小程序访问剪贴板的另一种方法是在您的主目录或配置文件目录中创建一个名为 .java.policy 的文件。 该文件应包含以下内容(将域替换为托管 Java 小程序的域):

grant codeBase "http://bugs.example.com/-" {
  permission java.awt.AWTPermission "accessClipboard";
};

值得庆幸的是,该解决方案是跨浏览器兼容的,因为无论使用什么浏览器,JVM 始终检查相同的文件。 由于我的解决方案需要在每台客户端计算机上都有这个 .java.policy 文件,我认为它并不理想,但在受控的公司环境中是可行的。

I've managed to build my own solution that works quite well. It places a Java file upload applet on the pages where you'd want to attach a screenshot. The applet has two buttons:

  1. 'paste screenshot', which pastes an image from the clipboard into the applet
  2. 'upload screenshot', which uploads the pasted image to the /tmp dir on the Mantis server and uses a javascript callback to place the autogenerated filename of the uploaded image into a form field.

Once the form is submitted, a new function in Mantis uses the filename in the form field to move the image from /tmp to the final location and processes the image just like other attachments. If the form is never submitted the uploaded file remains in /tmp and will eventually be purged by the server.

It works well, but has one drawback that I cannot avoid: I'm using Java to get access to the client's clipboard, but that requires breaking the JVM sandbox. Apparently, this can be done if you digitally sign the applet, which requires a rather expensive yearly payment (something like $500) to a company like Verisign (currently free options like cacert.org are still limited in their usefulness).

Another way to allow Java applets access to the clipboard is to create a file called .java.policy in your home or profile directory. This file should contain the following (Replace the domain with the domain that hosts your Java applet):

grant codeBase "http://bugs.example.com/-" {
  permission java.awt.AWTPermission "accessClipboard";
};

Thankfully the solution is cross-browser compatible since the JVM always checks the same file regardless of the browser used. Since my solution requires having this .java.policy file on each client computer I don't consider it ideal, but workable in a controlled company environment.

丘比特射中我 2024-08-03 15:03:20

我也研究过这个。 没有真正简单的方法,所以我允许他们上传无限数量的文件,然后这些文件将“附加”到该错误。 事实上,它更好,因为他们可以上传屏幕截图、电子表格、文字文档等。

与您的网站一样,这是一个仅供内部使用的网站,因此安全性很弱。 我在 ASP.Net 中做到了这一点,但总体思路是,当他们查看页面中的错误时,他们有一个上传框。 当他们上传一些东西时,我会预先附加错误 ID。 因此 ScreenShot.jpg 变为 233_ScreenShot.jpg。

该页面上还有一个网格 (GridView),它绑定到我的上传目录中以该 bug id 开头的所有文件名。

要查看它的样子 单击此处。

I looked in to this also. No real easy way, so instead I allowed them to upload an unlimited number of files and those files would then be "attached" to that bug. It actually turned out to be better because they can upload screenshot, spreadsheets, word docs, etc.

Like yours, this is an internal only site so security is light. I did this in ASP.Net, but the general idea is that when they are looking at a page for a bug they have an upload box. When they upload something I pre-append it with the bug id. So ScreenShot.jpg becomes 233_ScreenShot.jpg.

Also on that page is a grid (GridView) that is bound to all of the filenames in my upload directory that start with that bug id.

To see what this looks like click here.

与酒说心事 2024-08-03 15:03:20

对于面向技术的用户,总是有可能使用 Eclipse + Eclipse + Mylyn + Mylyn-Mantis 连接器< /a>.

然后上传屏幕截图非常简单:

屏幕截图上传 http://img216.imageshack.us/img216 /246/screenshotattachments1.png

For tech-oriented users, there's always to possibility of using Eclipse + Mylyn + Mylyn-Mantis connector.

Then uploading screeshots is very easy:

Screenshot upload http://img216.imageshack.us/img216/246/screenshotattachments1.png

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文