Skip to content

Commit

Permalink
release-functional commitments
Browse files Browse the repository at this point in the history
  • Loading branch information
LeosPrograms committed Jan 24, 2024
1 parent f7abdfb commit 371f671
Show file tree
Hide file tree
Showing 9 changed files with 497 additions and 22 deletions.
41 changes: 32 additions & 9 deletions ui/src/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,45 @@
word-wrap: break-word; /* for IE */
}
#console-output div {
margin-bottom: 0.1rem;
margin-bottom: 0.8rem;
}
</style>
</html>
<!--
<script>
// Reference to the div where console output will be displayed
const consoleOutputDiv = document.getElementById('console-output');

// Intercept console.log messages
const originalConsoleLog = console.log;
console.log = function () {
originalConsoleLog.apply(console, arguments);
<!-- <script>
const consoleOutputDiv = document.getElementById('console-output');
// Intercept console methods to capture all types of console messages
['log', 'warn', 'error', 'info', 'debug'].forEach(method => {
const originalConsoleMethod = console[method];
console[method] = function () {
originalConsoleMethod.apply(console, arguments);
const message = Array.from(arguments).map(arg => JSON.stringify(arg)).join(' ');
const newLine = document.createElement('div');
newLine.innerHTML = message;
consoleOutputDiv.appendChild(newLine);
};
});
let isResizing = false;
let initialX;
let initialWidth;
consoleOutputDiv.addEventListener('mousedown', (e) => {
if (e.target === consoleOutputDiv) {
isResizing = true;
initialX = e.clientX;
initialWidth = parseInt(getComputedStyle(consoleOutputDiv).width, 10);
}
});
document.addEventListener('mousemove', (e) => {
if (!isResizing) return;
const newWidth = initialWidth + (e.clientX - initialX);
consoleOutputDiv.style.width = newWidth + 'px';
});
document.addEventListener('mouseup', () => {
isResizing = false;
});
</script> -->
6 changes: 4 additions & 2 deletions ui/src/lib/AgentModal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@
"Weaving Factory",
"Designer",
"Shipping",
"Network",
]
let roleImages = {
"Farmer": "farm.svg",
Expand All @@ -132,6 +133,7 @@
"Weaving Factory": "mill.svg",
"Designer": "knitting.svg",
"Shipping": "truck.svg",
"Network": "knitting.svg",
}
// let addAgent: Mutate<QueryResponse> = mutation(ADD_AGENT)
Expand Down Expand Up @@ -252,12 +254,12 @@
$: isAgentValid = true && currentAgent.lat && currentAgent.long && currentAgent.name && currentAgent.imageUrl && currentAgent.role;
onMount(async () => {
// onMount(async () => {
// console.log("mounted")
// findAgent();
// // We pass '' as url because it will dynamically be replaced in launcher environments
// client = await AppAgentWebsocket.connect('', 'acfn');
});
// });
</script>
<!-- <button class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded" on:click={() => testFacetsCall()}>
test`
Expand Down
15 changes: 8 additions & 7 deletions ui/src/lib/CommitmentModal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ const GET_ALL_RESOURCE_SPECIFICATIONS = gql`
onMount(async() => {
window.addEventListener('keydown', checkKey)
await fetchUnits();
await fetchAgents();
await fetchResourceSpecifications();
})
Expand Down Expand Up @@ -208,15 +209,15 @@ const GET_ALL_RESOURCE_SPECIFICATIONS = gql`
}
}
onMount(async () => {
// onMount(async () => {
fetchUnits();
// fetchUnits();
// selectedCommitment = commitments.find(it => it.id == selectedCommitmentId)
// if (!selectedCommitment) {
// selectedCommitment = allColumns[commitmentModalColumn][commitmentModalProcess][commitmentModalSide].find(it => it.id == selectedCommitmentId)
// }
})
// // selectedCommitment = commitments.find(it => it.id == selectedCommitmentId)
// // if (!selectedCommitment) {
// // selectedCommitment = allColumns[commitmentModalColumn][commitmentModalProcess][commitmentModalSide].find(it => it.id == selectedCommitmentId)
// // }
// })
</script>

Expand Down
Loading

0 comments on commit 371f671

Please sign in to comment.