Unverified Commit d9fa944a authored by 老广's avatar 老广 Committed by GitHub

Merge pull request #120 from jumpserver/dev_beta

Dev beta
parents 388fb17f 23b0491a
...@@ -9,7 +9,7 @@ import {MAT_LABEL_GLOBAL_OPTIONS} from '@angular/material'; ...@@ -9,7 +9,7 @@ import {MAT_LABEL_GLOBAL_OPTIONS} from '@angular/material';
// service // service
import {AllServices} from '@app/services'; import {AllServices} from '@app/services';
import {AppRouterModule} from './router/router.module'; import {AppRouterModule} from './router.module';
import {Pipes} from './pipes/pipes'; import {Pipes} from './pipes/pipes';
import {AppComponent} from './pages/app.component'; import {AppComponent} from './pages/app.component';
import {PagesComponents} from './pages/pages.component'; import {PagesComponents} from './pages/pages.component';
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
</ul> </ul>
<ul id="remoteAppsTree" class="ztree"> <ul id="remoteAppsTree" class="ztree">
{{ "Loading"|trans }} ...
</ul> </ul>
</div> </div>
......
...@@ -134,7 +134,7 @@ export class ElementAssetTreeComponent implements OnInit, OnDestroy { ...@@ -134,7 +134,7 @@ export class ElementAssetTreeComponent implements OnInit, OnDestroy {
}; };
this._http.getMyGrantedRemoteApps().subscribe( this._http.getMyGrantedRemoteApps().subscribe(
resp => { resp => {
if (!resp) { if (resp.length === 1) {
return; return;
} }
const tree = $.fn.zTree.init($('#remoteAppsTree'), setting, resp); const tree = $.fn.zTree.init($('#remoteAppsTree'), setting, resp);
......
...@@ -13,8 +13,10 @@ import {ElementDialogAlertComponent} from './dialog/dialog.service'; ...@@ -13,8 +13,10 @@ import {ElementDialogAlertComponent} from './dialog/dialog.service';
import {ElementGuacamoleComponent} from './guacamole/guacamole.component'; import {ElementGuacamoleComponent} from './guacamole/guacamole.component';
import {ElementSshTermComponent} from './ssh-term/ssh-term.component'; import {ElementSshTermComponent} from './ssh-term/ssh-term.component';
import {ElementConnectComponent, AssetTreeDialogComponent, ManualPasswordDialogComponent} from './connect/connect.component'; import {ElementConnectComponent, AssetTreeDialogComponent, ManualPasswordDialogComponent} from './connect/connect.component';
import {ElementSftpComponent} from '@app/elements/sftp/sftp.component'; import {ElementSftpComponent} from './sftp/sftp.component';
import {ElementSettingComponent} from '@app/elements/setting/setting.component'; import {ElementSettingComponent} from './setting/setting.component';
import {ElementReplayGuacamoleComponent} from './replay/guacamole/guacamole.component';
import {ElementReplayJsonComponent} from './replay/json/json.component';
export const ElementComponents = [ export const ElementComponents = [
ElementLeftBarComponent, ElementLeftBarComponent,
...@@ -33,6 +35,8 @@ export const ElementComponents = [ ...@@ -33,6 +35,8 @@ export const ElementComponents = [
ElementSshTermComponent, ElementSshTermComponent,
ElementConnectComponent, ElementConnectComponent,
ElementSftpComponent, ElementSftpComponent,
ElementReplayGuacamoleComponent,
ElementReplayJsonComponent,
AssetTreeDialogComponent, AssetTreeDialogComponent,
ChangLanWarningDialogComponent, ChangLanWarningDialogComponent,
ManualPasswordDialogComponent, ManualPasswordDialogComponent,
......
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ReplayGuacamoleComponent } from './guacamole.component'; import { ElementReplayGuacamoleComponent } from './guacamole.component';
describe('ReplayGuacamoleComponent', () => { describe('ReplayGuacamoleComponent', () => {
let component: ReplayGuacamoleComponent; let component: ElementReplayGuacamoleComponent;
let fixture: ComponentFixture<ReplayGuacamoleComponent>; let fixture: ComponentFixture<ElementReplayGuacamoleComponent>;
beforeEach(async(() => { beforeEach(async(() => {
TestBed.configureTestingModule({ TestBed.configureTestingModule({
declarations: [ ReplayGuacamoleComponent ] declarations: [ ElementReplayGuacamoleComponent ]
}) })
.compileComponents(); .compileComponents();
})); }));
beforeEach(() => { beforeEach(() => {
fixture = TestBed.createComponent(ReplayGuacamoleComponent); fixture = TestBed.createComponent(ElementReplayGuacamoleComponent);
component = fixture.componentInstance; component = fixture.componentInstance;
fixture.detectChanges(); fixture.detectChanges();
}); });
......
import { Component, OnInit, Input } from '@angular/core'; import { Component, OnInit, Input } from '@angular/core';
import * as Guacamole from 'guacamole-common-js/dist/guacamole-common'; import * as Guacamole from 'guacamole-common-js/dist/guacamole-common';
import { Replay } from '../replay.model'; import { Replay } from '@app/model';
function zeroPad(num, minLength) { function zeroPad(num, minLength) {
let str = num.toString(); let str = num.toString();
...@@ -46,11 +46,11 @@ function formatTime(millis: number) { ...@@ -46,11 +46,11 @@ function formatTime(millis: number) {
@Component({ @Component({
selector: 'app-replay-guacamole', selector: 'elements-replay-guacamole',
templateUrl: './guacamole.component.html', templateUrl: './guacamole.component.html',
styleUrls: ['./guacamole.component.scss'] styleUrls: ['./guacamole.component.scss']
}) })
export class ReplayGuacamoleComponent implements OnInit { export class ElementReplayGuacamoleComponent implements OnInit {
isPlaying = false; isPlaying = false;
recording: any; recording: any;
playerRef: any; playerRef: any;
......
import {Component, Input, OnInit} from '@angular/core'; import {Component, Input, OnInit} from '@angular/core';
import {Terminal} from 'xterm'; import {Terminal} from 'xterm';
import {HttpService, LogService} from '@app/services'; import {HttpService, LogService} from '@app/services';
import {Replay} from '../replay.model'; import {Replay} from '@app/model';
function zeroPad(num, minLength) { function zeroPad(num, minLength) {
let str = num.toString(); let str = num.toString();
...@@ -47,11 +47,11 @@ function formatTime(millis: number) { ...@@ -47,11 +47,11 @@ function formatTime(millis: number) {
@Component({ @Component({
selector: 'app-replay-json', selector: 'elements-replay-json',
templateUrl: './json.component.html', templateUrl: './json.component.html',
styleUrls: ['./json.component.css'] styleUrls: ['./json.component.css']
}) })
export class JsonComponent implements OnInit { export class ElementReplayJsonComponent implements OnInit {
isPlaying = false; isPlaying = false;
recording: any; recording: any;
playerRef: any; playerRef: any;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<input [(value)]="setting.fontSize" matInput placeholder='{{"Font size"|trans}}' name="fontSize" type="number" min="5" max="60" > <input [(ngModel)]="setting.fontSize" matInput placeholder='{{"Font size"|trans}}' name="fontSize" type="number" min="5" max="60" >
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
......
...@@ -193,3 +193,16 @@ export class Setting { ...@@ -193,3 +193,16 @@ export class Setting {
isLoadTreeAsync: string = '1'; isLoadTreeAsync: string = '1';
isSkipAllManualPassword: string = '0'; isSkipAllManualPassword: string = '0';
} }
export class Replay {
id: string;
src: string;
type: string;
status: string;
timelist: Array<number>;
totalTime: number;
json: any;
height: number;
width: number;
}
...@@ -5,20 +5,17 @@ import {PagesMonitorComponent} from './monitor/monitor.component'; ...@@ -5,20 +5,17 @@ import {PagesMonitorComponent} from './monitor/monitor.component';
import {PagesReplayComponent} from './replay/replay.component'; import {PagesReplayComponent} from './replay/replay.component';
import {PagesNotFoundComponent} from './not-found/not-found.component'; import {PagesNotFoundComponent} from './not-found/not-found.component';
import {PagesLoginComponent} from './login/login.component'; import {PagesLoginComponent} from './login/login.component';
import {JsonComponent} from './replay/json/json.component';
import {PagesMonitorLinuxComponent} from './monitor/linux/linux.component'; import {PagesMonitorLinuxComponent} from './monitor/linux/linux.component';
import {PagesMonitorWindowsComponent} from './monitor/windows/windows.component'; import {PagesMonitorWindowsComponent} from './monitor/windows/windows.component';
import {ReplayGuacamoleComponent} from './replay/guacamole/guacamole.component';
export const PagesComponents = [ export const PagesComponents = [
PageMainComponent, PageMainComponent,
PagesBlankComponent, PagesBlankComponent,
PagesConnectComponent, PagesConnectComponent,
PagesMonitorComponent, PagesMonitorComponent,
PagesReplayComponent, JsonComponent, PagesReplayComponent,
PagesNotFoundComponent, PagesNotFoundComponent,
PagesLoginComponent, PagesLoginComponent,
PagesMonitorLinuxComponent, PagesMonitorLinuxComponent,
PagesMonitorWindowsComponent, PagesMonitorWindowsComponent,
ReplayGuacamoleComponent
]; ];
<app-replay-json [replay]="replay" *ngIf="replay.type=='json'"></app-replay-json> <elements-replay-json [replay]="replay" *ngIf="replay.type=='json'"></elements-replay-json>
<app-replay-guacamole [replay]="replay" *ngIf="replay.type=='guacamole'"></app-replay-guacamole> <elements-replay-guacamole [replay]="replay" *ngIf="replay.type=='guacamole'"></elements-replay-guacamole>
import {Component, OnInit} from '@angular/core'; import {Component, OnInit} from '@angular/core';
import {ActivatedRoute} from '@angular/router'; import {ActivatedRoute} from '@angular/router';
import {HttpService, LogService} from '@app/services'; import {HttpService, LogService} from '@app/services';
import {Replay} from './replay.model'; import {Replay} from '@app/model';
@Component({ @Component({
selector: 'pages-replay', selector: 'pages-replay',
......
export class Replay {
id: string;
src: string;
type: string;
status: string;
timelist: Array<number>;
totalTime: number;
json: any;
height: number;
width: number;
}
import {NgModule} from '@angular/core'; import {NgModule} from '@angular/core';
import {RouterModule, Routes} from '@angular/router'; import {RouterModule, Routes} from '@angular/router';
import {PagesBlankComponent} from '../pages/blank/blank.component'; import {PagesBlankComponent} from './pages/blank/blank.component';
import {PagesConnectComponent} from '../pages/connect/connect.component'; import {PagesConnectComponent} from './pages/connect/connect.component';
import {PagesReplayComponent} from '../pages/replay/replay.component'; import {PagesReplayComponent} from './pages/replay/replay.component';
import {PageMainComponent} from '../pages/main/main.component'; import {PageMainComponent} from './pages/main/main.component';
import {PagesMonitorComponent} from '../pages/monitor/monitor.component'; import {PagesMonitorComponent} from './pages/monitor/monitor.component';
import {ElementSftpComponent} from '../elements/sftp/sftp.component'; import {ElementSftpComponent} from './elements/sftp/sftp.component';
const appRoutes: Routes = [ const appRoutes: Routes = [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment