Skip to content

Commit

Permalink
luci-app-lldpd: Remove old footer from Tano Systems
Browse files Browse the repository at this point in the history
The app from Tano Systems appears to include a footer. Since most LuCi apps do not, I have removed it.

Signed-off-by: Marek Küthe <m.k@mk16.de>
  • Loading branch information
marek22k committed Jul 4, 2023
1 parent d834289 commit 2b728fd
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,6 @@
'require session';
'require uci';

const appVersion = '2.0.2';
const appHomeUrl = 'https://github.com/tano-systems/luci-app-lldpd';

const appFooter = E('div', { 'class': 'cbi-section' }, [
E('p', { 'class': 'cbi-section-node tano-copyright' }, [
E('a', { 'href': appHomeUrl },
_('LLDPd LuCI application (version %s)').format(appVersion)),
E('br', {}),
_('© 2018–2021, Tano Systems LLC, Anton Kikin'),
' <',
E('a', { 'href': 'mailto:a.kikin@tano-systems.com' },
E('nobr', {}, 'a.kikin@tano-systems.com')),
'>'
])
]);

/*
* Filter neighbors (-H)
*
Expand Down Expand Up @@ -190,39 +174,20 @@ var cbiFilterSelect = form.Value.extend({
function init() {
return new Promise(function(resolveFn, rejectFn) {
var data = session.getLocalData('luci-app-lldpd');
if ((data !== null) && data.hasOwnProperty('hideFooter')) {
if (data !== null) {
return resolveFn();
}

data = {};

return uci.load('luci').then(function() {
data.hideFooter = (uci.get('luci', 'app_tn_lldpd', 'hide_footer') == '1')
? true : false;
session.setLocalData('luci-app-lldpd', data);
return resolveFn();
});
});
}

function isNeedToHideFooter() {
var data = session.getLocalData('luci-app-lldpd');

if (data === null)
data = {};

if (data.hasOwnProperty('hideFooter'))
return data.hideFooter;
else
return false;
}

function renderFooter() {
return isNeedToHideFooter() ? '' : appFooter;
}

return L.Class.extend({
cbiFilterSelect: cbiFilterSelect,
renderFooter: renderFooter,
init: init,
});
Original file line number Diff line number Diff line change
Expand Up @@ -474,11 +474,4 @@ return L.view.extend({

return m.render();
},

addFooter: function() {
return [
this.super('addFooter', arguments),
lldpd.renderFooter()
];
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -705,13 +705,6 @@ return L.view.extend({
}, this));
},

addFooter: function() {
return [
this.super('addFooter', arguments),
lldpd.renderFooter()
];
},

handleSaveApply: null,
handleSave: null,
handleReset: null
Expand Down

0 comments on commit 2b728fd

Please sign in to comment.