Skip to content

Commit

Permalink
add eol icon to 2.3 ui
Browse files Browse the repository at this point in the history
  • Loading branch information
jertel committed Oct 27, 2023
1 parent 6f3f7fb commit 917a041
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
3 changes: 3 additions & 0 deletions html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,9 @@
<v-footer app>
<span id="version" class="text-no-wrap">
{{ i18n.version }}: {{ version }}
<a class="mx-2" target="so-help" :href="parameters.docsUrl + 'eol.html'">
<v-icon :color="$root.eol_color(new Date())":title="i18n.versionEolHelp">fa-exclamation-triangle</v-icon>
</a>
</span>
<v-spacer></v-spacer>
<span class="text-no-wrap d-none d-md-flex">
Expand Down
7 changes: 7 additions & 0 deletions html/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,13 @@ $(document).ready(function() {

return "#"+RR+GG+BB;
},
eol_color(nowDate) {
const eolDate = Date.parse("2024-04-06T00:00:00.000Z");
if (nowDate > eolDate) {
return "error";
}
return "warning";
},
truncate(value, max) {
const ellipses = "...";
if (value.length > max + ellipses.length) {
Expand Down
7 changes: 7 additions & 0 deletions html/js/app.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,13 @@ test('populateUserDetails', async () => {
expect(obj.owner).toBe('[email protected]');
});

test('eol_color', () => {
const dec23 = Date.parse("2023-12-20T01:01:59.000Z");
const may24 = Date.parse("2024-05-01T01:01:59.000Z");
expect(app.eol_color(dec23)).toBe("warning");
expect(app.eol_color(may24)).toBe("error");
});

test('loadServerSettings', async () => {
const fakeInfo = {
version: 'myVersion',
Expand Down
1 change: 1 addition & 0 deletions html/js/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,7 @@ const i18n = {
users: 'Users',
value: 'Value',
version: 'Version',
versionEolHelp: 'The Security Onion 2.3 platform is nearing or has exceeded its End-of-Life (EOL). Upgrading to the latest Security Onion platform version is highly recommended.',
view: 'View',
viewCase: 'Case Details',
weeks: 'weeks',
Expand Down

0 comments on commit 917a041

Please sign in to comment.