展示HN:从任何HTTPS端点构建原生iOS小部件
我开发了Dashlet,因为我经常需要为各种数据(自定义页面浏览监控、应用下载、家庭传感器信息)构建不同的网页仪表板,而我很快就厌倦了每次都要在Safari中导航到一个页面并重新输入凭据来访问它们。
我希望能够在手机上轻松查看这些信息,几乎是实时的。
过去,我曾为自己开发过一些定制应用,专门映射特定的自定义API,但每当我更改响应或为自己添加新的API时,这都很麻烦。
因此,Dashlet就是为了解决这个问题而诞生的——它可以处理任何JSON(或XML,甚至是图像)端点,并提供一种良好的交互方式来选择哪些值应该显示在何种类型的小部件中。因此,如果某个东西有API但没有应用(或小部件),Dashlet允许你指向一个HTTPS端点,直观地映射JSON/XML/图像中的字段,并在不编写代码的情况下创建本地主屏幕(以及锁屏和Apple Watch)小部件。
一些示例包括:
- 家庭助手传感器(在本地网络上的`http`端点工作良好)
- 太阳能发电
- 公共网络摄像头
- RSS源
- 服务器仪表板(我主要用于这个,因为我设置了自定义简单的独特访问分析,并且我喜欢在锁屏上显示相对较新的数据)
所有数据都是只读的,存储在设备上,并且应用与数据之间没有任何后端。目前支持基本的Bearer端点身份验证和自定义头部。任何秘密信息都安全地保存在钥匙串中,所有数据获取都由设备进行(无论是通过小部件本身还是作为后台刷新的一部分)。
这是着陆页 - [https://getdashlet.app](https://getdashlet.app)
这里是一些使用示例 - [https://docs.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.