Username form process of VSCode
This commit is contained in:
parent
304bf04afe
commit
a343243576
@ -90,6 +90,7 @@ public class Aggregation
|
||||
private static ReadOnlyCollection<Notification> GetNotifications(Settings settings, string directory)
|
||||
{
|
||||
List<Notification> results = new();
|
||||
string? key;
|
||||
string text;
|
||||
string[] files;
|
||||
Notification? notification;
|
||||
@ -108,12 +109,13 @@ public class Aggregation
|
||||
notification = JsonSerializer.Deserialize(text, NotificationSourceGenerationContext.Default.Notification);
|
||||
if (notification is null || notification.Id == 0)
|
||||
continue;
|
||||
if (string.IsNullOrEmpty(notification.RemoteIpAddress))
|
||||
key = !string.IsNullOrEmpty(notification.Username) ? notification.Username : notification.RemoteIpAddress;
|
||||
if (string.IsNullOrEmpty(key))
|
||||
continue;
|
||||
if (!keyValuePairs.TryGetValue(notification.RemoteIpAddress, out collection))
|
||||
if (!keyValuePairs.TryGetValue(key, out collection))
|
||||
{
|
||||
keyValuePairs.Add(notification.RemoteIpAddress, new());
|
||||
if (!keyValuePairs.TryGetValue(notification.RemoteIpAddress, out collection))
|
||||
keyValuePairs.Add(key, new());
|
||||
if (!keyValuePairs.TryGetValue(key, out collection))
|
||||
throw new Exception();
|
||||
}
|
||||
collection.Add(notification);
|
||||
|
@ -11,30 +11,36 @@ public class Notification
|
||||
public Notification(int? fibonacci,
|
||||
int id,
|
||||
int? inverse,
|
||||
string? machineId,
|
||||
string page,
|
||||
string? remoteIpAddress,
|
||||
string? site,
|
||||
long time,
|
||||
string? username,
|
||||
int value)
|
||||
{
|
||||
int? i = inverse is not null ? inverse : GetInverse(value);
|
||||
Fibonacci = fibonacci is not null ? fibonacci : i is null ? null : GetFibonacci(i.Value);
|
||||
Id = id;
|
||||
Inverse = i;
|
||||
MachineId = machineId;
|
||||
Page = page;
|
||||
RemoteIpAddress = remoteIpAddress is not null ? remoteIpAddress : null;
|
||||
Site = site is not null ? site : "MES";
|
||||
Time = time;
|
||||
Username = username;
|
||||
Value = value;
|
||||
}
|
||||
|
||||
[JsonPropertyName("id")] public int Id { get; }
|
||||
[JsonPropertyName("fibonacci")] public int? Fibonacci { get; }
|
||||
[JsonPropertyName("inverse")] public int? Inverse { get; }
|
||||
[JsonPropertyName("machineId")] public string? MachineId { get; }
|
||||
[JsonPropertyName("page")] public string Page { get; }
|
||||
[JsonPropertyName("RemoteIpAddress")] public string? RemoteIpAddress { get; }
|
||||
[JsonPropertyName("site")] public string? Site { get; }
|
||||
[JsonPropertyName("time")] public long Time { get; }
|
||||
[JsonPropertyName("username")] public string? Username { get; }
|
||||
[JsonPropertyName("value")] public int Value { get; }
|
||||
|
||||
internal static int? GetInverse(int value) =>
|
||||
@ -67,10 +73,12 @@ public class Notification
|
||||
new(notification.Fibonacci,
|
||||
notification.Id,
|
||||
notification.Inverse,
|
||||
notification.MachineId,
|
||||
notification.Page,
|
||||
remoteIpAddress ?? connectionId,
|
||||
notification.Site,
|
||||
notification.Time,
|
||||
notification.Username,
|
||||
notification.Value);
|
||||
|
||||
}
|
||||
|
@ -1,13 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
<title>Infineon - Cost of Delay (CoD) (see @SCALE formula)</title>
|
||||
<link href="/styles/bootstrap.min.css?no-cache=2024-10-04-08-34" rel="stylesheet" />
|
||||
<link href="/igniteui/css/themes/bootstrap3/default/infragistics.theme.css?v=2025-01-22-10-49" rel="stylesheet" />
|
||||
<link href="/igniteui/css/structure/infragistics.css?v=2025-01-22-10-49" rel="stylesheet" />
|
||||
<link href="/styles/cod.css?no-cache=2024-10-04-08-34" rel="stylesheet" />
|
||||
<script src="/js/scripts/jquery-1.6.4.min.js"></script>
|
||||
<script src="/js/scripts/jquery.signalR-2.4.3.min.js"></script>
|
||||
@ -56,6 +54,8 @@
|
||||
<script>
|
||||
|
||||
$(document).ready(function () {
|
||||
const username = '';
|
||||
const machineId = '';
|
||||
const fromHtml = true;
|
||||
const signalRUrl = "/signalr";
|
||||
const windowLocationHRef = window.location.href;
|
||||
@ -100,7 +100,7 @@
|
||||
th: "Weightest Shortest Job First calculation (WSJF)",
|
||||
span: "Weightest Shortest Job First calculation (see @SCALE formula)"
|
||||
};
|
||||
initIndex(fromHtml, windowLocationHRef, workItems, b, r, t, c, e, w, apiUrl, signalRUrl);
|
||||
initIndex(fromHtml, username, machineId, windowLocationHRef, workItems, b, r, t, c, e, w, apiUrl, signalRUrl);
|
||||
});
|
||||
|
||||
</script>
|
||||
|
@ -1,7 +1,9 @@
|
||||
var _site = '';
|
||||
var _chat = {};
|
||||
var _site = '';
|
||||
var _apiUrl = '';
|
||||
var _toggle = true;
|
||||
var _username = '';
|
||||
var _machineId = '';
|
||||
var _windowLocationHRef = '';
|
||||
var _connectionHubStartDone = false;
|
||||
|
||||
@ -177,7 +179,15 @@ function getRecords(b, r, t, c, e, w, data, dataB) {
|
||||
}
|
||||
|
||||
function sendValue(fromHtml, element, page, id) {
|
||||
var notification = { time: new Date().getTime(), site: _site, page: page, id: id, value: element.value };
|
||||
var notification = {
|
||||
id: id,
|
||||
machineId: _machineId,
|
||||
page: page,
|
||||
site: _site,
|
||||
time: new Date().getTime(),
|
||||
username: _username,
|
||||
value: element.value,
|
||||
};
|
||||
if (fromHtml && notification.value !== "9") {
|
||||
$("#AllTextarea").hide();
|
||||
document.getElementById('AllTextarea').value = '';
|
||||
@ -360,15 +370,7 @@ function highlight(el, i) {
|
||||
.fadeOut(1000 * i);
|
||||
}
|
||||
|
||||
function setupSignalR(b, r, t, c, e, w, signalRUrl) {
|
||||
$.connection.hub.logging = true;
|
||||
$.connection.hub.url = signalRUrl;
|
||||
_chat = $.connection.weightedShortestJobFirstHub;
|
||||
if (_chat == undefined || _chat.server == undefined) {
|
||||
alert("Error within handshake!");
|
||||
}
|
||||
else {
|
||||
_chat.client.updateWorkItem = function (page, workItem) {
|
||||
function updateWorkItem(b, r, t, c, e, w, page, workItem) {
|
||||
console.log(workItem);
|
||||
var x = null;
|
||||
var aggregation = null;
|
||||
@ -438,6 +440,18 @@ function setupSignalR(b, r, t, c, e, w, signalRUrl) {
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function setupSignalR(b, r, t, c, e, w, signalRUrl) {
|
||||
$.connection.hub.logging = true;
|
||||
$.connection.hub.url = signalRUrl;
|
||||
_chat = $.connection.weightedShortestJobFirstHub;
|
||||
if (_chat == undefined || _chat.server == undefined) {
|
||||
alert('Error within handshake!');
|
||||
}
|
||||
else {
|
||||
_chat.client.updateWorkItem = function (page, workItem) {
|
||||
updateWorkItem(b, r, t, c, e, w, page, workItem);
|
||||
};
|
||||
// $.connection.hub.start({ transport: 'longPolling' })
|
||||
$.connection.hub.start()
|
||||
@ -456,8 +470,10 @@ function setupSignalR(b, r, t, c, e, w, signalRUrl) {
|
||||
}
|
||||
}
|
||||
|
||||
function initIndex(fromHtml, windowLocationHRef, workItems, b, r, t, c, e, w, apiUrl, signalRUrl) {
|
||||
function initIndex(fromHtml, username, machineId, windowLocationHRef, workItems, b, r, t, c, e, w, apiUrl, signalRUrl) {
|
||||
_apiUrl = apiUrl;
|
||||
_username = username;
|
||||
_machineId = machineId;
|
||||
_windowLocationHRef = windowLocationHRef;
|
||||
if (!fromHtml) {
|
||||
console.log(b);
|
||||
@ -17038,6 +17054,8 @@ function getExampleDataB() {
|
||||
// #region Test
|
||||
|
||||
if (typeof document == 'undefined') {
|
||||
const username = '';
|
||||
const machineId = '';
|
||||
const fromHtml = false;
|
||||
const signalRUrl = "/signalr";
|
||||
const apiUrl = "https://oi-metrology-viewer-prod.mes.infineon.com:4438/api/v1/ado/";
|
||||
@ -17090,7 +17108,7 @@ if (typeof document == 'undefined') {
|
||||
if (dataA.length > 0)
|
||||
console.log(dataA[0]);
|
||||
setRecords(fromHtml, b, r, t, c, e, w, records);
|
||||
initIndex(fromHtml, windowLocationHRef, workItems, b, r, t, c, e, w, apiUrl, signalRUrl);
|
||||
initIndex(fromHtml, username, machineId, windowLocationHRef, workItems, b, r, t, c, e, w, apiUrl, signalRUrl);
|
||||
}
|
||||
|
||||
// #endregion Test
|
@ -207,10 +207,12 @@ public class MESAFIBACKLOG
|
||||
Notification notification = new(fibonacci: null,
|
||||
id: 1107438888,
|
||||
inverse: null,
|
||||
machineId: Environment.MachineName,
|
||||
page: "effort",
|
||||
remoteIpAddress: "10.95.36.87",
|
||||
site: "MES",
|
||||
time: 1737573418926,
|
||||
username: Environment.UserName,
|
||||
value: 1);
|
||||
weightedShortestJobFirstHub.NotifyAll(notification);
|
||||
NonThrowTryCatch();
|
||||
|
Loading…
x
Reference in New Issue
Block a user