Moved server performance indicators; control tips working again.

This commit is contained in:
PeekabooSteam 2023-10-04 20:07:49 +01:00
parent e41484186b
commit f7b3e5bf77
11 changed files with 92 additions and 36 deletions

View File

@ -33,6 +33,7 @@ class ControlTipsPlugin {
}
initialize(app) {
__classPrivateFieldSet(this, _ControlTipsPlugin_app, app, "f");
debugger;
__classPrivateFieldSet(this, _ControlTipsPlugin_shortcutManager, __classPrivateFieldGet(this, _ControlTipsPlugin_app, "f").getShortcutManager(), "f");
__classPrivateFieldGet(this, _ControlTipsPlugin_shortcutManager, "f").onKeyDown(() => {
__classPrivateFieldGet(this, _ControlTipsPlugin_instances, "m", _ControlTipsPlugin_updateTips).call(this);

View File

@ -1,5 +1,6 @@
import { OlympusPlugin } from "interfaces";
const SHOW_CONTROL_TIPS = "Show control tips"
export class ControlTipsPlugin implements OlympusPlugin {
@ -22,7 +23,7 @@ export class ControlTipsPlugin implements OlympusPlugin {
initialize(app: any) {
this.#app = app;
debugger;
this.#shortcutManager = this.#app.getShortcutManager();
this.#shortcutManager.onKeyDown(() => {

View File

@ -99,6 +99,6 @@
},
"include": [
"src/*.ts",
"../../@types/*.d.ts"
"../../@types/olympus/*.d.ts"
]
}

View File

@ -72,15 +72,6 @@
z-index: 9999;
}
#server-status-panel {
bottom: 20px;
font-size: 12px;
position: absolute;
right: 200px;
width: 300px;
z-index: 9999;
}
#mouse-info-panel {
bottom: 60px;
display: flex;
@ -148,7 +139,7 @@
#log-panel {
position: absolute;
right: 0px;
top: 220px;
top: 170px;
width: 310px;
height: fit-content;
z-index: 9990;

View File

@ -26,3 +26,55 @@
#log-panel.open>div:nth-child(2) {
display: block;
}
#log-panel-header-right {
align-items: center;
column-gap: 16px;
display:flex;
flex-flow: row nowrap;
}
#server-status-panel abbr {
text-decoration: none;
}
#server-status-panel dl {
column-gap: 4px;
display:flex;
flex-direction: row;
width:fit-content;
}
#server-status-panel dl > * {
margin:0;
width:fit-content;
}
#server-status-panel dd {
font-weight: bold;
}
.fps-low {
color: red;
}
.fps-medium {
color: orange;
}
.fps-high {
color: lightgreen;
}
.load-low {
color: lightgreen;
}
.load-medium {
color: orange;
}
.load-high {
color: red;
}

View File

@ -5,31 +5,26 @@
column-gap: 10px;
}
#server-status-panel .ol-data-grid {
width: 100%;
#log-panel-header-right {
align-items: center;
column-gap: 16px;
display:flex;
flex-flow: row nowrap;
}
@media (min-width: 1525px) {
#server-status-panel .ol-data-grid:first-of-type {
border-right: 1px solid gray;
padding-right: 10px;
}
#server-status-panel dl {
column-gap: 4px;
display:flex;
flex-direction: row;
width:fit-content;
}
@media (max-width: 1525px) {
#server-status-panel {
flex-direction: column;
row-gap: 10px;
width: 180px;
}
#server-status-panel .ol-data-grid:first-of-type {
border-bottom: 1px solid gray;
padding-bottom: 10px;
}
#server-status-panel dl > * {
margin:0;
width:fit-content;
}
#server-status-panel dd {
font-weight: bold;
}

View File

@ -121,7 +121,7 @@ export class Map extends L.Map {
/* Scale */
//@ts-ignore TODO more hacking because the module is provided as a pure javascript module only
L.control.scalenautic({ position: "topright", maxWidth: 300, nautic: true, metric: true, imperial: false }).addTo(this);
//L.control.scalenautic({ position: "topright", maxWidth: 300, nautic: true, metric: true, imperial: false }).addTo(this);
/* Map source dropdown */
this.#mapSourceDropdown = new Dropdown("map-type", (layerName: string) => this.setLayer(layerName), this.getLayers());

View File

@ -15,7 +15,6 @@ import { PrimaryToolbar } from "./toolbars/primarytoolbar";
import { UnitsManager } from "./unit/unitsmanager";
import { WeaponsManager } from "./weapon/weaponsmanager";
import { Manager } from "./other/manager";
import { ShortcutKeyboard } from "./shortcut/shortcut";
import { SVGInjector } from "@tanem/svg-injector";
import { ServerManager } from "./server/servermanager";

View File

@ -28,7 +28,7 @@
<%- include('panels/unitinfo.ejs') %>
<%- include('panels/mouseinfo.ejs') %>
<%- include('panels/connectionstatus.ejs') %>
<%- include('panels/serverstatus.ejs') %>
<%- include('panels/hotgroup.ejs') %>
<%- include('panels/logpanel.ejs') %>
<%- include('panels/unitlist.ejs') %>

View File

@ -1,5 +1,22 @@
<div id="log-panel" oncontextmenu="return false;">
<div class="ol-panel" data-on-click="toggleLogPanel"><div id="log-panel-header">Server log</div><img src="/resources/theme/images/icons/chevron-down.svg" inject-svg></div>
<div class="ol-panel" data-on-click="toggleLogPanel">
<div id="log-panel-header">Server log</div>
<div id="log-panel-header-right">
<div id="server-status-panel" oncontextmenu="return false;">
<dl>
<dt><abbr title="Server frame rate (approx)">FPS</abbr>:</dt>
<dd id="server-frame-rate"></dd>
</dl>
<dl>
<dt><abbr title="Server load">Load</abbr>:</dt>
<dd id="server-load"></dd>
</dl>
</div>
<img src="/resources/theme/images/icons/chevron-down.svg" inject-svg>
</div>
</div>
<div class="ol-panel ol-scrollable closed">
</div>
</div>

View File

@ -1,4 +1,4 @@
<div id="unit-list-panel" class="ol-panel">
<div id="unit-list-panel" class="ol-panel hide">
<h3>Unit List</h3>
<div class="unit-list-unit headers">
<div data-sort-field="unitName">Name</div>