This commit is contained in:
leejinho 2020-02-05 17:50:02 +09:00
commit 4d0c8550e9
17 changed files with 139 additions and 67 deletions

View File

@ -47,7 +47,11 @@ import {
} from '@ucap-webmessenger/native';
import { ElectronAppChannel } from '@ucap-webmessenger/electron-core';
import { autoUpdater, CancellationToken } from 'electron-updater';
import {
autoUpdater,
CancellationToken,
UpdateCheckResult
} from 'electron-updater';
import log from 'electron-log';
import { RendererUpdater } from './lib/renderer-updater';
@ -124,6 +128,7 @@ let rendererUpdater: RendererUpdater | undefined;
log.transports.file.level = 'debug';
let autoUpdaterCancellationToken: CancellationToken;
let updateCheckResult: UpdateCheckResult;
autoUpdater.autoDownload = false;
autoUpdater.logger = log;
@ -299,6 +304,8 @@ app.on(ElectronAppChannel.Ready, () => {
},
onDenyUpdate: () => {
log.info('OnDenyUpdate');
updateCheckResult.cancellationToken.cancel();
updateWindowService.close();
},
onCancelDownload: () => {
@ -353,19 +360,18 @@ function onDidLoad(fn: OnDidLoadFn) {
}
ipcMain.on(UpdaterChannel.Apply, (event: IpcMainEvent, ...args: any[]) => {
// if (__DEV__) {
// event.returnValue = false;
// return;
// }
if (!autoUpdater.isUpdaterActive()) {
log.info('autoUpdater is not active');
return;
}
const ver = args[0];
if (semver.lt(app.getVersion(), ver)) {
autoUpdater
.checkForUpdatesAndNotify()
.then(result => {})
.catch(reason => {
log.error(reason);
updateCheckResult = undefined;
autoUpdater.checkForUpdatesAndNotify().then(r => {
log.debug('checkForUpdatesAndNotify.then');
updateCheckResult = r;
});
}
});
@ -770,6 +776,8 @@ autoUpdater.on('update-not-available', info => {
log.info('Update not available.');
});
autoUpdater.on('error', err => {
updateWindowService.close();
log.info('Error in auto-updater. ' + err);
});
autoUpdater.on('download-progress', progressObj => {

View File

@ -1,6 +1,6 @@
{
"name": "ucap-webmessenger",
"version": "0.0.14",
"version": "0.0.15",
"author": {
"name": "LG CNS",
"email": "lgucap@lgcns.com"

View File

@ -174,11 +174,19 @@
}
}
::ng-deep .chat-snackbar-class {
::ng-deep .cdk-global-overlay-wrapper {
.mat-snack-bar-container {
margin: 0;
padding: 30px;
.mat-simple-snackbar {
justify-content: center;
span {
@include ellipsis(1);
padding: 10px 40px;
border: 1px solid #ffffff;
background-color: rgb(255, 255, 255, 0.2);
color: #ffffff;
}
}
}
}

View File

@ -970,13 +970,13 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
}
if (result.canceled) {
this.snackBarService.open(
this.translateService.instant('common.file.results.canceled'),
this.translateService.instant('common.file.errors.label'),
{
duration: 1000
}
);
// this.snackBarService.open(
// this.translateService.instant('common.file.results.canceled'),
// this.translateService.instant('common.file.errors.label'),
// {
// duration: 1000
// }
// );
} else {
this.saveFile(value, result.filePath);
}

View File

@ -66,10 +66,19 @@
<video
controls
controlsList="nodownload nofullscreen"
*ngIf="selectedFile.info.type === FileType.Video"
[src]="getImageUrl(selectedFile)"
class="preview-video"
#videoPlayer
*ngIf="selectedFile.info.type === FileType.Video && playable"
[src]="getImageUrl(selectedFile)"
(loadeddata)="onLoadedDataVideo()"
></video>
<div
*ngIf="selectedFile.info.type === FileType.Video && !playable"
fxFlexFill
class="guide-msg"
>
{{ 'common.file.errors.cantPlay' | translate }}
</div>
</div>
<ul>
<li class="name">{{ selectedFile.info.name }}</li>

View File

@ -1,4 +1,11 @@
import { Component, OnInit, OnDestroy, Inject } from '@angular/core';
import {
Component,
OnInit,
OnDestroy,
Inject,
ElementRef,
ViewChild
} from '@angular/core';
import {
FileInfo,
FileDownloadInfo,
@ -45,6 +52,9 @@ export interface FileInfoTotal {
styleUrls: ['./album-box.component.scss']
})
export class AlbumBoxComponent implements OnInit, OnDestroy {
@ViewChild('videoPlayer', { static: false })
videoPlayer: ElementRef<HTMLVideoElement>;
filteredList: FileInfoTotal[] = [];
fileInfoTotal: FileInfoTotal[];
fileInfoList: FileInfo[];
@ -62,6 +72,8 @@ export class AlbumBoxComponent implements OnInit, OnDestroy {
thumbBaseUrl: string;
playable = true;
constructor(
private store: Store<any>,
private sessionStorageService: SessionStorageService,
@ -186,6 +198,7 @@ export class AlbumBoxComponent implements OnInit, OnDestroy {
event.stopPropagation();
}
this.playable = true;
this.selectedFile = fileInfo;
}
@ -323,4 +336,13 @@ export class AlbumBoxComponent implements OnInit, OnDestroy {
this.logger.error(reason);
});
}
onLoadedDataVideo(): void {
if (
0 === this.videoPlayer.nativeElement.videoWidth ||
0 === this.videoPlayer.nativeElement.videoHeight
) {
this.playable = false;
}
}
}

View File

@ -6,7 +6,9 @@
<div class="btn-area">
<ucap-integrated-search-form
*ngIf="!!loginRes"
(search)="onIntegratedSearch($event)" class="input-lineless integrated-search">
(search)="onIntegratedSearch($event)"
class="input-lineless integrated-search"
>
</ucap-integrated-search-form>
<div
*ngIf="!!loginRes && !!weblink"
@ -160,6 +162,7 @@
*ngIf="!!loginRes"
class="myprofile-item"
[matMenuTriggerFor]="profileMenu"
#profileMenuTrigger="matMenuTrigger"
></ucap-profile-my-profile-widget>
<div class="app-layout-native-title-bar-actions">
@ -498,7 +501,7 @@
</span>
<span class="version-info-button">
<button
*ngIf="checkingUpdateIsExist"
mat-flat-button
class="mat-primary"
(click)="onClickApplyUpdate($event)"

View File

@ -63,7 +63,7 @@ import {
} from '@app/layouts/messenger/dialogs/profile/profile.dialog.component';
import { DialogService } from '@ucap-webmessenger/ui';
import { DOCUMENT } from '@angular/common';
import { MatMenu, MatRadioChange } from '@angular/material';
import { MatMenu, MatRadioChange, MatMenuTrigger } from '@angular/material';
import { StatusCode, StatusType } from '@ucap-webmessenger/core';
import {
StatusInfo,
@ -119,6 +119,9 @@ export class TopBarComponent implements OnInit, OnDestroy {
readonly awayTimeList = [10, 20, 30];
@ViewChild('profileMenuTrigger', { static: false })
profileMenuTrigger: MatMenuTrigger;
@ViewChild('profileMenu', { static: true })
profileMenu: MatMenu;
@ -558,7 +561,10 @@ export class TopBarComponent implements OnInit, OnDestroy {
}
onClickApplyUpdate(event: Event) {
// this.profileMenuTrigger.closeMenu();
setTimeout(() => {
this.nativeService.checkForUpdates(this.checkingUpdateAppVersion);
}, 1000);
}
onIntegratedSearch(keyword: string) {

View File

@ -433,6 +433,7 @@
"failToSpecifyPath": "Specifing of save path failed.",
"expired": "This file has expired",
"noPreview": "This file does not support preview.",
"cantPlay": "This file does not support playing.",
"notSupporedType": "File format is not supported.",
"oversize": "You cannot upload files larger than {{size}} megabytes."
}

View File

@ -433,6 +433,7 @@
"failToSpecifyPath": "저장경로 지정에 실패하였습니다.",
"expired": "기간이 만료된 파일입니다",
"noPreview": "미리보기를 지원하지 않는 파일입니다.",
"cantPlay": "재생을 지원하지 않는 파일입니다.",
"notSupporedType": "지원하지 않는 파일형식입니다.",
"oversize": "{{maxSize}}MB 이상 파일을 업로드 할 수 없습니다."
}

View File

@ -275,15 +275,6 @@ $daesang-grey: (
cursor: pointer;
}
//snackbar
.cdk-global-overlay-wrapper {
align-items: center !important;
justify-content: center !important;
.mat-simple-snackbar {
justify-content: center;
}
}
.policy {
color: mat-color($accent, B100);
}

View File

@ -1,7 +1,8 @@
import { Component, OnInit, Input } from '@angular/core';
import { Component, OnInit, Input, ViewChild } from '@angular/core';
import { NGXLogger } from 'ngx-logger';
import { StatusBulkInfo, StatusInfo } from '@ucap-webmessenger/protocol-status';
import { StatusCode, PresenceType } from '@ucap-webmessenger/core';
import { MatMenu, MatMenuTrigger } from '@angular/material';
@Component({
selector: 'ucap-profile-my-profile-widget',

View File

@ -3,6 +3,8 @@
*/
export * from './lib/components/list-item.component';
export * from './lib/components/my-profile-widget.component';
export * from './lib/components/profile.component';
export * from './lib/components/user-list-item.component';
export * from './lib/ucap-ui-profile.module';

View File

@ -93,6 +93,7 @@
fxLayoutAlign="center center"
>
<video
*ngIf="playable"
#audioPlayer
[src]="fileDownloadUrl"
[style.width]="'auto'"
@ -109,6 +110,9 @@
(loadstart)="onLoadStartVideo()"
(loadeddata)="onLoadedDataVideo()"
></video>
<div *ngIf="!playable" class="guide-msg">
{{ 'common.file.errors.cantPlay' | translate }}
</div>
</div>
<div class="viewer-bottom">
<div
@ -142,6 +146,7 @@
(playing ? 'common.player.stop' : 'common.player.play') | translate
}}"
aria-label=""
[disabled]="!playable"
(click)="onClickPlayOrPause()"
>
<mat-icon>{{ playing ? 'pause' : 'play_arrow' }}</mat-icon>

View File

@ -36,6 +36,12 @@
.ucap-video-viewer-video-icon {
width: 100%;
height: calc(100% - 80px);
.guide-msg {
font-size: 16px;
margin: 30px;
color: #ffffff;
}
}
.viewer-bottom {
background-color: #212121;
@ -78,6 +84,8 @@ mat-slider {
::ng-deep .mat-slider-horizontal .mat-slider-track-background {
background-color: #999999 !important;
}
::ng-deep .mat-slider-min-value:not(.mat-slider-thumb-label-showing) .mat-slider-thumb{
::ng-deep
.mat-slider-min-value:not(.mat-slider-thumb-label-showing)
.mat-slider-thumb {
border-color: #999999 !important;
}

View File

@ -33,7 +33,7 @@ export class VideoViewerComponent implements OnInit {
@Output()
closed = new EventEmitter<void>();
@ViewChild('audioPlayer', { static: true })
@ViewChild('audioPlayer', { static: false })
audioPlayer: ElementRef<HTMLVideoElement>;
@ViewChild('timeSlider', { static: true })
@ -49,6 +49,8 @@ export class VideoViewerComponent implements OnInit {
videoWidth = 0;
videoHeight = 0;
playable = true;
Math = Math;
constructor(
@ -101,6 +103,11 @@ export class VideoViewerComponent implements OnInit {
this.videoWidth = this.audioPlayer.nativeElement.videoWidth;
this.videoHeight = this.audioPlayer.nativeElement.videoHeight;
if (0 === this.videoHeight || 0 === this.videoWidth) {
this.playable = false;
this.duration = 0;
}
}
onClickDownload(): void {