Commit 5fd7536e authored by zheng liu's avatar zheng liu

Merged in test (pull request #45)

Test
parents 71b71f2d fd6ceddf
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
"styles": [ "styles": [
"../node_modules/layui-layer/dist/theme/default/layer.css", "../node_modules/layui-layer/dist/theme/default/layer.css",
"../node_modules/animate.css/animate.min.css", "../node_modules/animate.css/animate.min.css",
"assets/inspinia/style.scss",
"../node_modules/xterm/dist/xterm.css", "../node_modules/xterm/dist/xterm.css",
"sass/style.scss", "sass/style.scss",
"styles.css" "styles.css"
......
This diff is collapsed.
...@@ -12,29 +12,29 @@ ...@@ -12,29 +12,29 @@
}, },
"private": true, "private": true,
"dependencies": { "dependencies": {
"@angular/animations": "^4.2.4", "@angular/animations": "5.2.0",
"@angular/cdk": "^2.0.0-beta.12", "@angular/cdk": "^5.1.0",
"@angular/common": "^4.2.4", "@angular/common": "5.2.0",
"@angular/compiler": "^4.2.4", "@angular/compiler": "5.2.0",
"@angular/core": "^4.2.4", "@angular/core": "5.2.0",
"@angular/forms": "^4.2.4", "@angular/forms": "5.2.0",
"@angular/http": "^4.2.4", "@angular/http": "5.2.0",
"@angular/platform-browser": "^4.2.4", "@angular/platform-browser": "5.2.0",
"@angular/platform-browser-dynamic": "^4.2.4", "@angular/platform-browser-dynamic": "5.2.0",
"@angular/router": "^4.2.4", "@angular/router": "5.2.0",
"angular2-logger": "^0.6.0",
"animate.css": "^3.5.2", "animate.css": "^3.5.2",
"body-parser": "^1.18.2", "body-parser": "^1.18.2",
"bootstrap": "^4.0.0-beta.3", "bootstrap": "^4.0.0-beta.3",
"clipboard": "^1.7.1", "clipboard": "^1.7.1",
"compass-mixins": "^0.12.10", "compass-mixins": "^0.12.10",
"core-js": "^2.4.1", "core-js": "2.5.3",
"directory-encoder": "^0.9.2", "directory-encoder": "^0.9.2",
"filetree-css": "^1.0.0", "filetree-css": "^1.0.0",
"font-awesome": "^4.7.0", "font-awesome": "4.7.0",
"handlebars": "^4.0.11", "handlebars": "^4.0.11",
"inconsolata": "0.0.2", "inconsolata": "0.0.2",
"jquery": "^3.1.0", "intl": "1.2.5",
"jquery": "3.2.1",
"jquery-slimscroll": "^1.3.8", "jquery-slimscroll": "^1.3.8",
"jquery-sparkline": "^2.4.0", "jquery-sparkline": "^2.4.0",
"jvectormap": "1.2.2", "jvectormap": "1.2.2",
...@@ -45,14 +45,17 @@ ...@@ -45,14 +45,17 @@
"ng2-charts": "^1.5.0", "ng2-charts": "^1.5.0",
"ng2-cookies": "^1.0.12", "ng2-cookies": "^1.0.12",
"ngx-bootstrap": "^1.6.6", "ngx-bootstrap": "^1.6.6",
"ngx-contextmenu": "^4.1.1", "ngx-layer": "0.0.4",
"ngx-logger": "^1.1.2",
"ngx-perfect-scrollbar": "5.2.0",
"ngx-progressbar": "^2.1.1",
"node": "^9.3.0", "node": "^9.3.0",
"npm": "^5.6.0", "npm": "^5.6.0",
"npm-font-open-sans": "^1.1.0", "npm-font-open-sans": "^1.1.0",
"peity": "^3.2.1", "peity": "^3.2.1",
"popper.js": "^1.12.9", "popper.js": "1.12.9",
"roboto-fontface": "^0.8.0", "roboto-fontface": "^0.8.0",
"rxjs": "^5.4.2", "rxjs": "5.5.6",
"sass-math": "^1.0.0", "sass-math": "^1.0.0",
"socket.io": "^2.0.3", "socket.io": "^2.0.3",
"socket.io-client": "^2.0.4", "socket.io-client": "^2.0.4",
...@@ -61,28 +64,31 @@ ...@@ -61,28 +64,31 @@
"tether": "^1.4.0", "tether": "^1.4.0",
"uuid-js": "^0.7.5", "uuid-js": "^0.7.5",
"xterm": "^2.9.2", "xterm": "^2.9.2",
"zone.js": "^0.8.14" "zone.js": "0.8.20"
}, },
"devDependencies": { "devDependencies": {
"@angular/cli": "1.5.2", "@angular-devkit/core": "0.0.28",
"@angular/compiler-cli": "^4.2.4", "@angular-devkit/schematics": "0.0.42",
"@angular/language-service": "^4.2.4", "@angular/cli": "^1.6.5",
"@types/jasmine": "~2.5.53",
"@types/jasminewd2": "~2.0.2", "@types/jasminewd2": "~2.0.2",
"@types/node": "~6.0.60",
"codelyzer": "^4.0.1",
"jasmine-core": "~2.6.2",
"jasmine-spec-reporter": "~4.1.0",
"karma": "~1.7.0",
"karma-chrome-launcher": "~2.1.1",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"node-sass": "^4.7.2", "node-sass": "^4.7.2",
"protractor": "~5.1.2", "@angular/compiler-cli": "5.2.0",
"ts-node": "~3.2.0", "@angular/language-service": "5.2.0",
"tslint": "~5.3.2", "@types/jasmine": "2.8.4",
"typescript": "~2.3.3" "@types/node": "9.3.0",
"codelyzer": "4.0.2",
"jasmine-core": "2.8.0",
"jasmine-spec-reporter": "4.2.1",
"karma": "2.0.0",
"karma-chrome-launcher": "2.2.0",
"karma-cli": "1.0.1",
"karma-coverage-istanbul-reporter": "1.3.3",
"karma-jasmine": "1.1.1",
"karma-jasmine-html-reporter": "0.2.2",
"protractor": "5.2.2",
"ts-node": "3.3.0",
"tslib": "1.8.1",
"tslint": "5.9.1",
"typescript": "2.4.2"
} }
} }
...@@ -6,19 +6,16 @@ ...@@ -6,19 +6,16 @@
* @author liuzheng <liuzheng712@gmail.com> * @author liuzheng <liuzheng712@gmail.com>
*/ */
import {Component, OnInit} from '@angular/core'; import {Component, OnInit} from '@angular/core';
import {Logger} from 'angular2-logger/core'; import {AppService, HttpService, LogService} from '../../app.service';
import {AppService, HttpService} from '../../app.service';
import {NgForm} from '@angular/forms'; import {NgForm} from '@angular/forms';
import {Router} from '@angular/router'; import {Router} from '@angular/router';
import {DataStore, User} from '../../globals'; import {DataStore, User} from '../../globals';
import * as jQuery from 'jquery/dist/jquery.min.js'; import * as jQuery from 'jquery/dist/jquery.min.js';
@Component({ @Component({
selector: 'app-login', selector: 'app-login',
templateUrl: './login.component.html', templateUrl: './login.component.html',
styleUrls: ['./login.component.css'], styleUrls: ['./login.component.css'],
providers: [AppService]
}) })
export class LoginComponent implements OnInit { export class LoginComponent implements OnInit {
DataStore = DataStore; DataStore = DataStore;
...@@ -28,7 +25,7 @@ export class LoginComponent implements OnInit { ...@@ -28,7 +25,7 @@ export class LoginComponent implements OnInit {
constructor(private _appService: AppService, constructor(private _appService: AppService,
private _http: HttpService, private _http: HttpService,
private _router: Router, private _router: Router,
private _logger: Logger) { private _logger: LogService) {
this._logger.log('login.ts:LoginComponent'); this._logger.log('login.ts:LoginComponent');
DataStore.NavShow = false; DataStore.NavShow = false;
} }
......
...@@ -8,8 +8,7 @@ ...@@ -8,8 +8,7 @@
*/ */
import {Component, OnInit} from '@angular/core'; import {Component, OnInit} from '@angular/core';
import {Logger} from 'angular2-logger/core'; import {AppService, HttpService, LogService} from '../../app.service';
import {AppService, HttpService} from '../../app.service';
import {SearchComponent} from '../search/search.component'; import {SearchComponent} from '../search/search.component';
import {DataStore} from '../../globals'; import {DataStore} from '../../globals';
import {version} from '../../../environments/environment'; import {version} from '../../../environments/environment';
...@@ -83,7 +82,7 @@ export class CleftbarComponent implements OnInit { ...@@ -83,7 +82,7 @@ export class CleftbarComponent implements OnInit {
constructor(private _appService: AppService, constructor(private _appService: AppService,
private _http: HttpService, private _http: HttpService,
private _search: SearchComponent, private _search: SearchComponent,
private _logger: Logger, private _logger: LogService,
private _menu: ElementServerMenuComponent) { private _menu: ElementServerMenuComponent) {
this._logger.log('nav.ts:NavComponent'); this._logger.log('nav.ts:NavComponent');
// this._appService.getnav() // this._appService.getnav()
......
div, app-element-term, app-element-guacamole { div, app-element-term, app-element-iframe {
height: 100%; height: 100%;
padding-bottom: 30px;
} }
div { div {
......
...@@ -11,6 +11,5 @@ ...@@ -11,6 +11,5 @@
[userid]="m.user.id" [userid]="m.user.id"
[index]="i" [index]="i"
*ngIf="m.type=='rdp'"> *ngIf="m.type=='rdp'">
</app-element-iframe> </app-element-iframe>
</div> </div>
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
.tabs ul li.active { .tabs ul li.active {
box-sizing: border-box; box-sizing: border-box;
border-bottom: 3px solid #19aa8d !important; border-bottom: 5px solid #19aa8d !important;
} }
.tabs ul li span { .tabs ul li span {
...@@ -87,13 +87,22 @@ ...@@ -87,13 +87,22 @@
*/ */
.tabs::-webkit-scrollbar-track { .tabs::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3); -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
background-color: #F5F5F5; background-color: #676a6c;
} }
.tabs::-webkit-scrollbar { .tabs::-webkit-scrollbar {
height: 1px; height: 2px;
} }
.tabs::-webkit-scrollbar-thumb { .tabs::-webkit-scrollbar-thumb {
background-color: #19aa8d; background-color: #F5F5F5;
}
.scroll-botton {
font-size: 20px;
float: left;
height: 30px;
overflow: hidden;
background-color: #3a3333;
color: white
} }
<div class="scroll-botton">
&nbsp; <a class="left" (click)="scrollleft()"><i class="fa fa-caret-left"></i></a>
&nbsp;
<a class="right" (click)="scrollright()"><i class="fa fa-caret-right"></i></a>
&nbsp;
</div>
<div class="tabs"> <div class="tabs">
<ul [ngStyle]="{'width':150*NavList.List.length+'px'}"> <ul [ngStyle]="{'width':150*NavList.List.length+'px'}">
<li *ngFor="let m of NavList.List;let i = index" <li *ngFor="let m of NavList.List;let i = index"
......
...@@ -11,7 +11,6 @@ import {Component, OnInit} from '@angular/core'; ...@@ -11,7 +11,6 @@ import {Component, OnInit} from '@angular/core';
import {ControlComponent, NavList} from '../control.component'; import {ControlComponent, NavList} from '../control.component';
import * as jQuery from 'jquery/dist/jquery.min.js'; import * as jQuery from 'jquery/dist/jquery.min.js';
@Component({ @Component({
selector: 'app-controlnav', selector: 'app-controlnav',
templateUrl: './controlnav.component.html', templateUrl: './controlnav.component.html',
...@@ -64,5 +63,12 @@ export class ControlnavComponent implements OnInit { ...@@ -64,5 +63,12 @@ export class ControlnavComponent implements OnInit {
ControlnavComponent.checkActive(index); ControlnavComponent.checkActive(index);
} }
scrollleft() {
jQuery('.tabs').scrollLeft(jQuery('.tabs').scrollLeft() - 100);
}
scrollright() {
jQuery('.tabs').scrollLeft(jQuery('.tabs').scrollLeft() + 100);
}
} }
...@@ -13,8 +13,6 @@ import {DataStore, User} from '../globals'; ...@@ -13,8 +13,6 @@ import {DataStore, User} from '../globals';
selector: 'app-controllpage', selector: 'app-controllpage',
templateUrl: './controlpage.component.html', templateUrl: './controlpage.component.html',
styleUrls: ['./controlpage.component.css'], styleUrls: ['./controlpage.component.css'],
providers: [AppService]
}) })
export class ControlPageComponent implements OnInit { export class ControlPageComponent implements OnInit {
DataStore = DataStore; DataStore = DataStore;
......
...@@ -7,9 +7,7 @@ ...@@ -7,9 +7,7 @@
*/ */
import {Component, OnChanges, Input, Pipe, PipeTransform} from '@angular/core'; import {Component, OnChanges, Input, Pipe, PipeTransform} from '@angular/core';
import {Logger} from 'angular2-logger/core'; import {AppService, HttpService, LogService} from '../../app.service';
import {AppService, HttpService} from '../../app.service';
export let Q = ''; export let Q = '';
...@@ -25,7 +23,7 @@ export class SearchComponent implements OnChanges { ...@@ -25,7 +23,7 @@ export class SearchComponent implements OnChanges {
constructor(private _appService: AppService, constructor(private _appService: AppService,
private _http: HttpService, private _http: HttpService,
private _logger: Logger) { private _logger: LogService) {
this._logger.log('LeftbarComponent.ts:SearchBar'); this._logger.log('LeftbarComponent.ts:SearchBar');
} }
......
...@@ -6,9 +6,7 @@ ...@@ -6,9 +6,7 @@
* @author liuzheng <liuzheng712@gmail.com> * @author liuzheng <liuzheng712@gmail.com>
*/ */
import {Component, OnInit} from '@angular/core'; import {Component, OnInit} from '@angular/core';
import {Logger} from 'angular2-logger/core'; import {AppService, LogService} from '../../app.service';
import {AppService} from '../../app.service';
@Component({ @Component({
selector: 'app-ileftbar', selector: 'app-ileftbar',
...@@ -18,7 +16,7 @@ import {AppService} from '../../app.service'; ...@@ -18,7 +16,7 @@ import {AppService} from '../../app.service';
export class IleftbarComponent implements OnInit { export class IleftbarComponent implements OnInit {
constructor(private _appService: AppService, constructor(private _appService: AppService,
private _logger: Logger) { private _logger: LogService) {
this._logger.log('nav.ts:NavComponent'); this._logger.log('nav.ts:NavComponent');
// this._appService.getnav() // this._appService.getnav()
} }
......
...@@ -13,7 +13,6 @@ import {User} from '../globals'; ...@@ -13,7 +13,6 @@ import {User} from '../globals';
selector: 'app-index-page', selector: 'app-index-page',
templateUrl: './index-page.component.html', templateUrl: './index-page.component.html',
styleUrls: ['./index-page.component.css'], styleUrls: ['./index-page.component.css'],
providers: [AppService]
}) })
export class IndexPageComponent implements OnInit { export class IndexPageComponent implements OnInit {
User = User; User = User;
......
...@@ -19,12 +19,12 @@ import {TermPageComponent} from './term-page/term-page.component'; ...@@ -19,12 +19,12 @@ import {TermPageComponent} from './term-page/term-page.component';
import {ElementServerMenuComponent} from './elements/server-menu/server-menu.component'; import {ElementServerMenuComponent} from './elements/server-menu/server-menu.component';
const appRoutes: Routes = [ const appRoutes: Routes = [
{path: 'users/login', component: LoginComponent}, // {path: 'users/login', component: LoginComponent},
{path: 'rdp/:token', component: RdpPageComponent}, {path: 'rdp/:token', component: RdpPageComponent},
{path: 'term/:token', component: TermPageComponent}, {path: 'term/:token', component: TermPageComponent},
{path: 'replay/:token', component: ReplayPageComponent}, {path: 'replay/:token', component: ReplayPageComponent},
{path: 'monitor/:token', component: MonitorPageComponent}, {path: 'monitor/:token', component: MonitorPageComponent},
{path: 'test', component: ElementServerMenuComponent}, {path: 'test', component: TermPageComponent},
{path: '', component: ControlPageComponent}, {path: '', component: ControlPageComponent},
{path: '**', component: NotFoundComponent} {path: '**', component: NotFoundComponent}
]; ];
......
<ng-progress></ng-progress>
<app-element-nav *ngIf="DataStore.NavShow"></app-element-nav> <app-element-nav *ngIf="DataStore.NavShow"></app-element-nav>
<router-outlet></router-outlet> <router-outlet></router-outlet>
<!--<app-element-interactive></app-element-interactive>--> <!--<app-element-interactive></app-element-interactive>-->
...@@ -13,7 +13,6 @@ import {DataStore} from './globals'; ...@@ -13,7 +13,6 @@ import {DataStore} from './globals';
selector: 'app-root', selector: 'app-root',
templateUrl: './app.component.html', templateUrl: './app.component.html',
styleUrls: ['./app.component.css'], styleUrls: ['./app.component.css'],
providers: [AppService, HttpService],
// directives: [LeftbarComponent, TermComponent] // directives: [LeftbarComponent, TermComponent]
}) })
......
...@@ -10,25 +10,29 @@ ...@@ -10,25 +10,29 @@
* @author liuzheng <liuzheng712@gmail.com> * @author liuzheng <liuzheng712@gmail.com>
*/ */
import {BrowserModule} from '@angular/platform-browser'; import {BrowserModule} from '@angular/platform-browser';
import {NgModule} from '@angular/core'; import {ClassProvider, NgModule} from '@angular/core';
import {FormsModule} from '@angular/forms'; // <-- NgModel lives here import {FormsModule} from '@angular/forms'; // <-- NgModel lives here
import {Logger, Options, Level as LoggerLevel} from 'angular2-logger/core'; // import {NGXLogger, LoggerConfig, NgxLoggerLevel as LoggerLevel} from 'ngx-logger';
import {HttpModule} from '@angular/http'; import {HttpModule} from '@angular/http';
import {AppRoutingModule} from './app-routing.module'; import {AppRoutingModule} from './app-routing.module';
import {AppComponent} from './app.component'; import {AppComponent} from './app.component';
// service
import {AppService, HttpService, LogService} from './app.service';
import {LayerService} from './elements/layer/layer.service';
// Elements // Elements
import {ElementFooterComponent} from './elements/footer/footer.component'; import {ElementFooterComponent} from './elements/footer/footer.component';
import {ElementTermComponent} from './elements/term/term.component'; import {ElementTermComponent} from './elements/term/term.component';
import {ElementInteractiveComponent} from './elements/interactive/interactive.component'; import {ElementInteractiveComponent} from './elements/interactive/interactive.component';
import {ElementNavComponent} from './elements/nav/nav.component'; import {ElementNavComponent} from './elements/nav/nav.component';
import {LoginComponent} from './BasicPage/login/login.component';
import {ElementPopupComponent} from './elements/popup/popup.component'; import {ElementPopupComponent} from './elements/popup/popup.component';
import {ElementRdpComponent} from './elements/rdp/rdp.component'; import {ElementRdpComponent} from './elements/rdp/rdp.component';
import {ElementServerMenuComponent} from './elements/server-menu/server-menu.component'; import {ElementServerMenuComponent} from './elements/server-menu/server-menu.component';
import {ElementIframeComponent} from './elements/iframe/iframe.component'; import {ElementIframeComponent} from './elements/iframe/iframe.component';
// pages // pages
import {LoginComponent} from './BasicPage/login/login.component';
import {IleftbarComponent} from './IndexPage/ileftbar/ileftbar.component'; import {IleftbarComponent} from './IndexPage/ileftbar/ileftbar.component';
import {SearchComponent, SearchFilter} from './ControlPage/search/search.component'; import {SearchComponent, SearchFilter} from './ControlPage/search/search.component';
import {CleftbarComponent} from './ControlPage/cleftbar/cleftbar.component'; import {CleftbarComponent} from './ControlPage/cleftbar/cleftbar.component';
...@@ -46,6 +50,10 @@ import {UtcDatePipe} from './app.pipe'; ...@@ -46,6 +50,10 @@ import {UtcDatePipe} from './app.pipe';
import {MonitorPageComponent} from './monitor-page/monitor-page.component'; import {MonitorPageComponent} from './monitor-page/monitor-page.component';
import {LinuxComponent} from './monitor-page/linux/linux.component'; import {LinuxComponent} from './monitor-page/linux/linux.component';
import {WindowsComponent} from './monitor-page/windows/windows.component'; import {WindowsComponent} from './monitor-page/windows/windows.component';
import {NgProgressModule} from 'ngx-progressbar';
import {TestPageComponent} from './test-page/test-page.component';
// import {NgxLayerModule} from 'ngx-layer';
@NgModule({ @NgModule({
imports: [ imports: [
...@@ -53,6 +61,8 @@ import {WindowsComponent} from './monitor-page/windows/windows.component'; ...@@ -53,6 +61,8 @@ import {WindowsComponent} from './monitor-page/windows/windows.component';
FormsModule, FormsModule,
AppRoutingModule, AppRoutingModule,
HttpModule, HttpModule,
NgProgressModule,
// NgxLayerModule
], ],
declarations: [ declarations: [
AppComponent, AppComponent,
...@@ -83,11 +93,16 @@ import {WindowsComponent} from './monitor-page/windows/windows.component'; ...@@ -83,11 +93,16 @@ import {WindowsComponent} from './monitor-page/windows/windows.component';
MonitorPageComponent, MonitorPageComponent,
LinuxComponent, LinuxComponent,
WindowsComponent, WindowsComponent,
TestPageComponent,
], ],
bootstrap: [AppComponent], bootstrap: [AppComponent],
providers: [ providers: [
{provide: Options, useValue: {store: false, level: LoggerLevel.WARN}}, // {provide: LoggerConfig, useValue: {level: LoggerLevel.WARN}},
Logger // {provide: BrowserXhr, useClass: NgProgressBrowserXhr},
AppService,
HttpService,
LogService,
LayerService
] ]
}) })
export class AppModule { export class AppModule {
......
...@@ -8,11 +8,12 @@ ...@@ -8,11 +8,12 @@
import {Injectable, OnInit} from '@angular/core'; import {Injectable, OnInit} from '@angular/core';
import {Http, RequestOptionsArgs, Headers} from '@angular/http'; import {Http, RequestOptionsArgs, Headers} from '@angular/http';
import {Router} from '@angular/router'; import {Router} from '@angular/router';
import {Cookie} from 'ng2-cookies/ng2-cookies'; // import {Cookie} from 'ng2-cookies/ng2-cookies';
import {Logger} from 'angular2-logger/core';
import 'rxjs/add/operator/map'; import 'rxjs/add/operator/map';
import 'rxjs/add/operator/catch'; import 'rxjs/add/operator/catch';
import {DataStore, User, Browser} from './globals'; import {DataStore, User, Browser} from './globals';
import {environment} from '../environments/environment';
declare function unescape(s: string): string; declare function unescape(s: string): string;
@Injectable() @Injectable()
...@@ -88,39 +89,71 @@ export class HttpService { ...@@ -88,39 +89,71 @@ export class HttpService {
} }
@Injectable()
export class LogService {
constructor() {
}
trace(message: any, ...additional: any[]) {
console.log(message, additional.join(' '));
}
debug(message: any, ...additional: any[]) {
console.log(message, additional.join(' '));
}
info(message: any, ...additional: any[]) {
console.log(message, additional.join(' '));
}
log(message: any, ...additional: any[]) {
console.log(message, additional.join(' '));
}
warn(message: any, ...additional: any[]) {
console.log(message, additional.join(' '));
}
error(message: any, ...additional: any[]) {
console.log(message, additional.join(' '));
}
}
@Injectable() @Injectable()
export class AppService implements OnInit { export class AppService implements OnInit {
// user:User = user ; // user:User = user ;
constructor(private _http: HttpService, constructor(private _http: HttpService,
private _router: Router, private _router: Router,
private _logger: Logger) { private _logger: LogService) {
if (Cookie.get('loglevel')) { // if (Cookie.get('loglevel')) {
// 0.- Level.OFF // // 0.- Level.OFF
// 1.- Level.ERROR // // 1.- Level.ERROR
// 2.- Level.WARN // // 2.- Level.WARN
// 3.- Level.INFO // // 3.- Level.INFO
// 4.- Level.DEBUG // // 4.- Level.DEBUG
// 5.- Level.LOG // // 5.- Level.LOG
this._logger.level = parseInt(Cookie.get('loglevel'), 10); // this._logger.level = parseInt(Cookie.get('loglevel'), 10);
// this._logger.debug('Your debug stuff'); // // this._logger.debug('Your debug stuff');
// this._logger.info('An info'); // // this._logger.info('An info');
// this._logger.warn('Take care '); // // this._logger.warn('Take care ');
// this._logger.error('Too late !'); // // this._logger.error('Too late !');
// this._logger.log('log !'); // // this._logger.log('log !');
} else { // } else {
Cookie.set('loglevel', '0', 99, '/', document.domain); // Cookie.set('loglevel', '0', 99, '/', document.domain);
// this._logger.level = parseInt(Cookie.getCookie('loglevel')); // // this._logger.level = parseInt(Cookie.getCookie('loglevel'));
this._logger.level = 0; // this._logger.level = 0;
} // }
// this.checklogin(); if (environment.production) {
this.checklogin();
}
} }
ngOnInit() { ngOnInit() {
} }
checklogin() { checklogin() {
this._logger.log('service.ts:AppService,checklogin'); this._logger.log('service.ts:AppService,checklogin');
if (DataStore.Path) { if (DataStore.Path) {
...@@ -135,32 +168,43 @@ export class AppService implements OnInit { ...@@ -135,32 +168,43 @@ export class AppService implements OnInit {
// jQuery('angular2').show(); // jQuery('angular2').show();
} else { } else {
this.browser(); this.browser();
this._http.get('/api/checklogin') this._http.get('/api/users/v1/profile/')
.map(res => res.json()) .map(res => res.json())
.subscribe( .subscribe(
data => { data => {
User.id = data.id;
User.name = data.name; User.name = data.name;
User.username = data.username; User.username = data.username;
User.email = data.email;
User.is_active = data.is_active;
User.is_superuser = data.is_superuser;
User.role = data.role;
// User.groups = data.groups;
User.wechat = data.wechat;
User.comment = data.comment;
User.date_expired = data.date_expired;
User.phone = data.phone.toString();
User.logined = data.logined; User.logined = data.logined;
this._logger.debug(User); this._logger.debug(User);
}, },
err => { err => {
this._logger.error(err); // this._logger.error(err);
User.logined = false; User.logined = false;
this._router.navigate(['login']); window.location.href = document.location.origin + '/users/login?next=' + document.location.pathname;
// this._router.navigate(['login']);
}, },
() => { // () => {
if (User.logined) { // if (User.logined) {
if (document.location.pathname === '/login') { // if (document.location.pathname === '/login') {
this._router.navigate(['']); // this._router.navigate(['']);
} else { // } else {
this._router.navigate([document.location.pathname]); // this._router.navigate([document.location.pathname]);
} // }
} else { // } else {
this._router.navigate(['login']); // this._router.navigate(['login']);
} // }
// jQuery('angular2').show(); // jQuery('angular2').show();
} // }
); );
} }
} }
...@@ -170,7 +214,6 @@ export class AppService implements OnInit { ...@@ -170,7 +214,6 @@ export class AppService implements OnInit {
} }
} }
browser() { browser() {
this._http.post('/api/browser', JSON.stringify(Browser)).map(res => res.json()).subscribe(); this._http.post('/api/browser', JSON.stringify(Browser)).map(res => res.json()).subscribe();
} }
...@@ -302,3 +345,4 @@ export class AppService implements OnInit { ...@@ -302,3 +345,4 @@ export class AppService implements OnInit {
// //
// } // }
} }
...@@ -6,8 +6,7 @@ ...@@ -6,8 +6,7 @@
* @author liuzheng <liuzheng712@gmail.com> * @author liuzheng <liuzheng712@gmail.com>
*/ */
import {Component, OnInit} from '@angular/core'; import {Component, OnInit} from '@angular/core';
import {AppService} from '../../app.service'; import {AppService, LogService} from '../../app.service';
import {Logger} from 'angular2-logger/core';
import {DataStore, User} from '../../globals'; import {DataStore, User} from '../../globals';
import {version} from '../../../environments/environment'; import {version} from '../../../environments/environment';
...@@ -22,7 +21,7 @@ export class ElementFooterComponent implements OnInit { ...@@ -22,7 +21,7 @@ export class ElementFooterComponent implements OnInit {
version = version; version = version;
constructor(private _appService: AppService, constructor(private _appService: AppService,
private _logger: Logger) { private _logger: LogService) {
this._logger.log('nav.ts:NavComponent'); this._logger.log('nav.ts:NavComponent');
// this._appService.getnav() // this._appService.getnav()
} }
......
...@@ -17,7 +17,9 @@ export class ElementIframeComponent implements OnInit { ...@@ -17,7 +17,9 @@ export class ElementIframeComponent implements OnInit {
} }
ngOnInit() { ngOnInit() {
this.target = 'https://wx.qq.com/'; this.target = document.location.origin +
'/guacamole/api/tokens?username=liu&password=zheng&asset_id=' +
this.host.id + '&system_user_id=' + this.userid;
} }
trust(url) { trust(url) {
......
import {Injectable} from '@angular/core';
@Injectable()
export class LayerService {
constructor() {
}
dialog() {
}
confirm() {
}
tip() {
}
loading() {
}
alert() {
// alert('sss');
}
}
...@@ -6,9 +6,7 @@ ...@@ -6,9 +6,7 @@
* @author liuzheng <liuzheng712@gmail.com> * @author liuzheng <liuzheng712@gmail.com>
*/ */
import {Component, OnInit} from '@angular/core'; import {Component, OnInit} from '@angular/core';
import {Logger} from 'angular2-logger/core'; import {AppService, HttpService, LogService} from '../../app.service';
import {AppService, HttpService} from '../../app.service';
import {CleftbarComponent} from '../../ControlPage/cleftbar/cleftbar.component'; import {CleftbarComponent} from '../../ControlPage/cleftbar/cleftbar.component';
import {ControlComponent, NavList} from '../../ControlPage/control/control.component'; import {ControlComponent, NavList} from '../../ControlPage/control/control.component';
import {DataStore} from '../../globals'; import {DataStore} from '../../globals';
...@@ -30,7 +28,7 @@ export class ElementNavComponent implements OnInit { ...@@ -30,7 +28,7 @@ export class ElementNavComponent implements OnInit {
constructor(private _appService: AppService, constructor(private _appService: AppService,
private _http: HttpService, private _http: HttpService,
private _logger: Logger) { private _logger: LogService) {
this._logger.log('nav.ts:NavComponent'); this._logger.log('nav.ts:NavComponent');
this.getnav(); this.getnav();
} }
......
import {Component, OnInit} from '@angular/core'; import {Component, OnInit} from '@angular/core';
import {LayerService} from '../layer/layer.service';
export class Menu { export class Menu {
name: string; name: string;
...@@ -9,14 +11,14 @@ export class Menu { ...@@ -9,14 +11,14 @@ export class Menu {
@Component({ @Component({
selector: 'app-element-server-menu', selector: 'app-element-server-menu',
templateUrl: './server-menu.component.html', templateUrl: './server-menu.component.html',
styleUrls: ['./server-menu.component.scss'] styleUrls: ['./server-menu.component.scss'],
}) })
export class ElementServerMenuComponent implements OnInit { export class ElementServerMenuComponent implements OnInit {
MenuList: Array<any>; MenuList: Array<any>;
top: number; top: number;
left: number; left: number;
constructor() { constructor(private ly: LayerService) {
} }
ngOnInit() { ngOnInit() {
...@@ -27,6 +29,7 @@ export class ElementServerMenuComponent implements OnInit { ...@@ -27,6 +29,7 @@ export class ElementServerMenuComponent implements OnInit {
m.type = 'lll'; m.type = 'lll';
line.type = 'line'; line.type = 'line';
this.MenuList = [m, m, line, m, m]; this.MenuList = [m, m, line, m, m];
this.ly.alert();
} }
public contextmenu(top: number, left: number) { public contextmenu(top: number, left: number) {
......
...@@ -44,7 +44,7 @@ export class ElementTermComponent implements OnInit, AfterViewInit { ...@@ -44,7 +44,7 @@ export class ElementTermComponent implements OnInit, AfterViewInit {
} }
} else { } else {
term.col = Math.floor(jQuery(this.el.nativeElement).width() / jQuery('#liuzheng').width() * 8) - 3; term.col = Math.floor(jQuery(this.el.nativeElement).width() / jQuery('#liuzheng').width() * 8) - 3;
term.row = Math.floor(jQuery(this.el.nativeElement).height() / jQuery('#liuzheng').height()) - 5; term.row = Math.floor(jQuery(this.el.nativeElement).height() / jQuery('#liuzheng').height()) - 3;
term.term = this.term; term.term = this.term;
} }
this.term.open(this.el.nativeElement, true); this.term.open(this.el.nativeElement, true);
...@@ -70,7 +70,7 @@ export class ElementTermComponent implements OnInit, AfterViewInit { ...@@ -70,7 +70,7 @@ export class ElementTermComponent implements OnInit, AfterViewInit {
if (this.host) { if (this.host) {
NavList.List[this.index].Term = this.term; NavList.List[this.index].Term = this.term;
this.term.write('\x1b[31mWelcome to Jumpserver!\x1b[m\r\n'); // this.term.write('\x1b[31mWelcome to Jumpserver!\x1b[m\r\n');
TermWS.emit('host', {'uuid': this.host.id, 'userid': this.userid, 'secret': this.secret}); TermWS.emit('host', {'uuid': this.host.id, 'userid': this.userid, 'secret': this.secret});
...@@ -87,6 +87,12 @@ export class ElementTermComponent implements OnInit, AfterViewInit { ...@@ -87,6 +87,12 @@ export class ElementTermComponent implements OnInit, AfterViewInit {
TermWS.on('disconnect', function () { TermWS.on('disconnect', function () {
that.TerminalDisconnect(); that.TerminalDisconnect();
}); });
TermWS.on('logout', function (data) {
if (data['room'] === NavList.List[that.index].room) {
NavList.List[this.index].connected = false;
this.term.write('\r\n\x1b[31mBye Bye!\x1b[m\r\n');
}
});
TermWS.on('room', function (data) { TermWS.on('room', function (data) {
if (data['secret'] === that.secret) { if (data['secret'] === that.secret) {
NavList.List[that.index].room = data['room']; NavList.List[that.index].room = data['room'];
......
...@@ -66,9 +66,13 @@ export let User: { ...@@ -66,9 +66,13 @@ export let User: {
avatar: string; avatar: string;
role: string; role: string;
email: string; email: string;
wechat: string;
comment: string;
is_active: boolean; is_active: boolean;
is_superuser: boolean;
date_joined: string; date_joined: string;
last_login: string; last_login: string;
date_expired: string;
groups: Array<Group>; groups: Array<Group>;
logined: boolean; logined: boolean;
} = { } = {
...@@ -80,9 +84,13 @@ export let User: { ...@@ -80,9 +84,13 @@ export let User: {
avatar: '', avatar: '',
role: '', role: '',
email: '', email: '',
wechat: '',
comment: '',
is_active: false, is_active: false,
is_superuser: false,
date_joined: '', date_joined: '',
last_login: '', last_login: '',
date_expired: '',
groups: [], groups: [],
logined: false, logined: false,
}; };
......
import {Component, OnInit} from '@angular/core'; import {Component, OnInit} from '@angular/core';
import {ActivatedRoute, Params} from '@angular/router'; import {ActivatedRoute, Params} from '@angular/router';
import {Logger} from 'angular2-logger/core'; import {HttpService, LogService} from '../app.service';
import {HttpService} from '../app.service';
import {Video, DataStore} from '../globals'; import {Video, DataStore} from '../globals';
@Component({ @Component({
...@@ -14,7 +13,7 @@ export class ReplayPageComponent implements OnInit { ...@@ -14,7 +13,7 @@ export class ReplayPageComponent implements OnInit {
constructor(private activatedRoute: ActivatedRoute, constructor(private activatedRoute: ActivatedRoute,
private _http: HttpService, private _http: HttpService,
private _logger: Logger) { private _logger: LogService) {
// this.video = {'type': 'none'}; // this.video = {'type': 'none'};
DataStore.NavShow = false; DataStore.NavShow = false;
...@@ -38,6 +37,7 @@ export class ReplayPageComponent implements OnInit { ...@@ -38,6 +37,7 @@ export class ReplayPageComponent implements OnInit {
Video.totalTime = Video.timelist[Video.timelist.length - 1] * 1000; Video.totalTime = Video.timelist[Video.timelist.length - 1] * 1000;
}, },
err => { err => {
alert('无法下载');
this._logger.error(err); this._logger.error(err);
}, },
); );
......
<p>
test-page works!
</p>
<!--<ngx-layer></ngx-layer>-->
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { TestPageComponent } from './test-page.component';
describe('TestPageComponent', () => {
let component: TestPageComponent;
let fixture: ComponentFixture<TestPageComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ TestPageComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(TestPageComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-test-page',
templateUrl: './test-page.component.html',
styleUrls: ['./test-page.component.scss']
})
export class TestPageComponent implements OnInit {
constructor() { }
ngOnInit() {
}
}
...@@ -9,3 +9,60 @@ $FontPathOpenSans: "~npm-font-open-sans/fonts"; ...@@ -9,3 +9,60 @@ $FontPathOpenSans: "~npm-font-open-sans/fonts";
@import '~npm-font-open-sans/open-sans'; @import '~npm-font-open-sans/open-sans';
$roboto-font-path: "~roboto-fontface/fonts"; $roboto-font-path: "~roboto-fontface/fonts";
@import "~roboto-fontface/css/mixins.scss"; @import "~roboto-fontface/css/mixins.scss";
/*
*
* INSPINIA - Responsive Admin Theme
* version 2.7.1
*
*/
$asset-path: '../static/imgs/inspinia';
// Variables, Mixins
@import "../assets/inspinia/imports/variables";
@import "../assets/inspinia/imports/mixins";
// INSPINIA Theme Elements
@import "../assets/inspinia/imports/typography";
@import "../assets/inspinia/imports/navigation";
@import "../assets/inspinia/imports/top_navigation";
@import "../assets/inspinia/imports/buttons";
@import "../assets/inspinia/imports/badges_labels";
@import "../assets/inspinia/imports/elements";
@import "../assets/inspinia/imports/sidebar";
@import "../assets/inspinia/imports/base";
@import "../assets/inspinia/imports/pages";
@import "../assets/inspinia/imports/chat";
@import "../assets/inspinia/imports/metismenu";
@import "../assets/inspinia/imports/spinners";
// Landing page styles
//@import "../assets/inspinia/imports/landing";
// RTL Support
@import "../assets/inspinia/imports/rtl";
// For demo only - config box style
@import "../assets/inspinia/imports/theme-config";
// INSPINIA Skins
@import "../assets/inspinia/imports/skins";
@import "../assets/inspinia/imports/md-skin";
// Media query style
@import "../assets/inspinia/imports/media";
// Custom style
// Your custom style to override base style
@import "../assets/inspinia/imports/custom";
// Clear layout on print mode
@media print {
nav.navbar-static-side {
display: none;
}
body { overflow: visible !important; }
#page-wrapper {
margin: 0;
}
}
...@@ -7,12 +7,12 @@ ...@@ -7,12 +7,12 @@
set -ex set -ex
git checkout publish && \ git checkout github_dev && \
git pull github dev --rebase && \ git pull github dev --rebase && \
git merge master -m "publish" && \ git merge dev -m "publish" && \
git reset --soft HEAD^ && \ git reset --soft HEAD^ && \
git commit -m "publish" && \ git commit -m "publish" && \
git push github publish:dev && \ git push github github_dev:dev && \
echo "success" echo "success"
git checkout master git checkout dev
git pull github dev --commit && git push origin master git pull github dev --commit && git push origin dev
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