Skip to content
This repository has been archived by the owner on Oct 10, 2022. It is now read-only.

Commit

Permalink
Merge pull request #102 from intelowlproject/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
eshaan7 committed May 21, 2021
2 parents 820731e + eb3adb6 commit d5a17a6
Show file tree
Hide file tree
Showing 29 changed files with 3,256 additions and 4,214 deletions.
3 changes: 1 addition & 2 deletions .browserslistrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@
last 2 versions
Firefox ESR
not dead
not IE 9-11 # For IE 9-11 support, remove 'not'.
not and_qq 10.4
not and_uc 12.12
not baidu 7.12
not kaios 2.5
not op_mini all
not op_mob 46
not op_mob > 1
2 changes: 0 additions & 2 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"builder": "@angular-devkit/build-angular:browser",
"options": {
"preserveSymlinks": true,
"rebaseRootRelativeCssUrls": true,
"outputPath": "dist",
"index": "src/index.html",
"main": "src/main.ts",
Expand Down Expand Up @@ -49,7 +48,6 @@
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
Expand Down
52 changes: 26 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "intelowl-ng",
"version": "2.0.1",
"version": "2.1.0",
"license": "AGPL-3.0",
"repository": {
"type": "git",
Expand Down Expand Up @@ -41,30 +41,28 @@
}
},
"dependencies": {
"@angular/animations": "^10.0.11",
"@angular/animations": "^11.2.14",
"@angular/cdk": "^10.2.1",
"@angular/common": "^10.0.11",
"@angular/compiler": "^10.0.11",
"@angular/core": "^10.0.11",
"@angular/forms": "^10.0.11",
"@angular/platform-browser": "^10.0.11",
"@angular/platform-browser-dynamic": "^10.0.11",
"@angular/router": "^10.0.11",
"@nebular/eva-icons": "6.2.1",
"@nebular/theme": "6.2.1",
"ang-jsoneditor": "^1.10.3",
"@angular/common": "^11.2.14",
"@angular/compiler": "^11.2.14",
"@angular/core": "^11.2.14",
"@angular/forms": "^11.2.14",
"@angular/platform-browser": "^11.2.14",
"@angular/platform-browser-dynamic": "^11.2.14",
"@angular/router": "^11.2.14",
"@nebular/eva-icons": "7.0.0",
"@nebular/theme": "7.0.0",
"ang-jsoneditor": "^1.10.5",
"bootstrap": "4.5.3",
"core-js": "^3.6.3",
"dexie": "^2.0.4",
"echarts": "^4.8.0",
"echarts": "^5.1.1",
"eva-icons": "^1.1.3",
"jsoneditor": "^7.0.2",
"ng-animate": "^1.0.0",
"ng2-completer": "^9.0.1",
"ng2-smart-table": "^1.7.2",
"ngx-animate": "^1.0.1",
"ngx-dexie": "^1.1.0",
"ngx-echarts": "^5.1.2",
"node-sass": "^4.14.1",
"ngx-echarts": "^7.0.1",
"normalize.css": "6.0.0",
"pace-js": "1.0.2",
"rxjs": "6.6.2",
Expand All @@ -75,28 +73,30 @@
"zone.js": "~0.10.2"
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.1000.7",
"@angular/cli": "^10.0.7",
"@angular/compiler-cli": "^10.0.11",
"@angular/language-service": "10.0.11",
"@angular-devkit/build-angular": "^0.1102.13",
"@angular/cli": "^11.2.13",
"@angular/compiler-cli": "^11.2.14",
"@angular/language-service": "11.2.14",
"@types/echarts": "^4.4.2",
"@types/jasmine": "~3.5.0",
"@types/jasmine": "~3.6.0",
"@types/jasminewd2": "2.0.3",
"@types/node": "12.11.1",
"codelyzer": "^6.0.0",
"husky": "4.2.5",
"jasmine-core": "~3.5.0",
"jasmine-core": "~3.6.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~5.0.0",
"karma": "~6.3.2",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~3.3.0",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"prettier": "2.0.5",
"pretty-quick": "^2.0.1",
"protractor": "~7.0.0",
"ts-node": "~8.3.0",
"tslint": "~6.1.0",
"typescript": "~3.9.7"
"typescript": "~4.1.5",
"@juggle/resize-observer": "^3.3.1",
"jsoneditor": "^9.4.1"
}
}
26 changes: 2 additions & 24 deletions src/app/@core/auth/login/login.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,8 @@
src="../../../../assets/intel_owl_positive.png"
alt="IntelOwl logo"
/>
<section
*ngIf="socialLinks && socialLinks.length > 0"
class="links"
aria-label="Social links"
>
<div class="socials">
<ng-container *ngFor="let socialLink of socialLinks">
<a
*ngIf="socialLink.url"
[attr.href]="socialLink.url"
[attr.target]="socialLink.target"
[attr.class]="socialLink.icon"
[class.with-icon]="socialLink.icon"
rel="noreferrer"
>
<nb-icon
*ngIf="socialLink.icon; else title"
[icon]="socialLink.icon"
></nb-icon>
<ng-template #title>{{ socialLink.title }}</ng-template>
</a>
</ng-container>
</div>
</section>
<!-- social links -->
<intelowl-social-links></intelowl-social-links>
</nb-card-header>
<nb-card-body>
<!-- IntelOwl Logo -->
Expand Down
14 changes: 0 additions & 14 deletions src/app/@core/auth/login/login.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,6 @@ nb-alert {
margin: 2rem 0;
}

