Skip to content

Commit

Permalink
fix: AddEndpointForm update
Browse files Browse the repository at this point in the history
  • Loading branch information
ralfaron committed Nov 5, 2024
1 parent b98aa44 commit 7040ece
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"type": "chrome",
"request": "launch",
"preLaunchTask": "start",
"url": "http://localhost:4200/",
"url": "http://127.0.0.1:4200/",
"webRoot": "${workspaceFolder}"
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ <h4 class="modal-title">
</div>
@if (schedule() === 'every') {
<div class="input-group mt-3">
<input type="text" class="form-control awp-number-input" placeholder="Hours" min="0" max="99"
aria-label="Hours" [(ngModel)]="hours">
<span class="input-group-text">Hours</span>
<input type="number" class="form-control awp-number-input" placeholder="Minutes" min="0" max="59"
aria-label="Minutes" [(ngModel)]="minutes">
<span class="input-group-text">Minutes</span>
<input #inputHours type="number" class="form-control awp-number-input" min="0" max="99"
aria-label="Hours" [value]="hours()" (input)="hours.set(inputHours.valueAsNumber)">
<span class="input-group-text" translate>AddEndpointForm.HOURS</span>
<input #inputMinutes type="number" class="form-control awp-number-input" min="0" max="59"
aria-label="Minutes" [value]="minutes()" (input)="minutes.set(inputMinutes.valueAsNumber)">
<span class="input-group-text" translate>AddEndpointForm.MINUTES</span>
</div>
}
<div class="col-12 mt-2" style="max-height: 200px; overflow-y: auto;">
Expand Down
4 changes: 3 additions & 1 deletion projects/aas-portal/src/assets/i18n/de-de.json
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,9 @@
"PLACEHOLDER_URL_HTTP": "http(s)://",
"PLACEHOLDER_URL_OPCUA": "opc.tcp://",
"PLACEHOLDER_URL_WEBDAV": "http(s)://",
"ADVANCED_SETTINGS": "Erweiterte Einstellungen"
"ADVANCED_SETTINGS": "Erweiterte Einstellungen",
"MINUTES": "Minuten",
"HOURS": "Stunden"
},
"CustomerFeedback": {
"OverallRating": "Gesamtbewertung",
Expand Down
4 changes: 3 additions & 1 deletion projects/aas-portal/src/assets/i18n/en-us.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,9 @@
"PLACEHOLDER_URL_HTTP": "http(s)://",
"PLACEHOLDER_URL_OPCUA": "opc.tcp://",
"PLACEHOLDER_URL_WEBDAV": "http(s)://",
"ADVANCED_SETTINGS": "Advanced settings"
"ADVANCED_SETTINGS": "Advanced settings",
"MINUTES": "Minutes",
"HOURS": "Hours"
},
"CustomerFeedback": {
"OverallRating": "Overall rating",
Expand Down
3 changes: 0 additions & 3 deletions projects/aas-server/src/app/aas-provider/aas-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import {
getChildren,
isReferenceElement,
AASEndpointSchedule,
noop,
} from 'aas-core';

import { ImageProcessing } from '../image-processing.js';
Expand Down Expand Up @@ -487,8 +486,6 @@ export class AASProvider {
const timeout = Date.now() - start - values[0];
return timeout >= 0 ? timeout : values[0];
}
} else if (schedule.type === 'daily' || ) {
noop();
}

return this.variable.SCAN_ENDPOINT_TIMEOUT;
Expand Down
14 changes: 13 additions & 1 deletion projects/aas-server/src/app/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*****************************************************************************/

import { AASEndpoint, getEndpointName, getEndpointType } from 'aas-core';
import { decodeBase64Url } from './convert.js';

/** The AAS Server configuration. */
export interface AASServerConfiguration {
Expand All @@ -23,9 +24,20 @@ export function urlToEndpoint(url: string | URL): AASEndpoint {
const name = getEndpointName(value);
const type = getEndpointType(value);
const version = value.searchParams.get('version') ?? 'v3';
const schedule = value.searchParams.get('schedule');
const headers = value.searchParams.get('headers');

value.search = '';
value.hash = '';

return { url: value.href.split('?')[0], name: name, type, version };
const endpoint: AASEndpoint = { url: value.href.split('?')[0], name: name, type, version };
if (schedule) {
endpoint.schedule = JSON.parse(decodeBase64Url(schedule));
}

if (headers) {
endpoint.headers = JSON.parse(decodeBase64Url(headers));
}

return endpoint;
}

0 comments on commit 7040ece

Please sign in to comment.