Skip to content

Commit

Permalink
fixed wrong parameter in upload_extension
Browse files Browse the repository at this point in the history
  • Loading branch information
ck-c8y committed Jan 25, 2025
1 parent c705187 commit 40fe5f1
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 17 deletions.
3 changes: 1 addition & 2 deletions analytics-service/flask_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,7 @@ def create_extension_zip():
)
else:
id = agent.upload_extension(
request.headers,
request.cookies,
request,
extension_name,
extension_zip,
)
Expand Down
6 changes: 5 additions & 1 deletion analytics-ui/src/manage/extension-card.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { AnalyticsService, ConfirmationModalComponent } from '../shared';
selector: 'a17t-extension-card',
templateUrl: './extension-card.component.html'
})
export class ExtensionCardComponent {
export class ExtensionCardComponent{
@Input() extension: IManagedObject;
@Output() extensionChanged: EventEmitter<void> = new EventEmitter();

Expand All @@ -24,8 +24,12 @@ export class ExtensionCardComponent {
private router: Router,
private activatedRoute: ActivatedRoute,
private bsModalService: BsModalService,

private wizardModalService: WizardModalService
) {}
// ngOnInit(): void {
// console.log('application', this.as);
// }

async detail() {
if (this.extension.loaded) {
Expand Down
12 changes: 11 additions & 1 deletion analytics-ui/src/shared/analytics-navigation.factory.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Injectable } from '@angular/core';

import {
AppStateService,
gettext,
NavigatorNode,
NavigatorNodeFactory,
Expand All @@ -18,10 +19,19 @@ export class AnalyticsNavigationFactory implements NavigatorNodeFactory {
preventDuplicates: true
});

constructor(private permissions: Permissions) {}
constructor(private permissions: Permissions,
private as: AppStateService,
) {}

get(): NavigatorNode {
console.log('AppState', this.as);
if (this.canActivate()) {
// id running in
if (this.as['options'].contextPath == 'streaminganalytics'){
// console.log('AppState contextPath', this.as['options'].contextPath);
delete this.extensionsNode['parent'];
this.extensionsNode['label'] = gettext('Extensions');
}
return this.extensionsNode;
}
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,26 +108,32 @@ export class ExtensionCreateComponent implements OnInit {
this.configuration.deploy,
this.monitors
);
const binary = await await response.arrayBuffer();
this.loading = false;
const blob = new Blob([binary], {
type: 'application/x-zip-compressed'
});
if (response.status < 400) {
const binary = await await response.arrayBuffer();
this.loading = false;
const blob = new Blob([binary], {
type: 'application/x-zip-compressed'
});

if (!this.configuration.upload) {
saveAs(blob, `${this.configuration.name}.zip`);
this.alertService.success(
`Created extension ${this.configuration.name}.zip. Please deploy from UI.`
);
if (!this.configuration.upload) {
saveAs(blob, `${this.configuration.name}.zip`);
this.alertService.success(
`Created extension ${this.configuration.name}.zip. Please deploy from UI.`
);
} else {
this.alertService.success(
`Uploaded extension ${this.configuration.name}.zip.`
);
}
} else {
this.alertService.success(
`Uploaded extension ${this.configuration.name}.zip.`
this.alertService.warning(
`Uploaded extension ${this.configuration.name}.zip was not successful`
);
}
this.closeSubject.next(true);
}

onClose(){
onClose() {
this.closeSubject.next(false);
}
}

0 comments on commit 40fe5f1

Please sign in to comment.