1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-10 23:31:13 -05:00

huge commit for webfront facelift

This commit is contained in:
RaidMax
2022-04-19 18:43:58 -05:00
parent 7b78e0803a
commit d5b4c60e5a
105 changed files with 2981 additions and 2545 deletions

View File

@ -1,28 +0,0 @@
$white: #fff !default;
$blue: #007ACC !default;
$red: rgba(255, 69, 69, 0.85) !default;
$green: rgba(116,147,99, 1) !default;
$orange: #fd7e14 !default;
$primary: $blue !default;
$secondary: $orange !default;
$light: rgb(204, 204, 204) !default;
$dark: rgb(24, 24, 24) !default;
$body-bg: rgb(34, 34, 34) !default;
$big-dark: #191919;
$body-color: $white !default;
$link-color: $white !default;
$link-decoration: none !default;
$link-hover-color: $primary !default;
$link-hover-decoration: none !default;
$font-family-sans-serif: -apple-system, BlinkMacSystemFont, "Open Sans", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol" !default;
$navbar-padding-y: 0 !default;
$navbar-nav-link-padding-x: 2rem !default;
$font-size-base: 1rem !default; // Assumes the browser default, typically `16px`
$h5-font-size: $font-size-base * 1.25 !default;
$h1-font-size: $font-size-base * 2.5 !default;
$navbar-brand-font-size: $h1-font-size !default;
$navbar-toggler-font-size: $h5-font-size !default;
$navbar-dark-hover-color: $primary !default;
@import '../../lib/bootstrap/scss/bootstrap.scss';

View File

