mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-04-23 00:06:15 -04:00
fix: lint
This commit is contained in:
parent
2abc3149e2
commit
98f6b044de
4 changed files with 20 additions and 20 deletions
|
@ -128,7 +128,7 @@ function activateOption(option: PaletteOption) {
|
||||||
<c-input-text ref="inputRef" v-model:value="searchPrompt" raw-text placeholder="Type to search a tool or a command..." autofocus clearable />
|
<c-input-text ref="inputRef" v-model:value="searchPrompt" raw-text placeholder="Type to search a tool or a command..." autofocus clearable />
|
||||||
|
|
||||||
<div v-for="(options, category) in filteredSearchResult" :key="category">
|
<div v-for="(options, category) in filteredSearchResult" :key="category">
|
||||||
<div ml-3 mt-3 text-sm font-bold text-primary op-60>
|
<div ml-3 mt-3 text-sm text-primary font-bold op-60>
|
||||||
{{ category }}
|
{{ category }}
|
||||||
</div>
|
</div>
|
||||||
<command-palette-option v-for="option in options" :key="option.name" :option="option" :selected="selectedOptionIndex === getOptionIndex(option)" @activated="activateOption" />
|
<command-palette-option v-for="option in options" :key="option.name" :option="option" :selected="selectedOptionIndex === getOptionIndex(option)" @activated="activateOption" />
|
||||||
|
|
|
@ -151,7 +151,7 @@ function onSearchInput() {
|
||||||
>
|
>
|
||||||
<div flex-1 truncate>
|
<div flex-1 truncate>
|
||||||
<slot name="displayed-value">
|
<slot name="displayed-value">
|
||||||
<input v-if="searchable && isOpen" ref="searchInputRef" v-model="searchQuery" type="text" placeholder="Search..." class="search-input" w-full lh-normal color-current @input="onSearchInput">
|
<input v-if="searchable && isOpen" ref="searchInputRef" v-model="searchQuery" type="text" placeholder="Search..." class="search-input" w-full color-current lh-normal @input="onSearchInput">
|
||||||
<span v-else-if="selectedOption" lh-normal>
|
<span v-else-if="selectedOption" lh-normal>
|
||||||
{{ selectedOption.label }}
|
{{ selectedOption.label }}
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -39,7 +39,7 @@ const headers = computed(() => {
|
||||||
<template>
|
<template>
|
||||||
<div class="relative overflow-x-auto rounded">
|
<div class="relative overflow-x-auto rounded">
|
||||||
<table class="w-full border-collapse text-left text-sm text-gray-500 dark:text-gray-400" role="table" :aria-label="description">
|
<table class="w-full border-collapse text-left text-sm text-gray-500 dark:text-gray-400" role="table" :aria-label="description">
|
||||||
<thead v-if="!hideHeaders" class="bg-#ffffff uppercase text-gray-700 dark:bg-#333333 dark:text-gray-400" border-b="1px solid dark:transparent #efeff5">
|
<thead v-if="!hideHeaders" class="bg-#ffffff text-gray-700 uppercase dark:bg-#333333 dark:text-gray-400" border-b="1px solid dark:transparent #efeff5">
|
||||||
<tr>
|
<tr>
|
||||||
<th v-for="header in headers" :key="header.key" scope="col" class="px-6 py-3 text-xs">
|
<th v-for="header in headers" :key="header.key" scope="col" class="px-6 py-3 text-xs">
|
||||||
{{ header.label }}
|
{{ header.label }}
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import { describe, expect, it } from 'vitest';
|
import { describe, expect, it } from 'vitest';
|
||||||
import { getIPNetworkType, getNetworksCount, getSubnets, parseAsCIDR, to6to4Prefix, toARPA, toIPv4MappedAddress, toIPv4MappedAddressDecimal } from './ip';
|
import { getIPNetworkType, getNetworksCount, getSubnets, parseAsCIDR, to6to4Prefix, toARPA, toIPv4MappedAddress, toIPv4MappedAddressDecimal } from './ip';
|
||||||
|
|
||||||
describe('ipv4/6 util', // NOSONAR () => {
|
describe('ipv4/6 util', () => {
|
||||||
describe('parseAsCIDR', // NOSONAR () => {
|
describe('parseAsCIDR', () => {
|
||||||
it('returns cidr', // NOSONAR () => {
|
it('returns cidr', () => {
|
||||||
expect(parseAsCIDR('1.1.1.1/6')).to.eql('1.1.1.1/6'); // NOSONAR
|
expect(parseAsCIDR('1.1.1.1/6')).to.eql('1.1.1.1/6'); // NOSONAR
|
||||||
expect(parseAsCIDR('172.16.2.2/16')).to.eql('172.16.2.2/16'); // NOSONAR
|
expect(parseAsCIDR('172.16.2.2/16')).to.eql('172.16.2.2/16'); // NOSONAR
|
||||||
expect(parseAsCIDR('1a:b:c::d:e:f/ffff:ffff:f4ff:ffff:ffff:ff5f:ffff:ff00')).to.eql(''); // NOSONAR
|
expect(parseAsCIDR('1a:b:c::d:e:f/ffff:ffff:f4ff:ffff:ffff:ff5f:ffff:ff00')).to.eql(''); // NOSONAR
|
||||||
|
@ -21,8 +21,8 @@ describe('ipv4/6 util', // NOSONAR () => {
|
||||||
expect(parseAsCIDR('10.0.0.0/255.255.0.0')).to.eql('10.0.0.0/16'); // NOSONAR
|
expect(parseAsCIDR('10.0.0.0/255.255.0.0')).to.eql('10.0.0.0/16'); // NOSONAR
|
||||||
});
|
});
|
||||||
}); // NOSONAR
|
}); // NOSONAR
|
||||||
describe('getSubnets', // NOSONAR () => {
|
describe('getSubnets', () => {
|
||||||
it('returns subnets', // NOSONAR () => {
|
it('returns subnets', () => {
|
||||||
expect(getSubnets('1.1.1.1/1')).to.eql([
|
expect(getSubnets('1.1.1.1/1')).to.eql([
|
||||||
'0.0.0.0/1', // NOSONAR
|
'0.0.0.0/1', // NOSONAR
|
||||||
'128.0.0.0/1', // NOSONAR
|
'128.0.0.0/1', // NOSONAR
|
||||||
|
@ -119,8 +119,8 @@ describe('ipv4/6 util', // NOSONAR () => {
|
||||||
expect(getSubnets('2001:db8:0:85a3:0:0:ac1f:8001/112')).to.eql([]); // NOSONAR
|
expect(getSubnets('2001:db8:0:85a3:0:0:ac1f:8001/112')).to.eql([]); // NOSONAR
|
||||||
}); // NOSONAR
|
}); // NOSONAR
|
||||||
}); // NOSONAR
|
}); // NOSONAR
|
||||||
describe('getNetworksCount', // NOSONAR () => {
|
describe('getNetworksCount', () => {
|
||||||
it('returns networks count', // NOSONAR () => {
|
it('returns networks count', () => {
|
||||||
expect(getNetworksCount('1.1.1.1/1')).to.eql(2); // NOSONAR
|
expect(getNetworksCount('1.1.1.1/1')).to.eql(2); // NOSONAR
|
||||||
expect(getNetworksCount('1.1.1.1/2')).to.eql(4); // NOSONAR
|
expect(getNetworksCount('1.1.1.1/2')).to.eql(4); // NOSONAR
|
||||||
expect(getNetworksCount('1.1.1.1/3')).to.eql(8); // NOSONAR
|
expect(getNetworksCount('1.1.1.1/3')).to.eql(8); // NOSONAR
|
||||||
|
@ -160,8 +160,8 @@ describe('ipv4/6 util', // NOSONAR () => {
|
||||||
expect(getNetworksCount('2001:db8:0:85a3:0:0:ac1f:8001/122')).to.eql(-1); // NOSONAR
|
expect(getNetworksCount('2001:db8:0:85a3:0:0:ac1f:8001/122')).to.eql(-1); // NOSONAR
|
||||||
}); // NOSONAR
|
}); // NOSONAR
|
||||||
}); // NOSONAR
|
}); // NOSONAR
|
||||||
describe('getIPNetworkType', // NOSONAR () => {
|
describe('getIPNetworkType', () => {
|
||||||
it('returns network type', // NOSONAR () => {
|
it('returns network type', () => {
|
||||||
expect(getIPNetworkType('1.1.1.1')).to.eql('Public'); // NOSONAR
|
expect(getIPNetworkType('1.1.1.1')).to.eql('Public'); // NOSONAR
|
||||||
expect(getIPNetworkType('10.10.1.1')).to.eql('Private Use'); // NOSONAR
|
expect(getIPNetworkType('10.10.1.1')).to.eql('Private Use'); // NOSONAR
|
||||||
expect(getIPNetworkType('172.16.0.1')).to.eql('Private Use'); // NOSONAR
|
expect(getIPNetworkType('172.16.0.1')).to.eql('Private Use'); // NOSONAR
|
||||||
|
@ -187,8 +187,8 @@ describe('ipv4/6 util', // NOSONAR () => {
|
||||||
}); // NOSONAR
|
}); // NOSONAR
|
||||||
}); // NOSONAR
|
}); // NOSONAR
|
||||||
|
|
||||||
describe('toARPA', // NOSONAR () => {
|
describe('toARPA', () => {
|
||||||
it('returns ARPA address', // NOSONAR () => {
|
it('returns ARPA address', () => {
|
||||||
expect(toARPA('1.1.1.1')).to.eql('1.1.1.1.in-addr.arpa'); // NOSONAR
|
expect(toARPA('1.1.1.1')).to.eql('1.1.1.1.in-addr.arpa'); // NOSONAR
|
||||||
expect(toARPA('10.10.1.1')).to.eql('1.1.10.10.in-addr.arpa'); // NOSONAR
|
expect(toARPA('10.10.1.1')).to.eql('1.1.10.10.in-addr.arpa'); // NOSONAR
|
||||||
expect(toARPA('192.168.1.1')).to.eql('1.1.168.192.in-addr.arpa'); // NOSONAR
|
expect(toARPA('192.168.1.1')).to.eql('1.1.168.192.in-addr.arpa'); // NOSONAR
|
||||||
|
@ -200,8 +200,8 @@ describe('ipv4/6 util', // NOSONAR () => {
|
||||||
expect(toARPA('::1')).to.eql('1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa.'); // NOSONAR
|
expect(toARPA('::1')).to.eql('1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa.'); // NOSONAR
|
||||||
}); // NOSONAR
|
}); // NOSONAR
|
||||||
}); // NOSONAR
|
}); // NOSONAR
|
||||||
describe('toIPv4MappedAddress', // NOSONAR () => {
|
describe('toIPv4MappedAddress', () => {
|
||||||
it('returns IPv4MappedAddress', // NOSONAR () => {
|
it('returns IPv4MappedAddress', () => {
|
||||||
expect(toIPv4MappedAddress('1.1.1.1')).to.eql('::ffff:0101:0101'); // NOSONAR
|
expect(toIPv4MappedAddress('1.1.1.1')).to.eql('::ffff:0101:0101'); // NOSONAR
|
||||||
expect(toIPv4MappedAddress('10.10.1.1')).to.eql('::ffff:0a0a:0101'); // NOSONAR
|
expect(toIPv4MappedAddress('10.10.1.1')).to.eql('::ffff:0a0a:0101'); // NOSONAR
|
||||||
expect(toIPv4MappedAddress('172.18.10.9')).to.eql('::ffff:ac12:0a09'); // NOSONAR
|
expect(toIPv4MappedAddress('172.18.10.9')).to.eql('::ffff:ac12:0a09'); // NOSONAR
|
||||||
|
@ -209,8 +209,8 @@ describe('ipv4/6 util', // NOSONAR () => {
|
||||||
expect(toIPv4MappedAddress('255.255.255.0')).to.eql('::ffff:ffff:ff00'); // NOSONAR
|
expect(toIPv4MappedAddress('255.255.255.0')).to.eql('::ffff:ffff:ff00'); // NOSONAR
|
||||||
}); // NOSONAR
|
}); // NOSONAR
|
||||||
}); // NOSONAR
|
}); // NOSONAR
|
||||||
describe('toIPv4MappedAddressDecimal', // NOSONAR () => {
|
describe('toIPv4MappedAddressDecimal', () => {
|
||||||
it('returns networks count', // NOSONAR () => {
|
it('returns networks count', () => {
|
||||||
expect(toIPv4MappedAddressDecimal('1.1.1.1')).to.eql('::ffff:1.1.1.1'); // NOSONAR
|
expect(toIPv4MappedAddressDecimal('1.1.1.1')).to.eql('::ffff:1.1.1.1'); // NOSONAR
|
||||||
expect(toIPv4MappedAddressDecimal('10.10.1.1')).to.eql('::ffff:10.10.1.1'); // NOSONAR
|
expect(toIPv4MappedAddressDecimal('10.10.1.1')).to.eql('::ffff:10.10.1.1'); // NOSONAR
|
||||||
expect(toIPv4MappedAddressDecimal('192.168.1.1')).to.eql('::ffff:192.168.1.1'); // NOSONAR
|
expect(toIPv4MappedAddressDecimal('192.168.1.1')).to.eql('::ffff:192.168.1.1'); // NOSONAR
|
||||||
|
@ -219,8 +219,8 @@ describe('ipv4/6 util', // NOSONAR () => {
|
||||||
expect(toIPv4MappedAddressDecimal('2001:db8:0:85a3::ac1f:8001')).to.eql(''); // NOSONAR
|
expect(toIPv4MappedAddressDecimal('2001:db8:0:85a3::ac1f:8001')).to.eql(''); // NOSONAR
|
||||||
}); // NOSONAR
|
}); // NOSONAR
|
||||||
}); // NOSONAR
|
}); // NOSONAR
|
||||||
describe('to6to4Prefix', // NOSONAR () => {
|
describe('to6to4Prefix', () => {
|
||||||
it('returns networks count', // NOSONAR () => {
|
it('returns networks count', () => {
|
||||||
expect(to6to4Prefix('1.1.1.1')).to.eql('2002:01:0:1:01:01::/48'); // NOSONAR
|
expect(to6to4Prefix('1.1.1.1')).to.eql('2002:01:0:1:01:01::/48'); // NOSONAR
|
||||||
expect(to6to4Prefix('10.10.1.1')).to.eql('2002:0a:0:a:01:01::/48'); // NOSONAR
|
expect(to6to4Prefix('10.10.1.1')).to.eql('2002:0a:0:a:01:01::/48'); // NOSONAR
|
||||||
expect(to6to4Prefix('172.18.10.9')).to.eql('2002:ac:1:2:0a:09::/48'); // NOSONAR
|
expect(to6to4Prefix('172.18.10.9')).to.eql('2002:ac:1:2:0a:09::/48'); // NOSONAR
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue