initial files
This commit is contained in:
153
public/views/desktop.hbs
Normal file
153
public/views/desktop.hbs
Normal file
@@ -0,0 +1,153 @@
|
||||
<head>
|
||||
|
||||
<script src="/socket.io/socket.io.js"></script>
|
||||
<script src="javascript/main.js"></script>
|
||||
<script src="javascript/customModal.js"></script>
|
||||
<script src="javascript/pluginAPI.js"></script>
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="stylesheet" href="styles/default.css">
|
||||
<link rel="stylesheet" href="styles/contextMenu.css">
|
||||
<link rel="stylesheet" href="styles/userNotification.css">
|
||||
<link rel="stylesheet" href="styles/table.css">
|
||||
<link rel="stylesheet" href="styles/jsonTree.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="styles/colors.css" />
|
||||
<link rel="stylesheet" href="styles/os.css" />
|
||||
|
||||
<div id="message-container"></div>
|
||||
<div id="copy-toast"></div>
|
||||
<title>Radix OS</title>
|
||||
</head>
|
||||
|
||||
<div id="desktop">
|
||||
<div id="windows"></div>
|
||||
|
||||
<!-- Startmenu -->
|
||||
<div id="start-menu" class="hidden">
|
||||
<div class="start-header"><img id="start-menu-icon"><span>Radix OS</span></div>
|
||||
<ul class="start-list">
|
||||
{{#groupBy startMenuItems "section"}}
|
||||
|
||||
<li class="start-submenu-head">
|
||||
<span><i>{{this.key}}</i></span>
|
||||
</li>
|
||||
{{#each items}}
|
||||
{{#ifSingle this.menu.items}}
|
||||
{{#if this.authorized}}
|
||||
<li class="start-item {{#unless ../this.active}}unload{{/unless}}" data-active="{{#equaler ../this.active "&&" this.authorized}}true{{else}}false{{/equaler}}" data-appname="{{../this.name}}" data-appview="{{this.view}}" data-viewlabel="{{this.label}}">
|
||||
{{#if this.icon}}
|
||||
<img src="{{#if ../this.pluginPath}}/{{../this.name}}{{/if}}/images/{{this.icon}}" class="start-icon" />
|
||||
{{else}}
|
||||
{{/if}}
|
||||
<span>{{this.label}}</span>
|
||||
</li>
|
||||
{{/if}}
|
||||
{{else}}
|
||||
<li class="start-item has-submenu">
|
||||
<img src="{{#if ../this.pluginPath}}/{{../this.name}}{{/if}}/images/folder.png" class="start-icon" style="position:absolute;left:12px;"/>
|
||||
<span class="menu-label">{{this.menu.label}}</span>
|
||||
{{!-- {{#if this.version}}<small>v{{this.version}}</small>{{/if}} --}}
|
||||
|
||||
<ul class="submenu">
|
||||
{{#each this.menu.items}}
|
||||
{{#equaler this.label "==" "hr"}}
|
||||
<li><hr></li>
|
||||
{{else}}
|
||||
{{#if this.authorized}}
|
||||
<li class="start-item {{#unless ../this.active}}unload{{/unless}}" data-active="{{#equaler ../this.active "&&" this.authorized}}true{{else}}false{{/equaler}}" data-appname="{{../this.name}}" data-appview="{{this.view}}" data-viewlabel="{{this.label}}">
|
||||
{{#if this.icon}}
|
||||
<img src="{{#if ../this.pluginPath}}/{{../this.name}}{{/if}}/images/{{this.icon}}" class="start-icon" />
|
||||
{{else}}
|
||||
{{/if}}
|
||||
<span>{{this.label}}</span>
|
||||
{{#if this.version}}<small>v{{this.version}}</small>{{/if}}
|
||||
</li>
|
||||
{{/if}}
|
||||
{{/equaler}}
|
||||
{{/each}}
|
||||
</ul>
|
||||
</li>
|
||||
{{/ifSingle}}
|
||||
{{/each}}
|
||||
{{/groupBy}}
|
||||
{{!-- [Function restart] in javascript/main.js --}}
|
||||
</ul>
|
||||
|
||||
<div class="start-item-sys-container">
|
||||
<button class="monolyth start-sys-item" data-tooltip="Neustart" onclick="restart();" data-tooltip-mode="always">⟳</button>
|
||||
<button class="monolyth start-sys-item" data-tooltip="Abmelden" onclick="logout()" data-tooltip-mode="always">🔓</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Taskbar -->
|
||||
<div id="taskbar">
|
||||
<button id="start-btn">☰</button>
|
||||
<div id="taskbar-windows"></div>
|
||||
<button style="margin-right:0;" class="monolyth notify-button pulse">
|
||||
<img class="icon" src="/images/notifybubble.png">
|
||||
<div id="notify-bubble"></div>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="javascript/tutorial.js"></script>
|
||||
<script src="javascript/notifyBubble.js"></script>
|
||||
<script src="javascript/contextMenu.js"></script>
|
||||
<script src="javascript/tableFilter.js"></script>
|
||||
<script src="javascript/requiredFields.js"></script>
|
||||
<script src="javascript/loadOnce.js"></script>
|
||||
<script src="javascript/JSON.js"></script>
|
||||
<script src="javascript/os.js"></script>
|
||||
<script>
|
||||
addRestartHook(() => localStorage.setItem('openWindows', JSON.stringify({ })));
|
||||
|
||||
fetch('/api/Plugins/loadScripts', { method: 'POST', headers: {'Content-Type': 'application/json'} })
|
||||
.then(res => res.json())
|
||||
.then(scripts => {
|
||||
(scripts).forEach(script => {
|
||||
reloadPluginScript(script);
|
||||
});
|
||||
});
|
||||
|
||||
loadServerStyles(getCookie('theme'));
|
||||
|
||||
const notifyButtons = document.querySelectorAll('.notify-button');
|
||||
const trayNotifyButton = document.querySelector('#taskbar > .notify-button')
|
||||
const notify = new NotifyBubble(trayNotifyButton, "#notify-bubble");
|
||||
|
||||
document.addEventListener("contextmenu", evt => evt.preventDefault());
|
||||
|
||||
document.querySelectorAll('#start-menu .start-item.has-submenu').forEach(item => {
|
||||
item.addEventListener('click', evt => {
|
||||
// Toggle nur dieses Submenu
|
||||
item.classList.toggle('open');
|
||||
});
|
||||
});
|
||||
|
||||
async function logout() {
|
||||
const response = await fetch('/logout', { method: 'POST', headers: {'Content-Type': 'application/json'} });
|
||||
if (response.ok) {
|
||||
window.history.pushState({ }, '', '/login');
|
||||
location.reload();
|
||||
}
|
||||
}
|
||||
|
||||
fetch('/api/NotifyTray/getTrays')
|
||||
.then(res => res.json())
|
||||
.then(trays => {
|
||||
notify.clear();
|
||||
if (trays.length > 0) {
|
||||
trays.forEach(tray => {
|
||||
notify.addItem(tray, () => {
|
||||
if(tray.JSON) {
|
||||
//execution of tray action, e.g. open window
|
||||
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
Reference in New Issue
Block a user