Add test/local environment configurations and fix #147
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
|
||||
<app-loading-spinner #spinner></app-loading-spinner>
|
||||
<app-status-bar #status (getHelp)="getHelpModal.openModal(); helpStatus = $event; setExterHelp()"></app-status-bar>
|
||||
<webview id="mainWebView" #webview httpreferrer="https://sdiequestvr.com" src="https://sidequestvr.com" allowpopups [ngStyle]="{'left':webService.isWebviewOpen?'0':'-100%'}" class="bsaber-webview" ></webview>
|
||||
<webview id="mainWebView" #webview httpreferrer="https://sdiequestvr.com" [attr.src]="webUrl" allowpopups [ngStyle]="{'left':webService.isWebviewOpen?'0':'-100%'}" class="bsaber-webview" ></webview>
|
||||
|
||||
<mz-modal #getHelpModal [fixedFooter]="true">
|
||||
<mz-modal-header>
|
||||
@@ -21,7 +21,7 @@
|
||||
<br><br>
|
||||
<div class="center-align">
|
||||
<div class="btn pink-button waves-effect waves-light" (click)="statusService.copyStatus();statusService.showStatus('Copied to your clipboard!')">Copy To Clipboard</div><br><br>
|
||||
<div class="btn btn-flat waves-effect waves-dark" (click)="appService.opn('https://sdq.st/support')">Open Service Desk</div><br><br>
|
||||
<div class="btn btn-flat waves-effect waves-dark" (click)="appService.opn((shortenerUrl||'https://sdq.st')+'/support')">Open Service Desk</div><br><br>
|
||||
</div>
|
||||
</mz-modal-content>
|
||||
<mz-modal-footer>
|
||||
|
||||
@@ -6,6 +6,8 @@ import { WebviewService } from './webview.service';
|
||||
import { DragAndDropService } from './drag-and-drop.service';
|
||||
import { ElectronService } from './electron.service';
|
||||
import { AdbClientService } from './adb-client.service';
|
||||
import { environment } from '../environments/environment';
|
||||
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
templateUrl: './app.component.html',
|
||||
@@ -18,6 +20,8 @@ export class AppComponent implements OnInit, AfterViewInit {
|
||||
helpStatus: string;
|
||||
extraHelpStatus: string;
|
||||
devMode: boolean;
|
||||
webUrl = environment.configuration.web_url;
|
||||
shortenerUrl = environment.configuration.shortenerUrl;
|
||||
constructor(
|
||||
private spinnerService: LoadingSpinnerService,
|
||||
public statusService: StatusBarService,
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
</div>
|
||||
<div class="user-menu browser-menu" #browserMenu>
|
||||
<div class="btn-flat waves-light waves-light full-width center-align white-text truncate"
|
||||
(click)="browserMenu.style.display = 'none';browserMenuBack.style.display = 'none';webService.loadUrl('https://sidequestvr.com')"
|
||||
(click)="browserMenu.style.display = 'none';browserMenuBack.style.display = 'none';webService.loadUrl(webUrl || 'https://sidequestvr.com')"
|
||||
routerLink="/webview"><i class="material-icons left">home</i>Home</div><br>
|
||||
|
||||
<div class="btn-flat waves-light waves-light full-width center-align white-text"
|
||||
@@ -99,7 +99,7 @@
|
||||
</div>
|
||||
<div class="user-menu" #userMenu>
|
||||
<div class="btn-flat waves-light waves-light full-width center-align white-text"
|
||||
(click)="userMenu.style.display = 'none';userMenuBack.style.display = 'none';webService.loadUrl('https://sidequestvr.com')"
|
||||
(click)="userMenu.style.display = 'none';userMenuBack.style.display = 'none';webService.loadUrl(webUrl || 'https://sidequestvr.com')"
|
||||
routerLink="/webview"><i class="material-icons left">home</i>Home</div><br>
|
||||
<div class="btn-flat waves-light waves-light full-width center-align white-text"
|
||||
*ngIf="isConnected()&&osPlatform === 'win32'"
|
||||
@@ -140,7 +140,7 @@
|
||||
(click)="userMenu.style.display = 'block';userMenuBack.style.display = 'block'">
|
||||
arrow_drop_down
|
||||
</i>
|
||||
<i mz-tooltip routerLink="/webview" (click)="webService.back()"
|
||||
<i mz-tooltip routerLink="/webview" (click)="doBack()"
|
||||
class="material-icons white-text no-outline" position="bottom" tooltip="Back">
|
||||
arrow_back
|
||||
</i>
|
||||
@@ -312,7 +312,7 @@
|
||||
|
||||
</mz-modal-content>
|
||||
<mz-modal-footer>
|
||||
<button mz-button [flat]="true" mz-modal-close routerLink="/webview" (click)="webService.loadUrl('https://sidequestvr.com');" >SideQuest Home</button>
|
||||
<button mz-button [flat]="true" mz-modal-close routerLink="/webview" (click)="webService.loadUrl(webUrl || 'https://sidequestvr.com');" >SideQuest Home</button>
|
||||
<button mz-button [flat]="true" mz-modal-close>Close</button>
|
||||
</mz-modal-footer>
|
||||
</mz-modal>
|
||||
|
||||
@@ -10,6 +10,8 @@ import { DragAndDropService } from '../drag-and-drop.service';
|
||||
import { Router } from '@angular/router';
|
||||
import { ProcessBucketService } from '../process-bucket.service';
|
||||
import { Subscription } from 'rxjs/Subscription';
|
||||
import { environment } from '../../environments/environment';
|
||||
|
||||
interface ReplaceText {
|
||||
key: string;
|
||||
value: string;
|
||||
@@ -45,6 +47,7 @@ export class HeaderComponent implements OnInit {
|
||||
adbCommandToRun: string;
|
||||
osPlatform: string;
|
||||
saveLogcatPath: string;
|
||||
webUrl = environment.configuration.web_url;
|
||||
favourites: {
|
||||
browserFavourites: FavouriteItem[];
|
||||
fileFavourites: FavouriteItem[];
|
||||
@@ -98,7 +101,8 @@ export class HeaderComponent implements OnInit {
|
||||
public statusService: StatusBarService,
|
||||
public beatonService: BeatOnService,
|
||||
public dragAndDropService: DragAndDropService,
|
||||
public processService: ProcessBucketService
|
||||
public processService: ProcessBucketService,
|
||||
private router: Router
|
||||
) {
|
||||
this.osPlatform = this.appService.os.platform();
|
||||
console.log('Platform: ' + this.osPlatform);
|
||||
@@ -107,6 +111,19 @@ export class HeaderComponent implements OnInit {
|
||||
this.resetFavourites('commandFavourites');
|
||||
this.appService.headerComponent = this;
|
||||
}
|
||||
doBack() {
|
||||
if (
|
||||
this.appService.isTasksOpen ||
|
||||
this.appService.isFilesOpen ||
|
||||
this.appService.isPackagesOpen ||
|
||||
this.appService.isSettingsOpen
|
||||
) {
|
||||
this.router.navigateByUrl('/webview');
|
||||
return;
|
||||
} else {
|
||||
this.webService.back();
|
||||
}
|
||||
}
|
||||
resetFavourites(type: string) {
|
||||
let defaultFavs;
|
||||
switch (type) {
|
||||
@@ -182,7 +199,7 @@ export class HeaderComponent implements OnInit {
|
||||
}
|
||||
|
||||
updateAvailable() {
|
||||
this.appService.opn('https://sidequestvr.com/download');
|
||||
this.appService.opn(`${environment.configuration.web_url || 'https://sidequestvr.com'}/download`);
|
||||
}
|
||||
|
||||
startLogcat() {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Injectable, isDevMode } from '@angular/core';
|
||||
import { AppService } from './app.service';
|
||||
import { environment } from '../environments/environment';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
@@ -7,7 +8,7 @@ import { AppService } from './app.service';
|
||||
export class WebviewService {
|
||||
webView: any;
|
||||
isWebviewOpen: boolean;
|
||||
currentAddress: string = 'https://sidequestvr.com';
|
||||
currentAddress: string = environment.configuration.web_url || 'https://sidequestvr.com';
|
||||
isWebviewLoading: boolean = false;
|
||||
isLoaded = () => {};
|
||||
constructor(private appService: AppService) {
|
||||
|
||||
Reference in New Issue
Block a user