Commit e0fdfcea authored by wangqinghua's avatar wangqinghua

bug 修正

parent f61dd0ed
...@@ -2,9 +2,13 @@ import {Injectable, OnInit} from '@angular/core'; ...@@ -2,9 +2,13 @@ import {Injectable, OnInit} from '@angular/core';
import {NzMessageService, NzModalService} from 'ng-zorro-antd'; import {NzMessageService, NzModalService} from 'ng-zorro-antd';
import {SERVER_API_URL, SERVER_API_URL_COMS} from '../../app.constants'; import {SERVER_API_URL, SERVER_API_URL_COMS} from '../../app.constants';
import {DatePipe} from '@angular/common'; import {DatePipe} from '@angular/common';
import {WorkService} from '../../work/work.service';
declare var ActiveXObject: ActiveXObject; declare var ActiveXObject: ActiveXObject;
interface ActiveXObject { interface ActiveXObject {
new (type: string): ActiveXObject; new(type: string): ActiveXObject;
SendKeys(key: string): void; SendKeys(key: string): void;
} }
...@@ -12,7 +16,7 @@ interface ActiveXObject { ...@@ -12,7 +16,7 @@ interface ActiveXObject {
export class CommonService implements OnInit { export class CommonService implements OnInit {
constructor(private modalSer: NzModalService, private datePipe: DatePipe, constructor(private modalSer: NzModalService, private datePipe: DatePipe,
private message: NzMessageService) { private message: NzMessageService,private workSer:WorkService) {
// 定义发射事件 // 定义发射事件
} }
...@@ -143,11 +147,11 @@ export class CommonService implements OnInit { ...@@ -143,11 +147,11 @@ export class CommonService implements OnInit {
ieEDGE = navigator.userAgent.match(/Edge/g), ieEDGE = navigator.userAgent.match(/Edge/g),
ieVer = (ie ? ie[1] : (ie11 ? 11 : (ieEDGE ? 12 : -1))); ieVer = (ie ? ie[1] : (ie11 ? 11 : (ieEDGE ? 12 : -1)));
if (ieVer > -1) { if (ieVer > -1) {
if(typeof (<any>window).ActiveXObject !== "undefined") { if (typeof (<any>window).ActiveXObject !== 'undefined') {
//这的方法 模拟f11键,使浏览器全屏 //这的方法 模拟f11键,使浏览器全屏
const wscript = new ActiveXObject("WScript.Shell"); const wscript = new ActiveXObject('WScript.Shell');
if(wscript != null) { if (wscript != null) {
wscript.SendKeys("{F11}"); wscript.SendKeys('{F11}');
} }
} }
} }
...@@ -227,7 +231,7 @@ export class CommonService implements OnInit { ...@@ -227,7 +231,7 @@ export class CommonService implements OnInit {
} }
//内存单位换算 //内存单位换算
unitConversion(unit){ unitConversion(unit) {
let res; let res;
let Gbps = 1000 * 1000 * 1000; let Gbps = 1000 * 1000 * 1000;
let Mbps = 1000 * 1000; let Mbps = 1000 * 1000;
...@@ -240,8 +244,25 @@ export class CommonService implements OnInit { ...@@ -240,8 +244,25 @@ export class CommonService implements OnInit {
} else if (size / kbps > 1) { } else if (size / kbps > 1) {
res += (size / kbps).toFixed(2) + 'kbps'; res += (size / kbps).toFixed(2) + 'kbps';
} else { } else {
res +=(size) + 'bps'; res += (size) + 'bps';
} }
return res; return res;
} }
/**
* 文件预览
*/
previewFile(fileUrl) {
// this.workSer.getPreview().subscribe(
// (res)=>{
//
// }
// )
console.log(window.location.host + '/zabbixBox');
const previeUrl1 = "http://10.10.38.99:8282"+fileUrl;
// const previeUrl = "http://10.10.38.99:8282/file/knowledge/zyh.jpg";
window.open('http://10.10.38.99:8012/onlinePreview?url=' + encodeURIComponent(previeUrl1) );
// window.open('http://10.10.38.99:8012/onlinePreview?url=' + encodeURIComponent(previeUrl) );
// window.open(window.location.host + '/zabbixBox' + fileUrl);
}
} }
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