Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quicklinks added to Configuration #226

Merged
merged 2 commits into from
May 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions html/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -307,15 +307,15 @@ td {
padding: 8px;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
margin: 8px 0 8px 0;
}

.theme--dark.v-application .markdown-body td,
.theme--dark.v-application .markdown-body th {
border: 1px solid hsla(0,0%,100%,.1);
Expand Down
60 changes: 59 additions & 1 deletion html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3268,7 +3268,65 @@ <h4 v-if="!$root.loading">{{ i18n.settingsCustomized }} {{ settingsCustomized }}
<v-divider vertical />
<v-col cols="12" lg="8">
<v-fade-transition mode="out-in" duration="100">
<v-alert v-if="!selected" v-text="i18n.settingSelect" type="info" />
<div v-if="!selected" id="config-quick-links">
<v-alert v-text="i18n.settingSelect" type="info" />
<div>
<p class="font-weight-bold">{{i18n.configQLGridTitle}}</p>
<ul>
<li>
<router-link :to="{ name: 'config', query: {s: 'ntp.config'}}">{{i18n.configQLNTP}}</router-link>
</li>
<li>
{{i18n.configQLFirewallHeader}}
<ul>
<li>
<router-link :to="{name: 'config', query: {s: 'firewall.hostgroups.analyst'}}">{{i18n.configQLFirewallWebInterface}}</router-link>
</li>
<li>
<router-link :to="{name: 'config', query: {s: 'firewall.hostgroups.elastic_agent_endpoint'}}">{{i18n.configQLFirewallElastic}}</router-link>
</li>
</ul>
</li>
<li>
<router-link :to="{name: 'config', query: {s: 'idstools.config.ruleset'}}">{{i18n.configQLNIDSRuleset}}</router-link>
</li>
<li>
<router-link :to="{name: 'config', query: {s: 'idstools.config.oinkcode'}}">{{i18n.configQLNIDSOinkCode}}</router-link>
</li>
</ul>
<br/>
<p class="font-weight-bold">{{i18n.configQLAnalystTitle}}</p>
<ul>
<li>
{{i18n.configQLSuricataHeader}}
<ul>
<li>
<router-link :to="{name: 'config', query: {s: 'suricata.config.vars.address-groups.HOME_NET'}}">{{i18n.configQLHomeNet}}</router-link>
</li>
<li>
<router-link :to="{name: 'config', query: {s: 'idstools.sids'}}">{{i18n.configQLSIDS}}</router-link>
</li>
<li>
<router-link :to="{name: 'config', query: {s: 'suricata.thresholding.sids__yaml'}}">{{i18n.configQLSIDSThresholding}}</router-link>
</ul>
</li>
<li>
{{i18n.configQLBPFHeader}}
<ul>
<li>
<router-link :to="{name: 'config', query: {s: 'bpf.pcap'}}">{{i18n.configQLPCAP}}</router-link>
</li>
<li>
<router-link :to="{name: 'config', query: {s: 'bpf.suricata'}}">{{i18n.configQLSuricata}}</router-link>
</li>
<li>
<router-link :to="{name: 'config', query: {s: 'bpf.zeek'}}">{{i18n.configQLZeek}}</router-link>
</li>
</ul>
</li>
</ul>
</div>
</div>
<v-card v-else :key="selected.id" class="pt-6 mx-auto config-setting" flat>
<v-card-text>
<div class="text-subtitle-1 mb-4">
Expand Down
16 changes: 16 additions & 0 deletions html/js/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,22 @@ const i18n = {
completed: 'Completed',
config: 'Configuration',
configTitle: 'Grid Configuration',
configQLGridTitle: 'Grid Administration Quicklinks',
configQLNTP: 'NTP',
configQLFirewallHeader: 'Firewall',
configQLFirewallWebInterface: 'Allow access to SO Web Interface',
configQLFirewallElastic: 'Allow access to Elastic Agent endpoints',
configQLNIDSRuleset: 'Change NIDS Ruleset',
configQLNIDSOinkCode: 'Paid NIDS Rulesets Registration Code (oinkcode)',
configQLAnalystTitle: 'Analyst Quicklinks',
configQLSuricataHeader: 'Tune Suricata',
configQLHomeNet: 'HOME_NET Variable',
configQLSIDS: 'SIDS - ENABLE | DISABLE | MODIFY',
configQLSIDSThresholding: 'SIDS - Thresholding',
configQLBPFHeader: 'BPFs',
configQLPCAP: 'PCAP',
configQLSuricata: 'Suricata',
configQLZeek: 'Zeek',
container: 'Container',
containerStatus: 'Container Status',
continue: 'Would you like to continue?',
Expand Down
34 changes: 21 additions & 13 deletions html/js/routes/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,7 @@ routes.push({ path: '/config', name: 'config', component: {
nextStopId: null,
}},
mounted() {
if (this.$route.query.f) {
this.search = this.$route.query.f;
}
if (this.$route.query.e == "1") {
this.autoExpand = true;
}
if (this.$route.query.s) {
this.autoSelect = this.$route.query.s;
this.autoExpand = true;
this.search = this.$route.query.s;
}
this.processRouteParameters();
this.loadData();
},
watch: {
Expand All @@ -55,7 +45,25 @@ routes.push({ path: '/config', name: 'config', component: {
return this.findActiveSetting();
},
},
beforeRouteUpdate(to, from, next) {
next();
this.processRouteParameters();
this.refreshTree();
},
methods: {
processRouteParameters() {
if (this.$route.query.f) {
this.search = this.$route.query.f;
}
if (this.$route.query.e == "1") {
this.autoExpand = true;
}
if (this.$route.query.s) {
this.autoSelect = this.$route.query.s;
this.autoExpand = true;
this.search = this.$route.query.s;
}
},
findActiveSetting() {
if (this.active.length > 0) {
const id = this.active[0];
Expand Down Expand Up @@ -294,7 +302,7 @@ routes.push({ path: '/config', name: 'config', component: {
// Only set after next tick to avoid UI glitch. This has an unfortunate
// flicker effect as the modal appears, but it avoids a more serious problem
// of having the wrong setting selected after dismissing the modal popup.
this.active = this.activeBackup;
this.active = this.activeBackup;
});
return false;
}
Expand Down Expand Up @@ -434,7 +442,7 @@ routes.push({ path: '/config', name: 'config', component: {
} catch (error) {
this.$root.showError(error);
}
this.$root.stopLoading();
this.$root.stopLoading();
},
edit(setting, nodeId) {
if (nodeId) {
Expand Down