Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ArkBot/Ark/ArkContextManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ public ArkServerContext[] GetServersInCluster(string key)
{
if (key == null) return null;

return Servers.Where(x => x.Config.ClusterKey.Equals(key, StringComparison.OrdinalIgnoreCase)).ToArray();
return Servers.Where(x => x.Config.ClusterKey?.Equals(key, StringComparison.OrdinalIgnoreCase) == true).ToArray();
}

public ArkClusterContext GetCluster(string key)
Expand Down
2 changes: 1 addition & 1 deletion ArkBot/WebApp/dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@
<h3 class="w3-text-grey">Loading...</h3>
</div>
</section>
<script type="text/javascript" src="inline.9e5f573f17601dcc9e1a.bundle.js"></script><script type="text/javascript" src="polyfills.70a52f0b33460f37363a.bundle.js"></script><script type="text/javascript" src="scripts.fbf4958174ba477fe15b.bundle.js"></script><script type="text/javascript" src="vendor.f8d4a57af80469b13c5c.bundle.js"></script><script type="text/javascript" src="main.5c285ad7e37cab7baf69.bundle.js"></script></body>
<script type="text/javascript" src="inline.c034f60d1641851a325c.bundle.js"></script><script type="text/javascript" src="polyfills.c2c650e443c940acda1b.bundle.js"></script><script type="text/javascript" src="scripts.01c3505ddbe0d20e9ed0.bundle.js"></script><script type="text/javascript" src="vendor.f8d4a57af80469b13c5c.bundle.js"></script><script type="text/javascript" src="main.530f7ebf959a6f5fc07c.bundle.js"></script></body>
</html>
1 change: 0 additions & 1 deletion ArkBot/WebApp/dist/inline.9e5f573f17601dcc9e1a.bundle.js

This file was deleted.

1 change: 1 addition & 0 deletions ArkBot/WebApp/dist/inline.c034f60d1641851a325c.bundle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions ArkBot/WebApp/dist/main.530f7ebf959a6f5fc07c.bundle.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion ArkBot/WebApp/dist/main.5c285ad7e37cab7baf69.bundle.js

This file was deleted.

6 changes: 3 additions & 3 deletions ArkBot/WebApp/dist/vendor.f8d4a57af80469b13c5c.bundle.js

Large diffs are not rendered by default.

12 changes: 10 additions & 2 deletions ArkBot/WebApp/src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div id="page">
<div class="w3-bar">
<breadcrumb prefix="Home" [useBootstrap]="false" class="breadcrumb w3-bar-item"></breadcrumb>
<div class="w3-bar-item w3-right w3-tiny theme-l1"><span *ngIf="dataService.Servers?.User?.SteamId">Logged in as {{dataService.Servers.User.Name}} | <a [href]="getLogoutUrl()">Logout</a> | </span><span *ngIf="!dataService.Servers?.User?.SteamId"><a href="#" (click)="openLogin($event)">Login</a> | </span>Theme: <a href="#" (click)="setTheme('light')">Light</a> | <a href="#" (click)="setTheme('dark')">Dark</a></div>
<div class="w3-bar-item w3-right w3-tiny theme-l1"><span *ngIf="dataService.Servers?.User?.SteamId">Logged in as {{dataService.Servers.User.Name}} | <a [href]="getLogoutUrl()">Logout</a> | </span><span *ngIf="!dataService.Servers?.User?.SteamId"><a href="#" (click)="openLogin($event)">Login</a> | </span><span *ngIf="this.dataService.hasFeatureAccess('pages', 'admin-server')"><a href="#" (click)="openAdminOptions($event)">Admin Options</a> | </span>Theme: <a href="#" (click)="setTheme('light')">Light</a> | <a href="#" (click)="setTheme('dark')">Dark</a></div>
</div>
<router-outlet></router-outlet>
</div>
Expand All @@ -29,9 +29,17 @@ <h2>Log In</h2>
<span (click)="showAdmin = false" class="w3-button theme-d1 w3-xlarge w3-display-topright">&times;</span>
<h2>Admin Options</h2>
</header>
<div class="w3-container w3-medium theme-l2">
<div class="w3-section">
These setting are configured in the application configuration editor/config.json but can be generated and previewed here.
</div>
</div>
<div class="w3-container w3-medium theme-l2">
<div class="w3-section"><button class="w3-button theme-d1" style="width: 100%;" (click)="openCustomTheme($event, customTheme)">Create Custom Theme</button></div>
<div class="w3-section">
<button class="w3-button theme-d1" style="width: 100%;" (click)="previewOverrideMenuOption = !previewOverrideMenuOption"><i [ngClass]="{'w3-hide': !previewOverrideMenuOption}" class="material-icons" style="margin: -5px 5px -5px -5px; vertical-align: middle;">check</i>{{(previewOverrideMenuOption ? previewMenuName + " Preview Enabled" : "Preview " + previewMenuName )}}</button>
</div>
</div>
</div>
</div>
<custom-theme #customTheme *ngIf="dataService.hasFeatureAccess('pages', 'admin-server')"></custom-theme>
<custom-theme #customTheme></custom-theme>
14 changes: 13 additions & 1 deletion ArkBot/WebApp/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export class AppComponent implements OnInit, OnDestroy {
};
public showLogin: boolean = false;
public showAdmin: boolean = false;
public previewOverrideMenuOption: boolean = false;
public previewMenuName: string;
public currentUrl: string = "/";
private serversUpdatedSubscription: any;
private serversUpdatedBefore: boolean = false;
Expand Down Expand Up @@ -61,6 +63,9 @@ export class AppComponent implements OnInit, OnDestroy {
this.doc.getElementsByTagName("head")[0].appendChild(l);
}

