Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions Angular/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Editor configuration, see https://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.ts]
quote_type = single

[*.md]
max_line_length = off
trim_trailing_whitespace = false
42 changes: 42 additions & 0 deletions Angular/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

# Compiled output
/dist
/tmp
/out-tsc
/bazel-out

# Node
/node_modules
npm-debug.log
yarn-error.log

# IDEs and editors
.idea/
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# Visual Studio Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*

# Miscellaneous
/.angular/cache
.sass-cache/
/connect.lock
/coverage
/libpeerconnection.log
testem.log
/typings

# System files
.DS_Store
Thumbs.db
101 changes: 101 additions & 0 deletions Angular/angular.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"Angular": {
"projectType": "application",
"schematics": {},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/angular",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.css"
],
"scripts": []
},
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "4kb"
}
],
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"outputHashing": "all"
},
"development": {
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"browserTarget": "Angular:build:production"
},
"development": {
"browserTarget": "Angular:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "Angular:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.css"
],
"scripts": []
}
}
}
}
}
}
44 changes: 44 additions & 0 deletions Angular/karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html

module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
jasmine: {
// you can add configuration options for Jasmine here
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
// for example, you can disable the random execution with `random: false`
// or set a specific seed with `seed: 4321`
},
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
jasmineHtmlReporter: {
suppressAll: true // removes the duplicated traces
},
coverageReporter: {
dir: require('path').join(__dirname, './coverage/angular'),
subdir: '.',
reporters: [
{ type: 'html' },
{ type: 'text-summary' }
]
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
restartOnFileChange: true
});
};
38 changes: 38 additions & 0 deletions Angular/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"name": "angular",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test"
},
"private": true,
"dependencies": {
"@angular/animations": "^16.2.0",
"@angular/common": "^16.2.0",
"@angular/compiler": "^16.2.0",
"@angular/core": "^16.2.0",
"@angular/forms": "^16.2.0",
"@angular/platform-browser": "^16.2.0",
"@angular/platform-browser-dynamic": "^16.2.0",
"@angular/router": "^16.2.0",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"zone.js": "~0.13.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "^16.2.10",
"@angular/cli": "^16.2.10",
"@angular/compiler-cli": "^16.2.0",
"@types/jasmine": "~4.3.0",
"jasmine-core": "~4.6.0",
"karma": "~6.4.0",
"karma-chrome-launcher": "~3.2.0",
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.1.0",
"typescript": "~5.1.3"
}
}
1 change: 1 addition & 0 deletions Angular/src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<router-outlet></router-outlet>
33 changes: 33 additions & 0 deletions Angular/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { Component } from '@angular/core';
import { appService } from './app.service';

@Component({
selector: 'app-root',
templateUrl: './app.component.html'
})

export class AppComponent {

//Node.js application will run on http://localhost:8080, which needs to be set as apiHost.
public apiHost="http://localhost:8080";

//Url of the authorizationserver action in Node.js application.
public authorizationUrl= "/authorizationserver";

//Url of the GetDetails action in Node.js application.
public getEmbedConfigUrl= "/getData";

public embedConfig: any;

public dashboards: any;

public baseUrl: any;

public dashboardServerApiUrl!: string;

constructor(private _app: appService) {
}

ngOnInit() {
}
}
26 changes: 26 additions & 0 deletions Angular/src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { HttpClientModule, HttpClient } from '@angular/common/http';
import { AppComponent } from './app.component';
import { RouterModule } from '@angular/router';
import { Dashboard } from './dashboard/dashboard.component';
import { appService } from './app.service';

@NgModule({
imports: [
BrowserModule,
RouterModule.forRoot([
{ path: '', component: Dashboard },
]
),
HttpClientModule
],
providers: [appService],
declarations: [
AppComponent,
Dashboard
],

bootstrap: [AppComponent]
})
export class AppModule { }
47 changes: 47 additions & 0 deletions Angular/src/app/app.service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import { Injectable } from '@angular/core';
import { HttpClient, HttpParams, HttpHeaders } from '@angular/common/http';

@Injectable()

export class appService {

private authUrl!: string;
private getDashboardsUrl!: string;
private header!: HttpHeaders;

constructor(private http: HttpClient) {
}

/* public Gettoken(dashboardServerApiUrl: string,userId: string, userPassword: string) {
this.header = new HttpHeaders().set('Content-Type', 'application/x-www-form-urlencoded');

let body = new HttpParams();
body = body.set('UserId', userId);
body = body.set('Password', userPassword);

return this.http.post(dashboardServerApiUrl + '/get-user-key', body, {
headers: this.header,
}).pipe(res => {
return <any>res;
});
}

public GetDashboards(getDashboardsUrl: string) {
this.header = new HttpHeaders();
this.header = this.header.append('Access-Control-Allow-Origin', '*');
this.header = this.header.append('Authorization', 'bearer ' + "token");

return this.http.get(getDashboardsUrl, {
headers: this.header
}).pipe(res => {
return <any>res;
});
} */

public GetEmbedConfig(getDashboardsUrl: string) {
return this.http.get(getDashboardsUrl, {
}).pipe(res => {
return <any>res;
});
}
}
9 changes: 9 additions & 0 deletions Angular/src/app/app.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export class Item {
Name!: string;
Description!: string;
Id!: string;
Version!: string;
IsPublic!: boolean;
ItemLocation!: string;
CategoryName!: string;
}
16 changes: 16 additions & 0 deletions Angular/src/app/dashboard.service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Injectable } from '@angular/core';

@Injectable({
providedIn: 'root'
})
export class DashboardService {
public embedConfig: any;

getEmbedConfig(): any {
return this.embedConfig;
}

setEmbedConfig(embedConfig: any): void {
this.embedConfig = embedConfig;
}
}
3 changes: 3 additions & 0 deletions Angular/src/app/dashboard/dashboard.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div id="viewer-section">
<div id="dashboard"></div>
</div>
Loading