mirror of
				https://github.com/CorentinTh/it-tools.git
				synced 2025-11-04 05:53:25 +00:00 
			
		
		
		
	Compare commits
	
		
			9 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					352365f012 | ||
| 
						 | 
					4f599b6999 | ||
| 
						 | 
					138149e6f0 | ||
| 
						 | 
					412de23796 | ||
| 
						 | 
					1a22d55b3c | ||
| 
						 | 
					bb4aac6d4a | ||
| 
						 | 
					e6953d1b67 | ||
| 
						 | 
					a70a0f83a1 | ||
| 
						 | 
					bdee93a9e4 | 
							
								
								
									
										28
									
								
								CHANGELOG.md
									
									
									
									
									
								
							
							
						
						
									
										28
									
								
								CHANGELOG.md
									
									
									
									
									
								
							@@ -2,6 +2,34 @@
 | 
			
		||||
 | 
			
		||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
 | 
			
		||||
 | 
			
		||||
### [2.9.2](https://github.com/CorentinTh/it-tools/compare/v2.9.1...v2.9.2) (2022-07-28)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
### Bug Fixes
 | 
			
		||||
 | 
			
		||||
* **base64-file:** fixed url slug ([412de23](https://github.com/CorentinTh/it-tools/commit/412de23796babbc080b0768a75029ff2ddf2acfc))
 | 
			
		||||
* **device-information:** handle of unknown values ([4f599b6](https://github.com/CorentinTh/it-tools/commit/4f599b699901a93444bcc67cbb3b3556a0561ae4))
 | 
			
		||||
* **device-information:** prevent unwanted y-truncature of text  ([138149e](https://github.com/CorentinTh/it-tools/commit/138149e6f0be91255907a6083887898e5c68882e))
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
### Refactors
 | 
			
		||||
 | 
			
		||||
* **base64-file:** fixed typo ([1a22d55](https://github.com/CorentinTh/it-tools/commit/1a22d55b3c48f58b05b5a50de4fea260e781fbef))
 | 
			
		||||
 | 
			
		||||
### [2.9.1](https://github.com/CorentinTh/it-tools/compare/v2.9.0...v2.9.1) (2022-07-25)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
### Refactors
 | 
			
		||||
 | 
			
		||||
* **base64:** split base64 text and file conversion in two tools + base64 to file ([e6953d1](https://github.com/CorentinTh/it-tools/commit/e6953d1b67b81a6d3c19973b706f29637c421f98))
 | 
			
		||||
 | 
			
		||||
## [2.9.0](https://github.com/CorentinTh/it-tools/compare/v2.8.0...v2.9.0) (2022-07-25)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
### Features
 | 
			
		||||
 | 
			
		||||
* **new-tool:** added a basic auth generator ([bdee93a](https://github.com/CorentinTh/it-tools/commit/bdee93a9e45c6b46e7f75cdcbe1907f138722dca))
 | 
			
		||||
 | 
			
		||||
## [2.8.0](https://github.com/CorentinTh/it-tools/compare/v2.7.0...v2.8.0) (2022-07-24)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										24
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										24
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							@@ -1,12 +1,12 @@
 | 
			
		||||
{
 | 
			
		||||
  "name": "it-tools",
 | 
			
		||||
  "version": "2.8.0",
 | 
			
		||||
  "version": "2.9.2",
 | 
			
		||||
  "lockfileVersion": 2,
 | 
			
		||||
  "requires": true,
 | 
			
		||||
  "packages": {
 | 
			
		||||
    "": {
 | 
			
		||||
      "name": "it-tools",
 | 
			
		||||
      "version": "2.8.0",
 | 
			
		||||
      "version": "2.9.2",
 | 
			
		||||
      "license": "GNU GPLv3",
 | 
			
		||||
      "dependencies": {
 | 
			
		||||
        "@it-tools/bip39": "^0.0.4",
 | 
			
		||||
@@ -25,6 +25,7 @@
 | 
			
		||||
        "highlight.js": "^11.5.1",
 | 
			
		||||
        "lodash": "^4.17.21",
 | 
			
		||||
        "mathjs": "^10.6.0",
 | 
			
		||||
        "mime-types": "^2.1.35",
 | 
			
		||||
        "naive-ui": "^2.31.0",
 | 
			
		||||
        "pinia": "^2.0.11",
 | 
			
		||||
        "plausible-tracker": "^0.3.5",
 | 
			
		||||
@@ -40,6 +41,7 @@
 | 
			
		||||
        "@types/bcryptjs": "^2.4.2",
 | 
			
		||||
        "@types/crypto-js": "^4.1.1",
 | 
			
		||||
        "@types/jsdom": "^16.2.14",
 | 
			
		||||
        "@types/mime-types": "^2.1.1",
 | 
			
		||||
        "@types/node": "^16.11.25",
 | 
			
		||||
        "@types/qrcode": "^1.4.2",
 | 
			
		||||
        "@types/randombytes": "^2.0.0",
 | 
			
		||||
@@ -2248,6 +2250,12 @@
 | 
			
		||||
      "integrity": "sha512-eC4U9MlIcu2q0KQmXszyn5Akca/0jrQmwDRgpAMJai7qBWq4amIQhZyNau4VYGtCeALvW1/NtjzJJ567aZxfKA==",
 | 
			
		||||
      "dev": true
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/@types/mime-types": {
 | 
			
		||||
      "version": "2.1.1",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@types/mime-types/-/mime-types-2.1.1.tgz",
 | 
			
		||||
      "integrity": "sha512-vXOTGVSLR2jMw440moWTC7H19iUyLtP3Z1YTj7cSsubOICinjMxFeb/V57v9QdyyPGbbWolUFSSmSiRSn94tFw==",
 | 
			
		||||
      "dev": true
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/@types/minimist": {
 | 
			
		||||
      "version": "1.2.2",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz",
 | 
			
		||||
@@ -7703,7 +7711,6 @@
 | 
			
		||||
      "version": "1.52.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
 | 
			
		||||
      "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
 | 
			
		||||
      "dev": true,
 | 
			
		||||
      "engines": {
 | 
			
		||||
        "node": ">= 0.6"
 | 
			
		||||
      }
 | 
			
		||||
@@ -7712,7 +7719,6 @@
 | 
			
		||||
      "version": "2.1.35",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
 | 
			
		||||
      "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
 | 
			
		||||
      "dev": true,
 | 
			
		||||
      "dependencies": {
 | 
			
		||||
        "mime-db": "1.52.0"
 | 
			
		||||
      },
 | 
			
		||||
@@ -12847,6 +12853,12 @@
 | 
			
		||||
      "integrity": "sha512-eC4U9MlIcu2q0KQmXszyn5Akca/0jrQmwDRgpAMJai7qBWq4amIQhZyNau4VYGtCeALvW1/NtjzJJ567aZxfKA==",
 | 
			
		||||
      "dev": true
 | 
			
		||||
    },
 | 
			
		||||
    "@types/mime-types": {
 | 
			
		||||
      "version": "2.1.1",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@types/mime-types/-/mime-types-2.1.1.tgz",
 | 
			
		||||
      "integrity": "sha512-vXOTGVSLR2jMw440moWTC7H19iUyLtP3Z1YTj7cSsubOICinjMxFeb/V57v9QdyyPGbbWolUFSSmSiRSn94tFw==",
 | 
			
		||||
      "dev": true
 | 
			
		||||
    },
 | 
			
		||||
    "@types/minimist": {
 | 
			
		||||
      "version": "1.2.2",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz",
 | 
			
		||||
@@ -16899,14 +16911,12 @@
 | 
			
		||||
    "mime-db": {
 | 
			
		||||
      "version": "1.52.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
 | 
			
		||||
      "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
 | 
			
		||||
      "dev": true
 | 
			
		||||
      "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg=="
 | 
			
		||||
    },
 | 
			
		||||
    "mime-types": {
 | 
			
		||||
      "version": "2.1.35",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
 | 
			
		||||
      "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
 | 
			
		||||
      "dev": true,
 | 
			
		||||
      "requires": {
 | 
			
		||||
        "mime-db": "1.52.0"
 | 
			
		||||
      }
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
{
 | 
			
		||||
  "name": "it-tools",
 | 
			
		||||
  "version": "2.8.0",
 | 
			
		||||
  "version": "2.9.2",
 | 
			
		||||
  "description": "Collection of handy online tools for developers, with great UX. ",
 | 
			
		||||
  "keywords": [
 | 
			
		||||
    "productivity",
 | 
			
		||||
@@ -47,6 +47,7 @@
 | 
			
		||||
    "highlight.js": "^11.5.1",
 | 
			
		||||
    "lodash": "^4.17.21",
 | 
			
		||||
    "mathjs": "^10.6.0",
 | 
			
		||||
    "mime-types": "^2.1.35",
 | 
			
		||||
    "naive-ui": "^2.31.0",
 | 
			
		||||
    "pinia": "^2.0.11",
 | 
			
		||||
    "plausible-tracker": "^0.3.5",
 | 
			
		||||
@@ -62,6 +63,7 @@
 | 
			
		||||
    "@types/bcryptjs": "^2.4.2",
 | 
			
		||||
    "@types/crypto-js": "^4.1.1",
 | 
			
		||||
    "@types/jsdom": "^16.2.14",
 | 
			
		||||
    "@types/mime-types": "^2.1.1",
 | 
			
		||||
    "@types/node": "^16.11.25",
 | 
			
		||||
    "@types/qrcode": "^1.4.2",
 | 
			
		||||
    "@types/randombytes": "^2.0.0",
 | 
			
		||||
 
 | 
			
		||||
@@ -1,11 +1,17 @@
 | 
			
		||||
import { extension as getExtensionFromMime } from 'mime-types';
 | 
			
		||||
import type { Ref } from 'vue';
 | 
			
		||||
 | 
			
		||||
export function useDownloadFileFromBase64({ source, filename = 'file' }: { source: Ref<string>; filename?: string }) {
 | 
			
		||||
export function useDownloadFileFromBase64({ source, filename }: { source: Ref<string>; filename?: string }) {
 | 
			
		||||
  return {
 | 
			
		||||
    download() {
 | 
			
		||||
      const base64 = source.value;
 | 
			
		||||
      const mimeType = base64.match(/data:(.*?);base64/i)?.[1] ?? 'text/plain';
 | 
			
		||||
      console.log({ mimeType });
 | 
			
		||||
      const cleanFileName = filename ?? `file.${getExtensionFromMime(mimeType)}`;
 | 
			
		||||
 | 
			
		||||
      const a = document.createElement('a');
 | 
			
		||||
      a.href = source.value;
 | 
			
		||||
      a.download = filename;
 | 
			
		||||
      a.download = cleanFileName;
 | 
			
		||||
      a.click();
 | 
			
		||||
    },
 | 
			
		||||
  };
 | 
			
		||||
 
 | 
			
		||||
@@ -1,9 +1,8 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <n-card title="Text to base64">
 | 
			
		||||
    <n-input v-model:value="textInput" type="textarea" placeholder="Put your string here..." />
 | 
			
		||||
    <n-input :value="textBase64" type="textarea" readonly />
 | 
			
		||||
  <n-card title="Base64 to file">
 | 
			
		||||
    <n-input v-model:value="base64Input" type="textarea" placeholder="Put your base64 file string here..." rows="5" />
 | 
			
		||||
    <n-space justify="center">
 | 
			
		||||
      <n-button secondary @click="copyTextBase64()"> Copy </n-button>
 | 
			
		||||
      <n-button secondary @click="download()"> Download file </n-button>
 | 
			
		||||
    </n-space>
 | 
			
		||||
  </n-card>
 | 
			
		||||
 | 
			
		||||
@@ -17,7 +16,7 @@
 | 
			
		||||
      </n-upload-dragger>
 | 
			
		||||
    </n-upload>
 | 
			
		||||
 | 
			
		||||
    <n-input :value="fileBase64" type="textarea" readonly />
 | 
			
		||||
    <n-input :value="fileBase64" type="textarea" readonly placeholder="File in base64 will be here" />
 | 
			
		||||
    <n-space justify="center">
 | 
			
		||||
      <n-button secondary @click="copyFileBase64()"> Copy </n-button>
 | 
			
		||||
    </n-space>
 | 
			
		||||
@@ -26,14 +25,14 @@
 | 
			
		||||
 | 
			
		||||
<script setup lang="ts">
 | 
			
		||||
import { useCopy } from '@/composable/copy';
 | 
			
		||||
import { useBase64 } from '@vueuse/core';
 | 
			
		||||
import { useDownloadFileFromBase64 } from '@/composable/downloadBase64';
 | 
			
		||||
import { Upload } from '@vicons/tabler';
 | 
			
		||||
import { ref, type Ref } from 'vue';
 | 
			
		||||
import { useBase64 } from '@vueuse/core';
 | 
			
		||||
import type { UploadFileInfo } from 'naive-ui';
 | 
			
		||||
import { ref, type Ref } from 'vue';
 | 
			
		||||
 | 
			
		||||
const textInput = ref('');
 | 
			
		||||
const { base64: textBase64 } = useBase64(textInput);
 | 
			
		||||
const { copy: copyTextBase64 } = useCopy({ source: textBase64, text: 'Base64 string copied to the clipboard' });
 | 
			
		||||
const base64Input = ref('');
 | 
			
		||||
const { download } = useDownloadFileFromBase64({ source: base64Input });
 | 
			
		||||
 | 
			
		||||
const fileList = ref();
 | 
			
		||||
const fileInput = ref() as Ref<File>;
 | 
			
		||||
@@ -2,11 +2,10 @@ import { FileDigit } from '@vicons/tabler';
 | 
			
		||||
import { defineTool } from '../tool';
 | 
			
		||||
 | 
			
		||||
export const tool = defineTool({
 | 
			
		||||
  name: 'Base64 converter',
 | 
			
		||||
  path: '/base64-converter',
 | 
			
		||||
  name: 'Base64 file converter',
 | 
			
		||||
  path: '/base64-file-converter',
 | 
			
		||||
  description: "Convert string, files or images into a it's base64 representation.",
 | 
			
		||||
  keywords: ['base64', 'converter', 'upload', 'image', 'file', 'conversion', 'web', 'data', 'format'],
 | 
			
		||||
  component: () => import('./base64-converter.vue'),
 | 
			
		||||
  component: () => import('./base64-file-converter.vue'),
 | 
			
		||||
  icon: FileDigit,
 | 
			
		||||
  redirectFrom: ['/file-to-base64', '/base64-string-converter'],
 | 
			
		||||
});
 | 
			
		||||
@@ -0,0 +1,65 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <n-card title="String to base64">
 | 
			
		||||
    <n-form-item label="String to encode">
 | 
			
		||||
      <n-input v-model:value="textInput" type="textarea" placeholder="Put your string here..." rows="5" />
 | 
			
		||||
    </n-form-item>
 | 
			
		||||
 | 
			
		||||
    <n-form-item label="Base64 of string">
 | 
			
		||||
      <n-input
 | 
			
		||||
        :value="base64Output"
 | 
			
		||||
        type="textarea"
 | 
			
		||||
        readonly
 | 
			
		||||
        placeholder="The base64 encoding of your string will be here"
 | 
			
		||||
        rows="5"
 | 
			
		||||
      />
 | 
			
		||||
    </n-form-item>
 | 
			
		||||
 | 
			
		||||
    <n-space justify="center">
 | 
			
		||||
      <n-button secondary @click="copyTextBase64()"> Copy base64 </n-button>
 | 
			
		||||
    </n-space>
 | 
			
		||||
  </n-card>
 | 
			
		||||
 | 
			
		||||
  <n-card title="Base64 to string">
 | 
			
		||||
    <n-form-item
 | 
			
		||||
      label="Base64 string to decode"
 | 
			
		||||
      :validation-status="b64Validation.status"
 | 
			
		||||
      :feedback="b64Validation.message"
 | 
			
		||||
    >
 | 
			
		||||
      <n-input v-model:value="base64Input" type="textarea" placeholder="Your base64 string..." rows="5" />
 | 
			
		||||
    </n-form-item>
 | 
			
		||||
 | 
			
		||||
    <n-form-item label="Decoded string">
 | 
			
		||||
      <n-input :value="textOutput" type="textarea" readonly placeholder="The decoded string will be here" rows="5" />
 | 
			
		||||
    </n-form-item>
 | 
			
		||||
 | 
			
		||||
    <n-space justify="center">
 | 
			
		||||
      <n-button secondary @click="copyText()"> Copy decoded string </n-button>
 | 
			
		||||
    </n-space>
 | 
			
		||||
  </n-card>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script setup lang="ts">
 | 
			
		||||
import { useCopy } from '@/composable/copy';
 | 
			
		||||
import { useValidation } from '@/composable/validation';
 | 
			
		||||
import { computed, ref } from 'vue';
 | 
			
		||||
 | 
			
		||||
const textInput = ref('');
 | 
			
		||||
const base64Output = computed(() => window.btoa(textInput.value));
 | 
			
		||||
const { copy: copyTextBase64 } = useCopy({ source: base64Output, text: 'Base64 string copied to the clipboard' });
 | 
			
		||||
 | 
			
		||||
const base64Input = ref('');
 | 
			
		||||
const textOutput = computed(() => {
 | 
			
		||||
  try {
 | 
			
		||||
    return window.atob(base64Input.value);
 | 
			
		||||
  } catch (_) {
 | 
			
		||||
    return '';
 | 
			
		||||
  }
 | 
			
		||||
});
 | 
			
		||||
const { copy: copyText } = useCopy({ source: textOutput, text: 'String copied to the clipboard' });
 | 
			
		||||
const b64Validation = useValidation({
 | 
			
		||||
  source: base64Input,
 | 
			
		||||
  rules: [{ message: 'Invalid base64 string', validator: (value) => true || window.atob(value) }],
 | 
			
		||||
});
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style lang="less" scoped></style>
 | 
			
		||||
							
								
								
									
										12
									
								
								src/tools/base64-string-converter/index.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								src/tools/base64-string-converter/index.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,12 @@
 | 
			
		||||
import { FileDigit } from '@vicons/tabler';
 | 
			
		||||
import { defineTool } from '../tool';
 | 
			
		||||
 | 
			
		||||
export const tool = defineTool({
 | 
			
		||||
  name: 'Base64 string encoder/decoder',
 | 
			
		||||
  path: '/base64-string-converter',
 | 
			
		||||
  description: 'Simply encode and decode string into a their base64 representation.',
 | 
			
		||||
  keywords: ['base64', 'converter', 'conversion', 'web', 'data', 'format', 'atob', 'btoa'],
 | 
			
		||||
  component: () => import('./base64-string-converter.vue'),
 | 
			
		||||
  icon: FileDigit,
 | 
			
		||||
  redirectFrom: ['/file-to-base64', '/base64-converter'],
 | 
			
		||||
});
 | 
			
		||||
							
								
								
									
										48
									
								
								src/tools/basic-auth-generator/basic-auth-generator.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										48
									
								
								src/tools/basic-auth-generator/basic-auth-generator.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,48 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div>
 | 
			
		||||
    <n-form-item label="Username">
 | 
			
		||||
      <n-input v-model:value="username" placeholder="Your username..." clearable />
 | 
			
		||||
    </n-form-item>
 | 
			
		||||
    <n-form-item label="Password">
 | 
			
		||||
      <n-input
 | 
			
		||||
        v-model:value="password"
 | 
			
		||||
        placeholder="Your password..."
 | 
			
		||||
        type="password"
 | 
			
		||||
        show-password-on="click"
 | 
			
		||||
        clearable
 | 
			
		||||
      />
 | 
			
		||||
    </n-form-item>
 | 
			
		||||
 | 
			
		||||
    <br />
 | 
			
		||||
    <n-card>
 | 
			
		||||
      <n-statistic label="Authorization header:" class="header">
 | 
			
		||||
        <n-scrollbar x-scrollable style="max-width: 550px; margin-bottom: -10px; padding-bottom: 10px" trigger="none">
 | 
			
		||||
          {{ header }}
 | 
			
		||||
        </n-scrollbar>
 | 
			
		||||
      </n-statistic>
 | 
			
		||||
    </n-card>
 | 
			
		||||
    <br />
 | 
			
		||||
    <n-space justify="center">
 | 
			
		||||
      <n-button secondary @click="copy">Copy header</n-button>
 | 
			
		||||
    </n-space>
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script setup lang="ts">
 | 
			
		||||
import { useCopy } from '@/composable/copy';
 | 
			
		||||
import { computed, ref } from 'vue';
 | 
			
		||||
 | 
			
		||||
const username = ref('');
 | 
			
		||||
const password = ref('');
 | 
			
		||||
const header = computed(() => `Authorization: Basic ${window.btoa(`${username.value}:${password.value}`)}`);
 | 
			
		||||
 | 
			
		||||
const { copy } = useCopy({ source: header, text: 'Header copied to the clipboard' });
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style lang="less" scoped>
 | 
			
		||||
::v-deep(.n-statistic-value__content) {
 | 
			
		||||
  font-family: monospace;
 | 
			
		||||
  font-size: 17px !important;
 | 
			
		||||
  white-space: nowrap;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
							
								
								
									
										21
									
								
								src/tools/basic-auth-generator/index.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								src/tools/basic-auth-generator/index.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,21 @@
 | 
			
		||||
import { PasswordRound } from '@vicons/material';
 | 
			
		||||
import { defineTool } from '../tool';
 | 
			
		||||
 | 
			
		||||
export const tool = defineTool({
 | 
			
		||||
  name: 'Basic auth generator',
 | 
			
		||||
  path: '/basic-auth-generator',
 | 
			
		||||
  description: 'Generate a base64 basic auth header from an username and a password.',
 | 
			
		||||
  keywords: [
 | 
			
		||||
    'basic',
 | 
			
		||||
    'auth',
 | 
			
		||||
    'generator',
 | 
			
		||||
    'username',
 | 
			
		||||
    'password',
 | 
			
		||||
    'base64',
 | 
			
		||||
    'authentication',
 | 
			
		||||
    'header',
 | 
			
		||||
    'authorization',
 | 
			
		||||
  ],
 | 
			
		||||
  component: () => import('./basic-auth-generator.vue'),
 | 
			
		||||
  icon: PasswordRound,
 | 
			
		||||
});
 | 
			
		||||
@@ -1,16 +1,17 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <n-card v-for="{ name, information } in sections" :key="name" :title="name">
 | 
			
		||||
    <n-grid cols="1 400:2" x-gap="12" y-gap="12">
 | 
			
		||||
      <n-gi v-for="{ label, value } in information" :key="label" class="information">
 | 
			
		||||
      <n-gi v-for="{ label, value: { value } } in information" :key="label" class="information">
 | 
			
		||||
        <n-card :bordered="false" embedded>
 | 
			
		||||
          <div class="label">
 | 
			
		||||
            {{ label }}
 | 
			
		||||
          </div>
 | 
			
		||||
 | 
			
		||||
          <div class="value">
 | 
			
		||||
            <n-ellipsis>
 | 
			
		||||
              {{ value.value }}
 | 
			
		||||
            <n-ellipsis v-if="value">
 | 
			
		||||
              {{ value }}
 | 
			
		||||
            </n-ellipsis>
 | 
			
		||||
            <div v-else class="undefined-value">unknown</div>
 | 
			
		||||
          </div>
 | 
			
		||||
        </n-card>
 | 
			
		||||
      </n-gi>
 | 
			
		||||
@@ -89,7 +90,10 @@ const sections = [
 | 
			
		||||
  .value {
 | 
			
		||||
    font-size: 20px;
 | 
			
		||||
    font-weight: 400;
 | 
			
		||||
    line-height: 1;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  .undefined-value {
 | 
			
		||||
    opacity: 0.8;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,9 @@
 | 
			
		||||
import { LockOpen } from '@vicons/tabler';
 | 
			
		||||
import type { ToolCategory } from './tool';
 | 
			
		||||
 | 
			
		||||
import { tool as base64Converter } from './base64-converter';
 | 
			
		||||
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 bcrypt } from './bcrypt';
 | 
			
		||||
import { tool as bip39 } from './bip39-generator';
 | 
			
		||||
import { tool as caseConverter } from './case-converter';
 | 
			
		||||
@@ -42,7 +44,8 @@ export const toolsByCategory: ToolCategory[] = [
 | 
			
		||||
      dateTimeConverter,
 | 
			
		||||
      baseConverter,
 | 
			
		||||
      romanNumeralConverter,
 | 
			
		||||
      base64Converter,
 | 
			
		||||
      base64StringConverter,
 | 
			
		||||
      base64FileConverter,
 | 
			
		||||
      colorConverter,
 | 
			
		||||
      caseConverter,
 | 
			
		||||
    ],
 | 
			
		||||
@@ -50,7 +53,7 @@ export const toolsByCategory: ToolCategory[] = [
 | 
			
		||||
  {
 | 
			
		||||
    name: 'Web',
 | 
			
		||||
    icon: LockOpen,
 | 
			
		||||
    components: [urlEncoder, htmlEntities, qrCodeGenerator, urlParser, deviceInformation],
 | 
			
		||||
    components: [urlEncoder, htmlEntities, qrCodeGenerator, urlParser, deviceInformation, basicAuthGenerator],
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    name: 'Development',
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user