Commit dc876107 authored by 周小侠's avatar 周小侠 Committed by ibuler

grunt config

parent 93a208d7
......@@ -95,9 +95,27 @@ module.exports = function(grunt) {
// { filter: 'isFile', dest: 'luna/dist/ts/', src: 'luna/src/ts/hostedit.js.map' }
// ]
},
// ts: {
// dest: 'luna/dist/ts/**',
// src: 'luna/src/ts/**'
// }
ts: {
dest: 'luna/dist/',
src: 'luna/src/ts/**'
files: [{
expand: true,
filter: 'isFile',
cwd: 'luna/src/ts',
src: '**',
dest: 'luna/dist/ts/'
}]
},
fonts: {
files: [{
expand: true,
filter: 'isFile',
cwd: 'luna/src/fonts',
src: '**',
dest: 'luna/dist/fonts'
}]
}
},
......
No preview for this file type
/**
* Created by liuzheng on 7/12/16.
*/
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var core_1 = require('@angular/core');
var core_2 = require("angular2-logger/core");
require('rxjs/Rx');
var service_1 = require('./service');
var SomeComponent = (function () {
function SomeComponent(_appService, _logger) {
this._appService = _appService;
this._logger = _logger;
this.DataStore = service_1.DataStore;
this._logger.log('SomeComponent.ts:SomeComponent');
}
SomeComponent.prototype.ngOnInit = function () {
};
SomeComponent = __decorate([
core_1.Component({
selector: 'ng-div',
template: "<div><p >{{DataStore.logined}}</p></div>",
}),
__metadata('design:paramtypes', [service_1.AppService, core_2.Logger])
], SomeComponent);
return SomeComponent;
}());
exports.SomeComponent = SomeComponent;
//# sourceMappingURL=copy-model.js.map
\ No newline at end of file
{"version":3,"file":"copy-model.js","sourceRoot":"","sources":["copy-model.ts"],"names":[],"mappings":"AAAA;;GAEG;;;;;;;;;;;AAEH,qBAAwB,eAAe,CAAC,CAAA;AAGxC,qBAAqB,sBAAsB,CAAC,CAAA;AAE5C,QAAQ,SAAS,CAAC,CAAA;AAGlB,wBAAoC,WAGpC,CAAC,CAH8C;AAS/C;IAGI,uBAAoB,WAAsB,EACtB,OAAc;QADd,gBAAW,GAAX,WAAW,CAAW;QACtB,YAAO,GAAP,OAAO,CAAO;QAHlC,cAAS,GAAG,mBAAS,CAAC;QAIlB,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;IACvD,CAAC;IAED,gCAAQ,GAAR;IAEA,CAAC;IAhBL;QAAC,gBAAS,CAAC;YACP,QAAQ,EAAE,QAAQ;YAClB,QAAQ,EAAE,0CAA0C;SACvD,CAAC;;qBAAA;IAeF,oBAAC;AAAD,CAAC,AAZD,IAYC;AAZY,qBAAa,gBAYzB,CAAA"}
\ No newline at end of file
/**
* Created by liuzheng on 7/12/16.
*/
import {Component} from '@angular/core';
import {NgClass} from '@angular/common';
import {ROUTER_DIRECTIVES} from '@angular/router-deprecated';
import {Logger} from "angular2-logger/core";
import 'rxjs/Rx';
declare var jQuery:any;
import {AppService, DataStore} from './service'
@Component({
selector: 'ng-div',
template: `<div><p >{{DataStore.logined}}</p></div>`,
})
export class SomeComponent {
DataStore = DataStore;
constructor(private _appService:AppService,
private _logger:Logger) {
this._logger.log('SomeComponent.ts:SomeComponent');
}
ngOnInit() {
}
}
\ No newline at end of file
/**
* Created by liuzheng on 7/12/16.
*/
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var core_1 = require('@angular/core');
var core_2 = require("angular2-logger/core");
require('rxjs/Rx');
var service_1 = require('./service');
var HostEditComponent = (function () {
function HostEditComponent(_appService, _logger) {
this._appService = _appService;
this._logger = _logger;
this.DataStore = service_1.DataStore;
this._logger.log('SomeComponent.ts:SomeComponent');
}
HostEditComponent.prototype.ngOnInit = function () {
};
HostEditComponent = __decorate([
core_1.Component({
selector: 'div',
template: "<div style=\"background-color: #fff;\">\n<table class=\"ui red table\">\n <thead>\n <tr><th>Food</th>\n <th>Calories</th>\n <th>Protein</th>\n </tr></thead><tbody>\n <tr>\n <td>Apples</td>\n <td>200</td>\n <td>0g</td>\n </tr>\n <tr>\n <td>Orange</td>\n <td>310</td>\n <td>0g</td>\n </tr>\n </tbody>\n</table>\n</div>",
}),
__metadata('design:paramtypes', [service_1.AppService, core_2.Logger])
], HostEditComponent);
return HostEditComponent;
}());
exports.HostEditComponent = HostEditComponent;
//# sourceMappingURL=hostedit.js.map
\ No newline at end of file
{"version":3,"file":"hostedit.js","sourceRoot":"","sources":["hostedit.ts"],"names":[],"mappings":"AAAA;;GAEG;;;;;;;;;;;AAEH,qBAAwB,eAAe,CAAC,CAAA;AAGxC,qBAAqB,sBAAsB,CAAC,CAAA;AAE5C,QAAQ,SAAS,CAAC,CAAA;AAGlB,wBAAoC,WAGpC,CAAC,CAH8C;AA4B/C;IAGI,2BAAoB,WAAsB,EACtB,OAAc;QADd,gBAAW,GAAX,WAAW,CAAW;QACtB,YAAO,GAAP,OAAO,CAAO;QAHlC,cAAS,GAAG,mBAAS,CAAC;QAIlB,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;IACvD,CAAC;IAED,oCAAQ,GAAR;IAEA,CAAC;IAnCL;QAAC,gBAAS,CAAC;YACP,QAAQ,EAAE,KAAK;YACf,QAAQ,EAAE,oXAmBP;SACN,CAAC;;yBAAA;IAeF,wBAAC;AAAD,CAAC,AAZD,IAYC;AAZY,yBAAiB,oBAY7B,CAAA"}
\ No newline at end of file
/**
* Created by liuzheng on 7/12/16.
*/
import {Component} from '@angular/core';
import {NgClass} from '@angular/common';
import {ROUTER_DIRECTIVES} from '@angular/router-deprecated';
import {Logger} from "angular2-logger/core";
import 'rxjs/Rx';
declare var jQuery:any;
import {AppService, DataStore} from './service'
@Component({
selector: 'div',
template: `<div style="background-color: #fff;">
<table class="ui red table">
<thead>
<tr><th>Food</th>
<th>Calories</th>
<th>Protein</th>
</tr></thead><tbody>
<tr>
<td>Apples</td>
<td>200</td>
<td>0g</td>
</tr>
<tr>
<td>Orange</td>
<td>310</td>
<td>0g</td>
</tr>
</tbody>
</table>
</div>`,
})
export class HostEditComponent {
DataStore = DataStore;
constructor(private _appService:AppService,
private _logger:Logger) {
this._logger.log('SomeComponent.ts:SomeComponent');
}
ngOnInit() {
}
}
\ No newline at end of file
/**
* Created by liuzheng on 4/7/16.
*/
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var platform_browser_dynamic_1 = require('@angular/platform-browser-dynamic');
var http_1 = require('@angular/http');
var core_1 = require('@angular/core');
var router_deprecated_1 = require('@angular/router-deprecated');
require('rxjs/Rx');
var core_2 = require("angular2-logger/core");
var service_1 = require('./service');
var nav_1 = require('./nav');
var leftbar_1 = require('./leftbar');
// import {SomeComponent} from './copy-model';
var terminal_1 = require('./terminal');
var login_1 = require('./login');
var hostedit_1 = require('./hostedit');
//noinspection TypeScriptValidateTypes
var WorkboardComponent = (function () {
function WorkboardComponent() {
this.DataStore = service_1.DataStore;
}
WorkboardComponent = __decorate([
core_1.Component({
selector: "div",
template: "<div id=\"left-bar\" [ngClass]=\"{'hideleftbar':DataStore.leftbarhide}\"></div>\n<term id=\"ngdiv\" [ngClass]=\"{'hideleftbar':DataStore.leftbarhide}\"></term>",
directives: [leftbar_1.LeftbarComponent, terminal_1.TermComponent]
}),
__metadata('design:paramtypes', [])
], WorkboardComponent);
return WorkboardComponent;
}());
exports.WorkboardComponent = WorkboardComponent;
//noinspection TypeScriptValidateTypes
var IndexComponent = (function () {
function IndexComponent() {
this.DataStore = service_1.DataStore;
}
IndexComponent = __decorate([
core_1.Component({
selector: "div",
// template: `<div style="background-color: white">Thank you for using <a [routerLink]="['WorkboardComponent']">Bifrost</a></div>`,
template: "<div id=\"left-bar\" *ngIf=\"!DataStore.leftbarhide\"></div>\n<term id=\"ngdiv\" [ngClass]=\"{'hideleftbar':DataStore.leftbarhide}\"></term>",
directives: [leftbar_1.LeftbarComponent, terminal_1.TermComponent]
}),
__metadata('design:paramtypes', [])
], IndexComponent);
return IndexComponent;
}());
exports.IndexComponent = IndexComponent;
// const routes:RouterConfig = [
// {path: '', component: IndexComponent},
// {path: 'aaa', component: IndexComponent}
// ];
// export const appRouterProviders = [
// provideRouter(routes)
// ];
//noinspection TypeScriptValidateTypes
var AppComponent = (function () {
function AppComponent() {
this.DataStore = service_1.DataStore;
}
AppComponent = __decorate([
core_1.Component({
selector: 'body',
template: "<nav></nav>\n<span id=\"liuzheng\" style=\"display:none\">liuzheng</span>\n<router-outlet></router-outlet>",
directives: [nav_1.NavComponent, router_deprecated_1.ROUTER_DIRECTIVES],
providers: [service_1.AppService, router_deprecated_1.ROUTER_PROVIDERS]
}),
router_deprecated_1.RouteConfig([
{ path: '/login', name: 'Login', component: login_1.LoginComponent },
{ path: '/', name: 'Index', component: IndexComponent },
{ path: '/aaa', name: 'Aaaa', component: IndexComponent },
{ path: '/bifrost', name: 'WorkboardComponent', component: WorkboardComponent },
{ path: '/hostedit', name: 'HostEdit', component: hostedit_1.HostEditComponent },
]),
__metadata('design:paramtypes', [])
], AppComponent);
return AppComponent;
}());
exports.AppComponent = AppComponent;
platform_browser_dynamic_1.bootstrap(AppComponent, [
http_1.HTTP_PROVIDERS,
core_2.Logger,
service_1.AppService
]);
//# sourceMappingURL=index.js.map
\ No newline at end of file
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;GAEG;;;;;;;;;;;AAEH,yCAA2B,mCAAmC,CAAC,CAAA;AAC/D,qBAAqC,eAAe,CAAC,CAAA;AACrD,qBAAgC,eAAe,CAAC,CAAA;AAChD,kCAA+D,4BAA4B,CAAC,CAAA;AAE5F,QAAQ,SAAS,CAAC,CAAA;AAElB,qBAAqB,sBAAsB,CAAC,CAAA;AAC5C,wBAA0C,WAAW,CAAC,CAAA;AACtD,oBAA2B,OAAO,CAAC,CAAA;AACnC,wBAA+B,WAAW,CAAC,CAAA;AAC3C,8CAA8C;AAC9C,yBAA4B,YAAY,CAAC,CAAA;AACzC,sBAA6B,SAAS,CAAC,CAAA;AACvC,yBAAgC,YAAY,CAAC,CAAA;AAG7C,sCAAsC;AAOtC;IAAA;QACI,cAAS,GAAG,mBAAS,CAAC;IAC1B,CAAC;IARD;QAAC,gBAAS,CAAC;YACP,QAAQ,EAAE,KAAK;YACf,QAAQ,EAAE,iKAC6D;YACvE,UAAU,EAAE,CAAC,0BAAgB,EAAE,wBAAa,CAAC;SAChD,CAAC;;0BAAA;IAGF,yBAAC;AAAD,CAAC,AAFD,IAEC;AAFY,0BAAkB,qBAE9B,CAAA;AACD,sCAAsC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aAAM;IACN,oBAAU;CACb,CAAC,CAAC"}
\ No newline at end of file
/**
* Created by liuzheng on 4/7/16.
*/
import {bootstrap} from '@angular/platform-browser-dynamic';
import {Http, HTTP_PROVIDERS} from '@angular/http';
import {Component} from '@angular/core';
import {RouteConfig, ROUTER_DIRECTIVES, ROUTER_PROVIDERS} from '@angular/router-deprecated';
import 'rxjs/Rx';
declare var jQuery:any;
import {Logger} from "angular2-logger/core";
import {AppService, User, DataStore} from './service';
import {NavComponent} from './nav';
import {LeftbarComponent} from './leftbar';
// import {SomeComponent} from './copy-model';
import {TermComponent} from './terminal';
import {LoginComponent} from './login';
import {HostEditComponent} from './hostedit';
//noinspection TypeScriptValidateTypes
@Component({
selector: "div",
template: `<div id="left-bar" [ngClass]="{'hideleftbar':DataStore.leftbarhide}"></div>
<term id="ngdiv" [ngClass]="{'hideleftbar':DataStore.leftbarhide}"></term>`,
directives: [LeftbarComponent, TermComponent]
})
export class WorkboardComponent {
DataStore = DataStore;
}
//noinspection TypeScriptValidateTypes
@Component({
selector: "div",
// template: `<div style="background-color: white">Thank you for using <a [routerLink]="['WorkboardComponent']">Bifrost</a></div>`,
template: `<div id="left-bar" *ngIf="!DataStore.leftbarhide"></div>
<term id="ngdiv" [ngClass]="{'hideleftbar':DataStore.leftbarhide}"></term>`,
directives: [LeftbarComponent, TermComponent]
})
export class IndexComponent {
DataStore = DataStore;
}
// const routes:RouterConfig = [
// {path: '', component: IndexComponent},
// {path: 'aaa', component: IndexComponent}
// ];
// export const appRouterProviders = [
// provideRouter(routes)
// ];
//noinspection TypeScriptValidateTypes
@Component({
selector: 'body',
template: `<nav></nav>
<span id="liuzheng" style="display:none">liuzheng</span>
<router-outlet></router-outlet>`,
directives: [NavComponent, ROUTER_DIRECTIVES],
providers: [AppService, ROUTER_PROVIDERS]
})
//noinspection TypeScriptValidateTypes
@RouteConfig([
{path: '/login', name: 'Login', component: LoginComponent},
{path: '/', name: 'Index', component: IndexComponent},
{path: '/aaa', name: 'Aaaa', component: IndexComponent},
{path: '/bifrost', name: 'WorkboardComponent', component: WorkboardComponent},
{path: '/hostedit', name: 'HostEdit', component: HostEditComponent},
// {path: '/kkk', name: 'Kkk', component: KkkComponent},
// {path: '/kkk', name: 'Kkk', component: KkkComponent},
])
export class AppComponent {
DataStore = DataStore;
// constructor(
// private _appService:AppService,
// private _logger:Logger) {
//
// }
}
bootstrap(AppComponent, [
HTTP_PROVIDERS,
Logger,
AppService
]);
/**
* Created by liuzheng on 7/12/16.
*/
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var core_1 = require('@angular/core');
var core_2 = require("angular2-logger/core");
require('rxjs/Rx');
var service_1 = require('./service');
var SearchBar = (function () {
function SearchBar(_appService, _logger) {
this._appService = _appService;
this._logger = _logger;
this._logger.log('LeftbarComponent.ts:SearchBar');
}
SearchBar.prototype.ngOnChanges = function (changes) {
this.q = changes.input.currentValue;
};
SearchBar.prototype.modelChange = function ($event) {
this._appService.Search(this.q);
};
__decorate([
core_1.Input(),
__metadata('design:type', Object)
], SearchBar.prototype, "input", void 0);
SearchBar = __decorate([
core_1.Component({
selector: 'search-bar',
template: "<input class=\"left-search\" placeholder=\" Search ...\" maxlength=\"2048\" name=\"q\" autocomplete=\"off\" title=\"Search\"\n type=\"text\" tabindex=\"1\" spellcheck=\"false\" autofocus [(ngModel)]=\"q\" (keyup.enter)=\"search()\"\n (ngModelChange)=\"modelChange($event)\">"
}),
__metadata('design:paramtypes', [service_1.AppService, core_2.Logger])
], SearchBar);
return SearchBar;
}());
var LeftbarComponent = (function () {
function LeftbarComponent(_appService, _logger) {
this._appService = _appService;
this._logger = _logger;
this.DataStore = service_1.DataStore;
this._logger.log('LeftbarComponent.ts:LeftbarComponent');
this._logger.debug("check DataStroe.leftbar", service_1.DataStore.leftbar);
}
LeftbarComponent.prototype.ngOnInit = function () {
this._logger.log('LeftbarComponent.ts:LeftbarComponent,ngOnInit');
};
LeftbarComponent.prototype.ngAfterViewInit = function () {
this._logger.log('LeftbarComponent.ts:LeftbarComponent,ngAfterViewInit');
jQuery("#left-bar").fancytree({
extensions: ["glyph"],
glyph: {
map: {
checkbox: "fa fa-square-o",
checkboxSelected: "fa fa-check-square-o",
checkboxUnknown: "fa fa-square",
dragHelper: "fa fa-arrow-right",
dropMarker: "fa fa-long-arrow-right",
error: "fa fa-warning",
expanderClosed: "fa fa-caret-right",
expanderLazy: "fa fa-angle-right",
expanderOpen: "fa fa-caret-down",
nodata: "fa fa-meh-o",
loading: "fa fa-spinner fa-pulse",
// Default node icons.
// (Use tree.options.icon callback to define custom icons based on node data)
doc: "fa fa-cube",
docOpen: "fa fa-cube",
folder: "fa fa-cubes",
folderOpen: "fa fa-cubes"
}
},
source: { url: service_1.DataStore.leftbar },
activeVisible: true,
aria: true,
autoActivate: true,
autoCollapse: true,
autoScroll: true,
clickFolderMode: 3,
checkbox: true,
debugLevel: 0,
disabled: false,
focusOnSelect: true,
escapeTitles: false,
generateIds: true,
idPrefix: "ft_",
icon: true,
// icon: function (event, data) {
// if (data.node.isFolder()) {
// return "glyphicon glyphicon-book";
// }
// },
keyboard: false,
keyPathSeparator: "/",
minExpandLevel: 1,
quicksearch: true,
selectMode: 3,
tabindex: "0",
titlesTabbable: false,
dblclick: function (event, data) {
console.log('leftbar dbclick', event, data);
if (!data.node.folder) {
var param = {
'assetId': data.node.data.id,
'sysUserId': data.node.data.system_users[0].id,
};
service_1.DataStore.termlist.push(param);
}
},
});
jQuery("#left-bar").contextmenu({
delegate: "span.fancytree-title",
hide: { effect: "explode", duration: "slow" },
menu: [
{
"title": "Cut",
"cmd": "cut",
"uiIcon": "fa fa-cut fa-size-1p3em"
},
{
"title": "Copy",
"cmd": "copy",
"uiIcon": "fa fa-copy fa-size-1p3em"
},
{
"title": "Paste",
"cmd": "paste",
"uiIcon": "fa fa-paste fa-size-1p3em",
"disabled": false
},
{
"title": "----"
},
{
"title": "Edit",
"cmd": "edit",
"uiIcon": "fa fa-edit fa-size-1p3em",
"disabled": true
},
{
"title": "Delete",
"cmd": "delete",
"uiIcon": "fa fa-trash fa-size-1p3em",
"disabled": true
},
{
"title": "More",
"uiIcon": "fa fa-caret-right fa-size-1p3em",
"children": [
{
"title": "Sub 1",
"cmd": "sub1"
},
{
"title": "Sub 2",
"cmd": "sub1"
}
]
}
],
beforeOpen: function (event, ui) {
var node = jQuery.ui.fancytree.getNode(ui.target[0]);
// Modify menu entries depending on node status
jQuery("#left-bar").contextmenu("enableEntry", "paste", node.isFolder());
// Show/hide single entries
// Activate node on right-click
node.setActive();
},
select: function (event, ui) {
var node = jQuery.ui.fancytree.getNode(ui.target[0]);
alert("select " + ui.cmd + " on " + node);
}
});
};
LeftbarComponent.prototype.getSelect = function () {
jQuery('#left-bar').fancytree('getTree').getSelectedNodes();
};
LeftbarComponent.prototype.Hide = function () {
this._appService.HideLeft();
};
LeftbarComponent = __decorate([
core_1.Component({
selector: 'div',
template: "<div style=\"height:30px;width:100%;background-color: #00b3ee\">\n <search-bar></search-bar></div>",
directives: [SearchBar],
}),
__metadata('design:paramtypes', [service_1.AppService, core_2.Logger])
], LeftbarComponent);
return LeftbarComponent;
}());
exports.LeftbarComponent = LeftbarComponent;
//# sourceMappingURL=leftbar.js.map
\ No newline at end of file
{"version":3,"file":"leftbar.js","sourceRoot":"","sources":["leftbar.ts"],"names":[],"mappings":"AAAA;;GAEG;;;;;;;;;;;AAEH,qBAA0C,eAAe,CAAC,CAAA;AAG1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@angular/core';
import {NgClass} from '@angular/common';
import {ROUTER_DIRECTIVES} from '@angular/router-deprecated';
import {Logger} from "angular2-logger/core";
import 'rxjs/Rx';
declare var jQuery:any;
import {AppService, DataStore} from './service'
@Component({
selector: 'search-bar',
template: `<input class="left-search" placeholder=" Search ..." maxlength="2048" name="q" autocomplete="off" title="Search"
type="text" tabindex="1" spellcheck="false" autofocus [(ngModel)]="q" (keyup.enter)="search()"
(ngModelChange)="modelChange($event)">`
})
class SearchBar implements OnChanges {
@Input() input;
q:string;
constructor(private _appService:AppService,
private _logger:Logger) {
this._logger.log('LeftbarComponent.ts:SearchBar');
}
ngOnChanges(changes) {
this.q = changes.input.currentValue;
}
modelChange($event) {
this._appService.Search(this.q)
}
}
@Component({
selector: 'div',
template: `<div style="height:30px;width:100%;background-color: #00b3ee">
<search-bar></search-bar></div>`,
directives: [SearchBar],
})
export class LeftbarComponent {
DataStore = DataStore;
constructor(private _appService:AppService,
private _logger:Logger) {
this._logger.log('LeftbarComponent.ts:LeftbarComponent');
this._logger.debug("check DataStroe.leftbar", DataStore.leftbar);
}
ngOnInit() {
this._logger.log('LeftbarComponent.ts:LeftbarComponent,ngOnInit');
}
ngAfterViewInit() {
this._logger.log('LeftbarComponent.ts:LeftbarComponent,ngAfterViewInit');
jQuery("#left-bar").fancytree({
extensions: ["glyph"],
glyph: {
map: {
checkbox: "fa fa-square-o",
checkboxSelected: "fa fa-check-square-o",
checkboxUnknown: "fa fa-square",
dragHelper: "fa fa-arrow-right",
dropMarker: "fa fa-long-arrow-right",
error: "fa fa-warning",
expanderClosed: "fa fa-caret-right",
expanderLazy: "fa fa-angle-right",
expanderOpen: "fa fa-caret-down",
nodata: "fa fa-meh-o",
loading: "fa fa-spinner fa-pulse",
// Default node icons.
// (Use tree.options.icon callback to define custom icons based on node data)
doc: "fa fa-cube",
docOpen: "fa fa-cube",
folder: "fa fa-cubes",
folderOpen: "fa fa-cubes"
}
},
source: {url: DataStore.leftbar},
activeVisible: true, // Make sure, active nodes are visible (expanded).
aria: true, // Enable WAI-ARIA support.
autoActivate: true, // Automatically activate a node when it is focused (using keys).
autoCollapse: true, // Automatically collapse all siblings, when a node is expanded.
autoScroll: true, // Automatically scroll nodes into visible area.
clickFolderMode: 3, // 1:activate, 2:expand, 3:activate and expand, 4:activate (dblclick expands)
checkbox: true, // Show checkboxes.
debugLevel: 0, // 0:quiet, 1:normal, 2:debug
disabled: false, // Disable control
focusOnSelect: true, // Set focus when node is checked by a mouse click
escapeTitles: false, // Escape `node.title` content for display
generateIds: true, // Generate id attributes like <span id='fancytree-id-KEY'>
idPrefix: "ft_", // Used to generate node id´s like <span id='fancytree-id-<key>'>.
icon: true, // Display node icons.
// icon: function (event, data) {
// if (data.node.isFolder()) {
// return "glyphicon glyphicon-book";
// }
// },
keyboard: false, // Support keyboard navigation.
keyPathSeparator: "/", // Used by node.getKeyPath() and tree.loadKeyPath().
minExpandLevel: 1, // 1: root node is not collapsible
quicksearch: true, // Navigate to next node by typing the first letters.
selectMode: 3, // 1:single, 2:multi, 3:multi-hier
tabindex: "0", // Whole tree behaves as one single control
titlesTabbable: false, // Node titles can receive keyboard focus
dblclick: function (event, data) {
console.log('leftbar dbclick', event, data);
if (!data.node.folder) {
let param = {
'assetId': data.node.data.id,
'sysUserId': data.node.data.system_users[0].id,
};
DataStore.termlist.push(param);
// DataStore.termActive = DataStore.term.push({
// "machine": data.node.data.machine,
// "nick": data.node.title
// }) - 1;
}
},
});
jQuery("#left-bar").contextmenu({
delegate: "span.fancytree-title",
hide: {effect: "explode", duration: "slow"},
menu: [
{
"title": "Cut",
"cmd": "cut",
"uiIcon": "fa fa-cut fa-size-1p3em"
},
{
"title": "Copy",
"cmd": "copy",
"uiIcon": "fa fa-copy fa-size-1p3em"
},
{
"title": "Paste",
"cmd": "paste",
"uiIcon": "fa fa-paste fa-size-1p3em",
"disabled": false
},
{
"title": "----"
},
{
"title": "Edit",
"cmd": "edit",
"uiIcon": "fa fa-edit fa-size-1p3em",
"disabled": true
},
{
"title": "Delete",
"cmd": "delete",
"uiIcon": "fa fa-trash fa-size-1p3em",
"disabled": true
},
{
"title": "More",
"uiIcon": "fa fa-caret-right fa-size-1p3em",
"children": [
{
"title": "Sub 1",
"cmd": "sub1"
},
{
"title": "Sub 2",
"cmd": "sub1"
}
]
}
],
beforeOpen: function (event, ui) {
var node = jQuery.ui.fancytree.getNode(ui.target[0]);
// Modify menu entries depending on node status
jQuery("#left-bar").contextmenu("enableEntry", "paste", node.isFolder());
// Show/hide single entries
// Activate node on right-click
node.setActive();
},
select: function (event, ui) {
var node = jQuery.ui.fancytree.getNode(ui.target[0]);
alert("select " + ui.cmd + " on " + node);
}
});
}
getSelect() {
jQuery('#left-bar').fancytree('getTree').getSelectedNodes();
}
Hide() {
this._appService.HideLeft()
}
}
/**
* Created by liuzheng on 7/12/16.
*/
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var core_1 = require('@angular/core');
var core_2 = require("angular2-logger/core");
require('rxjs/Rx');
var service_1 = require('./service');
var LoginComponent = (function () {
function LoginComponent(_appService, _logger, user) {
this._appService = _appService;
this._logger = _logger;
this.user = user;
this.DataStore = service_1.DataStore;
this._logger.log('login.ts:LoginComponent');
}
LoginComponent.prototype.onSubmit = function () {
this._logger.log(service_1.DataStore);
this._appService.login(this.user);
};
LoginComponent.prototype.ngOnInit = function () {
jQuery("#form").fadeIn("slow");
if (window.location.pathname != "/login") {
window.location.href = "/login";
}
// jQuery('nav').hide();
var vm = this;
window.onresize = function () {
if (!service_1.DataStore.logined) {
vm.background();
}
};
this.timer();
};
LoginComponent.prototype.timer = function () {
var _this = this;
if (service_1.DataStore.windowsize[0] != document.documentElement.clientWidth || service_1.DataStore.windowsize[1] != document.documentElement.clientHeight && !service_1.DataStore.logined) {
jQuery(window).trigger('resize');
service_1.DataStore.windowsize = [document.documentElement.clientWidth, document.documentElement.clientHeight];
}
setTimeout(function () {
_this.timer();
}, 33);
};
LoginComponent.prototype.background = function () {
var q = jQuery('#q')[0];
var width = q.width = document.documentElement.clientWidth;
var height = q.height = document.documentElement.clientHeight;
var letters = [];
for (var i = 0; i < 256; i++) {
letters.push(Math.round(Math.random() * i * 33));
}
var draw = function () {
q.getContext('2d').fillStyle = 'rgba(0,0,0,.05)';
q.getContext('2d').fillRect(0, 0, width, height);
q.getContext('2d').fillStyle = '#0F0';
letters.map(function (y_pos, index) {
var text = String.fromCharCode(65 + Math.random() * 26);
var x_pos = index * 10;
q.getContext('2d').fillText(text, x_pos, y_pos);
letters[index] = (y_pos > 758 + Math.random() * 1e4) ? 0 : y_pos + 10;
});
};
setInterval(draw, 33);
};
LoginComponent = __decorate([
core_1.Component({
selector: 'div',
template: "<div style=\"position: fixed;top: 0;left:0;width:100%;height:100%;z-index: 5;background-color: #000000;\"></div>\n<canvas id=\"q\" style=\"position:fixed;top: 0;z-index: 5;\"></canvas>\n<div id=\"form\" style=\"z-index: 9;display: none;\">\n<form (ngSubmit)=\"onSubmit()\"style=\"z-index:9;\" >\n <div class=\"from-group\">\n <input type=\"text\" name=\"username\" id=\"username\" placeholder=\"Username\" [(ngModel)]=\"user.username\" required>\n <span class=\"fa fa-user-secret form-control-feedback\"></span>\n </div>\n <div class=\"from-group\">\n <input type=\"password\" name=\"password\" id=\"password\" placeholder=\"password\" [(ngModel)]=\"user.password\" required (ngEnter)=\"onSubmit()\">\n <span class=\"fa fa-key form-control-feedback\"></span>\n </div>\n <button type=\"submit\">login to your account</button>\n</form>\n</div>",
providers: [service_1.AppService, service_1.User]
}),
__metadata('design:paramtypes', [service_1.AppService, core_2.Logger, service_1.User])
], LoginComponent);
return LoginComponent;
}());
exports.LoginComponent = LoginComponent;
//# sourceMappingURL=login.js.map
\ No newline at end of file
{"version":3,"file":"login.js","sourceRoot":"","sources":["login.ts"],"names":[],"mappings":"AAAA;;GAEG;;;;;;;;;;;AAEH,qBAAwB,eAAe,CAAC,CAAA;AAGxC,qBAAqB,sBAAsB,CAAC,CAAA;AAE5C,QAAQ,SAAS,CAAC,CAAA;AAGlB,wBAA0C,WAG1C,CAAC,CAHoD;AAwBrD;IAII,wBAAoB,WAAsB,EACtB,OAAc,EACd,IAAS;QAFT,gBAAW,GAAX,WAAW,CAAW;QACtB,YAAO,GAAP,OAAO,CAAO;QACd,SAAI,GAAJ,IAAI,CAAK;QAL7B,cAAS,GAAG,mBAAS,CAAC;QAMlB,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;IAChD,CAAC;IAGD,iCAAQ,GAAR;QACI,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAS,CAAC,CAAC;QAC5B,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACrC,CAAC;IAED,iCAAQ,GAAR;QACI,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAC/B,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,IAAI,QAAQ,CAAC,CAAC,CAAC;YACvC,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAA;QACnC,CAAC;QACD,wBAAwB;QACxB,IAAI,EAAE,GAAG,IAAI,CAAC;QACd,MAAM,CAAC,QAAQ,GAAG;YACd,EAAE,CAAC,CAAC,CAAC,mBAAS,CAAC,OAAO,CAAC,CAAC,CAAC;gBACrB,EAAE,CAAC,UAAU,EAAE,CAAC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C,CAAC,SAAS,GAAG,iBAAiB,CAAC;YACjD,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;YACjD,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,SAAS,GAAG,MAAM,CAAC;YACtC,OAAO,CAAC,GAAG,CAAC,UAAU,KAAK,EAAE,KAAK;gBAC9B,IAAI,IAAI,GAAG,MAAM,CAAC,YAAY,CAAC,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;gBACxD,IAAI,KAAK,GAAG,KAAK,GAAG,EAAE,CAAC;gBACvB,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;gBAChD,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,GAAG,GAAG,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,GAAG,EAAE,CAAC;YAC1E,CAAC,CAAC,CAAC;QACP,CAAC,CAAC;QACF,WAAW,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAC1B,CAAC;IApFL;QAAC,gBAAS,CAAC;YACP,QAAQ,EAAE,KAAK;YACf,QAAQ,EAAE,+1BAcP;YACH,SAAS,EAAE,CAAC,oBAAU,EAAE,cAAI,CAAC;SAChC,CAAC;;sBAAA;IAoEF,qBAAC;AAAD,CAAC,AAjED,IAiEC;AAjEY,sBAAc,iBAiE1B,CAAA"}
\ No newline at end of file
/**
* Created by liuzheng on 7/12/16.
*/
import {Component} from '@angular/core';
import {NgClass} from '@angular/common';
import {ROUTER_DIRECTIVES, ROUTER_PROVIDERS} from '@angular/router-deprecated';
import {Logger} from "angular2-logger/core";
import 'rxjs/Rx';
declare var jQuery:any;
import {AppService, DataStore, User} from './service'
@Component({
selector: 'div',
template: `<div style="position: fixed;top: 0;left:0;width:100%;height:100%;z-index: 5;background-color: #000000;"></div>
<canvas id="q" style="position:fixed;top: 0;z-index: 5;"></canvas>
<div id="form" style="z-index: 9;display: none;">
<form (ngSubmit)="onSubmit()"style="z-index:9;" >
<div class="from-group">
<input type="text" name="username" id="username" placeholder="Username" [(ngModel)]="user.username" required>
<span class="fa fa-user-secret form-control-feedback"></span>
</div>
<div class="from-group">
<input type="password" name="password" id="password" placeholder="password" [(ngModel)]="user.password" required (ngEnter)="onSubmit()">
<span class="fa fa-key form-control-feedback"></span>
</div>
<button type="submit">login to your account</button>
</form>
</div>`,
providers: [AppService, User]
})
// ToDo: ngEnter and redirect to default page
export class LoginComponent {
DataStore = DataStore;
constructor(private _appService:AppService,
private _logger:Logger,
private user:User) {
this._logger.log('login.ts:LoginComponent');
}
onSubmit() {
this._logger.log(DataStore);
this._appService.login(this.user)
}
ngOnInit() {
jQuery("#form").fadeIn("slow");
if (window.location.pathname != "/login") {
window.location.href = "/login"
}
// jQuery('nav').hide();
var vm = this;
window.onresize = function () {
if (!DataStore.logined) {
vm.background();
}
};
this.timer();
}
timer() {
if (DataStore.windowsize[0] != document.documentElement.clientWidth || DataStore.windowsize[1] != document.documentElement.clientHeight && !DataStore.logined) {
jQuery(window).trigger('resize');
DataStore.windowsize = [document.documentElement.clientWidth, document.documentElement.clientHeight]
}
setTimeout(()=> {
this.timer()
}, 33)
}
background() {
var q = jQuery('#q')[0];
var width = q.width = document.documentElement.clientWidth;
var height = q.height = document.documentElement.clientHeight;
var letters = [];
for (var i = 0; i < 256; i++) {
letters.push(Math.round(Math.random() * i * 33))
}
var draw = function () {
q.getContext('2d').fillStyle = 'rgba(0,0,0,.05)';
q.getContext('2d').fillRect(0, 0, width, height);
q.getContext('2d').fillStyle = '#0F0';
letters.map(function (y_pos, index) {
var text = String.fromCharCode(65 + Math.random() * 26);
var x_pos = index * 10;
q.getContext('2d').fillText(text, x_pos, y_pos);
letters[index] = (y_pos > 758 + Math.random() * 1e4) ? 0 : y_pos + 10;
});
};
setInterval(draw, 33);
}
}
\ No newline at end of file
/**
* Created by liuzheng on 4/7/16.
*/
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var core_1 = require('@angular/core');
var common_1 = require('@angular/common');
var router_deprecated_1 = require('@angular/router-deprecated');
var core_2 = require("angular2-logger/core");
require('rxjs/Rx');
var service_1 = require('./service');
//noinspection TypeScriptValidateTypes
var NavComponent = (function () {
function NavComponent(_appService, _logger) {
this._appService = _appService;
this._logger = _logger;
this.DataStore = service_1.DataStore;
this._logger.log('nav.ts:NavComponent');
this._appService.getnav();
}
NavComponent.prototype.ngOnInit = function () {
};
NavComponent.prototype.click = function (event) {
this._logger.debug('nav.ts:NavComponent,click', event);
if (event === "ReloadLeftbar") {
this._appService.ReloadLeftbar();
}
else if (event === "HideLeft") {
this._appService.HideLeft();
}
else if (event === "ShowLeft") {
this._appService.ShowLeft();
}
else if (event === "Copy") {
this._appService.copy();
}
else if (event === "Disconnect") {
this._appService.TerminalDisconnect(service_1.DataStore.termActive);
}
else if (event === "DisconnectAll") {
this._appService.TerminalDisconnectAll();
}
else if (event === "Website") {
window.open('http://www.jumpserver.org');
}
else if (event === "BBS") {
window.open('http://bbs.jumpserver.org');
}
else if (event === "EnterLicense") {
this.EnterLicense();
}
};
NavComponent.prototype.EnterLicense = function () {
layer.prompt({
formType: 2,
maxlength: 500,
title: 'Please Input Code',
scrollbar: false,
area: ['400px', '300px'],
moveOut: true,
moveType: 1
}, function (value, index) {
service_1.DataStore.socket.emit('key', value);
// layer.msg(value); //得到value
layer.close(index);
});
};
NavComponent = __decorate([
core_1.Component({
selector: 'nav',
template: "<div class=\"nav\" *ngIf=\"DataStore.logined\">\n <ul>\n <li><a [routerLink]=\"['Index']\"><img src=\"./imgs/logo.png\" height=\"26px\"/></a>\n </li>\n <li *ngFor=\"let v of DataStore.Nav; let k = index \" [ngClass]=\"{'dropdown': v.children}\">\n <a>{{v.name}}</a>\n <ul [ngClass]=\"{'dropdown-content': v.children}\">\n <li *ngFor=\"let vv of v.children; let kk = index\" [ngClass]=\"{'disabled': vv.disable}\">\n <a *ngIf=\"vv.href\" [routerLink]=\"[vv.href]\">{{vv.name}}</a>\n <a id=\"{{vv.id}}\" *ngIf=\"vv.click\" (click)=\"click(vv.click)\">{{vv.name}}</a>\n </li>\n </ul>\n </li>\n </ul>\n</div>",
directives: [router_deprecated_1.ROUTER_DIRECTIVES, common_1.NgClass]
}),
__metadata('design:paramtypes', [service_1.AppService, core_2.Logger])
], NavComponent);
return NavComponent;
}());
exports.NavComponent = NavComponent;
//# sourceMappingURL=nav.js.map
\ No newline at end of file
{"version":3,"file":"nav.js","sourceRoot":"","sources":["nav.ts"],"names":[],"mappings":"AAAA;;GAEG;;;;;;;;;;;AAEH,qBAAwB,eAAe,CAAC,CAAA;AACxC,uBAAyB,iBAAiB,CAAC,CAAA;AAC3C,kCAAgC,4BAA4B,CAAC,CAAA;AAC7D,qBAAqB,sBAAsB,CAAC,CAAA;AAE5C,QAAQ,SAAS,CAAC,CAAA;AAMlB,wBAAoC,WAIpC,CAAC,CAJ8C;AAG/C,sCAAsC;AAsBtC;IAGI,sBAAoB,WAAsB,EACtB,OAAc;QADd,gBAAW,GAAX,WAAW,CAAW;QACtB,YAAO,GAAP,OAAO,CAAO;QAHlC,cAAS,GAAG,mBAAS,CAAC;QAIlB,IAAI,CAAC,OAAO,CAAC,GA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AAK,KAAK,CAAC,CAAC,CAAC;YACzB,MAAM,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAA;QAC5C,CAAC;QAAC,IAAI,CAAC,EAAE,CAAC,CAAC,KAAK,KAAK,cAAc,CAAC,CAAC,CAAC;YAClC,IAAI,CAAC,YAAY,EAAE,CAAA;QACvB,CAAC;IACL,CAAC;IAED,mCAAY,GAAZ;QACI,KAAK,CAAC,MAAM,CAAC;YACT,QAAQ,EAAE,CAAC;YACX,SAAS,EAAE,GAAG;YACd,KAAK,EAAE,mBAAmB;YAC1B,SAAS,EAAE,KAAK;YAChB,IAAI,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC;YACxB,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,CAAC;SACd,EAAE,UAAU,KAAK,EAAE,KAAK;YACrB,mBAAS,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;YACpC,8BAA8B;YAC9B,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAEvB,CAAC,CAAC,CAAC;IACP,CAAC;IAxEL;QAAC,gBAAS,CAAC;YACP,QAAQ,EAAE,KAAK;YACf,QAAQ,EAAE,quBAcP;YACH,UAAU,EAAE,CAAC,qCAAiB,EAAE,gBAAO,CAAC;SAC3C,CAAC;;oBAAA;IAyDF,mBAAC;AAAD,CAAC,AAtDD,IAsDC;AAtDY,oBAAY,eAsDxB,CAAA"}
\ No newline at end of file
/**
* Created by liuzheng on 4/7/16.
*/
import {Component} from '@angular/core';
import {NgClass} from '@angular/common';
import {ROUTER_DIRECTIVES} from '@angular/router-deprecated';
import {Logger} from "angular2-logger/core";
import 'rxjs/Rx';
declare var jQuery:any;
declare var Clipboard:any;
declare var layer:any;
import {AppService, DataStore} from './service'
//noinspection TypeScriptValidateTypes
@Component({
selector: 'nav',
template: `<div class="nav" *ngIf="DataStore.logined">
<ul>
<li><a [routerLink]="['Index']"><img src="./imgs/logo.png" height="26px"/></a>
</li>
<li *ngFor="let v of DataStore.Nav; let k = index " [ngClass]="{'dropdown': v.children}">
<a>{{v.name}}</a>
<ul [ngClass]="{'dropdown-content': v.children}">
<li *ngFor="let vv of v.children; let kk = index" [ngClass]="{'disabled': vv.disable}">
<a *ngIf="vv.href" [routerLink]="[vv.href]">{{vv.name}}</a>
<a id="{{vv.id}}" *ngIf="vv.click" (click)="click(vv.click)">{{vv.name}}</a>
</li>
</ul>
</li>
</ul>
</div>`,
directives: [ROUTER_DIRECTIVES, NgClass]
})
export class NavComponent {
DataStore = DataStore;
constructor(private _appService:AppService,
private _logger:Logger) {
this._logger.log('nav.ts:NavComponent');
this._appService.getnav()
}
ngOnInit() {
}
click(event) {
this._logger.debug('nav.ts:NavComponent,click', event);
if (event === "ReloadLeftbar") {
this._appService.ReloadLeftbar()
} else if (event === "HideLeft") {
this._appService.HideLeft()
} else if (event === "ShowLeft") {
this._appService.ShowLeft()
} else if (event === "Copy") {
this._appService.copy()
} else if (event === "Disconnect") {
this._appService.TerminalDisconnect(DataStore.termActive)
} else if (event === "DisconnectAll") {
this._appService.TerminalDisconnectAll()
} else if (event === "Website") {
window.open('http://www.jumpserver.org')
} else if (event === "BBS") {
window.open('http://bbs.jumpserver.org')
} else if (event === "EnterLicense") {
this.EnterLicense()
}
}
EnterLicense() {
layer.prompt({
formType: 2,
maxlength: 500,
title: 'Please Input Code',
scrollbar: false,
area: ['400px', '300px'],
moveOut: true,
moveType: 1
}, function (value, index) {
DataStore.socket.emit('key', value);
// layer.msg(value); //得到value
layer.close(index);
});
}
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/**
* Created by liuzheng on 7/16/16.
*/
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var core_1 = require('@angular/core');
var common_1 = require('@angular/common');
var core_2 = require("angular2-logger/core");
require('rxjs/Rx');
var service_1 = require('./service');
var TermComponent = (function () {
function TermComponent(_appService, _logger) {
this._appService = _appService;
this._logger = _logger;
this.DataStore = service_1.DataStore;
this._logger.log('TermComponent.ts:TermComponent');
}
TermComponent.prototype.ngOnInit = function () {
//DataStore.term[0]["term"].open(document.getElementById("term-0"))
this.timer();
};
TermComponent.prototype.ngAfterViewInit = function () {
this._appService.TerminalConnect({});
//this._logger.debug("term width ", jQuery("#term").width());
//this._logger.debug("term height", jQuery("#term").height());
};
TermComponent.prototype.timer = function () {
var _this = this;
if (service_1.DataStore.termlist.length > 0) {
for (var i in service_1.DataStore.termlist)
this._appService.TerminalConnect(service_1.DataStore.termlist[i]);
service_1.DataStore.termlist = [];
}
jQuery(window).trigger('resize');
setTimeout(function () {
_this.timer();
}, 0);
};
TermComponent.prototype.close = function (i) {
this._logger.debug(i);
this._appService.TerminalDisconnect(i);
service_1.DataStore.term[i]["term"].destroy();
// delete DataStore.term.splice(i, 1)
};
TermComponent.prototype.dblclick = function () {
console.log(service_1.DataStore.term);
};
TermComponent = __decorate([
core_1.Component({
selector: 'term',
template: "<div id=\"tabs\" style=\"height: 30px;width: 100%\">\n <ul>\n <li *ngFor=\"let m of DataStore.term;let i = index\"\n [ngClass]=\"{'active':i==DataStore.termActive,'disconnected':!m.connected}\"\n id=\"termnav-{{i}}\">\n <span *ngIf=\"!m.$edit\" (click)=\"DataStore.termActive=i\" (dblclick)=\"m.$edit=true;DataStore.termActive=i\">{{m.nick}}</span>\n <input *ngIf=\"m.$edit\" [(ngModel)]=\"m.nick\" autofocus (blur)=\"m.$edit=false\" (keyup.enter)=\"m.$edit=false\"/>\n <a class=\"close\" (click)=\"close(i)\" onclick=\"this.parentElement.style.display='none';\">x</a></li>\n </ul>\n</div>\n<div id=\"term\" style=\"width: 100%;height: 100%;\">\n <div id=\"term-0\" [ngClass]=\"{'hidden':DataStore.termActive!=0}\"></div>\n <div *ngFor=\"let m of DataStore.term; let i = index\" [ngClass]=\"{'hidden':i+1!=DataStore.termActive}\"\n id=\"term-{{i+1}}\"></div>\n</div>",
directives: [common_1.NgClass, common_1.FORM_DIRECTIVES]
}),
__metadata('design:paramtypes', [service_1.AppService, core_2.Logger])
], TermComponent);
return TermComponent;
}());
exports.TermComponent = TermComponent;
//# sourceMappingURL=terminal.js.map
\ No newline at end of file
{"version":3,"file":"terminal.js","sourceRoot":"","sources":["terminal.ts"],"names":[],"mappings":"AAAA;;GAEG;;;;;;;;;;;AAEH,qBAAwB,eAAe,CAAC,CAAA;AACxC,uBAA0C,iBAAiB,CAAC,CAAA;AAE5D,qBAAqB,sBAAsB,CAAC,CAAA;AAI5C,QAAQ,SAAS,CAAC,CAAA;AAGlB,wBAAoC,WAGpC,CAAC,CAH8C;AAwB/C;IAKI,uBAAoB,WAAsB,EACtB,OAAc;QADd,gBAAW,GAAX,WAAW,CAAW;QACtB,YAAO,GAAP,OAAO,CAAO;QALlC,cAAS,GAAG,mBAAS,CAAC;QAMlB,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;IACvD,CAAC;IAED,gCAAQ,GAAR;QACI,mEAAmE;QACnE,IAAI,CAAC,KAAK,EAAE,CAAC;IACjB,CAAC;IAED,uCAAe,GAAf;QACI,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;QACrC,6DAA6D;QAC7D,8DAA8D;IAClE,CAAC;IAED,6BAAK,GAAL;QAAA,iBAUC;QATG,EAAE,CAAC,CAAC,mBAAS,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;YAChC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,mBAAS,CAAC,QAAQ,CAAC;gBAC7B,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC,mBAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;YAC5D,mBAAS,CAAC,QAAQ,GAAG,EAAE,CAAA;QAC3B,CAAC;QACD,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QACjC,UAAU,CAAC;YACP,KAAI,CAAC,KAAK,EAAE,CAAA;QAChB,CAAC,EAAE,CAAC,CAAC,CAAA;IACT,CAAC;IAED,6BAAK,GAAL,UAAM,CAAC;QACH,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACtB,IAAI,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC;QACvC,mBAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,CAAC;QAEpC,qCAAqC;IACzC,CAAC;IAED,gCAAQ,GAAR;QACI,OAAO,CAAC,GAAG,CAAC,mBAAS,CAAC,IAAI,CAAC,CAAA;IAC/B,CAAC;IAhEL;QAAC,gBAAS,CAAC;YACP,QAAQ,EAAE,MAAM;YAChB,QAAQ,EAAE,s7BAcP;YACH,UAAU,EAAE,CAAC,gBAAO,EAAE,wBAAe,CAAC;SACzC,CAAC;;qBAAA;IA+CF,oBAAC;AAAD,CAAC,AA5CD,IA4CC;AA5CY,qBAAa,gBA4CzB,CAAA"}
\ No newline at end of file
/**
* Created by liuzheng on 7/16/16.
*/
import {Component} from '@angular/core';
import {NgClass, FORM_DIRECTIVES} from '@angular/common';
import {ROUTER_DIRECTIVES} from '@angular/router-deprecated';
import {Logger} from "angular2-logger/core";
import {$WebSocket} from 'angular2-websocket/angular2-websocket';
import {Cookie} from 'ng2-cookies/ng2-cookies';
import 'rxjs/Rx';
declare var jQuery:any;
import {AppService, DataStore} from './service'
@Component({
selector: 'term',
template: `<div id="tabs" style="height: 30px;width: 100%">
<ul>
<li *ngFor="let m of DataStore.term;let i = index"
[ngClass]="{'active':i==DataStore.termActive,'disconnected':!m.connected}"
id="termnav-{{i}}">
<span *ngIf="!m.$edit" (click)="DataStore.termActive=i" (dblclick)="m.$edit=true;DataStore.termActive=i">{{m.nick}}</span>
<input *ngIf="m.$edit" [(ngModel)]="m.nick" autofocus (blur)="m.$edit=false" (keyup.enter)="m.$edit=false"/>
<a class="close" (click)="close(i)" onclick="this.parentElement.style.display='none';">x</a></li>
</ul>
</div>
<div id="term" style="width: 100%;height: 100%;">
<div id="term-0" [ngClass]="{'hidden':DataStore.termActive!=0}"></div>
<div *ngFor="let m of DataStore.term; let i = index" [ngClass]="{'hidden':i+1!=DataStore.termActive}"
id="term-{{i+1}}"></div>
</div>`,
directives: [NgClass, FORM_DIRECTIVES]
})
export class TermComponent {
DataStore = DataStore;
// portocol:string;
endpoint:string;
constructor(private _appService:AppService,
private _logger:Logger) {
this._logger.log('TermComponent.ts:TermComponent');
}
ngOnInit() {
//DataStore.term[0]["term"].open(document.getElementById("term-0"))
this.timer();
}
ngAfterViewInit() {
this._appService.TerminalConnect({});
//this._logger.debug("term width ", jQuery("#term").width());
//this._logger.debug("term height", jQuery("#term").height());
}
timer() {
if (DataStore.termlist.length > 0) {
for (var i in DataStore.termlist)
this._appService.TerminalConnect(DataStore.termlist[i]);
DataStore.termlist = []
}
jQuery(window).trigger('resize');
setTimeout(()=> {
this.timer()
}, 0)
}
close(i) {
this._logger.debug(i);
this._appService.TerminalDisconnect(i);
DataStore.term[i]["term"].destroy();
// delete DataStore.term.splice(i, 1)
}
dblclick() {
console.log(DataStore.term)
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -2,14 +2,14 @@
@font-face {
font-family: Roboto;
src: url('./fonts/roboto-light-webfont.ttf'), url('./fonts/roboto-light-webfont.eot');
src: url('fonts/roboto-light-webfont.ttf'), url('fonts/roboto-light-webfont.eot');
/* IE9+ */
font-weight: bold;
}
@font-face {
font-family: iosevka;
src: url('./fonts/iosevka-light.ttf');
src: url('fonts/iosevka-light.ttf');
font-weight: normal;
}
......
This diff is collapsed.
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'start' ]
2 info using npm@4.0.1
3 info using node@v4.3.1
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle bifrost@0.0.1~prestart: bifrost@0.0.1
6 silly lifecycle bifrost@0.0.1~prestart: no script for prestart, continuing
7 info lifecycle bifrost@0.0.1~start: bifrost@0.0.1
8 verbose lifecycle bifrost@0.0.1~start: unsafe-perm in lifecycle true
9 verbose lifecycle bifrost@0.0.1~start: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/zhouxiaoxia/workspace/sofia/jumpserver-web-terminal/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/zhouxiaoxia/Library/Python/2.7/bin/
10 verbose lifecycle bifrost@0.0.1~start: CWD: /Users/zhouxiaoxia/workspace/sofia/jumpserver-web-terminal
11 silly lifecycle bifrost@0.0.1~start: Args: [ '-c',
11 silly lifecycle 'grunt && tsc && concurrently "npm run tsc:w" "npm run lite" ' ]
12 silly lifecycle bifrost@0.0.1~start: Returned: code: 3 signal: null
13 info lifecycle bifrost@0.0.1~start: Failed to exec start script
14 verbose stack Error: bifrost@0.0.1 start: `grunt && tsc && concurrently "npm run tsc:w" "npm run lite" `
14 verbose stack Exit status 3
14 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:279:16)
14 verbose stack at emitTwo (events.js:87:13)
14 verbose stack at EventEmitter.emit (events.js:172:7)
14 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14)
14 verbose stack at emitTwo (events.js:87:13)
14 verbose stack at ChildProcess.emit (events.js:172:7)
14 verbose stack at maybeClose (internal/child_process.js:821:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
15 verbose pkgid bifrost@0.0.1
16 verbose cwd /Users/zhouxiaoxia/workspace/sofia/jumpserver-web-terminal
17 error Darwin 16.3.0
18 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "start"
19 error node v4.3.1
20 error npm v4.0.1
21 error code ELIFECYCLE
22 error bifrost@0.0.1 start: `grunt && tsc && concurrently "npm run tsc:w" "npm run lite" `
22 error Exit status 3
23 error Failed at the bifrost@0.0.1 start script 'grunt && tsc && concurrently "npm run tsc:w" "npm run lite" '.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the bifrost package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error grunt && tsc && concurrently "npm run tsc:w" "npm run lite"
23 error You can get information on how to open an issue for this project with:
23 error npm bugs bifrost
23 error Or if that isn't available, you can get their info via:
23 error npm owner ls bifrost
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]
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