Skip to content
Open
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
46 changes: 46 additions & 0 deletions .github/workflows/bundle-analyzer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Vite Bundle Visualizer

on:
push:
branches: [ chore/all-my-stuffs ]

jobs:
analyze:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v6
- run: |
echo "Before: corepack version => $(corepack --version || echo 'not installed')"
npm install -g corepack@latest
echo "After : corepack version => $(corepack --version)"
corepack enable
pnpm --version
- uses: actions/setup-node@v6
with:
node-version: 22
cache: 'pnpm'

- name: Install dependencies
run: pnpm i --ignore-scripts

# Ensure vite-bundle-visualizer is installed
# (or remove this step if already in package.json)
- name: Install visualizer
run: pnpm install --save-dev vite-bundle-visualizer

- name: Build the app
run: pnpm build

- name: Generate bundle visualizer report
run: |
# Generate stats.html using npx
npx vite-bundle-visualizer dist --template treemap --open false


- name: Upload bundle visualizer report
uses: actions/upload-artifact@v4
with:
name: bundle-visualizer-report
path: dist/stats.html
if-no-files-found: error
10 changes: 7 additions & 3 deletions src/tools/dns-propagation-tester/dns-propagation-tester.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
<script setup lang="ts">
import { useITStorage, useQueryParamOrStorage } from '@/composable/queryParams';
import { useNetworkUtilsConfig } from '@/tools/network-utils/network-utils-config';
import { Base64 } from 'js-base64';

const serverHost = useITStorage('dns-prop:url', 'http://localhost:8000');
const serverAuth = useITStorage('dns-prop:auth', '');
const { serverHost, serverAuth, hasFixedConfig } = useNetworkUtilsConfig({
toolKey: 'dns-prop',
urlStorageKey: 'dns-prop:url',
authStorageKey: 'dns-prop:auth',
});

const loading = ref(false);

Expand Down Expand Up @@ -172,7 +176,7 @@ async function runPropagation() {

<template>
<div>
<details mb-2>
<details v-if="!hasFixedConfig" mb-2>
<summary>Network Utilities Service Configuration (self hosted)</summary>
<n-card>
<NFormItem label="Network Utilities Service Url:" label-placement="top">
Expand Down
11 changes: 7 additions & 4 deletions src/tools/dns-tester/dns-tester.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<script setup lang="ts">
import { useITStorage } from '@/composable/queryParams';
import { useNetworkUtilsConfig } from '@/tools/network-utils/network-utils-config';
import { Base64 } from 'js-base64';

const serverHost = useITStorage('https-tester:url', 'http://localhost:8000');
const serverAuth = useITStorage('https-tester:auth', '');
const { serverHost, serverAuth, hasFixedConfig } = useNetworkUtilsConfig({
toolKey: 'dns-tester',
urlStorageKey: 'dns-tester:url',
authStorageKey: 'dns-tester:auth',
});

const loading = ref(false);
const error = ref<string | null>(null);
Expand Down Expand Up @@ -203,7 +206,7 @@ const labelProps = {

<template>
<div style="min-height: 80vh;">
<details mb-2>
<details v-if="!hasFixedConfig" mb-2>
<summary>Network Utilities Service Configuration (self hosted)</summary>
<n-card>
<NFormItem label="Network Utilities Service Url:" label-placement="top">
Expand Down
11 changes: 7 additions & 4 deletions src/tools/https-tester/https-tester.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<script setup lang="ts">
import { useITStorage } from '@/composable/queryParams';
import { useNetworkUtilsConfig } from '@/tools/network-utils/network-utils-config';
import { Base64 } from 'js-base64';

const serverHost = useITStorage('https-tester:url', 'http://localhost:8000');
const serverAuth = useITStorage('https-tester:auth', '');
const { serverHost, serverAuth, hasFixedConfig } = useNetworkUtilsConfig({
toolKey: 'https-tester',
urlStorageKey: 'https-tester:url',
authStorageKey: 'https-tester:auth',
});

const loading = ref(false);
const error = ref<string | null>(null);
Expand Down Expand Up @@ -128,7 +131,7 @@ const labelProps = {

<template>
<div>
<details mb-2>
<details v-if="!hasFixedConfig" mb-2>
<summary>Network Utilities Service Configuration (self hosted)</summary>
<n-card>
<NFormItem label="Network Utilities Service Url:" label-placement="top">
Expand Down
18 changes: 18 additions & 0 deletions src/tools/network-utils/network-utils-config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { getITToolsSetting, useITStorage } from '@/composable/queryParams';
import { ref } from 'vue';

export function useNetworkUtilsConfig({ toolKey, urlStorageKey, authStorageKey }: { toolKey: string; urlStorageKey: string; authStorageKey: string }) {
const fixedUrl = String(getITToolsSetting(`${toolKey}:url`, '') || '').trim();
const fixedAuth = String(getITToolsSetting(`${toolKey}:auth`, '') || '').trim();
const hasFixedConfig = Boolean(fixedUrl);

return {
serverHost: hasFixedConfig
? ref(fixedUrl)
: useITStorage(urlStorageKey, 'http://localhost:8000'),
serverAuth: hasFixedConfig
? ref(fixedAuth)
: useITStorage(authStorageKey, ''),
hasFixedConfig,
};
}