-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
Plugins.svelte
widget to Statusbar.svelte
- Loading branch information
Showing
6 changed files
with
80 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,6 +39,6 @@ | |
font-size: 12px; | ||
margin: 0px; | ||
display: grid; | ||
grid-column: 6; | ||
grid-column: 7; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,7 +81,7 @@ | |
font-size: 12px; | ||
margin: 0px; | ||
display: grid; | ||
grid-column: 4; | ||
grid-column: 5; | ||
} | ||
span { | ||
|
57 changes: 57 additions & 0 deletions
57
src/frontend/src/lib/components/shared/statusbar/Plugins.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<script lang="ts"> | ||
import { onMount } from "svelte"; | ||
let out_of: string = ""; | ||
let status: string = "success"; | ||
let content: string = "LOAD*"; | ||
onMount(() => { | ||
fetch("/plugins/status") | ||
.then((response) => response.json()) | ||
.then((responseJson) => { | ||
if (responseJson.ok == true) { | ||
status = "success"; | ||
out_of = `/${responseJson.plugins.length}`; | ||
content = responseJson.plugins.length; | ||
} else { | ||
status = "failure"; | ||
out_of = ""; | ||
content = "ERROR"; | ||
} | ||
}); | ||
}); | ||
</script> | ||
|
||
<a href="/plugins"> | ||
<pre class="plugins">Plugins: <span id={status}>{content}</span>{out_of}</pre> | ||
</a> | ||
|
||
<style> | ||
pre { | ||
color: whitesmoke; | ||
font-family: monaco, Consolas, "Lucida Console", monospace; | ||
font-size: 12px; | ||
margin: 0px; | ||
} | ||
.plugins { | ||
grid-column: 4; | ||
padding: 4px; | ||
} | ||
.plugins:hover { | ||
background-color: rgb(102, 153, 255); | ||
} | ||
#success { | ||
color: rgb(0, 255, 0); | ||
} | ||
#failure { | ||
color: red; | ||
} | ||
a { | ||
flex-grow: 1; | ||
text-decoration: none; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters