Merge pull request #2 from Lissy93/feat/workflow

Feat/workflow
This commit is contained in:
Alicia Sykes authored and GitHub committed 2025-09-27 10:15:11 +01:00
commit 2ff0751937
5 files changed
+497 -10

No files matched your search

+115
View File
@@ -0,0 +1,115 @@
name: 🚀 Create Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
create-release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- name: Install dependencies
run: npm ci
- name: Build project
run: npm run build
continue-on-error: true
- name: Create tarball
run: |
tar -czf networking-toolbox-${{ github.ref_name }}.tar.gz \
--exclude=node_modules \
--exclude=.git \
--exclude=.github \
--exclude=tests \
--exclude=playwright-report \
--exclude=coverage \
.
- name: Create zip
run: |
zip -r networking-toolbox-${{ github.ref_name }}.zip . \
-x "node_modules/*" \
-x ".git/*" \
-x ".github/*" \
-x "tests/*" \
-x "playwright-report/*" \
-x "coverage/*" \
-x "*.tar.gz"
- name: Generate changelog
id: changelog
uses: requarks/changelog-action@v1
with:
token: ${{ github.token }}
tag: ${{ github.ref_name }}
writeToFile: false
includeInvalidCommits: true
excludeTypes: build,docs,style,chore
- name: Extract version
id: version
run: echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: Networking Toolbox ${{ steps.version.outputs.version }}
body: |
## 📦 Networking Toolbox ${{ steps.version.outputs.version }}
${{ steps.changelog.outputs.changes }}
---
### 📥 Installation
**Docker:**
```bash
docker pull lissy93/networking-toolbox:${{ steps.version.outputs.version }}
docker run -d -p 8080:80 lissy93/networking-toolbox:${{ steps.version.outputs.version }}
```
**From Source:**
```bash
# Download and extract
tar -xzf networking-toolbox-${{ github.ref_name }}.tar.gz
# Install and run
npm install
npm run build
npm run preview
```
**Deploy to Vercel:**
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/Lissy93/networking-toolbox)
### 📋 What's Changed
${{ steps.changelog.outputs.previousTag && format('**Full Changelog**: https://github.com/{0}/compare/{1}...{2}', github.repository, steps.changelog.outputs.previousTag, github.ref_name) || '' }}
### 🔗 Links
- 📚 [Documentation](https://github.com/${{ github.repository }}/blob/main/README.md)
- 🐛 [Report Issues](https://github.com/${{ github.repository }}/issues)
- 🌐 [Live Demo](https://networking-toolbox.as93.net)
files: |
networking-toolbox-${{ github.ref_name }}.tar.gz
networking-toolbox-${{ github.ref_name }}.zip
draft: false
prerelease: ${{ contains(github.ref_name, '-rc') || contains(github.ref_name, '-beta') || contains(github.ref_name, '-alpha') }}
generate_release_notes: false
+35
View File
@@ -0,0 +1,35 @@
name: 🏷️ Tag new versions
on:
push:
branches:
- main
paths:
- 'package.json'
jobs:
tag-version:
runs-on: ubuntu-latest
steps:
- name: Check out repo with bot token
uses: actions/checkout@v4
- name: Configure git as bot user
run: |
git config user.name "liss-bot"
git config user.email "alicia-gh-bot@mail.as93.net"
- name: Get version from package.json
id: get_version
run: |
VERSION=$(jq -r .version package.json)
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Create Git Tag (skip if exists)
run: |
VERSION="${{ steps.get_version.outputs.version }}"
# Check if the tag already exists remotely
if git ls-remote --tags origin | grep -q "refs/tags/v${VERSION}"; then
echo "Tag v${VERSION} already exists. Skipping."
else
echo "Tag v${VERSION} does not exist. Creating now..."
git tag "v${VERSION}"
git push origin "v${VERSION}"
fi
+88 -3
View File
@@ -66,6 +66,10 @@
// Using a separate internal function to avoid reactivity warnings
function openSearch() {
isOpen = true;
// Push a new history state when opening search on mobile
if (browser && window.innerWidth <= 768) {
window.history.pushState({ searchOpen: true }, '', window.location.href);
}
setTimeout(() => searchInput?.focus(), 0);
}
@@ -127,7 +131,21 @@
bookmarks.init();
toolUsage.init();
document.addEventListener('keydown', handleGlobalKeydown);
return () => document.removeEventListener('keydown', handleGlobalKeydown);
// Handle browser back button on mobile
const handlePopState = (e: PopStateEvent) => {
if (isOpen && window.innerWidth <= 768) {
e.preventDefault();
close();
}
};
window.addEventListener('popstate', handlePopState);
return () => {
document.removeEventListener('keydown', handleGlobalKeydown);
window.removeEventListener('popstate', handlePopState);
};
});
export { showSearch };
@@ -294,6 +312,12 @@
justify-content: center;
padding-top: 15vh;
animation: fadeIn var(--transition-fast);
@media (max-width: 768px) {
padding: 0;
align-items: stretch;
background: var(--bg-primary);
}
}
.search-modal {
@@ -307,8 +331,15 @@
animation: slideDown var(--transition-normal);
@media (max-width: 768px) {
margin: 0 var(--spacing-md);
max-width: calc(100vw - 2rem);
max-width: 100%;
height: 100vh;
height: 100dvh;
border-radius: 0;
border: none;
box-shadow: none;
display: flex;
flex-direction: column;
animation: slideInFromBottom var(--transition-normal);
}
}
@@ -319,6 +350,15 @@
padding: var(--spacing-lg);
border-bottom: 1px solid var(--border-primary);
@media (max-width: 768px) {
padding: var(--spacing-md);
position: sticky;
top: 0;
background: var(--bg-primary);
z-index: 10;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.search-input {
flex: 1;
background: transparent;
@@ -327,6 +367,10 @@
color: var(--text-primary);
font-size: var(--font-size-lg);
@media (max-width: 768px) {
font-size: var(--font-size-md);
}
&::placeholder {
color: var(--text-tertiary);
}
@@ -341,6 +385,10 @@
border-radius: var(--radius-sm);
transition: all var(--transition-fast);
@media (max-width: 768px) {
padding: var(--spacing-sm);
}
&:hover {
background: var(--surface-hover);
color: var(--text-primary);
@@ -351,6 +399,13 @@
.search-results {
max-height: 60vh;
overflow-y: auto;
@media (max-width: 768px) {
max-height: none;
flex: 1;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
}
}
.result-item {
@@ -366,6 +421,11 @@
text-align: left;
transition: background var(--transition-fast);
@media (max-width: 768px) {
padding: var(--spacing-md);
min-height: 60px;
}
&:hover,
&.selected {
background: var(--surface-hover);
@@ -428,12 +488,22 @@
padding: var(--spacing-2xl);
color: var(--text-secondary);
text-align: center;
@media (max-width: 768px) {
padding: var(--spacing-xl) var(--spacing-md);
min-height: 50vh;
justify-content: center;
}
}
.search-help {
padding: var(--spacing-lg);
border-top: 1px solid var(--border-secondary);
@media (max-width: 768px) {
padding: var(--spacing-md);
}
.help-item {
display: flex;
align-items: center;
@@ -449,6 +519,10 @@
.frequently-used-section {
padding: var(--spacing-md) var(--spacing-lg);
border-top: 1px solid var(--border-secondary);
@media (max-width: 768px) {
padding: var(--spacing-md);
}
}
.bookmarks-header,
@@ -570,4 +644,15 @@
transform: translateY(0) scale(1);
}
}
@keyframes slideInFromBottom {
from {
opacity: 0;
transform: translateY(100%);
}
to {
opacity: 1;
transform: translateY(0);
}
}
</style>
+5 -2
View File
@@ -23,9 +23,12 @@
return navItems;
}
// Separate tools from reference pages
// Separate tools from reference pages and standalone pages
const referencePages = extractNavItems(SUB_NAV['/reference'] || []);
const toolPages = ALL_PAGES.filter((page) => !page.href.startsWith('/reference'));
const toolPages = ALL_PAGES.filter(
(page) =>
!page.href.startsWith('/reference') && !page.href.startsWith('/bookmarks') && !page.href.startsWith('/offline'),
);
let filteredTools: NavItem[] = $state(toolPages);
let filteredReference: NavItem[] = $state(referencePages);
+254 -5
View File
@@ -1,21 +1,270 @@
<!doctype html>
<html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>API Docs</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="description" content="REST API documentation for Networking Toolbox - Free IP address calculators, subnet tools, and network utilities">
<meta name="theme-color" content="#e3ed70">
<title>API Docs - Networking Toolbox</title>
<link rel="icon" href="/favicon.png">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swagger-ui-dist@5/swagger-ui.css">
<style> body { margin:0 } </style>
<style>
:root {
--bg-primary: #0d1117;
--bg-secondary: #161b22;
--bg-tertiary: #21262d;
--text-primary: #c9d1d9;
--text-secondary: #7d8590;
--color-primary: #e3ed70;
--border: #30363d;
}
body {
margin: 0;
background: var(--bg-primary);
color: var(--text-primary);
font-family: 'Roboto Mono', monospace;
}
/* Header & Info */
.swagger-ui .info h1,
.swagger-ui .info .title,
.swagger-ui .description h2,
.swagger-ui h3
.swagger-ui .info .title {
color: var(--color-primary);
font-family: 'Roboto Mono', monospace;
}
.swagger-ui .info {
margin-bottom: 2rem;
}
.swagger-ui .info .description p,
.swagger-ui .info .description,
.swagger-ui .description {
color: var(--text-primary);
}
.swagger-ui .info a {
color: var(--color-primary);
}
/* Sections */
.swagger-ui .opblock-tag {
color: var(--text-primary);
border-bottom: 1px solid var(--border);
}
.swagger-ui .opblock-tag:hover {
background: var(--bg-secondary);
}
/* Operations */
.swagger-ui .opblock {
background: var(--bg-secondary);
border: 1px solid var(--border);
}
.swagger-ui .opblock .opblock-summary {
border: 1px solid var(--border);
background: var(--bg-tertiary);
}
.swagger-ui .opblock .opblock-summary:hover {
background: var(--bg-secondary);
}
.swagger-ui .opblock.opblock-get .opblock-summary {
border-color: #50fa7b;
}
.swagger-ui .opblock.opblock-post .opblock-summary {
border-color: #8be9fd;
}
/* Text & Labels */
.swagger-ui .opblock .opblock-summary-path,
.swagger-ui .opblock .opblock-summary-description,
.swagger-ui .opblock-description-wrapper p,
.swagger-ui .opblock-body pre,
.swagger-ui .parameter__name,
.swagger-ui .parameter__type,
.swagger-ui .response-col_status,
.swagger-ui .response-col_description,
.swagger-ui .description,
.swagger-ui .description p,
.swagger-ui .description ul,
.swagger-ui .description ul li,
.swagger-ui .parameter__description,
.swagger-ui .response-col_description__inner p {
color: var(--text-primary);
}
.swagger-ui .opblock .opblock-summary-method {
background: var(--bg-primary);
color: var(--text-primary);
font-weight: bold;
}
.swagger-ui .opblock.opblock-get .opblock-summary-method {
background: #50fa7b;
color: var(--bg-primary);
}
.swagger-ui .opblock.opblock-post .opblock-summary-method {
background: #8be9fd;
color: var(--bg-primary);
}
/* Parameters */
.swagger-ui .parameters-col_description input[type=text],
.swagger-ui .parameters-col_description textarea {
background: var(--bg-primary);
color: var(--text-primary);
border: 1px solid var(--border);
}
.swagger-ui .parameters-col_description input[type=text]:focus,
.swagger-ui .parameters-col_description textarea:focus {
border-color: var(--color-primary);
outline: none;
}
/* Buttons */
.swagger-ui .btn {
background: var(--bg-tertiary);
color: var(--text-primary);
border: 1px solid var(--border);
}
.swagger-ui .btn:hover {
background: var(--bg-secondary);
}
.swagger-ui .btn.execute {
background: var(--color-primary);
color: var(--bg-primary);
border: none;
}
.swagger-ui .btn.execute:hover {
filter: brightness(1.1);
}
/* Response */
.swagger-ui .responses-inner {
background: var(--bg-primary);
}
.swagger-ui .response .response-col_status {
color: var(--color-primary);
}
.swagger-ui pre.microlight,
.swagger-ui .highlight-code {
background: var(--bg-primary) !important;
color: var(--text-primary);
border: 1px solid var(--border);
}
/* Models */
.swagger-ui .model-container {
background: var(--bg-secondary);
border: 1px solid var(--border);
}
.swagger-ui .model {
color: var(--text-primary);
}
/* Scrollbar */
::-webkit-scrollbar {
width: 8px;
height: 8px;
}
::-webkit-scrollbar-track {
background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
background: var(--border);
border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
background: var(--text-secondary);
}
/* Top bar */
.swagger-ui .topbar {
background: var(--bg-secondary);
border-bottom: 1px solid var(--border);
padding: 8px 0;
}
.swagger-ui .topbar .download-url-wrapper {
display: none;
}
/* Scheme container */
.swagger-ui .scheme-container {
background: var(--bg-secondary);
border: 1px solid var(--border);
box-shadow: none;
}
/* Filter input */
.swagger-ui .operation-filter-input {
background: var(--bg-primary);
color: var(--text-primary);
border: 1px solid var(--border);
}
/* Section headers */
.swagger-ui .opblock-section-header {
background: var(--bg-tertiary);
color: var(--text-primary);
box-shadow: none;
border-bottom: 1px solid var(--border);
}
.swagger-ui .opblock-section-header h4 {
color: var(--text-primary);
}
/* Body param text */
.swagger-ui .body-param__text {
background: var(--bg-primary);
color: var(--text-primary);
border: 1px solid var(--border);
}
.swagger-ui .body-param__text:focus {
border-color: var(--color-primary);
outline: none;
}
/* Additional select and input fixes */
.swagger-ui select,
.swagger-ui input[type=text],
.swagger-ui input[type=password],
.swagger-ui input[type=search],
.swagger-ui input[type=email],
.swagger-ui input[type=file],
.swagger-ui textarea {
background: var(--bg-primary);
color: var(--text-primary);
border: 1px solid var(--border);
}
.swagger-ui select:focus,
.swagger-ui input[type=text]:focus,
.swagger-ui input[type=password]:focus,
.swagger-ui input[type=search]:focus,
.swagger-ui input[type=email]:focus,
.swagger-ui textarea:focus {
border-color: var(--color-primary);
outline: none;
box-shadow: 0 0 0 1px var(--color-primary);
}
/* Table headers */
.swagger-ui table thead tr th,
.swagger-ui table thead tr td {
background: var(--bg-tertiary);
color: var(--text-primary);
border-color: var(--border);
}
/* Response tabs */
.swagger-ui .tab li {
color: var(--text-secondary);
}
.swagger-ui .tab li.active {
background: var(--bg-tertiary);
color: var(--text-primary);
}
</style>
</head>
<body>
<div id="swagger"></div>
<script src="https://cdn.jsdelivr.net/npm/swagger-ui-dist@5/swagger-ui-bundle.js"></script>
<script>
SwaggerUIBundle({
url: "/swagger.yaml",
url: "https://raw.githubusercontent.com/Lissy93/networking-toolbox/refs/heads/main/swagger.yaml?token=GHSAT0AAAAAAC4DRTQMEKVRUYJKMDSKHFHE2GXWK6Q",
dom_id: "#swagger",
deepLinking: true,
presets: [SwaggerUIBundle.presets.apis],
layout: "BaseLayout",
defaultModelsExpandDepth: 0,
defaultModelExpandDepth: 0,
docExpansion: "list",
filter: true,
showExtensions: true,
showCommonExtensions: true,
tryItOutEnabled: true,
displayRequestDuration: true,
persistAuthorization: true,
validatorUrl: null
});
</script>
</body>