Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
masterarbeit-frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Robin Leber
masterarbeit-frontend
Commits
ead7a9a2
Commit
ead7a9a2
authored
Jun 19, 2024
by
Robin Leber
Browse files
Options
Downloads
Patches
Plain Diff
vorbereitung für pipe binding
parent
665032e4
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/functions/codeEditor.js
+3
-2
3 additions, 2 deletions
src/functions/codeEditor.js
src/functions/duplication.js
+3
-2
3 additions, 2 deletions
src/functions/duplication.js
src/main.js
+5
-0
5 additions, 0 deletions
src/main.js
with
11 additions
and
4 deletions
src/functions/codeEditor.js
+
3
−
2
View file @
ead7a9a2
...
@@ -42,13 +42,13 @@ export const codeEditor = (instance) => {
...
@@ -42,13 +42,13 @@ export const codeEditor = (instance) => {
let
editorValues
;
let
editorValues
;
if
(
filterToCode
.
type
.
includes
(
"
Sender
"
))
if
(
filterToCode
.
type
.
includes
(
"
Sender
"
))
editorValues
=
{
editorValues
=
{
doc
:
"
// publisher.js
\n
const amqp = require('amqplib/callback_api');
\n\n
const rabbitmqUrl = 'amqp://mquser:mqpass@rabbit:5672';
\n\n
amqp.connect(rabbitmqUrl, (error0, connection) => {
\n
if (error0) {
\n
throw error0;
\n
}
\n
connection.createChannel((error1, channel) => {
\n
if (error1) {
\n
throw error1;
\n
}
\n\n
const queue = 'hello';
\n\n
channel.assertQueue(queue, {
\n
durable: false
\n
});
\n\n
const sendMessage = () => {
\n
const msg = 'Hello World! ' + new Date().toISOString();
\n
channel.sendToQueue(queue, Buffer.from(msg));
\n
console.log(
\"
[x] Sent '%s'
\"
, msg);
\n
};
\n\n
setInterval(sendMessage, 1000);
\n
});
\n
});
\n
"
,
doc
:
"
// publisher.js
\n
const amqp = require('amqplib/callback_api');
\n\n
const rabbitmqUrl = 'amqp://mquser:mqpass@rabbit:5672';
\n\n
amqp.connect(rabbitmqUrl, (error0, connection) => {
\n
if (error0) {
\n
throw error0;
\n
}
\n
connection.createChannel((error1, channel) => {
\n
if (error1) {
\n
throw error1;
\n
}
\n\n
// DO NOT CHANGE
\n
const queue = process.env.QUEUE_NAME
\n\n
channel.assertQueue(queue, {
\n
durable: false
\n
});
\n\n
const sendMessage = () => {
\n
const msg = 'Hello World! ' + new Date().toISOString();
\n
channel.sendToQueue(queue, Buffer.from(msg));
\n
console.log(
\"
[x] Sent '%s'
\"
, msg);
\n
};
\n\n
setInterval(sendMessage, 1000);
\n
});
\n
});
\n
"
,
extensions
:
[
basicSetup
,
javascript
()],
extensions
:
[
basicSetup
,
javascript
()],
parent
:
editorContainer
,
parent
:
editorContainer
,
};
};
else
if
(
filterToCode
.
type
.
includes
(
"
Receiver
"
))
{
else
if
(
filterToCode
.
type
.
includes
(
"
Receiver
"
))
{
editorValues
=
{
editorValues
=
{
doc
:
"
// consumer.js
\n
const amqp = require('amqplib/callback_api');
\n\n
const rabbitmqUrl = 'amqp://mquser:mqpass@rabbit:5672';
\n\n
amqp.connect(rabbitmqUrl, (error0, connection) => {
\n\t
if (error0) {
\n\t\t
throw error0;
\n\t
}
\n\t
connection.createChannel((error1, channel) => {
\n\t\t
if (error1) {
\n\t\t\t
throw error1;
\n\t\t
}
\n\n\t\t
const queue = 'hello';
\n\n\t\t
channel.assertQueue(queue, {
\n\t\t\t
durable: false
\n\t\t
});
\n\n\t\t
console.log(
\"
[*] Waiting for messages in %s. To exit press CTRL+C
\"
, queue);
\n\n\t\t
// Funktion, um eine Nachricht aus der Queue zu konsumieren
\n\t\t
const consumeMessage = () => {
\n\t\t\t
channel.get(queue, { noAck: false }, (error, msg) => {
\n\t\t\t\t
if (error) {
\n\t\t\t\t\t
throw error;
\n\t\t\t\t
}
\n\t\t\t\t
if (msg) {
\n\t\t\t\t\t
console.log(
\"
[x] Received '%s'
\"
, msg.content.toString());
\n\t\t\t\t\t
// Nachricht bestätigen (acknowledge)
\n\t\t\t\t\t
channel.ack(msg);
\n\t\t\t\t
} else {
\n\t\t\t\t\t
console.log(
\"
[x] No message received at this interval.
\"
);
\n\t\t\t\t
}
\n\t\t\t
});
\n\t\t
};
\n\n\t\t
// Setze ein Intervall von 3 Sekunden
\n\t\t
setInterval(consumeMessage, 3000);
\n\t
});
\n
});
\n
"
,
doc
:
"
// consumer.js
\n
const amqp = require('amqplib/callback_api');
\n\n
const rabbitmqUrl = 'amqp://mquser:mqpass@rabbit:5672';
\n\n
amqp.connect(rabbitmqUrl, (error0, connection) => {
\n\t
if (error0) {
\n\t\t
throw error0;
\n\t
}
\n\t
connection.createChannel((error1, channel) => {
\n\t\t
if (error1) {
\n\t\t\t
throw error1;
\n\t\t
}
\n\n\t\t
// DO NOT CHANGE
\n
const queue = process.env.QUEUE_NAME
\n\n\t\t
channel.assertQueue(queue, {
\n\t\t\t
durable: false
\n\t\t
});
\n\n\t\t
console.log(
\"
[*] Waiting for messages in %s. To exit press CTRL+C
\"
, queue);
\n\n\t\t
// Funktion, um eine Nachricht aus der Queue zu konsumieren
\n\t\t
const consumeMessage = () => {
\n\t\t\t
channel.get(queue, { noAck: false }, (error, msg) => {
\n\t\t\t\t
if (error) {
\n\t\t\t\t\t
throw error;
\n\t\t\t\t
}
\n\t\t\t\t
if (msg) {
\n\t\t\t\t\t
console.log(
\"
[x] Received '%s'
\"
, msg.content.toString());
\n\t\t\t\t\t
// Nachricht bestätigen (acknowledge)
\n\t\t\t\t\t
channel.ack(msg);
\n\t\t\t\t
} else {
\n\t\t\t\t\t
console.log(
\"
[x] No message received at this interval.
\"
);
\n\t\t\t\t
}
\n\t\t\t
});
\n\t\t
};
\n\n\t\t
// Setze ein Intervall von 3 Sekunden
\n\t\t
setInterval(consumeMessage, 3000);
\n\t
});
\n
});
\n
"
,
extensions
:
[
basicSetup
,
javascript
()],
extensions
:
[
basicSetup
,
javascript
()],
parent
:
editorContainer
,
parent
:
editorContainer
,
};
};
...
@@ -95,6 +95,7 @@ const handleSubmit = (node, code) => {
...
@@ -95,6 +95,7 @@ const handleSubmit = (node, code) => {
.
innerHTML
.
split
(
"
\n
"
)[
1
],
.
innerHTML
.
split
(
"
\n
"
)[
1
],
id
:
window
.
selectedFilter
,
id
:
window
.
selectedFilter
,
code
:
code
,
code
:
code
,
pipe
:
""
,
isDeployed
:
false
,
isDeployed
:
false
,
isPaused
:
false
,
isPaused
:
false
,
isScaled
:
""
,
isScaled
:
""
,
...
...
...
...
This diff is collapsed.
Click to expand it.
src/functions/duplication.js
+
3
−
2
View file @
ead7a9a2
...
@@ -55,7 +55,7 @@ export const duplicateFilter = (instance) => {
...
@@ -55,7 +55,7 @@ export const duplicateFilter = (instance) => {
};
};
export
const
extendPipe
=
()
=>
{
export
const
extendPipe
=
()
=>
{
let
p
ipeName
=
prompt
(
"
Bitte geben Sie einen Pipe Namen ein:
"
);
let
newP
ipeName
=
prompt
(
"
Bitte geben Sie einen Pipe Namen ein:
"
);
const
pipeToName
=
document
.
getElementById
(
window
.
selectedPipe
);
const
pipeToName
=
document
.
getElementById
(
window
.
selectedPipe
);
if
(
pipeToName
)
{
if
(
pipeToName
)
{
var
textIndex
=
pipeToName
.
innerHTML
.
indexOf
(
"
Queue
"
);
var
textIndex
=
pipeToName
.
innerHTML
.
indexOf
(
"
Queue
"
);
...
@@ -70,9 +70,10 @@ export const extendPipe = () => {
...
@@ -70,9 +70,10 @@ export const extendPipe = () => {
);
);
var
afterQueue
=
pipeToName
.
innerHTML
.
slice
(
textIndex
+
"
Queue
"
.
length
);
var
afterQueue
=
pipeToName
.
innerHTML
.
slice
(
textIndex
+
"
Queue
"
.
length
);
var
newContent
=
beforeQueue
+
`<br> "
${
p
ipeName
}
"`
+
afterQueue
;
var
newContent
=
beforeQueue
+
`<br> "
${
newP
ipeName
}
"`
+
afterQueue
;
pipeToName
.
innerHTML
=
newContent
;
pipeToName
.
innerHTML
=
newContent
;
}
}
appState
.
addPipe
(
pipeToName
.
id
,
newPipeName
);
}
}
};
};
This diff is collapsed.
Click to expand it.
src/main.js
+
5
−
0
View file @
ead7a9a2
...
@@ -33,6 +33,11 @@ function App() {
...
@@ -33,6 +33,11 @@ function App() {
if
(
!
isConnectionAllowed
(
source
,
target
))
{
if
(
!
isConnectionAllowed
(
source
,
target
))
{
return
false
;
return
false
;
}
}
if
(
source
.
getAttribute
(
"
class
"
).
includes
(
"
Filter
"
))
{
appState
.
addConnection
(
source
.
id
,
target
.
id
);
}
else
{
appState
.
addConnection
(
target
.
id
,
source
.
id
);
}
return
true
;
return
true
;
});
});
...
...
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment