Add system tray HTML interface and update tray functionality
This commit is contained in:
parent
8087a08ecb
commit
0b285aef85
2 changed files with 101 additions and 3 deletions
98
cmd/app/frontend/dist/system-tray.html
vendored
Normal file
98
cmd/app/frontend/dist/system-tray.html
vendored
Normal file
|
|
@ -0,0 +1,98 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en" class="dark">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Core System Tray</title>
|
||||||
|
<script src="https://cdn.tailwindcss.com"></script>
|
||||||
|
<script>
|
||||||
|
tailwind.config = {
|
||||||
|
theme: {
|
||||||
|
extend: {
|
||||||
|
colors: {
|
||||||
|
'core-gray': {
|
||||||
|
'light': '#333333',
|
||||||
|
'DEFAULT': '#1a1a1a',
|
||||||
|
'dark': '#0d0d0d',
|
||||||
|
},
|
||||||
|
'core-blue': '#00aaff',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
-moz-osx-font-smoothing: grayscale;
|
||||||
|
/* Ensure no scrollbars appear in the small window */
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body class="bg-core-gray-dark text-gray-300 font-sans">
|
||||||
|
|
||||||
|
<div class="w-full h-full p-4 text-center">
|
||||||
|
|
||||||
|
<header class="mb-6">
|
||||||
|
<h1 class="text-3xl font-bold text-white">
|
||||||
|
<span class="text-core-blue">Core</span> Status
|
||||||
|
</h1>
|
||||||
|
<p class="text-sm text-gray-400">Services at a glance.</p>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<main>
|
||||||
|
<div class="space-y-4">
|
||||||
|
|
||||||
|
<!-- Config Service Card -->
|
||||||
|
<div class="bg-core-gray p-4 rounded-lg shadow-md border border-core-gray-light flex items-center space-x-4">
|
||||||
|
<div class="text-core-blue">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-8 w-8" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" />
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
<div class="text-left">
|
||||||
|
<h3 class="text-lg font-bold text-white">Config</h3>
|
||||||
|
<p class="text-sm text-gray-400">State and preferences loaded.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Display Service Card -->
|
||||||
|
<div class="bg-core-gray p-4 rounded-lg shadow-md border border-core-gray-light flex items-center space-x-4">
|
||||||
|
<div class="text-core-blue">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-8 w-8" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" d="M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" />
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
<div class="text-left">
|
||||||
|
<h3 class="text-lg font-bold text-white">Display</h3>
|
||||||
|
<p class="text-sm text-gray-400">UI manager is active.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Crypt Service Card -->
|
||||||
|
<div class="bg-core-gray p-4 rounded-lg shadow-md border border-core-gray-light flex items-center space-x-4">
|
||||||
|
<div class="text-core-blue">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-8 w-8" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" />
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
<div class="text-left">
|
||||||
|
<h3 class="text-lg font-bold text-white">Crypt</h3>
|
||||||
|
<p class="text-sm text-gray-400">Security services are running.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<footer class="absolute bottom-4 left-0 right-0 text-center">
|
||||||
|
<p class="text-xs text-gray-500">Core Framework Active</p>
|
||||||
|
</footer>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="assets/app.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -10,8 +10,8 @@ import (
|
||||||
func (d *API) systemTray() {
|
func (d *API) systemTray() {
|
||||||
|
|
||||||
systray := d.core.App.SystemTray.New()
|
systray := d.core.App.SystemTray.New()
|
||||||
systray.SetTooltip("Lethean Desktop")
|
systray.SetTooltip("Core")
|
||||||
systray.SetLabel("hey")
|
systray.SetLabel("Core")
|
||||||
//appTrayIcon, _ := d.assets.ReadFile("assets/apptray.png")
|
//appTrayIcon, _ := d.assets.ReadFile("assets/apptray.png")
|
||||||
//
|
//
|
||||||
//if runtime.GOOS == "darwin" {
|
//if runtime.GOOS == "darwin" {
|
||||||
|
|
@ -25,7 +25,7 @@ func (d *API) systemTray() {
|
||||||
trayWindow := d.NewWithStruct(&Window{
|
trayWindow := d.NewWithStruct(&Window{
|
||||||
Name: "system-tray",
|
Name: "system-tray",
|
||||||
Title: "System Tray Status",
|
Title: "System Tray Status",
|
||||||
URL: "/#/system-tray",
|
URL: "system-tray.html",
|
||||||
Width: 400,
|
Width: 400,
|
||||||
Frameless: true,
|
Frameless: true,
|
||||||
Hidden: true,
|
Hidden: true,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue