展示 HN:使用任意 HTTPS 端点构建原生 iOS 小组件
1 分•作者: elkabong•2 个月前
我创建 Dashlet 是因为我经常需要为各种数据(自定义页面浏览量监控、应用下载量、家庭传感器信息)构建不同的 Web 仪表板,而我很快就厌倦了每次都要打开 Safari 浏览器并重新输入凭据来访问它们。
我希望能够简单地在手机上查看这些信息,在浏览时几乎实时地更新。
过去,我曾为自己构建过专门的应用,用于映射特定的自定义 API,但每次更改响应内容或添加新的 API 时都会很麻烦。
因此,Dashlet 应运而生。它可以处理任何 JSON(或 XML,甚至图片)端点,并提供一种直观的交互方式,让您可以选择要显示在不同类型小部件中的值。所以,如果某个服务有 API 但没有应用(或没有小部件),Dashlet 可以让您指向一个 HTTPS 端点,以可视化的方式映射 JSON/XML/图片中的字段,从而无需编写代码即可创建原生的主屏幕(以及锁屏和 Apple Watch)小部件。
一些例子:
- Home Assistant 传感器(适用于本地网络的 `http` 端点)
- 太阳能发电量
- 公共网络摄像头
- RSS 订阅
- 服务器仪表板(我主要用它来做这个,因为我设置了自定义的简单独立访客分析,并且我喜欢在锁屏上看到相对最新的数据)
所有数据都是只读的,在设备上处理,并且应用程序和数据之间没有任何后端。目前支持基本的 + Bearer 端点身份验证 + 自定义标头。任何敏感信息都安全地存储在钥匙串中,所有数据获取都由设备完成(无论是通过小部件本身还是作为后台刷新的一部分)。
这是官网:https://getdashlet.app
这里有一些使用示例:https://docs.getdashlet.app
希望其他人也能觉得它有用,甚至能想到我还没想到的连接方式,我将非常感谢您的反馈。
查看原文
I built Dashlet since I often found myself building different web dashboards for all sorts of data (custom page views monitoring, app downloads, info from my home sensors) and I quickly got tired of always having to navigate to a page in Safari and reenter credentials to access them.<p>I wanted to just simply be able to see it on my phone, when scrolling around it - in almost realtime.<p>I've built bespoke apps (just for myself) in the past, that mapped a specific custom API for that purpose, but it was a hassle anytime I changed something in the response or added some new API for myself.<p>So, Dashlet is an answer to that - it can handle any JSON (or XML, or even image) endpoints and has a nice interactive way of picking which values out of it should be displayed in which type of widget. So, if something has an API but no app (or no widget), Dashlet lets you point it at an HTTPS endpoint, visually map fields from JSON/XML/images, and create native Home Screen (also lock screen and Apple Watch) widgets without writing code.<p>Some examples:<p>- Home Assistant sensors (works fine with `http` endpoints on local network)<p>- Solar production<p>- Public webcams<p>- RSS feeds<p>- Server dashboards (I use it for this mostly, as I have custom simple unique visits analytics set up, and I enjoy having relatively recent data show up on my lock screen)<p>Everything is read-only, on-device and without any backend between the app and the data. It currently supports basic+bearer endpoint authentication + custom headers. Any secrets are kept securely in the keychain and all the fetching happens by the device (either by the widgets themselves or as part of a background refresh).<p>This is the landing page - <a href="https://getdashlet.app" rel="nofollow">https://getdashlet.app</a><p>And here's some of the examples of how it can be used - <a href="https://docs.getdashlet.app" rel="nofollow">https://docs.getdashlet.app</a><p>Hope anybody else finds it useful and can even think of ways to wire it up that I haven't thought of yet, and I'd really appreciate feedback.