.links {
text-align: center;

.socials a {
margin: 0 1rem;
text-decoration: none;
vertical-align: middle;

&.with-icon {
font-size: 2rem;
}
}
}

.another-action {
margin-top: 2rem;
text-align: center;
Expand Down
26 changes: 3 additions & 23 deletions src/app/@core/auth/login/login.component.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Component } from '@angular/core';
import { AuthService } from '../../services/auth.service';
import { Router } from '@angular/router';
import { ThemeSwitcherComponent } from '../../../@theme/components/header/theme-switcher/theme-switcher.component';

@Component({
templateUrl: './login.component.html',
Expand All @@ -16,32 +17,11 @@ export class LoginComponent {
messages: string[] = [];
submitted: boolean = false;

socialLinks: any[] = [
{
url: 'https://github.com/intelowlproject',
target: '_blank',
icon: 'github',
},
{
url: 'https://gsoc-slack.honeynet.org/',
target: '_blank',
icon: 'message-circle-outline',
},
{
url: 'https://twitter.com/intel_owl',
target: '_blank',
icon: 'twitter',
},
];

isDarkTheme: boolean;

constructor(private authService: AuthService, private router: Router) {
this.isDarkTheme = LoginComponent.getThemeName() === 'dark' ? true : false;
}

static getThemeName(): string {
return localStorage.getItem('themeName') || 'dark';
this.isDarkTheme =
ThemeSwitcherComponent.getThemeName() === 'dark' ? true : false;
}

async login() {
Expand Down
2 changes: 1 addition & 1 deletion src/app/@core/models/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export interface Job {
status: string;
analyzers_requested: string[] | string;
analyzers_to_execute: string[];
analysis_reports?: any;
analysis_reports?: any[];
received_request_time: string | Date;
finished_analysis_time?: string | Date;
force_privacy: boolean | string;
Expand Down
2 changes: 1 addition & 1 deletion src/app/@core/services/tag.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { HttpClient } from '@angular/common/http';
import { HttpService } from './http.service';
import { Tag } from '../models/models';
import { ToastService } from './toast.service';
import { Subject } from 'rxjs/internal/Subject';
import { Subject } from 'rxjs';

@Injectable({
providedIn: 'root',
Expand Down
3 changes: 1 addition & 2 deletions src/app/@core/services/toast.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ export class ToastService {
) {
this.toastrService.show(message, title, {
duration: 0,
icon: iconName,
iconPack: 'eva',
icon: { icon: iconName, pack: 'eva' },
});
}
}
25 changes: 9 additions & 16 deletions src/app/@theme/components/echarts-pie/echarts-pie.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
ChangeDetectorRef,
} from '@angular/core';
import { NbThemeService } from '@nebular/theme';
import { EChartOption } from 'echarts';
import { Subscription } from 'rxjs';

@Component({
Expand All @@ -18,7 +17,7 @@ import { Subscription } from 'rxjs';
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class EchartsPieComponent implements OnChanges, OnDestroy {
options: EChartOption;
options: any;
private themeSubscription: Subscription;

@Input() pieChartData: any;
Expand Down Expand Up @@ -54,7 +53,7 @@ export class EchartsPieComponent implements OnChanges, OnDestroy {
],
tooltip: {
trigger: 'item',
formatter: '{a} <br/>{b} : {c} ({d}%)',
formatter: '<b>{b}</b> : {c} ({d}%)',
},
legend: {
orient: 'horizontal',
Expand All @@ -65,6 +64,9 @@ export class EchartsPieComponent implements OnChanges, OnDestroy {
color: echarts.textColor,
},
},
textStyle: {
color: echarts.textColor,
},
series: [
{
name: this.pieChartName,
Expand All @@ -73,25 +75,16 @@ export class EchartsPieComponent implements OnChanges, OnDestroy {
height: 375,
center: ['50%', '50%'],
data: this.pieChartData,
itemStyle: {
emphasis: {
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: echarts.itemHoverShadowColor,
},
},
label: {
normal: {
textStyle: {
color: echarts.textColor,
},
},
},
labelLine: {
normal: {
lineStyle: {
color: echarts.axisLineColor,
},
lineStyle: {
color: echarts.axisLineColor,
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class EchartsTreeComponent implements OnInit, OnDestroy {
series: [
{
type: 'tree',
name: 'Integrations Tree',
name: 'Analyzers Tree',
// orient: "TB",
data: [this.treeInputData],
top: '0%',
Expand Down
8 changes: 1 addition & 7 deletions src/app/@theme/components/header/header.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,7 @@
<nb-actions size="small">
<!-- Theme Switcher -->
<nb-action class="d-flex align-items-center">
<nb-icon icon="sun-outline" size="tiny"></nb-icon>
<nb-toggle
class="mx-2"
(checkedChange)="changeTheme($event)"
[(checked)]="isDarkTheme"
></nb-toggle>
<nb-icon icon="moon-outline" size="tiny"></nb-icon>
<theme-switcher></theme-switcher>
</nb-action>
<!-- User actions -->
<nb-action class="user-action" *ngIf="userService.user$ | async as user">
Expand Down
22 changes: 7 additions & 15 deletions src/app/@theme/components/header/header.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,22 @@ import { filter, map, take } from 'rxjs/operators';
templateUrl: './header.component.html',
})
export class HeaderComponent implements OnInit {
isDarkTheme: boolean;

userMenu: NbMenuItem[] = [
{ title: 'Django Admin Interface' },
{ title: 'Log out' },
];
isDarkTheme: boolean;

constructor(
private sidebarService: NbSidebarService,
private nbMenuService: NbMenuService,
public userService: UserService,
private themeService: NbThemeService
private nbThemeService: NbThemeService,
public userService: UserService
) {
this.isDarkTheme = HeaderComponent.getThemeName() === 'dark' ? true : false;
this.nbThemeService.onThemeChange().subscribe((themeName) => {
this.isDarkTheme = themeName?.name === 'dark' ? true : false;
});
}

ngOnInit(): void {
Expand Down Expand Up @@ -54,13 +57,6 @@ export class HeaderComponent implements OnInit {
});
}

changeTheme(toggleFlag: boolean): void {
let themeName: string;
toggleFlag ? (themeName = 'dark') : (themeName = 'default');
localStorage.setItem('themeName', themeName);
this.themeService.changeTheme(themeName);
}

toggleSidebar(): boolean {
this.sidebarService.toggle(true, 'menu-sidebar');
return false;
Expand All @@ -70,8 +66,4 @@ export class HeaderComponent implements OnInit {
this.nbMenuService.navigateHome();
return false;
}

static getThemeName(): string {
return localStorage.getItem('themeName') || 'dark';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<nb-icon icon="sun-outline" size="tiny"></nb-icon>
<nb-toggle
class="mx-2"
(checkedChange)="changeTheme($event)"
[(checked)]="isDarkTheme"
></nb-toggle>
<nb-icon icon="moon-outline" size="tiny"></nb-icon>
Loading

0 comments on commit d5a17a6

Please sign in to comment.