@ -3,16 +3,28 @@
$icon-font-path: '/font/' !default;
@import '../../lib/open-iconic/font/css/open-iconic-bootstrap.scss';
.navbar-nav .nav-link:hover {
background-color: $body-bg;
}
nav.navbar-dark {
border-bottom: 1px solid $secondary;
}
a.nav-link {
padding: $spacer * 1.5;
:root {
--blue-color: #007ACC;
--yellow-color: #fe7e4c;
--yellow-color-dark: #fe7e4c88;
--yellow-color-very-dark: #fe7e4c22;
--yellow-color-light: #fe7e4c88;
--yellow-color-very-light: #fe7e4c22;
--red-color: #ff6060;
--red-color-dark: #ff606088;
--red-color-very-dark: #ff606022;
--red-color-light: #ff606088;
--red-color-very-light: #ff606022;
--green-color: #8cc982;
--lm-base-body-bg-color: rgb(245, 245, 245);
--lm-card-bg-color: var(--gray-color-light);
--gray-color-light: white;
//--dm-border-color: var(--primary-color);
//--lm-border-color: var(--primary-color);
--card-border-width: 0;
}
.server-history-row {
@ -30,42 +42,11 @@ a.nav-link {
border: none;
}
.server-history,
.server-activity,
#mobile_seperator,
.border-bottom {
border-bottom: 1px solid $primary !important;
}
.border-bottom-dark {
border-bottom: 1px solid $body-bg !important;
}
.server-history {
background-color: $big-dark;
}
.border-top {
border-top: 1px solid $primary !important;
}
#client_search {
background-color: #222222 !important;
border-radius: 0;
border: 1px solid $orange;
color: $white;
}
.server-join-button, .server-join-button:hover {
color: $white !important;
}
a.link-inverse {
color: $primary;
}
a.link-inverse:hover {
color: $white;
border-top: 1px solid var(--primary-color) !important;
}
@media (min-width: 768px) {
@ -90,7 +71,6 @@ a.link-inverse:hover {
#console .form-control, #console button {
border-radius: 0;
border-color: $primary;
border-left: 0;
border-right: 0;
}
@ -100,29 +80,16 @@ a.link-inverse:hover {
}
.modal-footer {
border-top-color: $orange;
border-top-color: var(--secondary-color);
}
.modal-header {
border-bottom-color: $orange;
}
form *, select, button.btn {
border-radius: 0 !important;
border-bottom-color: var(--secondary-color);
}
#penalty_filter_selection {
border-left: none !important;
border-right: none !important;
border-bottom: none !important;
border-top: 1px solid $text-muted;
}
.oi-fix-navbar {
line-height: 1.5 !important;
top: 0 !important;
font-size: 1rem !important;
}
border: none !important;
}
@-webkit-keyframes rotation {
from {
@ -140,11 +107,11 @@ form *, select, button.btn {
top: 50% !important;
margin-left: -37px;
margin-top: -37px;
color: $primary;
color: var(--dm-base-text-color);
z-index: 100;
font-size: 4rem;
-webkit-animation: rotation 1s infinite linear;
background-color: rgba(0, 0,0, 0.5);
background-color: var(--primary-color);
border-radius: 40px;
padding: 5px;
visibility: hidden;
@ -161,7 +128,7 @@ form *, select, button.btn {
}
.input-text-danger {
border-color: $red !important;
border-color: var(--red-color) !important;
}
.form-control:focus {
@ -169,11 +136,6 @@ form *, select, button.btn {
-webkit-box-shadow: none;
}
.dropdown-item {
border-bottom: 1px solid $secondary;
margin-top: -3px;
}
.striped > div:nth-child(even) {
background-color: rgba(0, 0, 0, 0.125);
}
@ -211,43 +173,6 @@ form *, select, button.btn {
right: 1em;
}
.nav-tabs, .nav-tabs .nav-link.active {
color: $white !important;
border: none;
}
.nav-tabs .nav-link:hover {
color: $blue;
background-color: rgba(24, 24, 24, 0.75);
border: none;
}
.nav-tabs .nav-link {
border-radius: 0;
padding: 1.5rem;
color: #6c757d;
border: none;
min-width: 20rem;
background-color: #181818;
}
.nav-tabs .nav-link.active {
border: none;
background-color: $blue;
}
.nav-tabs .nav-link.active:hover {
background-color: darken($primary, 10%);
}
title {
background-color: darken($primary, 10%);
}
.nav-tabs .nav-item {
margin-bottom: 0;
}
.mt-n1 {
margin-top: -0.25rem !important;
}
@ -258,7 +183,7 @@ title {
/* Configuration */
.configuration-form input[type='text'], .configuration-form input[type='number'], input.text-box {
border: 1px solid $orange;
border: 1px solid var(--secondary-color);
}
.hide {
@ -273,6 +198,7 @@ title {
background-repeat: no-repeat
}
/*
.text-color-code-0 {
color: $dark;
}
@ -286,7 +212,7 @@ title {
}
.text-color-code-3 {
color: $yellow;
// color: $yellow;
}
.text-color-code-4 {
@ -294,11 +220,11 @@ title {
}
.text-color-code-5 {
color: $teal;
// color: $teal;
}
.text-color-code-5 {
color: $purple;
//color: $purple;
}
.text-color-code-7 {
@ -312,7 +238,7 @@ title {
.text-color-code-58 {
animation: color-change 54s infinite;
}
*/
@keyframes color-change {
0% {
color: #ff0000;
@ -343,56 +269,6 @@ title {
}
}
.toggle-switch input {
opacity: 0;
width: 0;
height: 0;
margin:0;
padding: 0;
}
label.toggle-switch {
margin: 0;
}
.toggle-switch {
position: relative;
height: calc(1.5em + 0.75rem + 2px);
width: 6rem;
border: 1px solid $text-muted;
}
.toggle-switch-slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: $dark;
-webkit-transition: .4s;
transition: .4s;
}
.toggle-switch-slider:before {
position: absolute;
content: "";
height: calc(1.5em + 0.75rem);
width: 3em;
background-color: $light;
-webkit-transition: 0.25s;
transition: 0.25s;
}
input:checked + .toggle-switch-slider {
background-color: $primary;
}
input:checked + .toggle-switch-slider:before {
-webkit-transform: translateX(3em);
-ms-transform: translateX(3em);
transform: translateX(3em);
}
.action-kick-button {
color: #492121;
margin-top: 0.25rem;
@ -411,37 +287,16 @@ input:checked + .toggle-switch-slider:before {
div.card {
min-width: 15rem;
border-radius: 0;
}
.stat-card {
max-width: 15rem;
}
#rank_icon {
max-height: 6rem;
}
.border-bottom-danger {
border-bottom: $danger;
}
.border-top-danger {
border-top: $danger;
}
.border-danger {
border: 1px solid $danger;
}
#client_stats_summary a:hover {
color: #e0e0e0;
}
#hitlocation_container {
background-color: #141414;
}
.cursor-help {
cursor: help;
}
@ -467,3 +322,127 @@ div.card {
.team-spectator-bg {
background-color: rgba(200, 200, 0, 0.1);
}
#penalty_table tr.d-table-row, {
border: 0;
}
.server-header {
--dm-navbar-link-text-color-hover: white;
--lm-navbar-link-text-color-hover: white;
}
#console_server_select {
--input-border-width: 0;
}
.sidebar-link > .oi {
font-size: 1.2rem;
}
table {
border-collapse: collapse;
border-radius: var(--base-border-radius) !important;
overflow: hidden;
}
.ui-error-icon {
background-image:url('/images/ui/error-face.svg');
background-size: contain;
background-position: center center;
background-repeat: no-repeat;
}
/* Sidenav */
.on-this-page-nav {
position: fixed;
margin-right: 2rem;
z-index: 20;
background-color: var(--lm-base-body-bg-color);
padding: 0.5rem;
border-radius: 0.4rem;
}
.dark-mode .on-this-page-nav {
background-color: #25282c;
}
.on-this-page-nav .title {
font-weight: 500;
font-size: 1.5rem;
margin-bottom: 1rem;
}
.on-this-page-nav a {
text-align: left;
display: block;
padding: 0.4rem 0 0.4rem 2rem;
line-height: 1.4;
color: rgba(0, 0, 0, 0.7);
border-left: 1px solid rgba(0, 0, 0, 0.15);
}
.dark-mode .on-this-page-nav a {
color: rgba(255, 255, 255, 0.65);
border-color: rgba(255, 255, 255, 0.15);
}
.on-this-page-nav a:hover,
.dark-mode .on-this-page-nav a:hover, {
color: #1890ff;
text-decoration: none;
}
@media (max-width: 1200px) {
.on-this-page-nav-container {
display: none;
}
}
.no-decoration {
text-decoration: none !important;
}
.h-125 {
height: 12.5rem!important;
}
.w-125 {
width: 12.5rem!important;
}
table.with-fixed-layout {
table-layout:fixed;
}
table.with-auto-width td {
width: 1px;
white-space: nowrap;
}
.bg-light-ex-lm {
background-color: var(--lm-base-body-bg-color);
}
.progress-bar {
height: 2px;
background-color: var(--primary-color);
width: 100%;
overflow: hidden;
}
.progress-bar-value {
width: 100%;
height: 100%;
background-color:black;
animation: indeterminateAnimation 2s infinite linear;
transform-origin: 0 50%;
}
@keyframes indeterminateAnimation {
0% {
transform: translateX(0) scaleX(0);
}
40% {
transform: translateX(0) scaleX(0.4);
}
100% {
transform: translateX(100%) scaleX(0.5);
}
}

View File

@ -1,93 +1,89 @@
@import 'bootstrap-custom.scss';
.level-bgcolor-console {
.level-bgcolor-console {
background-color: grey;
}
.level-color-user, .level-color-guest, .level-color-0 {
color: #6c757d;
color: rgba(255, 255, 255, 0.68);
}
.level-bgcolor-user, .level-bgcolor-guest, .level-bgcolor-0 {
background-color: #6c757d;
background-color: rgba(255, 255, 255, 0.68);
background-color: #6c757d !important;
background-color: rgba(255, 255, 255, 0.68) !important;
}
.level-color-trusted, .level-color-2 {
color: #749363;
color: rgba(116,147,99,1);
color: #749363 !important;
color: rgba(116,147,99,1) !important;
}
.level-bgcolor-trusted, .level-bgcolor-2 {
background-color: #749363;
background-color: rgba(116,147,99,1);
background-color: #749363 !important;
background-color: rgba(116,147,99,1) !important;
}
.level-color-flagged, .level-color-1 {
color: #fd9c38;
color: rgba(253, 139, 22, 0.85);
color: #fd9c38 !important;
color: rgba(253, 139, 22, 0.85) !important;
}
.level-bgcolor-flagged, .level-bgcolor-1 {
background-color: #fd9c38;
background-color: rgba(253, 139, 22, 0.85);
background-color: #fd9c38 !important;
background-color: rgba(253, 139, 22, 0.85) !important;
}
.level-color-banned, .level-color-console, .level-color--1 {
color: #ff6060;
color: #ff6060 !important;
color: rgba(255, 69, 69, 0.85);
}
.level-bgcolor-banned, .level-bgcolor--1 {
background-color: #ff6060;
background-color: rgba(255, 69, 69, 0.85);
background-color: #ff6060 !important ;
background-color: rgba(255, 69, 69, 0.85) !important;
}
.level-color-moderator, .level-color-3 {
color: #f0de8b;
color: rgba(235, 211, 101, 0.75);
color: #f0de8b !important;
color: rgba(235, 211, 101, 0.75) !important;
}
.level-bgcolor-moderator, .level-bgcolor-3 {
background-color: #f0de8b;
background-color: rgba(235, 211, 101, 0.75);
background-color: #f0de8b !important;
background-color: rgba(235, 211, 101, 0.75) !important;
}
.level-color-administrator, .level-color-4 {
color: #f1a8e8;
color: rgba(236, 130, 222, 0.69);
color: #f1a8e8 !important;
color: rgba(236, 130, 222, 0.69) !important;
}
.level-bgcolor-administrator, .level-bgcolor-4 {
background-color: #f1a8e8;
background-color: rgba(236, 130, 222, 0.69);
background-color: #f1a8e8 !important;
background-color: rgba(236, 130, 222, 0.69) !important;
}
.level-color-senioradmin, .level-color-5 {
color: #50bcc3;
color: rgba(50, 177, 185, 0.85);
color: #50bcc3 !important;
color: rgba(50, 177, 185, 0.85) !important;
}
.level-bgcolor-senioradmin, .level-bgcolor-5 {
background-color: #50bcc3;
background-color: rgba(50, 177, 185, 0.85);
background-color: #50bcc3 !important;
background-color: rgba(50, 177, 185, 0.85) !important;
}
.level-color-owner, .level-color-6 {
color: rgb(0, 122, 204);
color: rgb(0, 122, 204) !important;
}
.level-bgcolor-owner, .level-bgcolor-6 {
background-color: $primary;
background-color: var(--primary-color) !important;
}
.level-color-8 {
color: #de4423;
color: #de4423 !important;
}
.level-bgcolor-8 {
background-color: #de4423;
background-color: #de4423 !important;
}
.profile-meta-title {
@ -137,7 +133,6 @@
}
#profile_aliases_btn {
color: $blue;
cursor: pointer;
}
@ -145,10 +140,6 @@
cursor: pointer;
}
.oi:hover {
color: darken($primary, 10%) !important;
}
#profile_aliases {
position: relative;
display: none;
@ -197,15 +188,28 @@
word-break: break-all;
}
#filter_meta_container .nav-link:hover {
background-color: $dark;
color: $white !important;
}
.ip-lookup-profile {
height: 2.5rem;
min-width: 3.0rem;
background-size: contain;
background-repeat: no-repeat;
background-position: center;
}
.status-indicator {
height: 1rem;
width: 1rem;
}
.with-ripple {
animation: ripple 1.5s ease-out infinite;
}
@keyframes ripple {
from {
opacity: 1;
transform: scale(1);
}
to {
opacity: 0;
transform: scale(2);
}
}

View File

@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.0"
width="64"
height="64"
id="svg2"
inkscape:version="0.91 r13725"
sodipodi:docname="Location_dot_lightgrey.svg">
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1600"
inkscape:window-height="837"
id="namedview5"
showgrid="false"
inkscape:zoom="7.3822688"
inkscape:cx="32"
inkscape:cy="32"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="svg2" />
<defs
id="defs8" />
<circle
cx="32"
cy="32"
r="30"
id="circle4"
style="fill:#808080;stroke:none;stroke-width:0.1" />
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 17.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="32px" height="32px" viewBox="0 0 32 32" enable-background="new 0 0 32 32" xml:space="preserve">
<g>
<path fill="#828282" d="M16-0.034C7.159-0.034-0.035,7.158-0.035,16S7.159,32.034,16,32.034S32.035,24.842,32.035,16
S24.841-0.034,16-0.034z M16,30.966C7.748,30.966,1.035,24.252,1.035,16S7.748,1.034,16,1.034S30.965,7.748,30.965,16
S24.252,30.966,16,30.966z"/>
<path fill="#828282" d="M16.163,19.823c-2.789,0-5.477,1.179-7.374,3.235c-0.2,0.217-0.187,0.555,0.031,0.755
c0.216,0.2,0.554,0.188,0.755-0.03c1.695-1.838,4.096-2.892,6.587-2.892c2.529,0,4.956,1.081,6.656,2.967
c0.105,0.116,0.251,0.176,0.397,0.176c0.128,0,0.256-0.045,0.358-0.138c0.219-0.197,0.237-0.535,0.039-0.755
C21.709,21.032,18.994,19.823,16.163,19.823z"/>
<path fill="#828282" d="M10.5,16.5c1.103,0,2-0.897,2-2s-0.897-2-2-2s-2,0.897-2,2S9.397,16.5,10.5,16.5z M10.5,13.5
c0.551,0,1,0.448,1,1s-0.449,1-1,1s-1-0.448-1-1S9.949,13.5,10.5,13.5z"/>
<path fill="#828282" d="M21.5,16.5c1.103,0,2-0.897,2-2s-0.897-2-2-2s-2,0.897-2,2S20.397,16.5,21.5,16.5z M21.5,13.5
c0.551,0,1,0.448,1,1s-0.449,1-1,1s-1-0.448-1-1S20.949,13.5,21.5,13.5z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -1,52 +1,101 @@
function hideLoader() {
$('.layout-loading-icon').fadeOut();
$('#mainLoadingBar').fadeOut();
$('#modalLoadingBar').fadeOut();
}
function showLoader() {
$('.layout-loading-icon').attr('style', 'visibility:visible');
$('.layout-loading-icon').removeClass('text-danger');
$('.layout-loading-icon').removeClass('text-muted');
$('.layout-loading-icon').fadeIn();
$('#mainLoadingBar').fadeIn();
$('#modalLoadingBar').fadeIn();
}
function errorLoader() {
$('.layout-loading-icon').addClass('text-danger');
$('#mainLoadingBar').addClass('bg-danger').delay(2000).fadeOut();
}
function staleLoader() {
$('.layout-loading-icon').addClass('text-muted');
$('#mainLoadingBar').addClass('bg-grey');
}
function getUrlParameter(sParam) {
let sPageURL = window.location.search.substring(1),
sURLVariables = sPageURL.split('&'),
sParameterName,
i;
for (i = 0; i < sURLVariables.length; i++) {
sParameterName = sURLVariables[i].split('=');
if (sParameterName[0] === sParam) {
return sParameterName[1] === undefined ? true : decodeURIComponent(sParameterName[1]);
}
}
return false;
}
function clearQueryString() {
const uri = window.location.href.toString();
if (uri.indexOf("?") > 0) {
const cleanUri = uri.substring(0, uri.indexOf("?"));
window.history.replaceState({}, document.title, cleanUri);
}
}
const entityMap = {
'&': '&amp;',
'<': '&lt;',
'>': '&gt;',
'"': '&quot;',
"'": '&#39;',
'/': '&#x2F;',
'`': '&#x60;',
'=': '&#x3D;'
};
function escapeHtml (string) {
return String(string).replace(/[&<>"'`=\/]/g, function (s) {
return entityMap[s];
});
}
$(document).ready(function () {
let toastMessage = getUrlParameter('toastMessage');
if (toastMessage) {
toastMessage = unescape(toastMessage);
}
if (toastMessage) {
clearQueryString();
halfmoon.initStickyAlert({
content: toastMessage,
title: 'Success',
alertType: 'alert-success',
fillType: 'filled'
});
}
hideLoader();
/*
* hide loader when clicking
*/
$(document).click(function (e) {
//hideLoader()
});
/*
* handle action modal
*/
$(document).off('click', '.profile-action');
$(document).on('click', '.profile-action', function (e) {
$(document).on('click', '.profile-action', function () {
const actionType = $(this).data('action');
const actionId = $(this).data('action-id');
const actionIdKey = actionId === undefined ? '' : '?id=' + actionId;
$.get('/Action/' + actionType + 'Form' + actionIdKey)
const actionIdKey = actionId === undefined ? '' : `?id=${actionId}`;
showLoader();
$.get(`/Action/${actionType}Form/${actionIdKey}`)
.done(function (response) {
$('#actionModal .modal-message').fadeOut('fast');
$('#actionModal .modal-body-content').html(response);
$('#actionModal').modal();
$('#actionModal').trigger('action_form_received', actionType);
$('#actionModalContent').html(response);
hideLoader();
})
.fail(function (jqxhr, textStatus, error) {
$('#actionModal .modal-body-content').html('');
$('#actionModal .modal-message').text(_localization['GLOBAL_ERROR'] + ' — ' + jqxhr.responseText);
$('#actionModal').modal();
$('#actionModal .modal-message').fadeIn('fast');
halfmoon.initStickyAlert({
content: jqxhr.responseText,
title: 'Error',
alertType: 'alert-danger',
fillType: 'filled'
});
});
});
@ -56,35 +105,58 @@ $(document).ready(function () {
$(document).on('submit', '.action-form', function (e) {
e.preventDefault();
$(this).append($('#target_id input'));
$('#actionModal').data('should-refresh', $('#actionModal').find('.refreshable').length !== 0);
const modal = $('#actionModal');
const shouldRefresh = modal.data('should-refresh', modal.find('.refreshable').length !== 0);
const data = $(this).serialize();
showLoader();
$.get($(this).attr('action') + '/?' + data)
.done(function (response) {
hideLoader();
// success without content
if (response.length === 0) {
location.reload();
}
else {
$('#actionModal .modal-message').fadeOut('fast');
$('#actionModal .modal-body-content').html(response);
$('#actionModal').modal();
} else {
let message = response;
try {
message = response.map(r => escapeHtml(r.response));
}
catch{}
if (shouldRefresh) {
window.location = `${window.location.href.replace('#actionModal', '')}?toastMessage=${escape(message)}`;
}
else {
modal.modal();
halfmoon.initStickyAlert({
content: escapeHtml(message),
title: 'Executed',
alertType: 'alert-primary',
fillType: 'filled'
});
}
}
})
.fail(function (jqxhr, textStatus, error) {
errorLoader();
.fail(function (jqxhr) {
hideLoader();
if ($('#actionModal .modal-message').text.length > 0) {
$('#actionModal .modal-message').fadeOut('fast');
let message = jqxhr.responseText;
try {
const jsonMessage = $.parseJSON(message);
if (jsonMessage) {
message = jsonMessage.map(r => escapeHtml(r.response));
}
}
if (jqxhr.status === 401) {
$('#actionModal .modal-message').text(_localization['WEBFRONT_ACTION_CREDENTIALS']);
}
else {
$('#actionModal .modal-message').text(_localization['GLOBAL_ERROR'] + ' — ' + jqxhr.responseText);
}
$('#actionModal .modal-message').fadeIn('fast');
catch{}
halfmoon.initStickyAlert({
content: message.join("<br/>"),
title: 'Error',
alertType: 'alert-danger',
fillType: 'filled'
});
});
});
@ -96,8 +168,8 @@ $(document).ready(function () {
if (actionType === 'RecentClients') {
const ipAddresses = $('.client-location-flag');
$.each(ipAddresses, function (index, address) {
$.get('https://ip2c.org/' + $(address).data('ip'), function (result) {
const countryCode = result.split(';')[1].toLowerCase();
$.get(`https://get.geojs.io/v1/ip/country/${(address).data('ip')}.json`, function (result) {
const countryCode = result['country'].toLowerCase();
if (countryCode !== 'zz') {
$(address).css('background-image', `url('https://flagcdn.com/w80/${countryCode}.png')`);
}
@ -105,15 +177,4 @@ $(document).ready(function () {
});
}
});
/*
* handle close event to refresh if need be
*/
$("#actionModal").on("hidden.bs.modal", function () {
let shouldRefresh = $(this).data('should-refresh');
if (shouldRefresh !== undefined && shouldRefresh) {
location.reload();
}
});
});
});

View File

@ -4,7 +4,15 @@
$(document).ready(function () {
$('.table-slide').click(function () {
$(this).siblings().children().children('.hidden-row').slideToggle(0);
if ($(window).width() < 993) {
$(this).prev().find('.hidden-row').toggleClass('d-none d-flex');
} else {
$(this).prev().find('.hidden-row-lg').toggleClass('d-none');
}
$(this).attr('data-title', '');
$(this).attr('data-toggle', '');
$(this).children('span').toggleClass('oi-chevron-top oi-chevron-bottom');
});
setupPerformanceGraph();
@ -364,7 +372,7 @@ function renderPerformanceChart() {
elements: {
line: {
fill: false,
borderColor: 'rgba(255, 255, 255, 0.75)',
borderColor: halfmoon.getPreferredMode() === "light-mode" ? 'rgba(0, 0, 0, 0.85)' : 'rgba(255, 255, 255, 0.75)',
borderWidth: 2
},
point: {
@ -407,4 +415,4 @@ function renderPerformanceChart() {
data: chartData,
options: options
});
}
}

View File

@ -7,16 +7,30 @@
}
showLoader();
$.get('/Console/ExecuteAsync', { serverId: serverId, command: command })
$.get('/Console/Execute', { serverId: serverId, command: command })
.done(function (response) {
$('#console_command_response pre').html('');
hideLoader();
$('#console_command_response').append(response);
response.map(r => r.response).forEach(item => {
$('#console_command_response').append(`<div>${item}</div>`);
})
$('#console_command_response').append('<hr/>')
$('#console_command_value').val("");
})
.fail(function (jqxhr, textStatus, error) {
.fail(function (response) {
$('#console_command_response pre').html('');
errorLoader();
hideLoader();
$('#console_command_response').text(_localization['WEBFRONT_CONSOLE_ERROR'] + error).addClass('text-danger');
if (response.status < 500) {
response.responseJSON.map(r => r.response).forEach(item => {
$('#console_command_response').append(`<div class="text-danger">${item}</div>`);
})
} else {
$('#console_command_response').append(`<div class="text-danger">Could not execute command...</div>`);
}
});
}
@ -36,4 +50,4 @@ $(document).ready(function () {
executeCommand();
}
});
});
});

View File

@ -1,6 +1,7 @@
const textOffset = 15;
let previousRadarData = undefined;
let newRadarData = undefined;
let stateInfo;
/************************
* IW4 *
@ -219,42 +220,47 @@ function updatePlayerData() {
}
let column = player.team === 'allies' ? $('.player-data-left') : $('.player-data-right');
column.append(`<div class="progress" style="height: 1.5rem; background-color: transparent;">
<div style="position: absolute; font-size: 1rem; left: 1.5rem;">${player.name}</div>
<div class="progress-bar bg-success" role="progressbar" style="min-width: 0px; width: ${player.health}%" aria-valuenow="${player.health}" aria-valuemin="0" aria-valuemax="100"></div>
<div class="progress-bar bg-danger" role="progressbar" style="min-width: 0px; border-right: 0px; width: ${100 - player.health}%" aria-valuenow="${100 - player.health}" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<div class="d-flex flex-row flex-wrap p-2 mb-4 bg-dark border-bottom">
<div style="width: 3rem; height: 1.5rem; background-image:url(${weaponImageForWeapon(player.weapon)}); background-size: 3rem 1.5rem;" class="mr-auto text-left">
</div>
<div class="player-stat-icon" style="background-image:url('/images/radar/kills.png')"></div>
<div class="pr-2">${player.kills}</div>
<div class="player-stat-icon" style="background-image:url('/images/radar/death.png')"></div>
<div class="pr-3">${player.deaths}</div>
<span class="align-self-center oi oi-target pr-1"></span>
<div class="pr-3 ">${player.deaths == 0 ? player.kills.toFixed(2) : (player.kills / player.deaths).toFixed(2)}</div>
<span class="align-self-center oi oi-graph pr-1"></span>
<div>${ player.playTime == 0 ? '&mdash;' : Math.round(player.score / (player.playTime / 60))}</div>
</div>`);
let greenProgressClass = 'rounded-top';
let redProgressClass = 'rounded-right';
if (player.health < 100) {
greenProgressClass = 'rounded-left';
}
if (player.health <= 0) {
redProgressClass = 'rounded-top';
}
column.append(`
<div class="card m-0 p-0 mb-15">
<div class="progress h-25">
<div class="position-absolute ml-10 text-dark" style="top: 1.2rem;">${player.name}</div>
<div class="progress-bar bg-success ${greenProgressClass} h-25" role="progressbar" style="min-width: 0px; width: ${player.health}%" aria-valuenow="${player.health}" aria-valuemin="0" aria-valuemax="100"></div>
<div class="progress-bar bg-danger ${redProgressClass} h-25" role="progressbar" style="min-width: 0px; border-right: 0px; width: ${100 - player.health}%" aria-valuenow="${100 - player.health}" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<div class="ml-10 mr-10 pt-5 pb-5">
<div class="d-flex flex-row bg-dark-dm bg-light-lm rounded-bottom">
<div style="width: 3rem; height: 1.5rem; background-image:url(${weaponImageForWeapon(player.weapon)}); background-size: 3rem 1.5rem;" class="mr-auto text-left align-self-center" data-toggle="tooltip" data-title="${player.weapon}">
</div>
<div class="d-flex">
<div class="player-stat-icon align-self-center" style="background-image:url('/images/radar/kills.png')"></div>
<div class="pr-5 align-self-center">${player.kills}</div>
<div class="player-stat-icon align-self-center" style="background-image:url('/images/radar/death.png')"></div>
<div class="pr-10 align-self-center">${player.deaths}</div>
<span class="align-self-center oi oi-target pr-5"></span>
<div class="pr-10 align-self-center">${player.deaths == 0 ? player.kills.toFixed(2) : (player.kills / player.deaths).toFixed(2)}</div>
<span class="align-self-center oi oi-graph pr-5"></span>
<div>${ player.playTime == 0 ? '&mdash;' : Math.round(player.score / (player.playTime / 60))}</div>
</div>
</div>
</div>
</div>`);
});
$('.player-data-left').delay(1000).animate({opacity: 1}, 500);
$('.player-data-right').delay(1000).animate({opacity: 1}, 500);
}
const stateInfo = {
canvas: $('#map_canvas'),
ctx: $('#map_canvas')[0].getContext('2d'),
updateFrequency: 750,
updateFrameTimeDeviation: 0,
forwardDistance: undefined,
fovWidth: undefined,
mapInfo: undefined,
mapScaler: undefined,
deathIcons: {},
deathIconTime: 4000
};
function updateRadarData() {
$.getJSON(radarDataUrl, function (_radarItem) {
newRadarData = _radarItem;
@ -414,6 +420,20 @@ $(document).ready(function () {
if ($('#map_canvas').length === 0) {
return;
}
stateInfo = {
canvas: $('#map_canvas'),
ctx: $('#map_canvas')[0].getContext('2d'),
updateFrequency: 750,
updateFrameTimeDeviation: 0,
forwardDistance: undefined,
fovWidth: undefined,
mapInfo: undefined,
mapScaler: undefined,
deathIcons: {},
deathIconTime: 4000
};
$.getJSON(radarDataUrl, function (_map) {
stateInfo.mapInfo = _map;
updateRadarData();

View File

@ -13,7 +13,26 @@ function initLoader(location, loaderId, count = 10, start = count, additional =
loadCount = count;
loaderOffset = start;
additionalParams = additional;
setupListeners();
setupMonitor();
$('#loaderLoad').click(function () {
loadMoreItems();
});
}
function setupMonitor() {
const element = document.querySelector('#loaderLoad')
const observer = new window.IntersectionObserver(([entry]) => {
if (entry.isIntersecting && $('.content-wrapper').scrollTop() > 10) {
loadMoreItems();
}
}, {
root: null,
threshold: 1,
})
observer.observe(element);
}
function loadMoreItems() {
@ -23,10 +42,10 @@ function loadMoreItems() {
showLoader();
isLoaderLoading = true;
let params = { offset: loaderOffset, count: loadCount, startAt: startAt };
for (i = 0; i < additionalParams.length; i++) {
let params = {offset: loaderOffset, count: loadCount, startAt: startAt};
for (let i = 0; i < additionalParams.length; i++) {
let param = additionalParams[i];
params[param.name] = param.value;
params[param.name] = param.value instanceof Function ? param.value() : param.value;
}
$.get(loadUri, params)
@ -35,69 +54,22 @@ function loadMoreItems() {
if (response.trim().length === 0) {
staleLoader();
loaderReachedEnd = true;
$('.loader-load-more').addClass('disabled');
$('.loader-load-more').remove('text-primary').addClass('text-muted');
}
$(document).trigger("loaderFinished", response);
startAt = $(response).filter('.loader-data-time').last().data('time');
hideLoader();
isLoaderLoading = false;
})
.fail(function (jqxhr, statis, error) {
.fail(function () {
errorLoader();
halfmoon.initStickyAlert({
content: 'Could not load more items...',
title: 'Error',
alertType: 'alert-danger',
fillType: 'filled'
});
isLoaderLoading = false;
});
loaderOffset += loadCount;
}
var hasScrollBar = false;
function _ScrollHandler(e) {
//throttle event:
/*
https://stackoverflow.com/questions/3898130/check-if-a-user-has-scrolled-to-the-bottom
*/
var $window = $(window);
var $document = $(document);
hasScrollBar = true;
let _throttleTimer = null;
let _throttleDelay = 100;
clearTimeout(_throttleTimer);
_throttleTimer = setTimeout(function () {
//do work
if ($window.scrollTop() + $window.height() > $document.height() - 100) {
loadMoreItems();
}
}, _throttleDelay);
}
function setupListeners() {
if ($(loaderResponseId).length === 1) {
/*
https://stackoverflow.com/questions/19731730/jquery-js-detect-users-scroll-attempt-without-any-window-overflow-to-scroll
*/
$('html').bind('mousewheel DOMMouseScroll', function (e) {
var delta = e.originalEvent.wheelDelta || -e.originalEvent.detail;
if (delta < 0 && !hasScrollBar) {
loadMoreItems();
}
});
$(document).ready(function () {
$(window)
.off('scroll', _ScrollHandler)
.on('scroll', _ScrollHandler);
$('.loader-load-more:not(.disabled)').click(function (e) {
if (!isLoaderLoading) {
loadMoreItems();
}
});
});
}
}

View File

@ -1,85 +1,17 @@
let offset = 15;
let isLoading = false;
function PenaltyScrollHandler(e) {
//throttle event:
hasScrollBar = true;
clearTimeout(_throttleTimer);
_throttleTimer = setTimeout(function () {
//do work
if ($window.scrollTop() + $window.height() > $document.height() - 100) {
loadMorePenalties();
}
}, _throttleDelay);
function updateFilters() {
location = `${location.href.split('?')[0]}?showOnly=${$('#penalty_filter_selection').val()}&hideAutomatedPenalties=${document.getElementById('hide_automated_penalties_checkbox').checked}`;
}
function loadMorePenalties() {
if (isLoading) {
return false;
$(document).ready(function () {
const filterSelection = $('#penalty_filter_selection');
if (filterSelection) {
filterSelection.change(function () {
updateFilters();
});
$('#hide_automated_penalties_checkbox').click(function () {
updateFilters();
});
}
showLoader();
isLoading = true;
$.get('/Penalty/ListAsync', {
offset: offset,
showOnly: $('#penalty_filter_selection').val(),
hideAutomatedPenalties: document.getElementById('hide_automated_penalties_checkbox').checked
})
.done(function (response) {
$('#penalty_table').append(response);
if (response.trim().length === 0) {
staleLoader();
}
hideLoader();
isLoading = false;
})
.fail(function (jqxhr, statis, error) {
errorLoader();
isLoading = false;
});
offset += 15;
}
if ($('#penalty_table').length === 1) {
$('#penalty_filter_selection').change(function () {
location = location.href.split('?')[0] + "?showOnly=" + $('#penalty_filter_selection').val() + '&hideAutomatedPenalties=' + document.getElementById('hide_automated_penalties_checkbox').checked;
});
$('#hide_automated_penalties_checkbox').click(function () {
location = location.href.split('?')[0] + "?showOnly=" + $('#penalty_filter_selection').val() + '&hideAutomatedPenalties=' + document.getElementById('hide_automated_penalties_checkbox').checked;
});
/*
https://stackoverflow.com/questions/19731730/jquery-js-detect-users-scroll-attempt-without-any-window-overflow-to-scroll
*/
$('html').bind('mousewheel DOMMouseScroll', function (e) {
var delta = e.originalEvent.wheelDelta || -e.originalEvent.detail;
if (delta < 0 && !hasScrollBar) {
loadMorePenalties();
}
});
/*
https://stackoverflow.com/questions/3898130/check-if-a-user-has-scrolled-to-the-bottom
*/
var _throttleTimer = null;
var _throttleDelay = 100;
var $window = $(window);
var $document = $(document);
var hasScrollBar = false;
$document.ready(function () {
$window
.off('scroll', PenaltyScrollHandler)
.on('scroll', PenaltyScrollHandler);
$('#load_penalties_button').click(function () {
loadMorePenalties();
});
});
}
});

View File

@ -1,44 +1,8 @@
$(document).ready(function () {
/*
Expand alias tab if they have any
*/
$('#profile_aliases_btn').click(function (e) {
const aliases = $('#profile_aliases').text().trim();
if (aliases && aliases.length !== 0) {
$('#profile_aliases').slideToggle(150);
$(this).toggleClass('oi-caret-top');
}
});
const ipAddresses = $('.ip-lookup-profile');
$.each(ipAddresses, function (index, address) {
let ip = $(address).data('ip');
if (ip.length === 0) {
return;
}
$.get('https://ip2c.org/' + ip, function (result) {
const countryCode = result.split(';')[1].toLowerCase();
const country = result.split(';')[3];
if (country === 'Unknown') {
return;
}
$('#ip_lookup_country').text(country);
if (countryCode !== 'zz' && countryCode !== '') {
$(address).css('background-image', `url('https://flagcdn.com/w80/${countryCode}.png')`);
}
});
});
/* set the end time for initial event query */
startAt = $('.loader-data-time').last().data('time');
$('#filter_meta_container_button').click(function () {
$('#filter_meta_container').removeClass('d-none').addClass('flex-md-column');
$('#additional_meta_filter').removeClass('d-md-none');
});
/*
* load context of chat
*/

View File

@ -1,10 +1,10 @@
function refreshScoreboard() {
const serverPanel = $('.scoreboard-container.active');
const serverPanel = $('.scoreboard-container');
const serverId = $(serverPanel).data('server-id');
const scoreboardTable = $(serverPanel).children('.table-sort');
$.get(`../Server/${serverId}/Scoreboard?order=${scoreboardTable.data('sort-column')}&down=${scoreboardTable.data('sort-down')}`, (response) => {
$.get(`/Server/${serverId}/Scoreboard?order=${scoreboardTable.data('sort-column')}&down=${scoreboardTable.data('sort-down')}`, (response) => {
$(serverPanel).html(response);
setupDataSorting();
});
@ -16,10 +16,6 @@ $(document).ready(() => {
}
setInterval(refreshScoreboard, 5000);
$(window.location.hash).tab('show');
$(`${window.location.hash}_nav`).addClass('active');
setupDataSorting();
})

View File

@ -1,26 +1,27 @@
$(document).ready(function() {
$('.form-inline').submit(function(e) {
if ($('#client_search').val().length < 3) {
e.preventDefault();
$('#client_search')
.addClass('input-text-danger')
.delay(25)
.queue(function () {
$(this).addClass('input-border-transition').dequeue();
})
.delay(1000)
.queue(function () {
$(this).removeClass('input-text-danger').dequeue();
})
.delay(500)
.queue(function () {
$(this).removeClass('input-border-transition').dequeue();
});
}
$('.form-inline').submit(function(e) {
const id = $(e.currentTarget).find('input');
if ($(id).val().length < 3) {
e.preventDefault();
$(id)
.addClass('input-text-danger')
.delay(25)
.queue(function () {
$(this).addClass('input-border-transition').dequeue();
})
.delay(1000)
.queue(function () {
$(this).removeClass('input-text-danger').dequeue();
})
.delay(500)
.queue(function () {
$(this).removeClass('input-border-transition').dequeue();
});
}
else if ($('#client_search').val().startsWith("chat|")) {
e.preventDefault();
window.location = "/Message/Find?query=" + $('#client_search').val();
}
});
});
else if ($(id).val().startsWith("chat|")) {
e.preventDefault();
window.location = "/Message/Find?query=" + $(id).val();
}
});
});

View File

@ -16,7 +16,7 @@
}
function getPlayerHistoryChart(playerHistory, i, width, maxClients) {
const primaryColor = $('title').css('background-color');
const primaryColor = $('.text-primary').css('color');
const rgb = primaryColor.match(/\d+/g);
const fillColor = `rgba(${rgb[0]}, ${rgb[1]}, ${rgb[2]}, 0.66)`;
const offlineFillColor = 'rgba(255, 96, 96, 0.55)';
@ -54,29 +54,6 @@ function getPlayerHistoryChart(playerHistory, i, width, maxClients) {
let animationProgress = 0;
let initialAnimationComplete = false;
/*const originalLineDraw = Chart.controllers.line.prototype.draw;
Chart.helpers.extend(Chart.controllers.line.prototype, {
draw: function () {
originalLineDraw.apply(this, arguments);
const chart = this.chart;
const ctx = chart.chart.ctx;
chart.config.data.lineAtIndexes.forEach((elem, index) => {
const xScale = chart.scales['x-axis-0'];
const yScale = chart.scales['y-axis-0'];
ctx.save();
ctx.beginPath();
ctx.moveTo(xScale.getPixelForValue(undefined, elem), yScale.getPixelForValue(playerHistory[elem].clientCount) / (initialAnimationComplete ? 1 : animationProgress));
ctx.strokeStyle = 'rgba(255, 255, 255, 0.1)';
ctx.lineTo(xScale.getPixelForValue(undefined, elem), yScale.bottom);
ctx.stroke();
ctx.restore();
});
}
});*/
const canvas = document.getElementById(`server_history_canvas_${i}`);
canvas.setAttribute('width', width);
@ -156,23 +133,19 @@ function getPlayerHistoryChart(playerHistory, i, width, maxClients) {
});
}
function refreshClientActivity() {
$('.server-history-row').each(function (index) {
let serverId = $(this).data("serverid");
$.get({
url: "/server/clientactivity/" + serverId,
cache: false
function refreshClientActivity(serverId) {
$.get({
url: `/server/clientactivity/${serverId}`,
cache: false
})
.done(function (response) {
const clientCount = $(response).find('a.no-decoration').length;
$('#server_header_' + serverId + ' .server-clientcount').text(clientCount);
$('#server_clientactivity_' + serverId).html(response);
})
.done(function (response) {
const clientCount = $(response).find('a').length;
$('#server_header_' + serverId + ' .server-clientcount').text(clientCount);
$('#server_clientactivity_' + serverId).html(response);
})
.fail(function (jqxhr, textStatus, error) {
$('#server_clientactivity_' + serverId).html('');
});
});
.fail(function (jqxhr, textStatus, error) {
$('#server_clientactivity_' + serverId).html('');
});
}
$(document).ready(function () {
@ -182,7 +155,8 @@ $(document).ready(function () {
$('.server-history-row').each(function (index, element) {
let clientHistory = $(this).data('clienthistory-ex');
let serverId = $(this).data('serverid');
const serverId = $(this).data('serverid');
setInterval(() => refreshClientActivity(serverId), 2000 + (index * 100));
let maxClients = parseInt($('#server_header_' + serverId + ' .server-maxclients').text());
let width = $('.server-header').first().width();
getPlayerHistoryChart(clientHistory, serverId, width, maxClients);
@ -197,5 +171,3 @@ $(document).ready(function () {
}
});
});
setInterval(refreshClientActivity, 2000);