if (typeof config !== 'undefined' && config.webapp !== 'undefined' && config.webapp.topMenu === true) this.previewMenuName = "Sidebar Menu";
else this.previewMenuName = "Top Menu";

breadcrumbService.addFriendlyNameForRoute('/accessdenied', 'Access Denied');
breadcrumbService.addFriendlyNameForRoute('/connectionerror', 'Connection error');
breadcrumbService.hideRoute('/player');
Expand Down Expand Up @@ -112,7 +117,8 @@ export class AppComponent implements OnInit, OnDestroy {

getBodyClasses(): string {
let classes = this.getTheme();
if (typeof config !== 'undefined' && config.webapp !== 'undefined' && config.webapp.topMenu === true)
let topmenu = typeof config !== 'undefined' && config.webapp !== 'undefined' && config.webapp.topMenu === true;
if (topmenu !== this.previewOverrideMenuOption)
classes += " topmenu";
return classes;
}
Expand Down Expand Up @@ -142,6 +148,12 @@ export class AppComponent implements OnInit, OnDestroy {
this.showLogin = false;
}

openAdminOptions(event: any) {
this.showAdmin = true;
event.stopPropagation();
event.preventDefault();
}

openCustomTheme(event: any, customTheme: any): void {
event.stopPropagation();
event.preventDefault();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div id="modal_custom_theme" class="w3-modal" [style.display]="_show ? 'block' : 'none'" [style.opacity]="_hoverHide ? 0 : 1">
<div *ngIf="dataService.hasFeatureAccess('pages', 'admin-server')" id="modal_custom_theme" class="w3-modal" [style.display]="_show ? 'block' : 'none'" [style.opacity]="_hoverHide ? 0 : 1">
<div class="w3-modal-content w3-card-4 w3-animate-zoom" (clickOutside)="_show = false" style="font-size: 0;">
<header class="w3-container theme-d1">
<span (click)="_show = false" class="w3-button theme-d1 w3-xlarge w3-display-topright">&times;</span>
Expand Down
4 changes: 3 additions & 1 deletion ArkBot/WebApp/src/app/custom-theme/custom-theme.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Component, Inject, ViewChild } from '@angular/core';
import { CommonModule } from '@angular/common';
import { NotificationsService } from 'angular2-notifications';
import { DOCUMENT } from '@angular/common';
import { DataService } from '../data.service';
import { copyToClipboard } from '../utils'

type CustomTheme = {
Expand Down Expand Up @@ -38,7 +39,8 @@ export class CustomThemeComponent {
public currentCustomThemeGroup: CustomThemeGroup = this.customThemeGroups[0];

constructor(@Inject(DOCUMENT) private doc: any,
private notificationsService: NotificationsService) {}
private notificationsService: NotificationsService,
private dataService: DataService) {}

private toHexColor(colorStr: string): string {
let a = this.doc.createElement('div');
Expand Down