Remove the smoothie graphs. The sparklines are too good. I will rebuild whatever I'm missing with these.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4375 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
@ -7,8 +7,6 @@ let gFiles = {};
|
||||
let gApp = {files: {}, emoji: '📦'};
|
||||
let gEditor;
|
||||
let gSplit;
|
||||
let gGraphs = {};
|
||||
let gTimeSeries = {};
|
||||
let gOriginalInput;
|
||||
|
||||
let kErrorColor = "#dc322f";
|
||||
@ -431,24 +429,6 @@ function trace() {
|
||||
window.open(`/speedscope/#profileURL=${encodeURIComponent('/trace')}`);
|
||||
}
|
||||
|
||||
function stats() {
|
||||
window.localStorage.setItem('stats', '1');
|
||||
document.getElementById("statsPane").style.display = 'flex';
|
||||
}
|
||||
|
||||
function closeStats() {
|
||||
window.localStorage.setItem('stats', '0');
|
||||
document.getElementById("statsPane").style.display = 'none';
|
||||
}
|
||||
|
||||
function toggleStats() {
|
||||
if (document.getElementById("statsPane").style.display == 'none') {
|
||||
stats();
|
||||
} else {
|
||||
closeStats();
|
||||
}
|
||||
}
|
||||
|
||||
function guessMode(name) {
|
||||
return name.endsWith(".js") ? "javascript" :
|
||||
name.endsWith(".html") ? "htmlmixed" :
|
||||
@ -804,57 +784,6 @@ function _receive_websocket_message(message) {
|
||||
};
|
||||
const k_colors = ['#0f0', '#88f', '#ff0', '#f0f', '#0ff', '#f00', '#888'];
|
||||
let graph_key = k_groups[key]?.group || key;
|
||||
let graph = gGraphs[graph_key];
|
||||
if (!graph) {
|
||||
graph = {
|
||||
chart: new SmoothieChart({
|
||||
millisPerPixel: 100,
|
||||
minValue: 0,
|
||||
grid: {
|
||||
millisPerLine: 1000,
|
||||
verticalSections: 10,
|
||||
},
|
||||
tooltip: true,
|
||||
}),
|
||||
canvas: document.createElement('canvas'),
|
||||
title: document.createElement('div'),
|
||||
series: [],
|
||||
};
|
||||
gGraphs[graph_key] = graph;
|
||||
graph.canvas.width = 240;
|
||||
graph.canvas.height = 64;
|
||||
graph.title.innerText = graph_key;
|
||||
graph.title.style.flex = '0';
|
||||
document.getElementById('graphs').appendChild(graph.title);
|
||||
document.getElementById('graphs').appendChild(graph.canvas);
|
||||
graph.chart.streamTo(graph.canvas, 1000);
|
||||
}
|
||||
|
||||
let timeseries = gTimeSeries[key];
|
||||
if (!timeseries) {
|
||||
let is_multi = key != graph_key || graph.series.length > 1;
|
||||
timeseries = new TimeSeries();
|
||||
gTimeSeries[key] = timeseries;
|
||||
graph.chart.addTimeSeries(timeseries, {lineWidth: 2, strokeStyle: is_multi ? k_colors[graph.series.length] : '#fff'});
|
||||
graph.series.push(k_groups[key]?.name || key);
|
||||
if (is_multi) {
|
||||
while (graph.title.firstChild) {
|
||||
graph.title.removeChild(graph.title.firstChild);
|
||||
}
|
||||
function makeColoredText(text, color) {
|
||||
let element = document.createElement('span');
|
||||
element.style.color = color;
|
||||
element.innerText = text;
|
||||
return element;
|
||||
}
|
||||
graph.title.appendChild(makeColoredText(graph_key + ':', '#fff'));
|
||||
for (let series of graph.series) {
|
||||
graph.title.appendChild(makeColoredText(' ' + series, k_colors[graph.series.indexOf(series)]));
|
||||
}
|
||||
}
|
||||
}
|
||||
timeseries.append(now, message.stats[key]);
|
||||
|
||||
if (graph_key == 'cpu' || graph_key == 'rpc' || graph_key == 'store') {
|
||||
let line = document.getElementsByTagName('tf-navigation')[0].get_spark_line(graph_key, { max: 100 });
|
||||
line.dataset.emoji = {
|
||||
@ -1154,7 +1083,6 @@ window.addEventListener("load", function() {
|
||||
window.addEventListener("message", message, false);
|
||||
window.addEventListener("online", connectSocket);
|
||||
document.getElementById("name").value = window.location.pathname;
|
||||
document.getElementById('closeStats').addEventListener('click', () => closeStats());
|
||||
document.getElementById('closeEditor').addEventListener('click', () => closeEditor());
|
||||
document.getElementById('save').addEventListener('click', () => save());
|
||||
document.getElementById('icon').addEventListener('click', () => changeIcon());
|
||||
@ -1163,10 +1091,6 @@ window.addEventListener("load", function() {
|
||||
event.preventDefault();
|
||||
trace();
|
||||
});
|
||||
document.getElementById('stats_button').addEventListener('click', function(event) {
|
||||
event.preventDefault();
|
||||
toggleStats();
|
||||
});
|
||||
for (let tag of document.getElementsByTagName('a')) {
|
||||
if (tag.accessKey) {
|
||||
tag.classList.add('tooltip_parent');
|
||||
@ -1199,9 +1123,4 @@ window.addEventListener("load", function() {
|
||||
} else {
|
||||
closeEditor();
|
||||
}
|
||||
if (window.localStorage.getItem('stats') == '1') {
|
||||
stats();
|
||||
} else {
|
||||
closeStats();
|
||||
}
|
||||
});
|
||||
|
@ -936,8 +936,6 @@ loadSettings().then(function() {
|
||||
return staticDirectoryHandler(request, response, 'deps/speedscope/', match[1]);
|
||||
} else if (match = /^\/split\/([\.\w-/]*)$/.exec(request.uri)) {
|
||||
return staticDirectoryHandler(request, response, 'deps/split/', match[1]);
|
||||
} else if (match = /^\/smoothie\/([\.\w-/]*)$/.exec(request.uri)) {
|
||||
return staticDirectoryHandler(request, response, 'deps/smoothie/', match[1]);
|
||||
} else if (match = /^\/static(\/.*)/.exec(request.uri)) {
|
||||
return staticFileHandler(request, response, null, match[1]);
|
||||
} else if (request.uri == "/robots.txt") {
|
||||
|
@ -9,12 +9,6 @@
|
||||
<body style="display: flex; flex-flow: column">
|
||||
<tf-navigation></tf-navigation>
|
||||
<div id="content" class="hbox" style="flex: 1 1; width: 100%">
|
||||
<div id="statsPane" class="vbox" style="display: none; flex 1 1">
|
||||
<div class="hbox">
|
||||
<input type="button" id="closeStats" name="closeStats" value="Close">
|
||||
</div>
|
||||
<div id="graphs" class="vbox" style="height: 100%"></div>
|
||||
</div>
|
||||
<div id="editPane" class="vbox" style="display: none">
|
||||
<div class="navigation hbox">
|
||||
<input type="button" id="closeEditor" name="closeEditor" value="Close">
|
||||
@ -23,7 +17,6 @@
|
||||
<input type="text" id="name" name="name" style="flex: 1 1; min-width: 1em"></input>
|
||||
<input type="button" id="delete" name="delete" value="Delete">
|
||||
<input type="button" id="trace_button" value="Trace">
|
||||
<input type="button" id="stats_button" value="Stats">
|
||||
</div>
|
||||
<div class="hbox" style="height: 100%">
|
||||
<tf-files-pane></tf-files-pane>
|
||||
@ -40,7 +33,6 @@
|
||||
</div>
|
||||
<script>window.litDisableBundleWarning = true;</script>
|
||||
<script src="/split/split.min.js"></script>
|
||||
<script src="/smoothie/smoothie.js"></script>
|
||||
<script src="/static/client.js" type="module"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
Reference in New Issue
Block a user