Skip to content

Commit 281f173

Browse files
committed
Added documentation
1 parent 27e7ae3 commit 281f173

File tree

2 files changed

+51
-3
lines changed

2 files changed

+51
-3
lines changed

docs/widgets.md

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ Dashy has support for displaying dynamic content in the form of widgets. There a
6161
- [Sabnzbd](#sabnzbd)
6262
- [Gluetun VPN Info](#gluetun-vpn-info)
6363
- [Drone CI Build](#drone-ci-builds)
64+
- [Linkding](#linkding)
6465
- **[System Resource Monitoring](#system-resource-monitoring)**
6566
- [CPU Usage Current](#current-cpu-usage)
6667
- [CPU Usage Per Core](#cpu-usage-per-core)
@@ -2046,7 +2047,7 @@ Display the last builds from a [Drone CI](https://www.drone.ci) instance. A self
20462047

20472048
**Field** | **Type** | **Required** | **Description**
20482049
--- | --- | --- | ---
2049-
**`host`** | `string` | Required | The histname of the Drone CI instance.
2050+
**`host`** | `string` | Required | The hostname of the Drone CI instance.
20502051
**`apiKey`** | `string` | Required | The API key (https://<your-drone-instance>/account).
20512052
**`limit`** | `integer` | _Optional_ | Limit the amounts of listed builds.
20522053
**`repo`** | `string` | _Optional_ | Show only builds of the specified repo
@@ -2072,10 +2073,44 @@ Display the last builds from a [Drone CI](https://www.drone.ci) instance. A self
20722073

20732074
---
20742075

2076+
### Linkding
2077+
2078+
Linkding is a self-hosted bookmarking service, which has a clean interface and is simple to set up. This lists the links, filterable by tags.
2079+
2080+
#### Options
2081+
2082+
**Field** | **Type** | **Required** | **Description**
2083+
--- | --- | --- | ---
2084+
**`host`** | `string` | Required | The hostname of the Drone CI instance.
2085+
**`apiKey`** | `string` | Required | The API key (https://<your-linkding-instance>/settings/integrations).
2086+
**`tags`** | `list of string` | _Optional_ | Filter the links by tag.
2087+
2088+
#### Example
2089+
2090+
```yaml
2091+
- type: linkding
2092+
updateInterval: 30
2093+
options:
2094+
host: https://lingding.somedomain.com
2095+
apiKey: my-very-secret-api-key
2096+
tags:
2097+
- rpg
2098+
- markdown
2099+
```
2100+
2101+
#### Info
2102+
2103+
- **CORS**: 🟢 Enabled
2104+
- **Auth**: 🟢 Required
2105+
- **Price**: 🟢 Free
2106+
- **Host**: Self-Hosted (see [Linkding](https://github.com/sissbruecker/linkding))
2107+
- **Privacy**: _See [Linkding](https://github.com/sissbruecker/linkding)_
2108+
2109+
---
2110+
20752111
## System Resource Monitoring
20762112

20772113
### Glances
2078-
20792114
The easiest method for displaying system info and resource usage in Dashy is with [Glances](https://nicolargo.github.io/glances/).
20802115

20812116
Glances is a cross-platform monitoring tool developed by [@nicolargo](https://github.com/nicolargo). It's similar to top/htop but with a [Rest API](https://glances.readthedocs.io/en/latest/api.html) and many [data exporters](https://glances.readthedocs.io/en/latest/gw/index.html) available. Under the hood, it uses [psutil](https://github.com/giampaolo/psutil) for retrieving system info.

src/components/Widgets/Linkding.vue

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ export default {
3636
if (!this.options.apiKey) this.error('linkgding apiKey is required');
3737
return this.options.apiKey;
3838
},
39+
filtertags() {
40+
return this.options.tags;
41+
},
3942
},
4043
methods: {
4144
update() {
@@ -50,7 +53,17 @@ export default {
5053
);
5154
},
5255
processData(data) {
53-
this.links = data.results;
56+
const self = this;
57+
const fltr = function (entry) {
58+
if (self.filtertags === null) return true;
59+
for (let i = 0; i < self.filtertags.length; i += 1) {
60+
if (entry.tag_names.includes(self.filtertags[i])) return true;
61+
}
62+
return false;
63+
};
64+
this.links = data.results.filter(
65+
entry => fltr(entry),
66+
);
5467
},
5568
},
5669
};

0 commit comments

Comments
 (0)