Unverified Commit e689e27d authored by liuzheng712's avatar liuzheng712

Merge branch 'dev' into test

parents 4e193d1e 54e9ae8a
......@@ -31,6 +31,8 @@
"../node_modules/jquery-sparkline/jquery.sparkline.js",
"../node_modules/tether/dist/js/tether.min.js",
"../node_modules/bootstrap/dist/js/bootstrap.min.js",
"assets/inspinia/inspinia.js",
"assets/slimscroll/jquery.slimscroll.min.js",
"../node_modules/xterm/dist/xterm.js"
],
"environmentSource": "environments/environment.ts",
......
/**
* Created by liuzheng on 7/17/16.
*/
var server = {};
var http = require('http');
var express = require('express');
var io = require('socket.io');
var pty = require('pty.js');
// var terminal = require('term.js');
var socket;
var term;
var buff = [];
server.run = function (options) {
// create shell process
term = pty.fork(
process.env.SHELL || 'sh',
[],
{
name: require('fs').existsSync('/usr/share/terminfo/x/xterm-256color')
? 'xterm-256color'
: 'xterm',
cols: 80,
rows: 24,
cwd: process.env.HOME
}
);
//
// // store term's output into buffer or emit through socket
term.on('data', function (data) {
return !socket ? buff.push(data) : socket.emit('data', data);
});
// console.log('Created shell with pty master/slave pair (master: %d, pid: %d)', term.fd, term.pid);
var app = express();
var server = http.createServer(app);
var apis = express.Router();
app.use("/", express.static(__dirname + '/dist/')); // 创建服务端
// app.use("/socket.io/", express.static(__dirname + '/api/')); // 创建服务端
// let term.js handle req/res
// app.use(terminal.middleware());
apis.route('/browser')
.post(function (req, res) {
// console.log(req);
// res.string('');
res.json({verified: true, csrf: "liuzheng"})
});
apis.route('/checklogin')
.post(function (req, res) {
res.json({logined: true, id: 1, username: "liuzheng", name: "liuzheng"})
})
.get(function (req, res) {
res.json({logined: true})
});
apis.route('/nav')
.get(function (req, res) {
res.json([{
"id": "File",
"name": "Server",
"children": [
{
"id": "NewConnection",
"href": "Aaaa",
"name": "New connection",
"disable": true
},
{
"id": "Connect",
"href": "Aaaa",
"name": "Connect",
"disable": true
},
{
"id": "Disconnect",
"click": "Disconnect",
"name": "Disconnect"
},
{
"id": "DisconnectAll",
"click": "DisconnectAll",
"name": "Disconnect all"
},
{
"id": "Duplicate",
"href": "Aaaa",
"name": "Duplicate",
"disable": true
},
{
"id": "Upload",
"href": "Aaaa",
"name": "Upload",
"disable": true
},
{
"id": "Download",
"href": "Aaaa",
"name": "Download",
"disable": true
},
{
"id": " Search",
"href": "Aaaa",
"name": "Search",
"disable": true
},
{
"id": "Reload",
"click": "ReloadLeftbar",
"name": "Reload"
}
]
}, {
"id": "View",
"name": "View",
"children": [
{
"id": "HindLeftManager",
"click": "HideLeft",
"name": "Hind left manager"
},
{
"id": "SplitVertical",
"href": "Aaaa",
"name": "Split vertical",
"disable": true
},
{
"id": "CommandBar",
"href": "Aaaa",
"name": "Command bar",
"disable": true
},
{
"id": "ShareSession",
"href": "Aaaa",
"name": "Share session (read/write)",
"disable": true
},
{
"id": "Language",
"href": "Aaaa",
"name": "Language",
"disable": true
}]
}, {
"id": "Help",
"name": "Help",
"children": [
{
"id": "EnterLicense",
"click": "EnterLicense",
"name": "Enter License"
},
{
"id": "Website",
"click": "Website",
"name": "Website"
},
{
"id": "BBS",
"click": "BBS",
"name": "BBS"
}]
}])
});
apis.route('/replay')
.get(function (req, res) {
res.json({
"type": "json"
})
});
apis.route('/perms/v1/user/my/asset-groups-assets/')
.get(function (req, res) {
res.json([
{
"id": 0,
"name": "ungrouped",
"assets": []
},
{
"id": 1,
"name": "Default",
"comment": "Default asset group",
"assets": [
{
"id": 2,
"hostname": "192.168.1.6",
"ip": "192.168.2.6",
"port": 22,
"system": "windows",
"system_users": [
{
"id": 1,
"name": "web",
"username": "web",
"protocol": "ssh",
"auth_method": "P",
"auto_push": true
}
]
},
{
"id": 4,
"hostname": "testserver123",
"ip": "123.57.183.135",
"port": 8022,
"system": "linux",
"system_users": [
{
"id": 1,
"name": "web",
"username": "web",
"protocol": "ssh",
"auth_method": "P",
"auto_push": true
}
]
}
]
},
{
"id": 4,
"name": "java",
"comment": "",
"assets": [
{
"id": 2,
"hostname": "192.168.1.6",
"ip": "192.168.2.6",
"port": 22,
"system_users": [
{
"id": 1,
"name": "web",
"username": "web",
"protocol": "ssh",
"auth_method": "P",
"auto_push": true
}
]
}
]
},
{
"id": 3,
"name": "数据库",
"comment": "",
"assets": [
{
"id": 2,
"hostname": "192.168.1.6",
"ip": "192.168.2.6",
"port": 22,
"system_users": [
{
"id": 1,
"name": "web",
"username": "web",
"protocol": "ssh",
"auth_method": "P",
"auto_push": true
}
]
}
]
},
{
"id": 2,
"name": "运维组",
"comment": "",
"assets": [
{
"id": 2,
"hostname": "192.168.1.6",
"ip": "192.168.2.6",
"port": 22,
"system_users": [
{
"id": 1,
"name": "web",
"username": "web",
"protocol": "ssh",
"auth_method": "P",
"auto_push": true
}
]
}
]
}
])
});
app.use("/api", apis);
// let server listen on the port
options = options || {};
server.listen(options.port || 3000);
// let socket.io handle sockets
io = io.listen(server, {log: false});
io.sockets.on('connection', function (s) {
// when connect, store the socket
socket = s;
// handme incoming data (client -> server)
socket.on('data', function (data) {
term.write(data);
});
socket.on('resize', function (data) {
term.resize(data[0], data[1]);
console.log(data)
});
// handle connection lost
socket.on('disconnect', function () {
socket = null;
});
// send buffer data to client
while (buff.length) {
socket.emit('data', buff.shift());
}
});
};
server.run({port: 3000});
console.log('Please open your browser with http://127.0.0.1:3000');
{
"reset": "重置",
"submit": "提交",
"email subject prefix": "邮件主题前缀",
"basic setting": "基本设置",
"email setting": "邮件设置",
"ldap setting": "LDAP设置",
"terminal setting": "终端设置",
"current site url": "当前站点URL",
"user guide url": "用户向导URL",
"user first login update profile done redirect to it": "用户第一次登录,修改profile后重定向到地址",
"server": "服务器",
"view": "视图",
"help": "帮助",
"hide left manager": "隐藏左边栏",
"show left manager": "显示左边栏",
"disconnect all": "断开所有链接",
"disconnect": "断开链接",
"website": "我们的网站",
"search": "搜索",
"settings": "系统设置",
"job center": "作业中心",
"sessions": "会话管理",
"perms": "权限管理",
"assets": "资产管理",
"users": "用户管理",
"dashboard": "仪表盘",
"task": "任务",
"session online": "在线会话",
"session offline": "离线会话",
"commands": "命令记录",
"terminal": "终端管理",
"asset perminssion": "资产授权",
"asset": "资产",
"asset group": "资产组",
"cluster": "集群",
"admin user": "管理用户",
"system user": "系统用户",
"labels": "标签管理",
"user": "用户",
"user group": "用户组",
"login logs": "登陆日志"
}
#!/usr/bin/env python3
from flask import Flask, send_from_directory, render_template, request, jsonify, redirect, url_for
from flask import Flask, send_from_directory, render_template, request, jsonify, redirect, send_file
from flask_socketio import SocketIO, Namespace, emit, join_room, leave_room
import paramiko
import uuid
......@@ -85,7 +85,7 @@ class SSHws(Namespace):
join_room(room)
def on_token(self, token):
print(token)
self.on_host(token)
def on_disconnect(self):
print("disconnect")
......@@ -115,7 +115,7 @@ def index():
return render_template('index.html')
@app.route('/api/perms/v1/user/my/asset-groups-assets/')
@app.route('/api/perms/v1/user/nodes-assets/')
def asset_groups_assets():
assets = [
{
......@@ -233,6 +233,16 @@ def replay():
return redirect("http://jps.ilz.me/media/2017-12-24/ec87a486-0344-4f12-b27a-620321944f7f.gz")
@app.route('/i18n/<i18n>')
def i18n(i18n):
return send_file('./i18n/' + i18n + '.json')
def read_file(filename, charset='utf-8'):
with open(filename, 'r') as f:
return f.read().decode(charset)
if __name__ == '__main__':
socketio = SocketIO(app)
socketio.on_namespace(SSHws('/ssh'))
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -13,7 +13,7 @@
"private": true,
"dependencies": {
"@angular/animations": "^5.2.0",
"@angular/cdk": "^5.1.1",
"@angular/cdk": "^5.2.0",
"@angular/common": "5.2.0",
"@angular/compiler": "5.2.0",
"@angular/core": "5.2.0",
......@@ -23,6 +23,7 @@
"@angular/platform-browser": "5.2.0",
"@angular/platform-browser-dynamic": "5.2.0",
"@angular/router": "5.2.0",
"@swimlane/ngx-datatable": "^11.1.7",
"animate.css": "^3.5.2",
"body-parser": "^1.18.2",
"bootstrap": "^4.0.0-beta.3",
......@@ -39,18 +40,18 @@
"jquery-slimscroll": "^1.3.8",
"jquery-sparkline": "^2.4.0",
"jvectormap": "1.2.2",
"lodash": "^4.17.5",
"material-design-icons": "^3.0.1",
"materialize-css": "^0.100.2",
"metismenu": "^2.5.0",
"mstsc.js": "^0.2.4",
"ng2-charts": "^1.5.0",
"ng2-cookies": "^1.0.12",
"ngx-bootstrap": "^1.6.6",
"ngx-cookie-service": "^1.0.10",
"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",
"npm": "^5.6.0",
"npm-font-open-sans": "^1.1.0",
"peity": "^3.2.1",
"popper.js": "1.12.9",
......@@ -70,12 +71,10 @@
"@angular-devkit/core": "0.0.28",
"@angular-devkit/schematics": "0.0.42",
"@angular/cli": "^1.6.5",
"@types/jasminewd2": "~2.0.2",
"node-sass": "^4.7.2",
"@angular/compiler-cli": "5.2.0",
"@angular/language-service": "5.2.0",
"@types/jasmine": "2.8.4",
"@types/node": "9.3.0",
"@types/jasminewd2": "~2.0.2",
"codelyzer": "4.0.2",
"jasmine-core": "2.8.0",
"jasmine-spec-reporter": "4.2.1",
......@@ -85,6 +84,7 @@
"karma-coverage-istanbul-reporter": "1.3.3",
"karma-jasmine": "1.1.1",
"karma-jasmine-html-reporter": "0.2.2",
"node-sass": "^4.7.2",
"protractor": "5.2.2",
"ts-node": "3.3.0",
"tslint": "5.9.1",
......
......@@ -3,6 +3,10 @@
"target": "http://127.0.0.1:5000",
"secure": false
},
"/i18n": {
"target": "http://127.0.0.1:5000",
"secure": false
},
"/socket.io/": {
"target": "http://127.0.0.1:5000",
"secure": false
......
......@@ -78,3 +78,10 @@ label {
.fa.fa-undefined:before {
content: "\f26c";
}
.overflow {
height: 100%;
overflow-y: scroll;
position: absolute;
width: 100%;
}
......@@ -4,19 +4,23 @@
title="Search"
type="text" tabindex="1" spellcheck="false" autofocus [(ngModel)]="q" (keyup.enter)="Search(q)">
</div>
<ul class="filetree">
<li *ngFor="let hostGroup of HostGroups | SearchFilter: q; let i = index ">
<input type="checkbox" id="hostgroup-{{i}}">
<label for="hostgroup-{{i}}" matTooltip="{{hostGroup.name}}" [matTooltipPosition]="TooltipPosition">{{hostGroup.name}}</label>
<ul [ngClass]="{'insearch': q }">
<li *ngFor="let host of hostGroup.assets_granted | SearchFilter: q" (click)="Connect(host)"
(contextmenu)="onRightClick($event)" matTooltip="{{host.hostname}}" [matTooltipPosition]="TooltipPosition">
<i class="fa" [ngClass]="'fa-'+(host.platform||'undefined').toLowerCase()" id="fa-{{i}}"></i>
{{host.hostname}}
</li>
</ul>
</li>
</ul>
<div class="overflow">
<ul class="filetree">
<li *ngFor="let hostGroup of HostGroups | SearchFilter: q; let i = index ">
<input type="checkbox" id="hostgroup-{{i}}">
<label for="hostgroup-{{i}}" matTooltip="{{hostGroup.name}}" [matTooltipPosition]="TooltipPosition">{{hostGroup.name}}</label>
<ul [ngClass]="{'insearch': q }">
<li *ngFor="let host of hostGroup.assets_granted | SearchFilter: q" (click)="Connect(host)"
(contextmenu)="onRightClick($event)" matTooltip="{{host.hostname}}"
[matTooltipPosition]="TooltipPosition">
<i class="fa" [ngClass]="'fa-'+(host.platform||'undefined').toLowerCase()" id="fa-{{i}}"></i>
{{host.hostname}}
</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="footer">
Version <strong>{{version}}</strong>
......
......@@ -12,13 +12,11 @@ import {AppService, HttpService, LogService} from '../../app.service';
import {SearchComponent} from '../search/search.component';
import {DataStore} from '../../globals';
import {version} from '../../../environments/environment';
import * as jQuery from 'jquery/dist/jquery.min.js';
import {ElementServerMenuComponent} from '../../elements/server-menu/server-menu.component';
import {NavList, View} from '../control/control.component';
import {MAT_DIALOG_DATA, MatDialog, MatDialogRef} from '@angular/material';
import {logger} from 'codelyzer/util/logger';
import {selector} from 'rxjs/operator/publish';
import {FormControl, Validators} from '@angular/forms';
import {DialogService} from '../../elements/dialog/dialog.service';
export interface HostGroup {
......@@ -56,7 +54,7 @@ export class CleftbarComponent implements OnInit {
DataStore.leftbarshow = false;
DataStore.Nav.map(function (value, i) {
value['children'].forEach((v, key) => {
if (DataStore.Nav[i]['children'][key]['id'] === 'HindLeftManager') {
if (DataStore.Nav[i]['children'][key]['id'] === 'HideLeftManager') {
DataStore.Nav[i]['children'][key] = {
'id': 'ShowLeftManager',
'click': 'ShowLeft',
......@@ -73,9 +71,9 @@ export class CleftbarComponent implements OnInit {
value['children'].forEach((v, key) => {
if (DataStore.Nav[i]['children'][key]['id'] === 'ShowLeftManager') {
DataStore.Nav[i]['children'][key] = {
'id': 'HindLeftManager',
'id': 'HideLeftManager',
'click': 'HideLeft',
'name': 'Hind left manager'
'name': 'Hide left manager'
};
}
});
......@@ -87,7 +85,8 @@ export class CleftbarComponent implements OnInit {
private _search: SearchComponent,
private _logger: LogService,
private _menu: ElementServerMenuComponent,
public _dialog: MatDialog) {
public _dialog: MatDialog,
private _layer: DialogService) {
this._logger.log('nav.ts:NavComponent');
// this._appService.getnav()
}
......@@ -96,25 +95,43 @@ export class CleftbarComponent implements OnInit {
this._http.get_my_asset_groups_assets()
.subscribe(response => {
this.HostGroups = response;
this.autologin();
if (!DataStore.autologin) {
this.autologin();
}
});
}
autologin() {
const id = this._appService.getQueryString('id');
if (id) {
const asset_id = this._appService.getQueryString('asset_id');
const user_id = this._appService.getQueryString('user_id');
let tag = false;
if (asset_id) {
for (let g of this.HostGroups) {
if (g['assets_granted']) {
g['assets_granted'].forEach((v, k) => {
if (v.id.toSource() === id.toString()) {
this.Connect(v);
return;
for (let host of g['assets_granted']) {
if (host.id.toString() === asset_id) {
if (user_id) {
host['system_users_granted'].forEach((user, kk) => {
if (user.id.toString() === user_id.toString()) {
this.login(host, user);
tag = true;
return;
}
});
} else {
this.Connect(host);
tag = true;
return;
}
}
});
}
}
}
if (!tag) {
this._layer.alert('Maybe you do not have permission on that host');
}
}
DataStore.autologin = true;
}
Connect(host) {
......@@ -125,7 +142,7 @@ export class CleftbarComponent implements OnInit {
if (user) {
this.login(host, user);
} else {
const dialogRef = this._dialog.open(CleftbarComponentDialog, {
const dialogRef = this._dialog.open(CleftbarDialogComponent, {
height: '200px',
width: '300px',
data: {users: host.system_users_granted}
......@@ -169,7 +186,7 @@ export class CleftbarComponent implements OnInit {
}
checkPriority(sysUsers) {
let priority: number = -1;
let priority = -1;
let user: any;
for (const u of sysUsers) {
if (u.priority > priority) {
......@@ -199,11 +216,11 @@ export class CleftbarComponent implements OnInit {
selector: 'app-cleftbar-dialog',
templateUrl: 'dialog.html',
})
export class CleftbarComponentDialog implements OnInit {
export class CleftbarDialogComponent implements OnInit {
UserSelectControl = new FormControl('', [Validators.required]);
selected: any;
constructor(public dialogRef: MatDialogRef<CleftbarComponentDialog>,
constructor(public dialogRef: MatDialogRef<CleftbarDialogComponent>,
@Inject(MAT_DIALOG_DATA) public data: any,
private _logger: LogService) {
}
......
......@@ -19,6 +19,7 @@ import {TermPageComponent} from './term-page/term-page.component';
import {ElementServerMenuComponent} from './elements/server-menu/server-menu.component';
import {BlankPageComponent} from './blank-page/blank-page.component';
import {TestPageComponent} from './test-page/test-page.component';
import {SettingPageComponent} from './setting-page/setting-page.component';
const appRoutes: Routes = [
// {path: 'users/login', component: LoginComponent},
......@@ -27,6 +28,7 @@ const appRoutes: Routes = [
{path: 'replay/:token', component: ReplayPageComponent},
{path: 'monitor/:token', component: MonitorPageComponent},
{path: 'test', component: TestPageComponent},
{path: 'setting', component: SettingPageComponent},
{path: 'undefined', component: BlankPageComponent},
{path: '', component: ControlPageComponent},
{path: '**', component: NotFoundComponent}
......
......@@ -6,14 +6,12 @@
* @author liuzheng <liuzheng712@gmail.com>
*/
import {Component} from '@angular/core';
import {AppService, HttpService} from './app.service';
import {DataStore} from './globals';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
// directives: [LeftbarComponent, TermComponent]
})
export class AppComponent {
......
......@@ -17,8 +17,8 @@ import {AppComponent} from './app.component';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
// service
import {AppService, HttpService, LogService, UUIDService} from './app.service';
import {DialogService} from './elements/dialog/dialog.service';
import {AppService, HttpService, LocalStorageService, LogService, UUIDService} from './app.service';
import {DialogService, ElementDialogAlertComponent} from './elements/dialog/dialog.service';
// Elements
import {ElementFooterComponent} from './elements/footer/footer.component';
......@@ -33,7 +33,7 @@ import {ElementIframeComponent} from './elements/iframe/iframe.component';
import {LoginComponent} from './BasicPage/login/login.component';
import {IleftbarComponent} from './IndexPage/ileftbar/ileftbar.component';
import {SearchComponent, SearchFilter} from './ControlPage/search/search.component';
import {CleftbarComponent, CleftbarComponentDialog} from './ControlPage/cleftbar/cleftbar.component';
import {CleftbarComponent, CleftbarDialogComponent} from './ControlPage/cleftbar/cleftbar.component';
import {ControlComponent} from './ControlPage/control/control.component';
import {ControlnavComponent} from './ControlPage/control/controlnav/controlnav.component';
import {ControlPageComponent} from './ControlPage/controlpage.component';
......@@ -49,9 +49,22 @@ import {MonitorPageComponent} from './monitor-page/monitor-page.component';
import {LinuxComponent} from './monitor-page/linux/linux.component';
import {WindowsComponent} from './monitor-page/windows/windows.component';
import {NgProgressModule} from 'ngx-progressbar';
import {TestPageComponent, TestPageComponentDialog} from './test-page/test-page.component';
import {TestPageComponent} from './test-page/test-page.component';
import {BlankPageComponent} from './blank-page/blank-page.component';
import {MaterialModule} from './MaterialModule.component';
import {CookieService} from 'ngx-cookie-service';
import {NgxDatatableModule} from '@swimlane/ngx-datatable';
import {ElementTableComponent} from './elements/table/table.component';
import {SettingPageComponent} from './setting-page/setting-page.component';
import {ElementLeftbarComponent} from './elements/leftbar/leftbar.component';
import {ElementOfooterComponent} from './elements/ofooter/ofooter.component';
import {SettingPageBasicComponent} from './setting-page/basic/basic.component';
import {SettingPageEmailComponent} from './setting-page/email/email.component';
import {SettingPageLdapComponent} from './setting-page/ldap/ldap.component';
import {SettingPageTerminalComponent} from './setting-page/terminal/terminal.component';
import {SettingPageS3Component} from './setting-page/s3/s3.component';
import {TransPipe} from './trans.pipe';
import {MAT_LABEL_GLOBAL_OPTIONS} from '@angular/material';
@NgModule({
imports: [
......@@ -64,7 +77,7 @@ import {MaterialModule} from './MaterialModule.component';
ReactiveFormsModule,
MaterialModule,
LoggerModule.forRoot({serverLoggingUrl: '/api/logs', level: NgxLoggerLevel.DEBUG, serverLogLevel: NgxLoggerLevel.ERROR}),
// NgxLayerModule
NgxDatatableModule
],
declarations: [
AppComponent,
......@@ -76,11 +89,15 @@ import {MaterialModule} from './MaterialModule.component';
ElementRdpComponent,
ElementServerMenuComponent,
ElementIframeComponent,
ElementDialogAlertComponent,
ElementTableComponent,
ElementLeftbarComponent,
ElementOfooterComponent,
LoginComponent,
SearchComponent,
SearchFilter,
IleftbarComponent,
CleftbarComponent, CleftbarComponentDialog,
CleftbarComponent, CleftbarDialogComponent,
ControlComponent,
ControlnavComponent,
ControlPageComponent,
......@@ -95,12 +112,19 @@ import {MaterialModule} from './MaterialModule.component';
MonitorPageComponent,
LinuxComponent,
WindowsComponent,
TestPageComponent, TestPageComponentDialog,
TestPageComponent,
BlankPageComponent,
SettingPageComponent,
SettingPageBasicComponent,
SettingPageEmailComponent,
SettingPageLdapComponent,
SettingPageTerminalComponent,
SettingPageS3Component,
TransPipe,
],
entryComponents: [
CleftbarComponentDialog,
TestPageComponentDialog
CleftbarDialogComponent,
ElementDialogAlertComponent,
],
bootstrap: [AppComponent],
providers: [
......@@ -110,8 +134,12 @@ import {MaterialModule} from './MaterialModule.component';
HttpService,
LogService,
UUIDService,
LocalStorageService,
DialogService,
NGXLogger
CookieService,
NGXLogger,
{provide: MAT_LABEL_GLOBAL_OPTIONS, useValue: {float: 'always'}}
]
})
export class AppModule {
......
......@@ -7,10 +7,10 @@
*/
import {Injectable, OnInit} from '@angular/core';
import {Router} from '@angular/router';
// import {Cookie} from 'ng2-cookies/ng2-cookies';
import {CookieService} from 'ngx-cookie-service';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/catch';
import {DataStore, User, Browser} from './globals';
import {DataStore, User, Browser, i18n} from './globals';
import {environment} from '../environments/environment';
import {HttpClient, HttpHeaders, HttpParams} from '@angular/common/http';
import {NGXLogger} from 'ngx-logger';
......@@ -67,7 +67,7 @@ export class HttpService {
}
get_my_asset_groups_assets() {
return this.http.get<Array<HostGroup>>('/api/perms/v1/user/my/asset-groups-assets/');
return this.http.get<Array<HostGroup>>('/api/perms/v1/user/nodes-assets/');
}
get_guacamole_token(username: string, assetID: string, systemUserID: string) {
......@@ -76,7 +76,9 @@ export class HttpService {
.set('password', 'jumpserver')
.set('asset_id', assetID)
.set('system_user_id', systemUserID);
return this.http.post('/guacamole/api/tokens', body.toString(), {headers: new HttpHeaders().set('Content-Type', 'application/x-www-form-urlencoded')});
return this.http.post('/guacamole/api/tokens',
body.toString(),
{headers: new HttpHeaders().set('Content-Type', 'application/x-www-form-urlencoded')});
}
search(q: string) {
......@@ -135,37 +137,76 @@ export class LogService {
}
@Injectable()
export class LocalStorageService {
constructor() {
}
get(key: string): string {
return localStorage.getItem(key);
}
set(key: string, value: any) {
return localStorage.setItem(key, value);
}
}
@Injectable()
export class AppService implements OnInit {
// user:User = user ;
lang: string;
constructor(private _http: HttpService,
private _router: Router,
private _logger: LogService) {
// if (Cookie.get('loglevel')) {
// // 0.- Level.OFF
// // 1.- Level.ERROR
// // 2.- Level.WARN
// // 3.- Level.INFO
// // 4.- Level.DEBUG
// // 5.- Level.LOG
// this._logger.level = parseInt(Cookie.get('loglevel'), 10);
// // this._logger.debug('Your debug stuff');
// // this._logger.info('An info');
// // this._logger.warn('Take care ');
// // this._logger.error('Too late !');
// // this._logger.log('log !');
// } else {
// Cookie.set('loglevel', '0', 99, '/', document.domain);
// // this._logger.level = parseInt(Cookie.getCookie('loglevel'));
// this._logger.level = 0;
// }
private _logger: LogService,
private _cookie: CookieService,
private _localStorage: LocalStorageService) {
if (this._cookie.get('loglevel')) {
// 0.- Level.OFF
// 1.- Level.ERROR
// 2.- Level.WARN
// 3.- Level.INFO
// 4.- Level.DEBUG
// 5.- Level.LOG
this._logger.level = parseInt(this._cookie.get('loglevel'), 10);
// this._logger.debug('Your debug stuff');
// this._logger.info('An info');
// this._logger.warn('Take care ');
// this._logger.error('Too late !');
// this._logger.log('log !');
} else {
this._cookie.set('loglevel', '0', 99, '/', document.domain);
// this._logger.level = parseInt(Cookie.getCookie('loglevel'));
this._logger.level = 0;
}
if (environment.production) {
this._logger.level = 2;
this.checklogin();
}
// this._logger
// .debug(this._http.get_user_profile());
if (this._cookie.get('lang')) {
this.lang = this._cookie.get('lang');
} else {
this.lang = window.navigator.languages ? window.navigator.languages[0] : 'cn';
this._cookie.set('lang', this.lang);
}
if (this.lang !== 'en') {
this._http.get('/i18n/' + this.lang).subscribe(
data => {
this._localStorage.set('lang', JSON.stringify(data));
}
);
}
const l = this._localStorage.get('lang');
if (l) {
const data = JSON.parse(l);
Object.keys(data).forEach((k, _) => {
i18n.set(k, data[k]);
});
}
}
ngOnInit() {
......@@ -252,7 +293,7 @@ export class AppService implements OnInit {
//
// DataStore.Nav.map(function (value, i) {
// for (var ii in value['children']) {
// if (DataStore.Nav[i]['children'][ii]['id'] === 'HindLeftManager') {
// if (DataStore.Nav[i]['children'][ii]['id'] === 'HideLeftManager') {
// DataStore.Nav[i]['children'][ii] = {
// 'id': 'ShowLeftManager',
// 'click': 'ShowLeft',
......@@ -271,9 +312,9 @@ export class AppService implements OnInit {
// for (var ii in value['children']) {
// if (DataStore.Nav[i]['children'][ii]['id'] === 'ShowLeftManager') {
// DataStore.Nav[i]['children'][ii] = {
// 'id': 'HindLeftManager',
// 'id': 'HideLeftManager',
// 'click': 'HideLeft',
// 'name': 'Hind left manager'
// 'name': 'Hide left manager'
// };
// }
// }
......@@ -374,3 +415,4 @@ export class UUIDService {
return UUID.create()['hex'];
}
}
<div class="alert">
<h1 mat-dialog-title>Alert</h1>
<p>{{data.msg}}</p>
<button mat-raised-button (click)="onNoClick()">Close</button>
</div>
h1 {
border-bottom: 1px solid #eee;
width: 100%;
}
button {
float: right;
bottom: 0;
}
.alert {
height: 100%;
}
import {Injectable} from '@angular/core';
import {Component, Inject, Injectable, OnInit} from '@angular/core';
import {MAT_DIALOG_DATA, MatDialog, MatDialogRef} from '@angular/material';
import {LogService} from '../../app.service';
import {FormControl, Validators} from '@angular/forms';
// import * as layer from 'layui-layer/src/layer.js';
@Injectable()
export class DialogService {
constructor() {
constructor(public _dialog: MatDialog) {
}
open(options: any) {
......@@ -24,11 +28,33 @@ export class DialogService {
loading() {
}
alert() {
// alert('sss');
alert(msg: string) {
this._dialog.open(ElementDialogAlertComponent, {
height: '200px',
width: '300px',
data: {msg: msg}
});
}
close(index: any) {
// layer.close(index);
}
}
@Component({
selector: 'app-alert',
templateUrl: 'alert.html',
styleUrls: ['./alert.scss']
})
export class ElementDialogAlertComponent {
constructor(public dialogRef: MatDialogRef<ElementDialogAlertComponent>,
@Inject(MAT_DIALOG_DATA) public data: any,
private _logger: LogService) {
}
onNoClick(): void {
this.dialogRef.close();
}
}
This diff is collapsed.
<mat-sidenav-container>
<mat-sidenav #sidenav mode="side" opened="true" class="example-sidenav"
[fixedInViewport]="options.value.fixed" [fixedTopGap]="options.value.top"
[fixedBottomGap]="options.value.bottom">
<nav>
<div class="header">
<a href="http://www.jumpserver.org" target="_blank">
<img alt="image" height="55" src="/static/imgs/logo-text.png" style="margin-left: 10px">
</a>
</div>
<div class="body">
<ul class="nav metismenu nav-frist-level">
<li *ngFor="let bar of leftbar;let i = index" [ngClass]="{'active':i==active}">
<a (click)="gotoLink(bar.link,i,-1)">
<i class="{{bar.class}}"></i>
<span class="nav-label">{{bar.name|trans}}</span>
<span class="{{bar.label}}"></span>
</a>
<ul class="nav nav-second-level collapse">
<li *ngFor="let child of bar.child;let ii = index" [ngClass]="{'active':ii==active2}">
<a (click)="gotoLink(child.link,i,ii)">{{child.name|trans}}</a>
</li>
</ul>
</li>
</ul>
</div>
</nav>
</mat-sidenav>
<div class="navbar-header">
<button class="navbar-minimalize minimalize-styl-2 btn btn-primary " (click)="sidenav.toggle()"><i
class="fa fa-bars"></i></button>
</div>
</mat-sidenav-container>
li a {
background-color: rgba(0, 0, 0, 0);
box-sizing: border-box;
color: rgb(167, 177, 194);
cursor: pointer;
display: block;
font-family: "open sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 13px;
font-weight: 600;
height: 46px;
line-height: 18.5714px;
list-style-image: none;
list-style-position: outside;
list-style-type: none;
padding-bottom: 14px;
padding-left: 25px;
padding-right: 20px;
padding-top: 14px;
position: relative;
text-align: left;
text-decoration-color: rgb(167, 177, 194);
text-decoration-line: none;
text-decoration-style: solid;
text-size-adjust: 100%;
width: 220px;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
li.active > a {
width: 216px;
color: white;
}
li.active ul.nav.nav-second-level li {;
border-bottom-style: none;
border-bottom-width: 0px;
box-sizing: border-box;
color: rgb(103, 106, 108);
display: block;
font-family: "open sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 13px;
height: 32px;
line-height: 18.5714px;
list-style-image: none;
list-style-position: outside;
list-style-type: none;
position: relative;
text-align: left;
text-size-adjust: 100%;
visibility: visible;
width: 216px;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
li.active ul.nav.nav-second-level {
box-sizing: border-box;
color: rgb(103, 106, 108);
display: block;
font-family: "open sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 13px;
line-height: 18.5714px;
list-style-image: none;
list-style-position: outside;
list-style-type: none;
margin-bottom: 0px;
margin-top: 0px;
padding-left: 0px;
text-align: left;
text-size-adjust: 100%;
visibility: visible;
width: 216px;
-webkit-margin-after: 0px;
-webkit-margin-before: 0px;
-webkit-margin-end: 0px;
-webkit-margin-start: 0px;
-webkit-padding-start: 0px;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
mat-sidenav {
background-color: #2f4050;
}
nav {
width: 220px;
font-family: "open sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 13px;
}
div.header {
background-color: #202c37;
}
div.body {
background-color: #2f4050;
height: 100%;
}
li:hover {
color: white !important;
}
.nav-second-level li a {
padding: 7px 10px 7px 52px;
}
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ElementLeftbarComponent } from './leftbar.component';
describe('ElementLeftbarComponent', () => {
let component: ElementLeftbarComponent;
let fixture: ComponentFixture<ElementLeftbarComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ElementLeftbarComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ElementLeftbarComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import {Component, OnInit} from '@angular/core';
import {FormBuilder, FormGroup} from '@angular/forms';
import {Router} from '@angular/router';
@Component({
selector: 'app-element-leftbar',
templateUrl: './leftbar.component.html',
styleUrls: ['./leftbar.component.scss']
})
export class ElementLeftbarComponent implements OnInit {
leftbar = [
{
'name': 'Dashboard',
'class': 'fa fa-dashboard',
'label': '',
'link': '/'
},
{
'name': 'Users',
'class': 'fa fa-group',
'label': 'fa arrow',
'child': [
{
'name': 'User',
}, {
'name': 'User group',
}, {
'name': 'Login logs',
}
]
},
{
'name': 'Assets',
'class': 'fa fa-inbox',
'label': 'fa arrow',
'child': [
{
'name': 'Asset',
}, {
'name': 'Asset group',
}, {
'name': 'Cluster',
}, {
'name': 'Admin user',
}, {
'name': 'System user',
}, {
'name': 'Labels',
}
]
},
{
'name': 'Perms',
'class': 'fa fa-edit',
'label': 'fa arrow',
'child': [{'name': 'Asset permission'}]
},
{
'name': 'Sessions',
'class': 'fa fa-rocket',
'label': 'fa arrow',
'child': [
{
'name': 'Session online'
},
{
'name': 'Session offline'
},
{
'name': 'Commands'
},
{
'name': 'Terminal'
},
]
},
{
'name': 'Job Center',
'class': 'fa fa-coffee',
'label': 'fa arrow',
'child': [
{
'name': 'Task',
'link': '/task'
},
]
},
{
'name': 'Settings',
'class': 'fa fa-gears',
'label': '',
'link': '/luna/setting'
},
];
options: FormGroup;
active: number;
active2: number;
constructor(fb: FormBuilder,
private _router: Router) {
this.options = fb.group({
'fixed': true,
'top': 0,
'bottom': 0,
});
}
ngOnInit() {
this.active = 6;
this.active2 = 0;
}
gotoLink(link: string, index: number, index2: number) {
if (link) {
if (link === '/luna/setting') {
this._router.navigate(['setting']);
} else {
window.location.href = link;
}
}
this.active = index;
this.active2 = index2;
}
}
<script src="../../trans.pipe.spec.ts"></script>
<div class="nav">
<ul>
<li><a [routerLink]="['']"><img src="static/imgs/logo.png" height="26px"/></a>
</li>
<li *ngFor="let v of DataStore.Nav" [ngClass]="{'dropdown': v.children}">
<a>{{v.name}}</a>
<a>{{v.name | trans}}</a>
<ul [ngClass]="{'dropdown-content': v.children}">
<li *ngFor="let vv of v.children" [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>
<a *ngIf="vv.href" [routerLink]="[vv.href]">{{vv.name|trans}}</a>
<a id="{{vv.id}}" *ngIf="vv.click" (click)="click(vv.click)">{{vv.name|trans}}</a>
</li>
</ul>
</li>
......
......@@ -181,9 +181,9 @@ export class ElementNavComponent implements OnInit {
'name': 'View',
'children': [
{
'id': 'HindLeftManager',
'id': 'HideLeftManager',
'click': 'HideLeft',
'name': 'Hind left manager'
'name': 'Hide left manager'
},
{
'id': 'SplitVertical',
......
<div class="footer fixed">
<div class="pull-right">
Version <strong>{{version}}</strong> GPLv2.
<img style="display: none" src="http://www.jumpserver.org/img/evaluate_avatar1.jpg">
</div>
<div>
<strong>Copyright</strong> 北京堆栈科技有限公司 &copy; 2014-2018
</div>
</div>
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ElementOfooterComponent } from './ofooter.component';
describe('ElementOfooterComponent', () => {
let component: ElementOfooterComponent;
let fixture: ComponentFixture<ElementOfooterComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ElementOfooterComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ElementOfooterComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import {Component, OnInit} from '@angular/core';
import {version} from '../../../environments/environment';
import {DataStore} from '../../globals';
@Component({
selector: 'app-element-ofooter',
templateUrl: './ofooter.component.html',
styleUrls: ['./ofooter.component.scss']
})
export class ElementOfooterComponent implements OnInit {
version = version;
constructor() {
DataStore.NavShow = false;
}
ngOnInit() {
}
}
......@@ -29,7 +29,7 @@ export class ElementServerMenuComponent implements OnInit {
m.type = 'lll';
line.type = 'line';
this.MenuList = [m, m, line, m, m];
this._dialog.alert();
this._dialog.alert('sss');
}
public contextmenu(top: number, left: number) {
......
<div>
<input
type='text'
placeholder='Type to filter the name column...'
(keyup)='updateFilter($event)'
*ngIf="config.search"/>
<ngx-datatable
#table
class="material"
[rows]="rows"
[columns]="columns"
[limit]="config.limit"
[columnMode]="config.columnMode"
[headerHeight]="config.headerHeight"
[footerHeight]="config.footerHeight"
[rowHeight]="config.rowHeight"
[scrollbarV]="config.scrollbarV"
[scrollbarH]="config.scrollbarH"
></ngx-datatable>
<mat-paginator #paginator
[pageSize]="config.pageSize"
[pageSizeOptions]="config.pageSizeOptions"
(click)="test()">
</mat-paginator>
</div>
<button (click)="test()">ssss</button>
input {
padding: 8px;
margin: 15px auto;
width: 30%;
}
.material {
box-shadow: 0 3px 5px -3px rgba(0, 0, 0, 0.2);
}
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ElementTableComponent } from './table.component';
describe('ElementTableComponent', () => {
let component: ElementTableComponent;
let fixture: ComponentFixture<ElementTableComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ElementTableComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ElementTableComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import {Component, Input, OnInit, ViewChild} from '@angular/core';
import {DatatableComponent} from '@swimlane/ngx-datatable';
import {MatPaginator} from '@angular/material';
import {LogService} from '../../app.service';
export let Config: {
search: boolean,
scrollbarV: boolean,
scrollbarH: boolean,
rowHeight: number,
footerHeight: number,
headerHeight: number,
limit: number,
columnMode: string,
pageSize: number,
pageSizeOptions: Array<number>,
} = {
search: false,
scrollbarV: false,
scrollbarH: false,
rowHeight: 50,
footerHeight: 50,
headerHeight: 50,
limit: 10,
columnMode: 'force',
pageSize: 10,
pageSizeOptions: [5, 10, 20],
};
@Component({
selector: 'app-element-table',
templateUrl: './table.component.html',
styleUrls: ['./table.component.scss']
})
export class ElementTableComponent implements OnInit {
@Input() rows: Array<any>;
@Input() columns: Array<any>;
@Input() config: any;
temp = [];
@ViewChild(DatatableComponent) table: DatatableComponent;
@ViewChild(MatPaginator) paginator: MatPaginator;
constructor(private _logger: LogService) {
}
ngOnInit() {
Config = this.config;
this.paginator.length = this.rows.length;
}
updateFilter(event) {
const val = event.target.value.toLowerCase();
// filter our data
const temp = this.temp.filter(function (d) {
return d.name.toLowerCase().indexOf(val) !== -1 || !val;
});
// update the rows
this.rows = temp;
// Whenever the filter changes, always go back to the first page
this.table.offset = 0;
}
test() {
console.log(this.paginator._pageIndex);
console.log(this.paginator._pageIndex * this.paginator.pageSize + 1);
this.table.limit = this.paginator.pageSize;
}
}
import {AfterViewInit, Component, Input, OnInit, ViewChild} from '@angular/core';
import {ElementRef} from '@angular/core';
import {term, Terminal, TermWS} from '../../globals';
import {Cookie} from 'ng2-cookies/ng2-cookies';
import {NavList} from '../../ControlPage/control/control.component';
import * as jQuery from 'jquery/dist/jquery.min.js';
import {UUIDService} from '../../app.service';
import {CookieService} from 'ngx-cookie-service';
@Component({
selector: 'app-element-term',
......@@ -22,7 +22,8 @@ export class ElementTermComponent implements OnInit, AfterViewInit {
secret: string;
term: any;
constructor(private _uuid: UUIDService) {
constructor(private _uuid: UUIDService,
private _cookie: CookieService) {
}
ngOnInit() {
......@@ -38,11 +39,11 @@ export class ElementTermComponent implements OnInit, AfterViewInit {
ngAfterViewInit() {
if (this.host || this.token) {
if (Cookie.get('cols')) {
term.col = parseInt(Cookie.get('cols'), 10);
if (this._cookie.get('cols')) {
term.col = parseInt(this._cookie.get('cols'), 10);
}
if (Cookie.get('rows')) {
term.row = parseInt(Cookie.get('rows'), 10);
if (this._cookie.get('rows')) {
term.row = parseInt(this._cookie.get('rows'), 10);
}
} else {
term.col = Math.floor(jQuery(this.el.nativeElement).width() / jQuery('#liuzheng').width() * 8) - 3;
......@@ -62,8 +63,8 @@ export class ElementTermComponent implements OnInit, AfterViewInit {
}
that.term.resize(term.col, term.row);
if (that.host) {
Cookie.set('cols', term.col.toString(), 99, '/', document.domain);
Cookie.set('rows', term.row.toString(), 99, '/', document.domain);
that._cookie.set('cols', term.col.toString(), 99, '/', document.domain);
that._cookie.set('rows', term.row.toString(), 99, '/', document.domain);
TermWS.emit('resize', {'cols': term.col, 'rows': term.row});
}
};
......
......@@ -103,6 +103,7 @@ export let DataStore: {
loglevel: number;
leftbarshow: boolean;
windowsize: Array<number>;
autologin: boolean;
} = {
socket: io.connect(),
Nav: [{}],
......@@ -113,6 +114,7 @@ export let DataStore: {
loglevel: 0,
leftbarshow: true,
windowsize: [],
autologin: false,
};
export let CSRF = '';
......@@ -142,3 +144,6 @@ export let wsEvent: {
event: string;
data: any;
};
export const i18n = new Map();
......@@ -9,7 +9,6 @@ import {Video, DataStore} from '../globals';
styleUrls: ['./replay-page.component.css']
})
export class ReplayPageComponent implements OnInit {
Video = Video;
constructor(private activatedRoute: ActivatedRoute,
private _http: HttpService,
......
<div class="basic-form">
<br/>
<mat-form-field hintLabel="http://jumpserver.abc.com:8080">
<input matInput #input maxlength="10" placeholder="{{'Current SITE URL'|trans}}">
</mat-form-field>
<br/>
<mat-form-field hintLabel="{{'User first login update profile done redirect to it'|trans}}">
<input matInput #input maxlength="10" placeholder="{{'User Guide URL'|trans}}">
</mat-form-field>
<br/>
<mat-form-field hintLabel="">
<input matInput #input maxlength="10" placeholder="{{'Email Subject Prefix'|trans}}">
</mat-form-field>
<br/>
<div class="button-row">
<button mat-raised-button>{{ 'Reset' | trans }}</button>
<button mat-raised-button color="primary">{{ 'Submit' | trans }}</button>
</div>
<br/>
</div>
.basic-form {
height: 100%;
display: flex;
flex-direction: column;
max-width: 400px;
margin: auto;
font-size: 14pt;
}
.basic-form > * {
width: 100%;
}
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { SettingPageBasicComponent } from './basic.component';
describe('SettingPageBasicComponent', () => {
let component: SettingPageBasicComponent;
let fixture: ComponentFixture<SettingPageBasicComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ SettingPageBasicComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(SettingPageBasicComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-sp-basic',
templateUrl: './basic.component.html',
styleUrls: ['./basic.component.scss']
})
export class SettingPageBasicComponent implements OnInit {
constructor() { }
ngOnInit() {
}
}
<div class="email-form">
<mat-form-field hintLabel="">
<input matInput #input maxlength="10" placeholder="{{'SMTP host'|trans}}">
</mat-form-field>
<mat-form-field hintLabel="">
<input matInput #input maxlength="10" placeholder="{{'SMTP port'|trans}}">
</mat-form-field>
<mat-form-field hintLabel="">
<input matInput #input maxlength="10"
[formControl]="emailFormControl"
[errorStateMatcher]="matcher"
placeholder="{{'SMTP user'|trans}}">
<mat-error *ngIf="emailFormControl.hasError('email') && !emailFormControl.hasError('required')">
{{'Please enter a valid email address'|trans}}
</mat-error>
<mat-error *ngIf="emailFormControl.hasError('required')">
<strong>{{'Email is required'|trans}}</strong>
</mat-error>
</mat-form-field>
<mat-form-field hintLabel="{{'Some provider use token except password'|trans}}">
<input matInput #input maxlength="10"
[type]="hide ? 'password' : 'text'"
placeholder="{{'SMTP password'|trans}}">
<mat-icon matSuffix (click)="hide = !hide">{{hide ? 'visibility' : 'visibility_off'}}</mat-icon>
</mat-form-field>
<mat-form-field
[hideRequiredMarker]="options.value.hideRequired"
[floatLabel]="options.value.floatLabel">
<mat-select required>
<mat-option value="yes">{{'Yes'|trans}}</mat-option>
<mat-option value="no">{{'No'|trans}}</mat-option>
</mat-select>
<mat-placeholder>
<b>{{'Use SSL'|trans}}</b>
</mat-placeholder>
<mat-hint>{{'If SMTP port is 465, may be select'|trans}}</mat-hint>
</mat-form-field>
<mat-form-field
[hideRequiredMarker]="options.value.hideRequired"
[floatLabel]="options.value.floatLabel">
<mat-select required>
<mat-option value="yes">{{'Yes'|trans}}</mat-option>
<mat-option value="no">{{'No'|trans}}</mat-option>
</mat-select>
<mat-placeholder>
<b>{{'Use TLS'|trans}}</b>
</mat-placeholder>
<mat-hint>{{'If SMTP port is 587, may be select'|trans}}</mat-hint>
</mat-form-field>
<br>
<div class="button-row">
<button mat-raised-button>{{ 'Test connection' | trans }}</button>
<button mat-raised-button>{{ 'Reset' | trans }}</button>
<button mat-raised-button color="primary">{{ 'Submit' | trans }}</button>
</div>
<br/>
</div>
.email-form {
height: 100%;
display: flex;
flex-direction: column;
max-width: 400px;
margin: auto;
font-size: 14pt;
}
.email-form > * {
width: 100%;
}
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { SettingPageEmailComponent } from './email.component';
describe('SettingPageEmailComponent', () => {
let component: SettingPageEmailComponent;
let fixture: ComponentFixture<SettingPageEmailComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ SettingPageEmailComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(SettingPageEmailComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import {Component, OnInit} from '@angular/core';
import {FormBuilder, FormControl, FormGroup, FormGroupDirective, NgForm, Validators} from '@angular/forms';
import {ErrorStateMatcher} from '@angular/material/core';
/** Error when invalid control is dirty, touched, or submitted. */
export class MyErrorStateMatcher implements ErrorStateMatcher {
isErrorState(control: FormControl | null, form: FormGroupDirective | NgForm | null): boolean {
const isSubmitted = form && form.submitted;
return !!(control && control.invalid && (control.dirty || control.touched || isSubmitted));
}
}
@Component({
selector: 'app-sp-email',
templateUrl: './email.component.html',
styleUrls: ['./email.component.scss']
})
export class SettingPageEmailComponent implements OnInit {
emailFormControl = new FormControl('', [
Validators.required,
Validators.email,
]);
matcher = new MyErrorStateMatcher();
hide = true;
options: FormGroup;
constructor(fb: FormBuilder) {
this.options = fb.group({
hideRequired: false,
floatLabel: 'auto',
});
}
ngOnInit() {
}
}
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { SettingPageLdapComponent } from './ldap.component';
describe('SettingPageLdapComponent', () => {
let component: SettingPageLdapComponent;
let fixture: ComponentFixture<SettingPageLdapComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ SettingPageLdapComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(SettingPageLdapComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-sp-ldap',
templateUrl: './ldap.component.html',
styleUrls: ['./ldap.component.scss']
})
export class SettingPageLdapComponent implements OnInit {
constructor() { }
ngOnInit() {
}
}
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { SettingPageS3Component } from './s3.component';
describe('SettingPageS3Component', () => {
let component: SettingPageS3Component;
let fixture: ComponentFixture<SettingPageS3Component>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ SettingPageS3Component ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(SettingPageS3Component);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-sp-s3',
templateUrl: './s3.component.html',
styleUrls: ['./s3.component.scss']
})
export class SettingPageS3Component implements OnInit {
constructor() { }
ngOnInit() {
}
}
<div class="pace-done">
<app-element-leftbar></app-element-leftbar>
<mat-card class="content">
<mat-tab-group>
<mat-tab label="{{'Basic setting'|trans}}">
<app-sp-basic></app-sp-basic>
</mat-tab>
<mat-tab label="{{'Email setting'|trans}}">
<app-sp-email></app-sp-email>
</mat-tab>
<mat-tab label="{{'LDAP setting'|trans}}">
<app-sp-ldap></app-sp-ldap>
</mat-tab>
<mat-tab label="{{'Terminal setting'|trans}}">
<app-sp-terminal></app-sp-terminal>
</mat-tab>
</mat-tab-group>
</mat-card>
<app-element-ofooter></app-element-ofooter>
</div>
.pace-done {
width: 100%;
height: 100%;
padding: 0;
}
.content {
margin-left: 220px;
height: 100%;
}
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { SettingPageComponent } from './setting-page.component';
describe('SettingPageComponent', () => {
let component: SettingPageComponent;
let fixture: ComponentFixture<SettingPageComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ SettingPageComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(SettingPageComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-setting-page',
templateUrl: './setting-page.component.html',
styleUrls: ['./setting-page.component.scss']
})
export class SettingPageComponent implements OnInit {
constructor() { }
ngOnInit() {
}
}
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { SettingPageTerminalComponent } from './terminal.component';
describe('SettingPageTerminalComponent', () => {
let component: SettingPageTerminalComponent;
let fixture: ComponentFixture<SettingPageTerminalComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ SettingPageTerminalComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(SettingPageTerminalComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-sp-terminal',
templateUrl: './terminal.component.html',
styleUrls: ['./terminal.component.scss']
})
export class SettingPageTerminalComponent implements OnInit {
constructor() { }
ngOnInit() {
}
}
<app-element-term
[token]="token"
[index]="0">
[index]="0">
</app-element-term>
......@@ -2,6 +2,7 @@ import {Component, OnInit} from '@angular/core';
import {DataStore} from '../globals';
import {ActivatedRoute, Params} from '@angular/router';
import * as jQuery from 'jquery/dist/jquery.min.js';
import {LogService} from '../app.service';
@Component({
selector: 'app-term-page',
......@@ -11,8 +12,10 @@ import * as jQuery from 'jquery/dist/jquery.min.js';
export class TermPageComponent implements OnInit {
token: string;
constructor(private activatedRoute: ActivatedRoute) {
constructor(private activatedRoute: ActivatedRoute,
private _logger: LogService) {
DataStore.NavShow = false;
this._logger.debug('TermPageComponent');
}
ngOnInit() {
......
<h2 mat-dialog-title>Delete all</h2>
<mat-dialog-content>Are you sure?</mat-dialog-content>
<mat-dialog-actions>
<button mat-button mat-dialog-close>No</button>
<!-- The mat-dialog-close directive optionally accepts a value as a result for the dialog. -->
<button mat-button [mat-dialog-close]="true">Yes</button>
</mat-dialog-actions>
<mat-checkbox>Check me!</mat-checkbox>
<button mat-raised-button (click)="openDialog()">Pick one</button>
<!--<app-element-table-->
<!--[rows]="rows"-->
<!--[columns]="columns"-->
<!--[config]="config"-->
<!--&gt;</app-element-table>-->
<!--<button mat-raised-button (click)="test()">Test</button>-->
<app-element-leftbar></app-element-leftbar>
import {Component, Inject, OnInit} from '@angular/core';
import {Component, OnInit} from '@angular/core';
import {DataStore} from '../globals';
import {Config} from '../elements/table/table.component';
import {DialogService} from '../elements/dialog/dialog.service';
import {MAT_DIALOG_DATA, MatDialog, MatDialogRef} from '@angular/material';
// import {Mats, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material';
......@@ -11,41 +11,42 @@ import {MAT_DIALOG_DATA, MatDialog, MatDialogRef} from '@angular/material';
styleUrls: ['./test-page.component.scss']
})
export class TestPageComponent implements OnInit {
name: string;
constructor(private _dialog: MatDialog) {
rows = [
{name: 'Austin', gender: 'Male', company: 'Swimlane'},
{name: 'Dany', gender: 'Male', company: 'KFC'},
{name: 'Molly', gender: 'Female', company: 'Burger King'},
{name: 'Dany', gender: 'Male', company: 'KFC'},
{name: 'Molly', gender: 'Female', company: 'Burger King'},
{name: 'Dany', gender: 'Male', company: 'KFC'},
{name: 'Molly', gender: 'Female', company: 'Burger King'},
{name: 'Dany', gender: 'Male', company: 'KFC'},
{name: 'Molly', gender: 'Female', company: 'Burger King'},
{name: 'Dany', gender: 'Male', company: 'KFC'},
{name: 'Molly', gender: 'Female', company: 'Burger King'},
{name: 'Dany', gender: 'Male', company: 'KFC'},
{name: 'Molly', gender: 'Female', company: 'Burger King'},
{name: 'Dany', gender: 'Male', company: 'KFC'},
{name: 'Molly', gender: 'Female', company: 'Burger King'},
{name: 'Dany', gender: 'Male', company: 'KFC'},
{name: 'Molly', gender: 'Female', company: 'Burger King'},
];
columns = [
{prop: 'name'},
{name: 'Gender'},
{name: 'Company'}
];
config = Config;
constructor(private _layer: DialogService) {
DataStore.NavShow = false;
this.config.search = true;
this.config.scrollbarH = true;
}
ngOnInit() {
this.name = 'ssss';
}
openDialog(): void {
const dialogRef = this._dialog.open(TestPageComponentDialog, {
width: '251px',
data: {name: this.name}
});
dialogRef.afterClosed().subscribe(result => {
console.log('The dialog was closed', result);
// this.animal = result;
});
test() {
this._layer.alert('sss');
}
}
@Component({
selector: 'app-test-page-dialog',
templateUrl: 'dialog.html',
})
export class TestPageComponentDialog {
constructor(public dialogRef: MatDialogRef<TestPageComponentDialog>,
@Inject(MAT_DIALOG_DATA) public data: any) {
}
onNoClick(): void {
this.dialogRef.close();
}
}
import { TransPipe } from './trans.pipe';
describe('TransPipe', () => {
it('create an instance', () => {
const pipe = new TransPipe();
expect(pipe).toBeTruthy();
});
});
import {Pipe, PipeTransform} from '@angular/core';
import {i18n} from './globals';
@Pipe({
name: 'trans'
})
export class TransPipe implements PipeTransform {
transform(value: any, args?: any): any {
if (i18n.has(value.toLowerCase())) {
return i18n.get(value.toLowerCase());
} else {
return value;
}
}
}
/*
*
* INSPINIA - Responsive Admin Theme
* version 2.7.1
*
*/
$(document).ready(function () {
// Add body-small class if window less than 768px
if ($(this).width() < 769) {
$('body').addClass('body-small')
} else {
$('body').removeClass('body-small')
}
// MetisMenu
$('#side-menu').metisMenu();
// Collapse ibox function
$('.collapse-link').on('click', function () {
var ibox = $(this).closest('div.ibox');
var button = $(this).find('i');
var content = ibox.children('.ibox-content');
content.slideToggle(200);
button.toggleClass('fa-chevron-up').toggleClass('fa-chevron-down');
ibox.toggleClass('').toggleClass('border-bottom');
setTimeout(function () {
ibox.resize();
ibox.find('[id^=map-]').resize();
}, 50);
});
// Close ibox function
$('.close-link').on('click', function () {
var content = $(this).closest('div.ibox');
content.remove();
});
// Fullscreen ibox function
$('.fullscreen-link').on('click', function () {
var ibox = $(this).closest('div.ibox');
var button = $(this).find('i');
$('body').toggleClass('fullscreen-ibox-mode');
button.toggleClass('fa-expand').toggleClass('fa-compress');
ibox.toggleClass('fullscreen');
setTimeout(function () {
$(window).trigger('resize');
}, 100);
});
// Close menu in canvas mode
$('.close-canvas-menu').on('click', function () {
$("body").toggleClass("mini-navbar");
SmoothlyMenu();
});
// Run menu of canvas
$('body.canvas-menu .sidebar-collapse').slimScroll({
height: '100%',
railOpacity: 0.9
});
// Open close right sidebar
$('.right-sidebar-toggle').on('click', function () {
$('#right-sidebar').toggleClass('sidebar-open');
});
// Initialize slimscroll for right sidebar
$('.sidebar-container').slimScroll({
height: '100%',
railOpacity: 0.4,
wheelStep: 10
});
// Open close small chat
$('.open-small-chat').on('click', function () {
$(this).children().toggleClass('fa-comments').toggleClass('fa-remove');
$('.small-chat-box').toggleClass('active');
});
// Initialize slimscroll for small chat
$('.small-chat-box .content').slimScroll({
height: '234px',
railOpacity: 0.4
});
// Small todo handler
$('.check-link').on('click', function () {
var button = $(this).find('i');
var label = $(this).next('span');
button.toggleClass('fa-check-square').toggleClass('fa-square-o');
label.toggleClass('todo-completed');
return false;
});
// Append config box / Only for demo purpose
// Uncomment on server mode to enable XHR calls
//$.get("skin-config.html", function (data) {
// if (!$('body').hasClass('no-skin-config'))
// $('body').append(data);
//});
// Minimalize menu
$('.navbar-minimalize').on('click', function (event) {
event.preventDefault();
$("body").toggleClass("mini-navbar");
SmoothlyMenu();
});
// Tooltips demo
$('.tooltip-demo').tooltip({
selector: "[data-toggle=tooltip]",
container: "body"
});
// Full height of sidebar
function fix_height() {
var heightWithoutNavbar = $("body > #wrapper").height() - 61;
$(".sidebar-panel").css("min-height", heightWithoutNavbar + "px");
var navbarheight = $('nav.navbar-default').height();
var wrapperHeight = $('#page-wrapper').height();
if (navbarheight > wrapperHeight) {
$('#page-wrapper').css("min-height", navbarheight + "px");
}
if (navbarheight < wrapperHeight) {
$('#page-wrapper').css("min-height", $(window).height() + "px");
}
if ($('body').hasClass('fixed-nav')) {
if (navbarheight > wrapperHeight) {
$('#page-wrapper').css("min-height", navbarheight + "px");
} else {
$('#page-wrapper').css("min-height", $(window).height() - 60 + "px");
}
}
}
fix_height();
// Fixed Sidebar
$(window).bind("load", function () {
if ($("body").hasClass('fixed-sidebar')) {
$('.sidebar-collapse').slimScroll({
height: '100%',
railOpacity: 0.9
});
}
});
// Move right sidebar top after scroll
$(window).scroll(function () {
if ($(window).scrollTop() > 0 && !$('body').hasClass('fixed-nav')) {
$('#right-sidebar').addClass('sidebar-top');
} else {
$('#right-sidebar').removeClass('sidebar-top');
}
});
$(window).bind("load resize scroll", function () {
if (!$("body").hasClass('body-small')) {
fix_height();
}
});
$("[data-toggle=popover]")
.popover();
// Add slimscroll to element
$('.full-height-scroll').slimscroll({
height: '100%'
})
});
// Minimalize menu when screen is less than 768px
$(window).bind("resize", function () {
if ($(this).width() < 769) {
$('body').addClass('body-small')
} else {
$('body').removeClass('body-small')
}
});
// Local Storage functions
// Set proper body class and plugins based on user configuration
$(document).ready(function () {
if (localStorageSupport()) {
var collapse = localStorage.getItem("collapse_menu");
var fixedsidebar = localStorage.getItem("fixedsidebar");
var fixednavbar = localStorage.getItem("fixednavbar");
var boxedlayout = localStorage.getItem("boxedlayout");
var fixedfooter = localStorage.getItem("fixedfooter");
var body = $('body');
if (fixedsidebar == 'on') {
body.addClass('fixed-sidebar');
$('.sidebar-collapse').slimScroll({
height: '100%',
railOpacity: 0.9
});
}
if (collapse == 'on') {
if (body.hasClass('fixed-sidebar')) {
if (!body.hasClass('body-small')) {
body.addClass('mini-navbar');
}
} else {
if (!body.hasClass('body-small')) {
body.addClass('mini-navbar');
}
}
}
if (fixednavbar == 'on') {
$(".navbar-static-top").removeClass('navbar-static-top').addClass('navbar-fixed-top');
body.addClass('fixed-nav');
}
if (boxedlayout == 'on') {
body.addClass('boxed-layout');
}
if (fixedfooter == 'on') {
$(".footer").addClass('fixed');
}
}
});
// check if browser support HTML5 local storage
function localStorageSupport() {
return (('localStorage' in window) && window['localStorage'] !== null)
}
// For demo purpose - animation css script
function animationHover(element, animation) {
element = $(element);
element.hover(
function () {
element.addClass('animated ' + animation);
},
function () {
//wait for animation to finish before removing classes
window.setTimeout(function () {
element.removeClass('animated ' + animation);
}, 2000);
});
}
function SmoothlyMenu() {
if (!$('body').hasClass('mini-navbar') || $('body').hasClass('body-small')) {
// Hide menu in order to smoothly turn on when maximize menu
$('#side-menu').hide();
// For smoothly turn on menu
setTimeout(
function () {
$('#side-menu').fadeIn(400);
}, 200);
} else if ($('body').hasClass('fixed-sidebar')) {
$('#side-menu').hide();
setTimeout(
function () {
$('#side-menu').fadeIn(400);
}, 100);
} else {
// Remove all inline style from jquery fadeIn function to reset menu state
$('#side-menu').removeAttr('style');
}
}
// Dragable panels
function WinMove() {
var element = "[class*=col]";
var handle = ".ibox-title";
var connect = "[class*=col]";
$(element).sortable(
{
handle: handle,
connectWith: connect,
tolerance: 'pointer',
forcePlaceholderSize: true,
opacity: 0.8
})
.disableSelection();
}
......@@ -25,7 +25,7 @@
@import "imports/spinners";
// Landing page styles
@import "imports/landing";
//@import "imports/landing";
// RTL Support
@import "imports/rtl";
......
This diff is collapsed.
/*! Copyright (c) 2011 Piotr Rochala (http://rocha.la)
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
* and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
*
* Version: 1.3.6
*
*/
(function(e){e.fn.extend({slimScroll:function(g){var a=e.extend({width:"auto",height:"250px",size:"7px",color:"#000",position:"right",distance:"1px",start:"top",opacity:.4,alwaysVisible:!1,disableFadeOut:!1,railVisible:!1,railColor:"#333",railOpacity:.2,railDraggable:!0,railClass:"slimScrollRail",barClass:"slimScrollBar",wrapperClass:"slimScrollDiv",allowPageScroll:!1,wheelStep:20,touchScrollStep:200,borderRadius:"7px",railBorderRadius:"7px"},g);this.each(function(){function v(d){if(r){d=d||window.event;
var c=0;d.wheelDelta&&(c=-d.wheelDelta/120);d.detail&&(c=d.detail/3);e(d.target||d.srcTarget||d.srcElement).closest("."+a.wrapperClass).is(b.parent())&&m(c,!0);d.preventDefault&&!k&&d.preventDefault();k||(d.returnValue=!1)}}function m(d,e,g){k=!1;var f=d,h=b.outerHeight()-c.outerHeight();e&&(f=parseInt(c.css("top"))+d*parseInt(a.wheelStep)/100*c.outerHeight(),f=Math.min(Math.max(f,0),h),f=0<d?Math.ceil(f):Math.floor(f),c.css({top:f+"px"}));l=parseInt(c.css("top"))/(b.outerHeight()-c.outerHeight());
f=l*(b[0].scrollHeight-b.outerHeight());g&&(f=d,d=f/b[0].scrollHeight*b.outerHeight(),d=Math.min(Math.max(d,0),h),c.css({top:d+"px"}));b.scrollTop(f);b.trigger("slimscrolling",~~f);w();p()}function x(){u=Math.max(b.outerHeight()/b[0].scrollHeight*b.outerHeight(),30);c.css({height:u+"px"});var a=u==b.outerHeight()?"none":"block";c.css({display:a})}function w(){x();clearTimeout(B);l==~~l?(k=a.allowPageScroll,C!=l&&b.trigger("slimscroll",0==~~l?"top":"bottom")):k=!1;C=l;u>=b.outerHeight()?k=!0:(c.stop(!0,
!0).fadeIn("fast"),a.railVisible&&h.stop(!0,!0).fadeIn("fast"))}function p(){a.alwaysVisible||(B=setTimeout(function(){a.disableFadeOut&&r||y||z||(c.fadeOut("slow"),h.fadeOut("slow"))},1E3))}var r,y,z,B,A,u,l,C,k=!1,b=e(this);if(b.parent().hasClass(a.wrapperClass)){var n=b.scrollTop(),c=b.closest("."+a.barClass),h=b.closest("."+a.railClass);x();if(e.isPlainObject(g)){if("height"in g&&"auto"==g.height){b.parent().css("height","auto");b.css("height","auto");var q=b.parent().parent().height();b.parent().css("height",
q);b.css("height",q)}if("scrollTo"in g)n=parseInt(a.scrollTo);else if("scrollBy"in g)n+=parseInt(a.scrollBy);else if("destroy"in g){c.remove();h.remove();b.unwrap();return}m(n,!1,!0)}}else if(!(e.isPlainObject(g)&&"destroy"in g)){a.height="auto"==a.height?b.parent().height():a.height;n=e("<div></div>").addClass(a.wrapperClass).css({position:"relative",overflow:"hidden",width:a.width,height:a.height});b.css({overflow:"hidden",width:a.width,height:a.height});var h=e("<div></div>").addClass(a.railClass).css({width:a.size,
height:"100%",position:"absolute",top:0,display:a.alwaysVisible&&a.railVisible?"block":"none","border-radius":a.railBorderRadius,background:a.railColor,opacity:a.railOpacity,zIndex:90}),c=e("<div></div>").addClass(a.barClass).css({background:a.color,width:a.size,position:"absolute",top:0,opacity:a.opacity,display:a.alwaysVisible?"block":"none","border-radius":a.borderRadius,BorderRadius:a.borderRadius,MozBorderRadius:a.borderRadius,WebkitBorderRadius:a.borderRadius,zIndex:99}),q="right"==a.position?
{right:a.distance}:{left:a.distance};h.css(q);c.css(q);b.wrap(n);b.parent().append(c);b.parent().append(h);a.railDraggable&&c.bind("mousedown",function(a){var b=e(document);z=!0;t=parseFloat(c.css("top"));pageY=a.pageY;b.bind("mousemove.slimscroll",function(a){currTop=t+a.pageY-pageY;c.css("top",currTop);m(0,c.position().top,!1)});b.bind("mouseup.slimscroll",function(a){z=!1;p();b.unbind(".slimscroll")});return!1}).bind("selectstart.slimscroll",function(a){a.stopPropagation();a.preventDefault();return!1});
h.hover(function(){w()},function(){p()});c.hover(function(){y=!0},function(){y=!1});b.hover(function(){r=!0;w();p()},function(){r=!1;p()});b.bind("touchstart",function(a,b){a.originalEvent.touches.length&&(A=a.originalEvent.touches[0].pageY)});b.bind("touchmove",function(b){k||b.originalEvent.preventDefault();b.originalEvent.touches.length&&(m((A-b.originalEvent.touches[0].pageY)/a.touchScrollStep,!0),A=b.originalEvent.touches[0].pageY)});x();"bottom"===a.start?(c.css({top:b.outerHeight()-c.outerHeight()}),
m(0,!0)):"top"!==a.start&&(m(e(a.start).position().top,null,!0),a.alwaysVisible||c.hide());window.addEventListener?(this.addEventListener("DOMMouseScroll",v,!1),this.addEventListener("mousewheel",v,!1)):document.attachEvent("onmousewheel",v)}});return this}});e.fn.extend({slimscroll:e.fn.slimScroll})})(jQuery);
\ No newline at end of file
.red-fonts {
color: #ed5565;
}
.form-group.required .control-label:after {
content: " *";
color: red;
}
.n-invalid {border: 1px solid #f00;}
.primary-panel .ibox-title {
color: #ffffff;
background-color: #1AB394;
}
.primary-panel .ibox-content {
border: 1px solid #1AB394;
}
.info-panel .ibox-title {
color: #ffffff;
background-color: #23c6c8;
}
.info-panel .ibox-content {
border: 1px solid #23c6c8;;
}
th a {
color: #676a6c;
}
.select2-container--default .select2-results__option--highlighted[aria-selected] {
background-color: #d2d2d2 !important;
color: #333 !important;
}
.select2-selection--single,
.select2-selection--multiple {
border: 1px solid #e5e6e7 !important;
cursor: text !important;
}
.select2-container--forcus {
border: 1px solid #1AB394 !important;
}
.select2-selection__choice,
.chosen-container-multi .chosen-choices li.search-choice {
background: #f1f1f1 !important;
border: 1px solid #e5e6e7 !important;
/*border: 1px solid #ededed;*/
border-radius: 2px !important;
box-shadow: none !important;
color: #333333 !important;
cursor: default !important;
line-height: 13px !important;
/*margin: 3px 0 3px 5px !important;*/
padding: 3px 20px 3px 5px !important;
position: relative !important;
}
.select2-container--default.select2-container--focus .select2-selection--multiple {
border: 1px solid #1ab394 !important;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.3) !important;
}
.passwordBox2 {
max-width: 660px;
margin: 0 auto;
padding: 100px 20px 20px 20px;
}
.no-borders-tr td {
border-top: none !important;
}
table.dataTable tbody > tr.selected, table.dataTable tbody > tr > .selected {
background-color: #1ab394 !important;
}
table.dataTable tbody tr.selected a,
table.dataTable tbody th.selected a,
table.dataTable tbody td.selected a,
table.dataTable tbody tr.selected td i.text-navy,
table.dataTable tbody th.selected td i.text-navy,
table.dataTable tbody td.selected td i.text-navy
{
color: white !important;
}
.m-0 {
margin: 0px !important;
}
.m-t-0 {
margin-top: 0px !important;
}
.m-b-0 {
margin-bottom: 0px !important;
}
.m-l-0 {
margin-left: 0px !important;
}
.m-r-0 {
margin-right: 0px !important;
}
.m-5 {
margin: 5px !important;
}
.m-t-5 {
margin-top: 5px !important;
}
.m-b-5 {
margin-bottom: 5px !important;
}
.m-l-5 {
margin-left: 5px !important;
}
.m-r-5 {
margin-right: 5px !important;
}
.m-10 {
margin: 10px !important;
}
.m-t-10 {
margin-top: 10px !important;
}
.m-b-10 {
margin-bottom: 10px !important;
}
.m-l-10 {
margin-left: 10px !important;
}
.m-r-10 {
margin-right: 10px !important;
}
.m-15 {
margin: 15px !important;
}
.m-t-15 {
margin-top: 15px !important;
}
.m-b-15 {
margin-bottom: 15px !important;
}
.m-l-15 {
margin-left: 15px !important;
}
.m-r-15 {
margin-right: 15px !important;
}
.m-20 {
margin: 20px !important;
}
.m-t-20 {
margin-top: 20px !important;
}
.m-b-20 {
margin-bottom: 20px !important;
}
.m-l-20 {
margin-left: 20px !important;
}
.m-r-20 {
margin-right: 20px !important;
}
.m-25 {
margin: 25px !important;
}
.m-t-25 {
margin-top: 25px !important;
}
.m-b-25 {
margin-bottom: 25px !important;
}
.m-l-25 {
margin-left: 25px !important;
}
.m-r-25 {
margin-right: 25px !important;
}
.m-30 {
margin: 30px !important;
}
.m-t-30 {
margin-top: 30px !important;
}
.m-b-30 {
margin-bottom: 30px !important;
}
.m-l-30 {
margin-left: 30px !important;
}
.m-r-30 {
margin-right: 30px !important;
}
.ydxbd {
font-size: 12px;
width: 100%;
overflow: hidden;
padding-top: 15px;
margin-bottom: 15px;
display: block;
background: #f4f4f4;
padding-left: 10px;
padding-bottom: 15px;
}
.mar {
margin-left: 2px;
line-height: 0px;
}
.mar-j {
margin-left: 3px;
margin-right: 3px;
}
.form-asset-on p{
margin-bottom:0px;
}
.form-asset-on button{
background: #f1f1f1;
margin-right: 2px;
}
.form-asset-on{
border: 1px solid #e5e6e7;
padding-top:5px;
padding-bottom: 0px;
padding-left: 5px;
padding-right: 5px;
min-height:34px;
height: 100%;
}
.mgl-5 {
margin-left: 5px;
font-size: 12px;
}
.c02 {
color: #999;
}
.tagBtnList {
font-size: 12px;
line-height: 32px;
margin: -5px 0 0 0;
padding-left: 0px;
}
.tagBtn2 {
margin: 0 5px 5px 0;
font-size: 12px;
vertical-align: middle;
}
div.dataTables_wrapper div.dataTables_filter,
.dataTables_length {
float: right !important;
}
div.dataTables_wrapper div.dataTables_filter {
margin-left: 15px;
}
.simple-tag {
background-color: #f3f3f4;
border: 1px solid #e7eaec;
border-radius: 2px;
color: inherit;
display: inline-block;
font-size: 10px;
margin-right: 5px;
margin-top: 5px;
padding: 5px 12px;
}
#op.col-md-6{
padding-left: 0;
}
.help-message {
padding-left: 10px;
font-size: 12px;
line-height: 18px;
margin-bottom:0;
margin-left: 10px;
margin-right: 10px
}
.navbar-default {
background-color: #2f4050;
border-color: #2f4050;
}
.nav-header, body.mini-navbar .nav-header {
padding: 0;
background: #202c37;
}
.profile-element div:first-child {
line-height: 60px;
/*width: 70px;*/
float: left;
text-align: center;
}
.profile-element div:last-child a {
line-height: 60px;
width: 150px;
float: left;
font-size: 22px;
color: #1ab394;
}
.logo-element {
padding: 10px 0;
}
.welcome-message img {
margin: -11px 0;
}
.nav.nav-tabs li.active {
background-color: #FFF;
}
.ibox-title {
border-top: none;
}
.nav.nav-tabs li > a {
max-height: 38px;
}
.nav.nav-tabs li.active a {
border: none;
}
.popover{
max-width: 100%; /* Max Width of the popover (depending on the container!) */
padding-left: 20px;
padding-right: 20px;
}
......@@ -17,56 +17,10 @@ $roboto-font-path: "~roboto-fontface/fonts";
*
*/
$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;
}
}
@import "../assets/inspinia/style";
@import '~@angular/material/prebuilt-themes/deeppurple-amber.css';
@import '~@swimlane/ngx-datatable/release/index.css';
@import '~@swimlane/ngx-datatable/release/themes/material.css';
@import '~@swimlane/ngx-datatable/release/assets/icons.css';
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