mirror of
https://github.com/sharevb/it-tools.git
synced 2026-11-24 06:40:20 +03:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
46e2648ea5 |
No files matched your search
Vendored
+5
-2
@@ -80,7 +80,6 @@ declare module '@vue/runtime-core' {
|
||||
EtaCalculator: typeof import('./src/tools/eta-calculator/eta-calculator.vue')['default']
|
||||
FavoriteButton: typeof import('./src/components/FavoriteButton.vue')['default']
|
||||
FormatTransformer: typeof import('./src/components/FormatTransformer.vue')['default']
|
||||
GeoDistanceCalculator: typeof import('./src/tools/geo-distance-calculator/geo-distance-calculator.vue')['default']
|
||||
GitMemo: typeof import('./src/tools/git-memo/git-memo.vue')['default']
|
||||
'GitMemo.content': typeof import('./src/tools/git-memo/git-memo.content.md')['default']
|
||||
HashText: typeof import('./src/tools/hash-text/hash-text.vue')['default']
|
||||
@@ -131,6 +130,8 @@ declare module '@vue/runtime-core' {
|
||||
MetaTagGenerator: typeof import('./src/tools/meta-tag-generator/meta-tag-generator.vue')['default']
|
||||
MimeTypes: typeof import('./src/tools/mime-types/mime-types.vue')['default']
|
||||
NavbarButtons: typeof import('./src/components/NavbarButtons.vue')['default']
|
||||
NCheckbox: typeof import('naive-ui')['NCheckbox']
|
||||
NCode: typeof import('naive-ui')['NCode']
|
||||
NCollapseTransition: typeof import('naive-ui')['NCollapseTransition']
|
||||
NConfigProvider: typeof import('naive-ui')['NConfigProvider']
|
||||
NDivider: typeof import('naive-ui')['NDivider']
|
||||
@@ -139,11 +140,12 @@ declare module '@vue/runtime-core' {
|
||||
NH1: typeof import('naive-ui')['NH1']
|
||||
NH3: typeof import('naive-ui')['NH3']
|
||||
NIcon: typeof import('naive-ui')['NIcon']
|
||||
NInputNumber: typeof import('naive-ui')['NInputNumber']
|
||||
NLayout: typeof import('naive-ui')['NLayout']
|
||||
NLayoutSider: typeof import('naive-ui')['NLayoutSider']
|
||||
NMenu: typeof import('naive-ui')['NMenu']
|
||||
NScrollbar: typeof import('naive-ui')['NScrollbar']
|
||||
NSpace: typeof import('naive-ui')['NSpace']
|
||||
NTable: typeof import('naive-ui')['NTable']
|
||||
NumeronymGenerator: typeof import('./src/tools/numeronym-generator/numeronym-generator.vue')['default']
|
||||
OtpCodeGeneratorAndValidator: typeof import('./src/tools/otp-code-generator-and-validator/otp-code-generator-and-validator.vue')['default']
|
||||
PasswordStrengthAnalyser: typeof import('./src/tools/password-strength-analyser/password-strength-analyser.vue')['default']
|
||||
@@ -162,6 +164,7 @@ declare module '@vue/runtime-core' {
|
||||
RouterView: typeof import('vue-router')['RouterView']
|
||||
RsaKeyPairGenerator: typeof import('./src/tools/rsa-key-pair-generator/rsa-key-pair-generator.vue')['default']
|
||||
SafelinkDecoder: typeof import('./src/tools/safelink-decoder/safelink-decoder.vue')['default']
|
||||
SharepointDecoder: typeof import('./src/tools/sharepoint-decoder/sharepoint-decoder.vue')['default']
|
||||
SlugifyString: typeof import('./src/tools/slugify-string/slugify-string.vue')['default']
|
||||
SpanCopyable: typeof import('./src/components/SpanCopyable.vue')['default']
|
||||
SqlPrettify: typeof import('./src/tools/sql-prettify/sql-prettify.vue')['default']
|
||||
|
||||
@@ -46,7 +46,6 @@
|
||||
"@tiptap/starter-kit": "2.1.6",
|
||||
"@tiptap/vue-3": "2.0.3",
|
||||
"@types/figlet": "^1.5.8",
|
||||
"@types/haversine": "^1.1.8",
|
||||
"@types/markdown-it": "^13.0.7",
|
||||
"@vicons/material": "^0.12.0",
|
||||
"@vicons/tabler": "^0.12.0",
|
||||
@@ -68,7 +67,6 @@
|
||||
"figlet": "^1.7.0",
|
||||
"figue": "^1.2.0",
|
||||
"fuse.js": "^6.6.2",
|
||||
"haversine": "^1.1.1",
|
||||
"highlight.js": "^11.7.0",
|
||||
"iarna-toml-esm": "^3.0.5",
|
||||
"ibantools": "^4.3.3",
|
||||
|
||||
Generated
+1051
-1297
File diff suppressed because it is too large.
Load diff
@@ -1,80 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
import haversine from 'haversine';
|
||||
import SpanCopyable from '@/components/SpanCopyable.vue';
|
||||
import { useQueryParamOrStorage } from '@/composable/queryParams';
|
||||
|
||||
const latitude1 = useQueryParamOrStorage({ name: 'lat1', storageName: 'geo-dist:lat1', defaultValue: 0 });
|
||||
const longitude1 = useQueryParamOrStorage({ name: 'lng1', storageName: 'geo-dist:lng1', defaultValue: 0 });
|
||||
|
||||
const latitude2 = useQueryParamOrStorage({ name: 'lat2', storageName: 'geo-dist:lat2', defaultValue: 0 });
|
||||
const longitude2 = useQueryParamOrStorage({ name: 'lng2', storageName: 'geo-dist:lng2', defaultValue: 0 });
|
||||
|
||||
const start = computed(() => ({ latitude: latitude1.value, longitude: longitude1.value }));
|
||||
const end = computed(() => ({ latitude: latitude2.value, longitude: longitude2.value }));
|
||||
|
||||
const { coords: userCoords } = useGeolocation();
|
||||
|
||||
const distanceKM = computed(() => haversine(start.value, end.value, { unit: 'km' }));
|
||||
const distanceMeter = computed(() => haversine(start.value, end.value, { unit: 'meter' }));
|
||||
const distanceMile = computed(() => haversine(start.value, end.value, { unit: 'mile' }));
|
||||
const distanceNMI = computed(() => haversine(start.value, end.value, { unit: 'nmi' }));
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<c-card title="Distance computer" mb-2>
|
||||
<n-form-item label="Geolocation 1 (latitude, longitude):">
|
||||
<n-space justify="space-between">
|
||||
<n-input-number v-model:value="latitude1" :min="-90" :max="90" placeholder="Latitude..." />
|
||||
<n-input-number v-model:value="longitude1" :min="-180" :max="180" placeholder="Longitude..." />
|
||||
</n-space>
|
||||
</n-form-item>
|
||||
<n-form-item label="Geolocation 2 (latitude, longitude):" gap-2>
|
||||
<n-space justify="space-between">
|
||||
<n-input-number v-model:value="latitude2" :min="-90" :max="90" placeholder="Latitude..." />
|
||||
<n-input-number v-model:value="longitude2" :min="-180" :max="180" placeholder="Longitude..." />
|
||||
</n-space>
|
||||
</n-form-item>
|
||||
|
||||
<n-divider />
|
||||
|
||||
<n-form-item label="Distance (km):" label-width="120px" label-placement="left">
|
||||
<SpanCopyable :value="distanceKM.toString()" />
|
||||
</n-form-item>
|
||||
<n-form-item label="Distance (mile):" label-width="120px" label-placement="left">
|
||||
<SpanCopyable :value="distanceMile.toString()" />
|
||||
</n-form-item>
|
||||
<n-form-item label="Distance (meter):" label-width="120px" label-placement="left">
|
||||
<SpanCopyable :value="distanceMeter.toString()" />
|
||||
</n-form-item>
|
||||
<n-form-item label="Distance (nmi):" label-width="120px" label-placement="left">
|
||||
<SpanCopyable :value="distanceNMI.toString()" />
|
||||
</n-form-item>
|
||||
</c-card>
|
||||
|
||||
<c-card title="Your position">
|
||||
<n-space justify="center">
|
||||
<n-form-item label="Latitude:" label-placement="left">
|
||||
<SpanCopyable :value="userCoords?.latitude?.toString() || 'Unknown'" />
|
||||
</n-form-item>
|
||||
<n-form-item label="Longitude:" label-placement="left">
|
||||
<SpanCopyable :value="userCoords?.longitude?.toString() || 'Unknown'" />
|
||||
</n-form-item>
|
||||
</n-space>
|
||||
<n-space justify="center">
|
||||
<n-form-item label="Altitude:" label-placement="left">
|
||||
<SpanCopyable :value="userCoords?.altitude?.toString() || 'Unknown'" />
|
||||
</n-form-item>
|
||||
<n-form-item label="Heading:" label-placement="left">
|
||||
<SpanCopyable :value="userCoords?.heading?.toString() || 'Unknown'" />
|
||||
</n-form-item>
|
||||
<n-form-item label="Speed:" label-placement="left">
|
||||
<SpanCopyable :value="userCoords?.speed?.toString() || 'Unknown'" />
|
||||
</n-form-item>
|
||||
<n-form-item label="Accuracy:" label-placement="left">
|
||||
<SpanCopyable :value="userCoords?.accuracy?.toString() || 'Unknown'" />
|
||||
</n-form-item>
|
||||
</n-space>
|
||||
</c-card>
|
||||
</div>
|
||||
</template>
|
||||
@@ -1,12 +0,0 @@
|
||||
import { WorldLatitude } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'Geo distance calculator',
|
||||
path: '/geo-distance-calculator',
|
||||
description: 'Compute distance between two geo location (and display current user location information)',
|
||||
keywords: ['geo', 'distance', 'calculator'],
|
||||
component: () => import('./geo-distance-calculator.vue'),
|
||||
icon: WorldLatitude,
|
||||
createdAt: new Date('2025-01-01'),
|
||||
});
|
||||
+3
-7
@@ -2,7 +2,7 @@ import { tool as base64FileConverter } from './base64-file-converter';
|
||||
import { tool as base64StringConverter } from './base64-string-converter';
|
||||
import { tool as basicAuthGenerator } from './basic-auth-generator';
|
||||
import { tool as emailNormalizer } from './email-normalizer';
|
||||
import { tool as geoDistanceCalculator } from './geo-distance-calculator';
|
||||
import { tool as sharepointDecoder } from './sharepoint-decoder';
|
||||
|
||||
import { tool as asciiTextDrawer } from './ascii-text-drawer';
|
||||
|
||||
@@ -138,6 +138,7 @@ export const toolsByCategory: ToolCategory[] = [
|
||||
httpStatusCodes,
|
||||
jsonDiff,
|
||||
safelinkDecoder,
|
||||
sharepointDecoder,
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -173,12 +174,7 @@ export const toolsByCategory: ToolCategory[] = [
|
||||
},
|
||||
{
|
||||
name: 'Measurement',
|
||||
components: [
|
||||
chronometer,
|
||||
temperatureConverter,
|
||||
benchmarkBuilder,
|
||||
geoDistanceCalculator,
|
||||
],
|
||||
components: [chronometer, temperatureConverter, benchmarkBuilder],
|
||||
},
|
||||
{
|
||||
name: 'Text',
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
import { Mailbox } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'Sharepoint Share Url Decoder',
|
||||
path: '/sharepoint-decoder',
|
||||
description: 'Decode sharepoint.com share urls to "normal" Sharepoint Url',
|
||||
keywords: ['sharepoint', 'url', 'decoder'],
|
||||
component: () => import('./sharepoint-decoder.vue'),
|
||||
icon: Mailbox,
|
||||
createdAt: new Date('2025-02-09'),
|
||||
});
|
||||
@@ -0,0 +1,18 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { decodeSharePointsURL } from './sharepoint-decoder.service';
|
||||
|
||||
describe('sharepoint-decoder', () => {
|
||||
describe('decodeSharePointsURL', () => {
|
||||
describe('decode outlook sharepoint urls', () => {
|
||||
it('should decode basic sharepoint urls', () => {
|
||||
expect(decodeSharePointsURL('https://my-site.sharepoint.com/sites/SBL-AssuranceofLearning/AoL%20Reviews/Forms/AllItems.aspx?FolderCTID=0x0120004A7E52B45BF74940ABEB3A8AA69FF829&id=%2Fsites%2FSBL%2DAssuranceofLearning%2FAoL%20Reviews%2FAnalytics%2FSQL%2EDefinitions%2Fcourse%5Funit%5Fsets%2Esql&viewid=d65c252e%2Db796%2D4457%2D88dd%2D2a8095006fb9&parent=%2Fsites%2FSBL%2DAssuranceofLearning%2FAoL%20Reviews%2FAnalytics%2FSQL%2EDefinitions'))
|
||||
.toBe('https://my-site.sharepoint.com/sites/SBL-AssuranceofLearning/AoL Reviews/Analytics/SQL.Definitions/course_unit_sets.sql');
|
||||
});
|
||||
|
||||
it('throw on not outlook sharepoint urls', () => {
|
||||
expect(() => decodeSharePointsURL('https://google.com'))
|
||||
.toThrow('Invalid SharePoint URL provided');
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,8 @@
|
||||
export function decodeSharePointsURL(sharePointsUrl: string) {
|
||||
if (!sharePointsUrl.match(/\.sharepoint\.com/)) {
|
||||
throw new Error('Invalid SharePoint URL provided');
|
||||
}
|
||||
|
||||
const url = new URL(sharePointsUrl);
|
||||
return `${url.protocol}//${url.hostname}${url.searchParams.get('id')}`;
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<script setup lang="ts">
|
||||
import { decodeSharePointsURL } from './sharepoint-decoder.service';
|
||||
import TextareaCopyable from '@/components/TextareaCopyable.vue';
|
||||
|
||||
const inputSharePointUrl = ref('');
|
||||
const outputDecodedUrl = computed(() => {
|
||||
try {
|
||||
return decodeSharePointsURL(inputSharePointUrl.value);
|
||||
}
|
||||
catch (e: any) {
|
||||
return e.toString();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<c-input-text
|
||||
v-model:value="inputSharePointUrl"
|
||||
raw-text
|
||||
placeholder="Your input SharePoint Url..."
|
||||
autofocus
|
||||
label="Your input SharePoint Url:"
|
||||
/>
|
||||
|
||||
<n-divider />
|
||||
|
||||
<n-form-item label="Output decoded URL:">
|
||||
<TextareaCopyable :value="outputDecodedUrl" :word-wrap="true" />
|
||||
</n-form-item>
|
||||
</div>
|
||||
</template>
|
||||
Reference in new issue
Block a user