-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
313 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<!-- | ||
~ Copyright (c) 2022 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, | ||
~ and/or its subsidiaries and/or its affiliates and/or their licensors. | ||
~ | ||
~ SPDX-License-Identifier: Apache-2.0 | ||
~ | ||
~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
~ you may not use this file except in compliance with the License. | ||
~ You may obtain a copy of the License at | ||
~ | ||
~ http://www.apache.org/licenses/LICENSE-2.0 | ||
~ | ||
~ Unless required by applicable law or agreed to in writing, software | ||
~ distributed under the License is distributed on an "AS IS" BASIS, | ||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
~ See the License for the specific language governing permissions and | ||
~ limitations under the License. | ||
~ | ||
~ @authors Christof Strack | ||
--> | ||
|
||
<c8y-title translate>AnalyticsBuilder Blocks</c8y-title> | ||
<c8y-action-bar-item [placement]="'right'"> | ||
<button | ||
class="btn btn-link" | ||
title="{{ 'Refresh' | translate }}" | ||
(click)="loadBlocks()" | ||
> | ||
<i c8yIcon="refresh"></i> | ||
{{ "Refresh" | translate }} | ||
</button> | ||
|
||
</c8y-action-bar-item> | ||
<div class="card"> | ||
<div class="card-block"> | ||
<c8y-data-grid | ||
[title]="titleBlock | translate" | ||
[selectable]="'true'" | ||
[columns]="columnsBlocks" | ||
[rows]="blocks" | ||
[pagination]="pagination" | ||
[actionControls]="actionControls" | ||
|
||
> | ||
</c8y-data-grid> | ||
</div> | ||
<div class="card-block col-md-offset-5 bg-white"> | ||
<div class="c8y-empty-state" *ngIf="blocks.length === 0"> | ||
<h1 [c8yIcon]="'file-text'"></h1> | ||
<p> | ||
<strong>No blocks loaded.</strong><br /> | ||
</p> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
/* | ||
* Copyright (c) 2022 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, | ||
* and/or its subsidiaries and/or its affiliates and/or their licensors. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* @authors Christof Strack | ||
*/ | ||
import { | ||
Component, | ||
OnInit, | ||
ViewEncapsulation, | ||
} from "@angular/core"; | ||
import { | ||
ActionControl, | ||
AlertService, | ||
Column, | ||
ColumnDataType, | ||
Pagination, | ||
} from "@c8y/ngx-components"; | ||
import { BsModalService } from "ngx-bootstrap/modal"; | ||
import { AnalyticsService } from "../../shared/analytics.service"; | ||
import { Block } from "../../shared/analytics.model"; | ||
|
||
@Component({ | ||
selector: "c8y-block-grid", | ||
templateUrl: "block.component.html", | ||
encapsulation: ViewEncapsulation.None, | ||
}) | ||
export class BlockGridComponent implements OnInit { | ||
|
||
showConfigBlock: boolean = false; | ||
|
||
blocks: Block[] = []; | ||
actionControls: ActionControl[] = []; | ||
|
||
titleBlock: string = "AnalyticsBuilder Blocks"; | ||
|
||
columnsBlocks: Column[] = [ | ||
{ | ||
name: "name", | ||
header: "Name", | ||
path: "name", | ||
filterable: false, | ||
dataType: ColumnDataType.TextShort, | ||
visible: true, | ||
}, | ||
{ | ||
header: "Category", | ||
name: "category", | ||
path: "category", | ||
filterable: true, | ||
}, | ||
{ | ||
header: "Custom Block", | ||
name: "custom", | ||
path: "custom", | ||
filterable: true, | ||
sortable: false, | ||
}, | ||
]; | ||
|
||
pagination: Pagination = { | ||
pageSize: 3, | ||
currentPage: 1, | ||
}; | ||
|
||
constructor( | ||
public analyticsService: AnalyticsService, | ||
public alertService: AlertService, | ||
private bsModalService: BsModalService | ||
) {} | ||
|
||
async ngOnInit() { | ||
await this.loadBlocks(); | ||
} | ||
|
||
async loadBlocks() { | ||
this.blocks = await this.analyticsService.getBlocks(); | ||
} | ||
|
||
ngOnDestroy() { | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.