Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
L
luna
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
luna
Commits
761d91a2
Commit
761d91a2
authored
Sep 27, 2017
by
i317280
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into security
parents
0284b6af
065f383e
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
38 additions
and
198 deletions
+38
-198
footer.component.ts
src/app/BasicPage/footer.component.ts
+1
-1
footer.html
src/app/BasicPage/footer.html
+0
-0
nav.component.ts
src/app/BasicPage/nav.component.ts
+1
-1
nav.html
src/app/BasicPage/nav.html
+0
-0
not-found.component.ts
src/app/BasicPage/not-found.component.ts
+0
-0
leftbar.component.ts
src/app/IndexPage/leftbar.component.ts
+1
-1
leftbar.html
src/app/IndexPage/leftbar.html
+0
-0
welcome.component.ts
src/app/IndexPage/welcome.component.ts
+1
-1
welcome.html
src/app/IndexPage/welcome.html
+0
-0
app-routing.module.ts
src/app/app-routing.module.ts
+3
-2
app.module.ts
src/app/app.module.ts
+7
-5
app.service.ts
src/app/app.service.ts
+24
-187
No files found.
src/app/footer.component.ts
→
src/app/
BasicPage/
footer.component.ts
View file @
761d91a2
...
...
@@ -5,7 +5,7 @@
import
{
Component
}
from
'@angular/core'
;
import
{
Logger
}
from
'angular2-logger/core'
;
import
{
AppService
,
DataStore
}
from
'./app.service'
;
import
{
AppService
,
DataStore
}
from
'.
.
/app.service'
;
@
Component
({
...
...
src/app/footer.html
→
src/app/
BasicPage/
footer.html
View file @
761d91a2
File moved
src/app/nav.component.ts
→
src/app/
BasicPage/
nav.component.ts
View file @
761d91a2
...
...
@@ -13,7 +13,7 @@ import {Logger} from 'angular2-logger/core';
// declare var layer: any;
import
{
AppService
,
DataStore
}
from
'./app.service'
;
import
{
AppService
,
DataStore
}
from
'.
.
/app.service'
;
//noinspection TypeScriptValidateTypes
...
...
src/app/nav.html
→
src/app/
BasicPage/
nav.html
View file @
761d91a2
File moved
src/app/not-found.component.ts
→
src/app/
BasicPage/
not-found.component.ts
View file @
761d91a2
File moved
src/app/leftbar.component.ts
→
src/app/
IndexPage/
leftbar.component.ts
View file @
761d91a2
...
...
@@ -5,7 +5,7 @@
import
{
Component
}
from
'@angular/core'
;
import
{
Logger
}
from
'angular2-logger/core'
;
import
{
AppService
,
DataStore
}
from
'./app.service'
;
import
{
AppService
,
DataStore
}
from
'.
.
/app.service'
;
//noinspection TypeScriptValidateTypes
...
...
src/app/leftbar.html
→
src/app/
IndexPage/
leftbar.html
View file @
761d91a2
File moved
src/app/welcome.component.ts
→
src/app/
IndexPage/
welcome.component.ts
View file @
761d91a2
...
...
@@ -2,7 +2,7 @@
* Created by liuzheng on 2017/8/31.
*/
import
{
Component
}
from
'@angular/core'
;
import
{
AppService
}
from
'./app.service'
;
import
{
AppService
}
from
'.
.
/app.service'
;
@
Component
({
templateUrl
:
'./welcome.html'
,
...
...
src/app/welcome.html
→
src/app/
IndexPage/
welcome.html
View file @
761d91a2
File moved
src/app/app-routing.module.ts
View file @
761d91a2
...
...
@@ -3,10 +3,11 @@
*/
import
{
NgModule
}
from
'@angular/core'
;
import
{
RouterModule
,
Routes
}
from
'@angular/router'
;
import
{
WelcomeComponent
}
from
'./welcome.component'
;
import
{
PageNotFoundComponent
}
from
'./not-found.component'
;
import
{
environment
}
from
'../environments/environment'
;
import
{
WelcomeComponent
}
from
'./IndexPage/welcome.component'
;
import
{
PageNotFoundComponent
}
from
'./BasicPage/not-found.component'
;
const
appRoutes
:
Routes
=
[
// { path: 'crisis-center', component: CrisisListComponent },
{
path
:
'welcome'
,
component
:
WelcomeComponent
},
// <-- delete this line
...
...
src/app/app.module.ts
View file @
761d91a2
...
...
@@ -12,11 +12,13 @@ import {AppRoutingModule} from './app-routing.module';
import
{
AppComponent
}
from
'./app.component'
;
import
{
WelcomeComponent
}
from
'./welcome.component'
;
import
{
NavComponent
}
from
'./nav.component'
;
import
{
FooterComponent
}
from
'./footer.component'
;
import
{
LeftbarComponent
}
from
'./leftbar.component'
;
import
{
PageNotFoundComponent
}
from
'./not-found.component'
;
import
{
NavComponent
}
from
'./BasicPage/nav.component'
;
import
{
PageNotFoundComponent
}
from
'./BasicPage/not-found.component'
;
import
{
FooterComponent
}
from
'./BasicPage/footer.component'
;
import
{
WelcomeComponent
}
from
'./IndexPage/welcome.component'
;
import
{
LeftbarComponent
}
from
'./IndexPage/leftbar.component'
;
@
NgModule
({
imports
:
[
...
...
src/app/app.service.ts
View file @
761d91a2
...
...
@@ -25,8 +25,14 @@ import * as io from 'socket.io-client';
// }
// }
export
class
Group
{
id
:
number
;
name
:
string
;
membercount
:
number
;
comment
:
string
;
}
export
class
User
{
export
let
User
:
{
id
:
number
;
name
:
string
;
username
:
string
;
...
...
@@ -38,56 +44,44 @@ export class User {
is_active
:
boolean
;
date_joined
:
string
;
last_login
:
string
;
groups
:
Array
<
string
>
;
}
export
class
Group
{
id
:
number
;
name
:
string
;
membercount
:
number
;
comment
:
string
;
}
groups
:
Array
<
Group
>
;
logined
:
boolean
;
}
=
{
id
:
0
,
name
:
'nobody'
,
username
:
''
,
password
:
''
,
phone
:
''
,
avatar
:
''
,
role
:
''
,
email
:
''
,
is_active
:
false
,
date_joined
:
''
,
last_login
:
''
,
groups
:
[],
logined
:
false
,
};
export
let
DataStore
:
{
socket
:
any
;
user
:
User
;
Nav
:
Array
<
{}
>
;
logined
:
boolean
;
lastNavigationAttempt
:
string
;
route
:
Array
<
{}
>
;
activenav
:
{};
Path
:
{};
error
:
{};
msg
:
{};
leftbar
:
string
;
leftbarrightclick
:
string
;
loglevel
:
number
;
term
:
Array
<
{}
>
;
termActive
:
number
;
leftbarhide
:
boolean
;
termlist
:
Array
<
string
>
;
windowsize
:
Array
<
number
>
;
}
=
{
socket
:
io
.
connect
(),
user
:
new
User
,
Nav
:
[{}],
logined
:
false
,
lastNavigationAttempt
:
''
,
route
:
[{}],
activenav
:
{},
Path
:
{},
error
:
{},
msg
:
{},
leftbar
:
'/api/leftbar'
,
leftbarrightclick
:
'/api/leftbarrightclick'
,
loglevel
:
0
,
term
:
[],
termActive
:
0
,
leftbarhide
:
false
,
termlist
:
[],
windowsize
:
[],
};
@
Injectable
()
export
class
AppService
{
// user:User = user ;
...
...
@@ -333,161 +327,4 @@ export class AppService {
// });
//
// }
//
// // getMachineList() {
// // this._logger.log('service.ts:AppService,getMachineList');
// // return this.http.get('/api/leftbar')
// // .map(res => res.json())
// // .subscribe(response => {
// // DataStore.leftbar = response;
// // this._logger.debug("DataStore.leftbar:", DataStore.leftbar)
// //
// // // this._logger.warn(this._dataStore.user);
// // // this._logger.warn(DataStore.user)
// // });
// // }
// //
// // getLeftbarRightclick() {
// // this._logger.log('service.ts:AppService,getLeftbarRightclick');
// // return this.http.get('/api/leftbarrightclick')
// // .map(res => res.json())
// // .subscribe(response => {
// // DataStore.leftbarrightclick = response;
// // this._logger.debug("DataStore.leftbarrightclick:", DataStore.leftbarrightclick)
// // // this._logger.warn(this._dataStore.user);
// // // this._logger.warn(DataStore.user)
// // });
// //
// // }
// TerminalConnect(uuid) {
// var socket = io.connect();
// var vm = this;
//
// if (Cookie.get('cols')) {
// var cols = Cookie.get('cols');
// } else {
// var cols = '80';
// Cookie.set('cols', cols, 99, '/', document.domain);
// }
// if (Cookie.get('rows')) {
// var rows = Cookie.get('rows');
// } else {
// var rows = '24';
// Cookie.set('rows', rows, 99, '/', document.domain);
// }
// var id = DataStore.term.push({
// 'machine': 'localhost',
// 'nick': 'localhost',
// 'connected': true,
// 'socket': socket
// }) - 1;
// DataStore.termActive = id;
// DataStore.term[id]['term'] = new Terminal({
// cols: cols,
// rows: rows,
// useStyle: true,
// screenKeys: true
// });
//
// DataStore.term[id]['term'].on('title', function (title) {
// document.title = title;
// });
//
// DataStore.term[id]['term'].open(document.getElementById('term-' + id));
//
// DataStore.term[id]['term'].write('\x1b[31mWelcome to Jumpserver!\x1b[m\r\n');
//
// socket.on('connect', function () {
// socket.emit('machine', uuid);
//
// DataStore.term[id]['term'].on('data', function (data) {
// socket.emit('data', data);
// });
//
//
// socket.on('data', function (data) {
// DataStore.term[id]['term'].write(data);
// });
//
// socket.on('disconnect', function () {
// vm.TerminalDisconnect(id);
// // DataStore.term[id]["term"].destroy();
// // DataStore.term[id]["connected"] = false;
// });
//
// window.onresize = function () {
// var col = Math.floor(jQuery('#term').width() / jQuery('#liuzheng').width() * 8) - 3;
// var row = Math.floor(jQuery('#term').height() / jQuery('#liuzheng').height()) - 3;
// if (Cookie.get('rows')) {
// var rows = parseInt(Cookie.get('rows'));
// } else {
// var rows = 24;
// }
// if (Cookie.get('cols')) {
// var cols = parseInt(Cookie.get('cols'));
// } else {
// var cols = 80;
// }
// if (col < 80) col = 80;
// if (row < 24) row = 24;
// if (cols == col && row == rows) {
// } else {
// for (var termid in DataStore.term) {
// DataStore.term[termid]['socket'].emit('resize', [col, row]);
// DataStore.term[termid]['term'].resize(col, row);
// }
// Cookie.set('cols', String(col), 99, '/', document.domain);
// Cookie.set('rows', String(row), 99, '/', document.domain);
// }
// };
// });
//
// }
//
// TerminalDisconnect(i) {
// DataStore.term[i]['connected'] = false;
// DataStore.term[i]['socket'].destroy();
// DataStore.term[i]['term'].write('\r\n\x1b[31mBye Bye!\x1b[m\r\n');
// }
//
// TerminalDisconnectAll() {
// for (var i in DataStore.term) {
// this.TerminalDisconnect(i);
// // DataStore.term[i]["connected"] = false;
// // DataStore.term[i]["socket"].destroy();
// // DataStore.term[i]["term"].write('\r\n\x1b[31mBye Bye!\x1b[m\r\n');
// }
// }
//
// Search(q) {
// if (this.searchrequest) {
// this.searchrequest.unsubscribe();
// }
// this.searchrequest = this.http.get('/api/search?q=' + q)
// .map(res => res.json())
// .subscribe(
// data => {
// this._logger.log(data);
// },
// err => {
// this._logger.error(err);
// },
// () => {
// }
// );
// this._logger.log(q);
// }
}
// }
//
// @Pipe({
// name: 'join'
// })
//
// export class Join {
// transform(value, args?) {
// if (typeof value === 'undefined')
// return 'undefined';
// return value.join(args)
// }
// }
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment