mirror of
https://github.com/speatzle/nfsense.git
synced 2025-05-11 19:08:20 +00:00
"fix " services list
This commit is contained in:
parent
090b030002
commit
c2f1845c36
1 changed files with 5 additions and 7 deletions
|
@ -21,7 +21,7 @@ const displayData = $computed(() => {
|
||||||
data.push({
|
data.push({
|
||||||
name: services[index].name,
|
name: services[index].name,
|
||||||
value: getServiceValue(services[index]),
|
value: getServiceValue(services[index]),
|
||||||
type: services[index].type,
|
type: Object.keys(services[index].service_type)[0],
|
||||||
comment: services[index].comment,
|
comment: services[index].comment,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -29,11 +29,12 @@ const displayData = $computed(() => {
|
||||||
});
|
});
|
||||||
|
|
||||||
function getServiceValue(s: any): string {
|
function getServiceValue(s: any): string {
|
||||||
|
console.debug('test', Object.keys(s.service_type)[0]);
|
||||||
let value: string;
|
let value: string;
|
||||||
switch (s.type) {
|
switch (Object.keys(s.service_type)[0]) {
|
||||||
case 'tcp':
|
case 'tcp':
|
||||||
case 'udp':
|
case 'udp':
|
||||||
value = getServicePortRange(s);
|
value = getServicePortRange(s.service_type[Object.keys(s.service_type)[0]]);
|
||||||
break;
|
break;
|
||||||
case 'icmp':
|
case 'icmp':
|
||||||
value = 'icmp';
|
value = 'icmp';
|
||||||
|
@ -48,10 +49,7 @@ function getServiceValue(s: any): string {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getServicePortRange(s:any): string {
|
function getServicePortRange(s:any): string {
|
||||||
if (s.dport_end) {
|
return `${s.source}-${s.destination}`;
|
||||||
return `${s.dport_start }-${ s.dport_end}`;
|
|
||||||
}
|
|
||||||
return s.dport_start;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function load(){
|
async function load(){
|
||||||
|
|
Loading…
Add table
Reference in a new issue