Skip to content

Commit

Permalink
Bump framework libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
Razzmatazzz committed Oct 6, 2024
1 parent 984ec16 commit 1c7ebc3
Show file tree
Hide file tree
Showing 11 changed files with 93 additions and 133 deletions.
103 changes: 49 additions & 54 deletions src/tarkov-data-manager/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,10 @@ app.post('/auth', async (req, res) => {

const getHeader = (req, options) => {
const jsLibrary = {
datatables: 'https://cdn.datatables.net/1.10.23/js/jquery.dataTables.min.js'
datatables: 'https://cdn.datatables.net/2.1.8/js/dataTables.js',
};
const cssLibrary = {
datatables: 'https://cdn.datatables.net/1.10.23/css/jquery.dataTables.min.css'
datatables: 'https://cdn.datatables.net/2.1.8/css/dataTables.dataTables.css',
};
let includeJs = '';
let includeCss = '';
Expand All @@ -226,7 +226,7 @@ const getHeader = (req, options) => {
<head>
<title>Tarkov Data Manager</title>
<!-- Compiled and minified CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@materializecss/materialize@2.0.3-beta/dist/css/materialize.min.css">${includeCss}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@materializecss/materialize@2.1.1/dist/css/materialize.min.css">${includeCss}
<!-- Compiled and minified JavaScript -->
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
Expand All @@ -242,7 +242,7 @@ const getHeader = (req, options) => {
</head>
<body>
<nav>
<div class="nav-wrapper">
<div class="nav-wrapper blue">
<a href="/" class="brand-logo right"><i class="material-icons">query_stats</i>Tarkov Data Manager</a>
<a href="#" data-target="mobile-menu" class="sidenav-trigger"><i class="material-icons">menu</i></a>
<ul id="nav-main" class="hide-on-med-and-down">
Expand Down Expand Up @@ -282,7 +282,7 @@ const getFooter = (req) => {
return `
</div>
<footer class="page-footer"></footer>
<script src="https://cdn.jsdelivr.net/npm/@materializecss/materialize@2.0.3-beta/dist/js/materialize.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@materializecss/materialize@2.1.1/dist/js/materialize.min.js"></script>
<script>
$(document).ready(function(){
//$('.sidenav').sidenav();
Expand Down Expand Up @@ -334,14 +334,14 @@ app.get('/', async (req, res) => {
res.send(`${getHeader(req)}
<div class="row">
<div class="section col s12">
<h5><a href="/scanners" class="waves-effect waves-light btn"><i class="material-icons left">scanner</i>Scanners</a></h5>
<a href="/scanners" class="waves-effect waves-light btn filled"><i class="material-icons left">scanner</i>Scanners</a>
<ul class="browser-default">
<li>Active: ${activeScanners.length}</li>
</ul>
</div>
<div class="divider col s12"></div>
<div class="section col s12">
<h5><a href="/items" class="waves-effect waves-light btn"><i class="material-icons left">search</i>Items</a></h5>
<a href="/items" class="waves-effect waves-light btn filled"><i class="material-icons left">search</i>Items</a>
<ul class="browser-default">
<li>Total: ${itemCount}</li>
${untagged.length > 0 ? `<li>Untagged: ${untagged.length}</li>` : ''}
Expand Down Expand Up @@ -538,7 +538,7 @@ app.get('/items', async (req, res) => {
for(const type of AVAILABLE_TYPES){
typeFilters = `${typeFilters}
<div class="col s4 m3 l2">
<label for="type-${type}">
<label for="type-${type}" class="no-wrap">
<input type="checkbox" class="filled-in filter-type" id="type-${type}" value="${type}" ${type === 'disabled' ? 'checked' : ''} />
<span>${type}</span>
</label>
Expand All @@ -556,42 +556,40 @@ app.get('/items', async (req, res) => {
}
res.send(`${getHeader(req, {include: 'datatables'})}
<script src="/items.js"></script>
<div class="row">
<div class="col s12">
<ul class="collapsible">
<li>
<div class="collapsible-header"><i class="material-icons left">filter_list</i>Item Filters</div>
<div class="collapsible-body">
<div>Item Types</div>
<div>
<a class="waves-effect waves-light btn filter-types-all"><i class="material-icons left">all_inclusive</i>All</a>
<a class="waves-effect waves-light btn filter-types-none"><i class="material-icons left">not_interested</i>None</a>
</div>
<div>
<label>
<input class="filter-types-require-selected" name="type-filter-function" type="radio" value="any">
<span>Require any</span>
</label>
<label>
<input class="filter-types-require-selected" name="type-filter-function" type="radio" value="all">
<span>Require all</span>
</label>
<label>
<input class="filter-types-require-selected" name="type-filter-function" type="radio" value="none" checked>
<span>Exclude</span>
</label>
</div>
<div class="row">${typeFilters}</div>
<div>Special Filters</div>
<div>
<a class="waves-effect waves-light btn filter-special-all"><i class="material-icons left">all_inclusive</i>All</a>
<a class="waves-effect waves-light btn filter-special-none"><i class="material-icons left">not_interested</i>None</a>
</div>
<div class="row">${specFilters}</div>
<div>
<ul class="collapsible">
<li>
<div class="collapsible-header"><i class="material-icons">filter_list</i>Item&nbsp;Filters</div>
<div class="collapsible-body">
<div>Item Types</div>
<div>
<a class="waves-effect waves-light btn tonal filter-types-all"><i class="material-icons left">all_inclusive</i>All</a>
<a class="waves-effect waves-light btn tonal filter-types-none"><i class="material-icons left">not_interested</i>None</a>
</div>
</li>
</ul>
</div>
<div>
<label>
<input class="filter-types-require-selected" name="type-filter-function" type="radio" value="any">
<span>Require any</span>
</label>
<label>
<input class="filter-types-require-selected" name="type-filter-function" type="radio" value="all">
<span>Require all</span>
</label>
<label>
<input class="filter-types-require-selected" name="type-filter-function" type="radio" value="none" checked>
<span>Exclude</span>
</label>
</div>
<div class="row">${typeFilters}</div>
<div>Special Filters</div>
<div>
<a class="waves-effect waves-light btn tonal filter-special-all"><i class="material-icons left">all_inclusive</i>All</a>
<a class="waves-effect waves-light btn tonal filter-special-none"><i class="material-icons left">not_interested</i>None</a>
</div>
<div class="row">${specFilters}</div>
</div>
</li>
</ul>
</div>
<div class="row">
<div class="col s12">
Expand Down Expand Up @@ -703,7 +701,7 @@ app.get('/items', async (req, res) => {
});

app.get('/items/get', async (req, res) => {
const t = timer('getting-items');
//const t = timer('getting-items');
const myData = await remoteData.get();
const items = [];
const attributes = [
Expand Down Expand Up @@ -731,7 +729,7 @@ app.get('/items/get', async (req, res) => {
}
items.push(newItem);
}
t.end();
//t.end();
res.json(items);
});

Expand Down Expand Up @@ -772,7 +770,7 @@ app.get('/scanners', async (req, res) => {
</div>
<div id="scannerusers" class="col s12">
<div class="scanner-userss-wrapper">
<a href="#" class="waves-effect waves-light btn add-user tooltipped" data-tooltip="Add API user"><i class="material-icons">person_add</i></a>
<a href="#" class="waves-effect waves-light btn filled add-user tooltipped" data-tooltip="Add API user"><i class="material-icons">person_add</i></a>
<table class="highlight main">
<thead>
<tr>
Expand Down Expand Up @@ -1060,7 +1058,7 @@ app.get('/webhooks', async (req, res) => {
<script src="/webhooks.js"></script>
<div class="row">
<div class="col s12">
<a href="#" class="waves-effect waves-light btn add-webhook tooltipped" data-tooltip="Add webhook"><i class="material-icons">add</i></a>
<a href="#" class="waves-effect waves-light btn filled add-webhook tooltipped" data-tooltip="Add webhook"><i class="material-icons">add</i></a>
<table class="highlight main">
<thead>
<tr>
Expand Down Expand Up @@ -1406,7 +1404,7 @@ app.get('/json', async (req, res) => {
<div>
<form class="col s12 post-url json-upload id" data-attribute="action" method="post" action="">
<span>Upload: </span><input id="json-upload" class="single-upload" type="file" name="file" />
<a href="#" class="waves-effect waves-light btn json-upload tooltipped" data-tooltip="Upload"><i class="material-icons">file_upload</i></a>
<a href="#" class="waves-effect waves-light btn filled json-upload tooltipped" data-tooltip="Upload"><i class="material-icons">file_upload</i></a>
</form>
</div>
<div>
Expand Down Expand Up @@ -1579,7 +1577,7 @@ app.get('/s3-bucket', async (req, res) => {
<form class="col s12 post-url file-upload id" data-attribute="action" method="post" action="">
<span>Path: </span><input id="file-path" class="validate path" type="text" name="path" value="" style="width: auto;"/>
<span>Upload: </span><input id="file-upload" class="single-upload" type="file" name="file" multiple="multiple"/>
<a href="#" class="waves-effect waves-light btn file-upload tooltipped" data-tooltip="Upload"><i class="material-icons">file_upload</i></a>
<a href="#" class="waves-effect waves-light btn filled file-upload tooltipped" data-tooltip="Upload"><i class="material-icons">file_upload</i></a>
</form>
</div>
<table class="highlight main">
Expand Down Expand Up @@ -1769,7 +1767,7 @@ app.get('/wipes', async (req, res) => {
<script src="/wipes.js"></script>
<div class="row">
<div class="col s12">
<a href="#" class="waves-effect waves-light btn add-wipe tooltipped" data-tooltip="Add wipe"><i class="material-icons">add</i></a>
<a href="#" class="waves-effect waves-light btn filled add-wipe tooltipped" data-tooltip="Add wipe"><i class="material-icons">add</i></a>
<table class="highlight main">
<thead>
<tr>
Expand Down Expand Up @@ -1902,13 +1900,10 @@ app.get('/presets', async (req, res) => {
<script src="/presets.js"></script>
<div class="row">
<div class="col s12">
<!--a href="#" class="waves-effect waves-light btn add-preset tooltipped" data-tooltip="Add preset"><i class="material-icons">add</i></a-->
<!--a href="#" class="waves-effect waves-light btn filled add-preset tooltipped" data-tooltip="Add preset"><i class="material-icons">add</i></a-->
<table class="highlight main">
<thead>
<tr>
<th>
id
</th>
<th>
name
</th>
Expand Down
4 changes: 2 additions & 2 deletions src/tarkov-data-manager/modules/remote-data.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const methods = {
//console.log('Loading item data');

try {
const allDataTimer = timer('item-data-query');
//const allDataTimer = timer('item-data-query');
const results = await query(`
SELECT
item_data.*,
Expand All @@ -71,7 +71,7 @@ const methods = {
GROUP BY
item_data.id
`).then(rows => {
allDataTimer.end();
//allDataTimer.end();
return rows;
});

Expand Down
6 changes: 3 additions & 3 deletions src/tarkov-data-manager/public/crons.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ $(document).ready( function () {
return `
<div><b>${data}</b></div>
<div>
<a href="#" class="waves-effect waves-light btn-small edit-cron tooltipped" data-tooltip="Edit" data-job="${data}" data-schedule="${cron.schedule}"><i class="material-icons">edit</i></a>
<a href="#" class="waves-effect waves-light btn-small run-cron tooltipped${cron.running ? ' disabled' : ''}" data-tooltip="Run" data-job="${data}"><i class="material-icons">play_arrow</i></a>
<a href="#" class="waves-effect waves-light btn-small tonal edit-cron tooltipped" data-tooltip="Edit" data-job="${data}" data-schedule="${cron.schedule}"><i class="material-icons">edit</i></a>
<a href="#" class="waves-effect waves-light btn-small tonal run-cron tooltipped${cron.running ? ' disabled' : ''}" data-tooltip="Run" data-job="${data}"><i class="material-icons">play_arrow</i></a>
</div>
`;
}
Expand Down Expand Up @@ -41,7 +41,7 @@ $(document).ready( function () {
const date = new Date(data);
let runningLog = '';
if (cron.running) {
runningLog = `<div><a href="#" class="waves-effect waves-light btn-small view-current-log tooltipped" data-tooltip="View current log" data-job="${cron.name}"><i class="material-icons">text_snippet</i></a></div>`;
runningLog = `<div><a href="#" class="waves-effect waves-light btn-small tonal view-current-log tooltipped" data-tooltip="View current log" data-job="${cron.name}"><i class="material-icons">text_snippet</i></a></div>`;
}
return `<a href="#" class="view-cron-log" data-cron="${cron.name}">${date.toLocaleDateString()} ${date.toLocaleTimeString()}</a>${runningLog}`;
}
Expand Down
8 changes: 4 additions & 4 deletions src/tarkov-data-manager/public/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ pre {
width: 100px;
}

tr:hover {
background-color: #ccc;
}

.log-messages {
color: #fff;
background-color: #000;
Expand All @@ -39,3 +35,7 @@ tr:hover {
margin-top: 2px;
margin-bottom: 2px;
}

.no-wrap {
white-space: pre;
}
Loading

0 comments on commit 1c7ebc3

Please sign in to comment.