mirror of
https://github.com/bastienwirtz/homer.git
synced 2024-11-07 16:54:00 +01:00
Merge branch 'bastienwirtz:main' into apikey
This commit is contained in:
commit
f2c901a1ec
@ -19,6 +19,9 @@ logo: "assets/logo.png"
|
||||
# icon: "fas fa-skull-crossbones"
|
||||
|
||||
header: true # Set to false to hide the header
|
||||
# Optional: Different hotkey for search, defaults to "/"
|
||||
# hotkey:
|
||||
# search: "Shift"
|
||||
footer: '<p>Created with <span class="has-text-danger">❤️</span> with <a href="https://bulma.io/">bulma</a>, <a href="https://vuejs.org/">vuejs</a> & <a href="https://fontawesome.com/">font awesome</a> // Fork me on <a href="https://github.com/bastienwirtz/homer"><i class="fab fa-github-alt"></i></a></p>' # set false if you want to hide it.
|
||||
|
||||
columns: "3" # "auto" or number (must be a factor of 12: 1, 2, 3, 4, 6, 12)
|
||||
|
@ -97,8 +97,9 @@ For Ping you need to set the type to Ping and provide a url.
|
||||
- name: "Awesome app"
|
||||
type: Ping
|
||||
logo: "assets/tools/sample.png"
|
||||
subtitle: "Bookmark example" tag: "app"
|
||||
url: "https://www.reddit.com/r/selfhosted/"
|
||||
subtitle: "Bookmark example"
|
||||
tag: "app"
|
||||
url: "https://www.reddit.com/r/selfhosted/"
|
||||
```
|
||||
|
||||
## Prometheus
|
||||
|
@ -41,6 +41,7 @@
|
||||
|
||||
<SearchInput
|
||||
class="navbar-item is-inline-block-mobile"
|
||||
:hotkey=searchHotkey()
|
||||
@input="filterServices"
|
||||
@search-focus="showMenu = true"
|
||||
@search-open="navigateToFirstService"
|
||||
@ -167,6 +168,11 @@ export default {
|
||||
window.onhashchange = this.buildDashboard;
|
||||
},
|
||||
methods: {
|
||||
searchHotkey() {
|
||||
if (this.config.hotkey && this.config.hotkey.search) {
|
||||
return this.config.hotkey.search;
|
||||
}
|
||||
},
|
||||
buildDashboard: async function () {
|
||||
const defaults = jsyaml.load(defaultConfig);
|
||||
let config;
|
||||
|
@ -15,10 +15,16 @@
|
||||
<script>
|
||||
export default {
|
||||
name: "SearchInput",
|
||||
props: ["value"],
|
||||
props: {
|
||||
value: String,
|
||||
hotkey: {
|
||||
type: String,
|
||||
default: "/"
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this._keyListener = function (event) {
|
||||
if (event.key === "/") {
|
||||
if (event.key === this.hotkey) {
|
||||
event.preventDefault();
|
||||
this.focus();
|
||||
}
|
||||
@ -28,7 +34,7 @@ export default {
|
||||
};
|
||||
document.addEventListener("keydown", this._keyListener.bind(this));
|
||||
|
||||
// fill seach from get parameter.
|
||||
// fill search from get parameter.
|
||||
const search = new URLSearchParams(window.location.search).get("search");
|
||||
if (search) {
|
||||
this.$refs.search.value = search;
|
||||
|
Loading…
Reference in New Issue
Block a user