Skip to content

Commit

Permalink
import pathing issues fixed footer
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrewiski committed Feb 18, 2024
1 parent 0995fb6 commit 496a604
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 17 deletions.
3 changes: 1 addition & 2 deletions plugins/uisptools/serverSide.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,12 @@ var uisptools = {
//Any Routes above this line are not Checked for Auth and are Public
router.get('/' + this.uispToolsApiRequestHandler.options.urlPrefix + 'uisptools/api/*', this.checkApiAccess);
router.get('/' + this.uispToolsApiRequestHandler.options.urlPrefix + 'uisptools/api/getMenuItems', this.getMenuItems);
router.get('/' + this.uispToolsApiRequestHandler.options.urlPrefix + 'uisptools/api/getMenuItems', this.getMenuItems);
} catch (ex) {
this.debug("error", ex.msg, ex.stack);
}
}

fetchSiteClients(siteId){
getMenuItems(siteId){
return $.uisptools.ajax("/" + this.uispToolsApiRequestHandler.options.urlPrefix + "uisptools/api/nms/sites/" + siteId + "/clients");
}

Expand Down
2 changes: 1 addition & 1 deletion plugins/wilcowireless/widgets/freqmapper/freqmapper.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"use strict"
import baseClientSide from "/uisptools/plugins/baseClientSide.js";
import baseClientSide from "../../../baseClientSide.js";
/*
* uisptools 1.0
* Copyright (c) 2022 Wilco Wireless
Expand Down
2 changes: 1 addition & 1 deletion plugins/wilcowireless/widgets/towerclients/towerclients.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"use strict"
import baseClientSide from "/uisptools/plugins/baseClientSide.js";
import baseClientSide from "../../../baseClientSide.js";
/*
* uisptools 1.0
* Copyright (c) 2022 Wilco Wireless
Expand Down
5 changes: 5 additions & 0 deletions public/footer.htm
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<div class="container">
<p class="text-center">
<span class="text-muted">© 2023 - Wireless Inc - 123 Any St. Anytown, MS 66757 - (555) 555-1212</span>
</p>
</div>
2 changes: 1 addition & 1 deletion public/index.htm
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
<footer class="footer mt-auto py-3 bg-light">
<div class="container">
<p class="text-center">
<span class="text-muted">© 2020 - Wireless Inc - 123 Any St. Anytown, KS 66757 - (555) 555-1212</span>
<span class="text-muted"></span>
</p>
</div>
</footer>
Expand Down
13 changes: 12 additions & 1 deletion public/scripts/app/uispTools.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
templateCache: {
"login": { url: 'scripts/app/templates/login.htm', data: '', isLoaded: false },
"error": { url: 'scripts/app/templates/error.htm', data: '', isLoaded: false },
"footer": { url: 'footer.htm', data: '', isLoaded: false },
"defaultModal" : {url: 'scripts/app/templates/default.modal.htm', data: '', isLoaded: false}

},
Expand Down Expand Up @@ -232,6 +233,7 @@
//$.logToConsole("$.uisptools.appInit() DONE");

$.when(
$.uisptools.updateFooter(),
$.uisptools.getMenuItems(),
$.uisptools.loadPageContent()
).done(function (x, data) {
Expand Down Expand Up @@ -356,6 +358,9 @@
)
},




showPageContent: function (page) {
document.title = page.pageTitle;
$('meta[name="description"]').attr("content", page.pageDescription);
Expand Down Expand Up @@ -505,7 +510,13 @@
},



updateFooter: function () {
var deferred = $.Deferred();
$.uisptools.getTemplateCache("footer").then(function (footer) {
let $footer = $("footer").html(footer);
});
return deferred.promise();
},


getTemplateContent: function (options) {
Expand Down
19 changes: 8 additions & 11 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,13 +231,7 @@ var getSocketInfo = function (socket) {
return { ip: ip };
};

//config public files are used before public folder files to allow overwrite.

if(fs.existsSync(path.join(__dirname, objOptions.configDirectory, 'public'))){
app.use(express.static(path.join(__dirname, objOptions.configDirectory, 'public')));
}

app.use(express.static(path.join(__dirname, 'public')));


// disable the x-power-by express message in the header
Expand Down Expand Up @@ -510,11 +504,14 @@ var handlePublicFileRequest = function (req, res) {

//}

if (fs.existsSync(path.join(__dirname, 'public',filePath)) === true) {


res.sendFile(filePath, { root: path.join(__dirname, 'public') });

//config public files are used before public folder files to allow overwrite.



if (fs.existsSync(path.join(__dirname, objOptions.configDirectory, 'public',filePath)) === true) {
res.sendFile(filePath, { root: path.join(__dirname, objOptions.configDirectory, 'public') });
}else if (fs.existsSync(path.join(__dirname, 'public',filePath)) === true) {
res.sendFile(filePath, { root: path.join(__dirname, 'public') });
} else {
let fileExt = path.extname(filePath);
if(fileExt === "" || fileExt === ".htm" || fileExt === ".html"){
Expand Down

0 comments on commit 496a604

Please sign in to comment.