如何使用 Glimpse 客户端查看器而不是服务器实现

发布于 2024-12-02 19:56:29 字数 400 浏览 1 评论 0原文

我想在 Web 应用程序中使用 Glimpse 客户端查看器 来呈现一些 JSON。我无法在相关网站上使用 Glimpse 服务器实现。不过,我可以实现自己的 IHttpHandler,以使用 Glimpse JSON 格式呈现信息。

有没有人这样做过并发布了如何做到这一点的详细信息?如果没有,谁能告诉我启动并运行它所需的步骤?或者,还有其他类似的查看器框架吗?

注意:我正在浏览 并看到了客户端 js 等。我将继续沿着源代码黑客路线,但希望有人可以为我提供一些捷径!

I would like to use the Glimpse client viewer in a web application in order to render some JSON. I am unable to use the Glimpse server implementation on the site in question. However, I can implement my own IHttpHandler to render the information using the Glimpse JSON format.

Has anyone done this and posted details on how to do it? If not, can anyone tell me the steps required to get this up and running? Alternatively, are there any other similar viewer frameworks out there?

Note: I am poking around the source and have seen the client js etc. I will continue down the source hacking route, but was hoping someone may have some shortcuts for me!

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

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

发布评论

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

评论(2

与他有关 2024-12-09 19:56:29

正如尼克所说,我会对你正在尝试做的事情感兴趣。但与此同时,最好的查看位置是 http://getglimpse.com/Protocol

如果您查看此页面,您会看到我们已经构建了一个协议测试器。这允许您输入任何 JSON 并查看输出。

如果您想自己执行此操作,请查看 http://getglimpse.com/Scripts/Protocol /LayoutExample.js,您将看到我们如何在不使用整个 Glimpse 的情况下做到这一点。

您将看到我们正在做类似以下的事情:

var data = { test : 'test', hello : 'hello' };
var html = $Glimpse.glimpseProcessor.build(data, 0, false)
$('.panel').html(html);

我知道这并不那么好,但它的设计并没有考虑到这一点。

我们目前正在努力重构客户端代码以使这一切变得更好。

As Nik said I would be interested in what you are trying to do. But in the mean time the best place to look is http://getglimpse.com/Protocol.

If you look on this page you will see that we have built a protocol tester. This allows you to put in any JSON and see the output.

If you want to do this yourself, have a look at http://getglimpse.com/Scripts/Protocol/LayoutExample.js and you will see how we do this without using the whole of Glimpse.

You will see that we are doing something like the following:

var data = { test : 'test', hello : 'hello' };
var html = $Glimpse.glimpseProcessor.build(data, 0, false)
$('.panel').html(html);

I know this isn't as nice as it could be but it wasn't designed with this in mind.

We are currently working on refactoring the client code to make this all better.

誰認得朕 2024-12-09 19:56:29

我们还没有真正记录这一切。

最好的选择是首先查看渲染到页面的 javascript 文件 - 它是数据文件。如果您可以以这种格式输出数据(基本上只是键值对的一个对象),那么客户端将获取数据并呈现它。

您可能还想查看 Glimpse.PHP 实现,因为他们必须做与您相同的事情。

We haven't really documented all of this yet.

Your best bet is to look at first glimpse javascript file that gets rendered to a page - it is the data file. If you can output data in that format, which is basically just one object of key value pairs, then the client will pick up the data and render it.

You might also want to look at the Glimpse.PHP implementation, since they'vve had to do the same thing you are.

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