mirror of
https://github.com/sharevb/it-tools.git
synced 2026-11-23 14:21:04 +03:00
Compare commits
21
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
38fce38ab5 | ||
|
|
632c68df20 | ||
|
|
95ed4e402b | ||
|
|
bcec4020a1 | ||
|
|
920de5b431 | ||
|
|
d7f266bfd7 | ||
|
|
44e81e3025 | ||
|
|
ba663a4fb1 | ||
|
|
8172562fe6 | ||
|
|
49288d0959 | ||
|
|
64a21197af | ||
|
|
a5d15b579e | ||
|
|
87878aa33e | ||
|
|
5882b6a714 | ||
|
|
5c68336170 | ||
|
|
c9b448ce64 | ||
|
|
f90a69c86c | ||
|
|
80a2fb78c3 | ||
|
|
a99744646a | ||
|
|
b489f3aa02 | ||
|
|
2355232aed |
No files matched your search
@@ -130,7 +130,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v3
|
||||
@@ -153,7 +153,7 @@ jobs:
|
||||
uses: actions/configure-pages@v3
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-pages-artifact@v1
|
||||
uses: actions/upload-pages-artifact@v3
|
||||
with:
|
||||
path: './dist'
|
||||
|
||||
|
||||
Vendored
+18
-10
@@ -12,6 +12,7 @@ declare module '@vue/runtime-core' {
|
||||
'404.page': typeof import('./src/pages/404.page.vue')['default']
|
||||
About: typeof import('./src/pages/About.vue')['default']
|
||||
AdLdapSearcher: typeof import('./src/tools/ad-ldap-searcher/ad-ldap-searcher.vue')['default']
|
||||
AgeCrypto: typeof import('./src/tools/age-crypto/age-crypto.vue')['default']
|
||||
AiPromptSplitter: typeof import('./src/tools/ai-prompt-splitter/ai-prompt-splitter.vue')['default']
|
||||
AlarmSoundToggle: typeof import('./src/tools/pomodoro-timer/app/components/AlarmSoundToggle.vue')['default']
|
||||
AngleConverter: typeof import('./src/tools/angle-converter/angle-converter.vue')['default']
|
||||
@@ -28,6 +29,8 @@ declare module '@vue/runtime-core' {
|
||||
Base64FileConverter: typeof import('./src/tools/base64-file-converter/base64-file-converter.vue')['default']
|
||||
Base64HexConverter: typeof import('./src/tools/base64-hex-converter/base64-hex-converter.vue')['default']
|
||||
Base64StringConverter: typeof import('./src/tools/base64-string-converter/base64-string-converter.vue')['default']
|
||||
BashMemo: typeof import('./src/tools/bash-memo/bash-memo.vue')['default']
|
||||
'BashMemo.content': typeof import('./src/tools/bash-memo/bash-memo.content.md')['default']
|
||||
BasicAuthGenerator: typeof import('./src/tools/basic-auth-generator/basic-auth-generator.vue')['default']
|
||||
Bcrypt: typeof import('./src/tools/bcrypt/bcrypt.vue')['default']
|
||||
BenchmarkBuilder: typeof import('./src/tools/benchmark-builder/benchmark-builder.vue')['default']
|
||||
@@ -84,6 +87,7 @@ declare module '@vue/runtime-core' {
|
||||
Countdown: typeof import('./src/tools/countdown/countdown.vue')['default']
|
||||
Counter: typeof import('./src/tools/pomodoro-timer/app/components/Counter.vue')['default']
|
||||
CrcCalculator: typeof import('./src/tools/crc-calculator/crc-calculator.vue')['default']
|
||||
CronAlarm: typeof import('./src/tools/cron-alarm/cron-alarm.vue')['default']
|
||||
CrontabGenerator: typeof import('./src/tools/crontab-generator/crontab-generator.vue')['default']
|
||||
CSelect: typeof import('./src/ui/c-select/c-select.vue')['default']
|
||||
'CSelect.demo': typeof import('./src/ui/c-select/c-select.demo.vue')['default']
|
||||
@@ -116,9 +120,7 @@ declare module '@vue/runtime-core' {
|
||||
DiffViewer: typeof import('./src/tools/json-diff/diff-viewer/diff-viewer.vue')['default']
|
||||
DistinctWords: typeof import('./src/tools/distinct-words/distinct-words.vue')['default']
|
||||
DkimDnsGenerator: typeof import('./src/tools/dkim-dns-generator/dkim-dns-generator.vue')['default']
|
||||
'Dmarc-Generator': typeof import('./src/tools/dmarc-dns-generator/dmarc--generator.vue')['default']
|
||||
DmarcDnsGenerator: typeof import('./src/tools/dmarc-dns-generator/dmarc-dns-generator.vue')['default']
|
||||
DmarcGenerator: typeof import('./src/tools/dmarc-dns-generator/dmarc-generator.vue')['default']
|
||||
DmarcReportAnalyzer: typeof import('./src/tools/dmarc-report-analyzer/dmarc-report-analyzer.vue')['default']
|
||||
DnsQueries: typeof import('./src/tools/dns-queries/dns-queries.vue')['default']
|
||||
Docker: typeof import('./src/tools/docker-memo/docker.md')['default']
|
||||
@@ -260,6 +262,8 @@ declare module '@vue/runtime-core' {
|
||||
JsUnobfuscator: typeof import('./src/tools/js-unobfuscator/js-unobfuscator.vue')['default']
|
||||
JwtGenerator: typeof import('./src/tools/jwt-generator/jwt-generator.vue')['default']
|
||||
JwtParser: typeof import('./src/tools/jwt-parser/jwt-parser.vue')['default']
|
||||
K8sMemo: typeof import('./src/tools/k8s-memo/k8s-memo.vue')['default']
|
||||
'K8sMemo.content': typeof import('./src/tools/k8s-memo/k8s-memo.content.md')['default']
|
||||
KeycodeInfo: typeof import('./src/tools/keycode-info/keycode-info.vue')['default']
|
||||
LengthConverter: typeof import('./src/tools/length-converter/length-converter.vue')['default']
|
||||
ListComparer: typeof import('./src/tools/list-comparer/list-comparer.vue')['default']
|
||||
@@ -294,6 +298,8 @@ declare module '@vue/runtime-core' {
|
||||
MorseConverter: typeof import('./src/tools/morse-converter/morse-converter.vue')['default']
|
||||
MultiLinkDownloader: typeof import('./src/tools/multi-link-downloader/multi-link-downloader.vue')['default']
|
||||
MyIp: typeof import('./src/tools/my-ip/my-ip.vue')['default']
|
||||
NA: typeof import('naive-ui')['NA']
|
||||
NAlert: typeof import('naive-ui')['NAlert']
|
||||
NanoidGenerator: typeof import('./src/tools/nanoid-generator/nanoid-generator.vue')['default']
|
||||
NanoMemo: typeof import('./src/tools/nano-memo/nano-memo.vue')['default']
|
||||
'NanoMemo.content': typeof import('./src/tools/nano-memo/nano-memo.content.md')['default']
|
||||
@@ -305,12 +311,13 @@ declare module '@vue/runtime-core' {
|
||||
NCode: typeof import('naive-ui')['NCode']
|
||||
NCollapseTransition: typeof import('naive-ui')['NCollapseTransition']
|
||||
NConfigProvider: typeof import('naive-ui')['NConfigProvider']
|
||||
NDataTable: typeof import('naive-ui')['NDataTable']
|
||||
NDivider: typeof import('naive-ui')['NDivider']
|
||||
NDynamicTags: typeof import('naive-ui')['NDynamicTags']
|
||||
NEllipsis: typeof import('naive-ui')['NEllipsis']
|
||||
NForm: typeof import('naive-ui')['NForm']
|
||||
NFormItem: typeof import('naive-ui')['NFormItem']
|
||||
NginxFormatter: typeof import('./src/tools/nginx-formatter/nginx-formatter.vue')['default']
|
||||
NginxMemo: typeof import('./src/tools/nginx-memo/nginx-memo.vue')['default']
|
||||
'NginxMemo.content': typeof import('./src/tools/nginx-memo/nginx-memo.content.md')['default']
|
||||
NH1: typeof import('naive-ui')['NH1']
|
||||
NH3: typeof import('naive-ui')['NH3']
|
||||
NIcon: typeof import('naive-ui')['NIcon']
|
||||
@@ -319,15 +326,15 @@ declare module '@vue/runtime-core' {
|
||||
NLayout: typeof import('naive-ui')['NLayout']
|
||||
NLayoutSider: typeof import('naive-ui')['NLayoutSider']
|
||||
NMenu: typeof import('naive-ui')['NMenu']
|
||||
NModal: typeof import('naive-ui')['NModal']
|
||||
NP: typeof import('naive-ui')['NP']
|
||||
NRadio: typeof import('naive-ui')['NRadio']
|
||||
NRadioGroup: typeof import('naive-ui')['NRadioGroup']
|
||||
NScrollbar: typeof import('naive-ui')['NScrollbar']
|
||||
NSelect: typeof import('naive-ui')['NSelect']
|
||||
NSpace: typeof import('naive-ui')['NSpace']
|
||||
NSwitch: typeof import('naive-ui')['NSwitch']
|
||||
NText: typeof import('naive-ui')['NText']
|
||||
NTooltip: typeof import('naive-ui')['NTooltip']
|
||||
NTable: typeof import('naive-ui')['NTable']
|
||||
NTag: typeof import('naive-ui')['NTag']
|
||||
NTimePicker: typeof import('naive-ui')['NTimePicker']
|
||||
NumberInput: typeof import('./src/tools/pomodoro-timer/app/components/NumberInput.vue')['default']
|
||||
NumeronymGenerator: typeof import('./src/tools/numeronym-generator/numeronym-generator.vue')['default']
|
||||
OcrImage: typeof import('./src/tools/ocr-image/ocr-image.vue')['default']
|
||||
@@ -346,6 +353,7 @@ declare module '@vue/runtime-core' {
|
||||
PdfLinearize: typeof import('./src/tools/pdf-linearize/pdf-linearize.vue')['default']
|
||||
PdfSignatureChecker: typeof import('./src/tools/pdf-signature-checker/pdf-signature-checker.vue')['default']
|
||||
PdfSignatureDetails: typeof import('./src/tools/pdf-signature-checker/components/pdf-signature-details.vue')['default']
|
||||
PdfTextExtractor: typeof import('./src/tools/pdf-text-extractor/pdf-text-extractor.vue')['default']
|
||||
PdfUnlock: typeof import('./src/tools/pdf-unlock/pdf-unlock.vue')['default']
|
||||
PercentageCalculator: typeof import('./src/tools/percentage-calculator/percentage-calculator.vue')['default']
|
||||
PgpEncryption: typeof import('./src/tools/pgp-encryption/pgp-encryption.vue')['default']
|
||||
@@ -363,7 +371,6 @@ declare module '@vue/runtime-core' {
|
||||
PressureConverter: typeof import('./src/tools/pressure-converter/pressure-converter.vue')['default']
|
||||
ProgressBar: typeof import('./src/tools/pomodoro-timer/app/components/ProgressBar.vue')['default']
|
||||
PropertiesConverter: typeof import('./src/tools/properties-converter/properties-converter.vue')['default']
|
||||
PropertiesToYaml: typeof import('./src/tools/properties-to-yaml/properties-to-yaml.vue')['default']
|
||||
PunycodeConverter: typeof import('./src/tools/punycode-converter/punycode-converter.vue')['default']
|
||||
QrCodeDecoder: typeof import('./src/tools/qr-code-decoder/qr-code-decoder.vue')['default']
|
||||
QrCodeGenerator: typeof import('./src/tools/qr-code-generator/qr-code-generator.vue')['default']
|
||||
@@ -400,7 +407,6 @@ declare module '@vue/runtime-core' {
|
||||
SoftwareLicenceCompatibility: typeof import('./src/tools/software-licence-compatibility/software-licence-compatibility.vue')['default']
|
||||
SpanCopyable: typeof import('./src/components/SpanCopyable.vue')['default']
|
||||
SpfDnsGenerator: typeof import('./src/tools/spf-dns-generator/spf-dns-generator.vue')['default']
|
||||
SpfGenerator: typeof import('./src/tools/spf-dns-generator/spf-generator.vue')['default']
|
||||
SplashScreen: typeof import('./src/tools/pomodoro-timer/app/views/SplashScreen.vue')['default']
|
||||
SqlMinifier: typeof import('./src/tools/sql-minifier/sql-minifier.vue')['default']
|
||||
SqlPrettify: typeof import('./src/tools/sql-prettify/sql-prettify.vue')['default']
|
||||
@@ -445,6 +451,8 @@ declare module '@vue/runtime-core' {
|
||||
UuidConverter: typeof import('./src/tools/uuid-converter/uuid-converter.vue')['default']
|
||||
UuidGenerator: typeof import('./src/tools/uuid-generator/uuid-generator.vue')['default']
|
||||
VatValidator: typeof import('./src/tools/vat-validator/vat-validator.vue')['default']
|
||||
VimMemo: typeof import('./src/tools/vim-memo/vim-memo.vue')['default']
|
||||
'VimMemo.content': typeof import('./src/tools/vim-memo/vim-memo.content.md')['default']
|
||||
VolumeConverter: typeof import('./src/tools/volume-converter/volume-converter.vue')['default']
|
||||
WebsocketTester: typeof import('./src/tools/websocket-tester/websocket-tester.vue')['default']
|
||||
WeekNumberConverter: typeof import('./src/tools/week-number-converter/week-number-converter.vue')['default']
|
||||
|
||||
+6
-2
@@ -136,6 +136,7 @@
|
||||
"figue": "^1.2.0",
|
||||
"file-type": "^20.1.0",
|
||||
"flatten-anything": "^4.0.1",
|
||||
"flexsearch": "^0.8.167",
|
||||
"fuse.js": "^7.1.0",
|
||||
"generate-schema": "^2.6.0",
|
||||
"get-timezone-offset": "^1.0.5",
|
||||
@@ -218,7 +219,7 @@
|
||||
"netstack.js": "^2.1.1",
|
||||
"nginx-config-formatter": "^1.4.5",
|
||||
"node-forge": "^1.3.1",
|
||||
"openpgp": "^6.1.0",
|
||||
"openpgp": "^6.1.1",
|
||||
"oui-data": "^1.1.281",
|
||||
"parse-duration": "^2.1.2",
|
||||
"parse-torrent": "^11.0.18",
|
||||
@@ -269,6 +270,8 @@
|
||||
"ulid": "^2.3.0",
|
||||
"unicode-emoji-json": "^0.4.0",
|
||||
"unique-random": "^4.0.0",
|
||||
"unixcrypt-browser": "^2.0.4",
|
||||
"unpdf": "^1.0.5",
|
||||
"unplugin-auto-import": "^0.16.4",
|
||||
"utf8": "^3.0.0",
|
||||
"uuid": "^11.0.5",
|
||||
@@ -287,6 +290,7 @@
|
||||
"vuex": "^4.1.0",
|
||||
"w-websocket-client": "^1.0.29",
|
||||
"webcrack": "^2.15.0",
|
||||
"webcrypto-liner-shim": "^1.4.8",
|
||||
"webp-converter-browser": "^1.0.4",
|
||||
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.2/xlsx-0.20.2.tgz",
|
||||
"xml-formatter": "^3.6.4",
|
||||
@@ -361,7 +365,7 @@
|
||||
"unplugin-icons": "^0.17.0",
|
||||
"unplugin-vue-components": "^0.25.0",
|
||||
"vite": "^4.4.9",
|
||||
"vite-plugin-node-polyfills": "^0.22.0",
|
||||
"vite-plugin-node-polyfills": "^0.23.0",
|
||||
"vite-plugin-pwa": "^1.0.0",
|
||||
"vite-plugin-vue-markdown": "^0.23.5",
|
||||
"vite-plugin-wasm": "^3.4.1",
|
||||
|
||||
Generated
+200
-162
@@ -305,6 +305,9 @@ dependencies:
|
||||
flatten-anything:
|
||||
specifier: ^4.0.1
|
||||
version: 4.0.1
|
||||
flexsearch:
|
||||
specifier: ^0.8.167
|
||||
version: 0.8.167
|
||||
fuse.js:
|
||||
specifier: ^7.1.0
|
||||
version: 7.1.0
|
||||
@@ -552,8 +555,8 @@ dependencies:
|
||||
specifier: ^1.3.1
|
||||
version: 1.3.1
|
||||
openpgp:
|
||||
specifier: ^6.1.0
|
||||
version: 6.1.0
|
||||
specifier: ^6.1.1
|
||||
version: 6.1.1
|
||||
oui-data:
|
||||
specifier: ^1.1.281
|
||||
version: 1.1.281
|
||||
@@ -704,6 +707,12 @@ dependencies:
|
||||
unique-random:
|
||||
specifier: ^4.0.0
|
||||
version: 4.0.0
|
||||
unixcrypt-browser:
|
||||
specifier: ^2.0.4
|
||||
version: 2.0.4
|
||||
unpdf:
|
||||
specifier: ^1.0.5
|
||||
version: 1.0.5
|
||||
unplugin-auto-import:
|
||||
specifier: ^0.16.4
|
||||
version: 0.16.4(@vueuse/core@10.11.1)(rollup@2.79.2)
|
||||
@@ -758,6 +767,9 @@ dependencies:
|
||||
webcrack:
|
||||
specifier: ^2.15.0
|
||||
version: 2.15.0
|
||||
webcrypto-liner-shim:
|
||||
specifier: ^1.4.8
|
||||
version: 1.4.8
|
||||
webp-converter-browser:
|
||||
specifier: ^1.0.4
|
||||
version: 1.0.4
|
||||
@@ -977,8 +989,8 @@ devDependencies:
|
||||
specifier: ^4.4.9
|
||||
version: 4.4.9(@types/node@18.19.75)(less@4.2.2)
|
||||
vite-plugin-node-polyfills:
|
||||
specifier: ^0.22.0
|
||||
version: 0.22.0(rollup@2.79.2)(vite@4.4.9)
|
||||
specifier: ^0.23.0
|
||||
version: 0.23.0(rollup@2.79.2)(vite@4.4.9)
|
||||
vite-plugin-pwa:
|
||||
specifier: ^1.0.0
|
||||
version: 1.0.0(vite@4.4.9)(workbox-build@7.3.0)(workbox-window@7.3.0)
|
||||
@@ -5401,6 +5413,21 @@ packages:
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/@peculiar/asn1-schema@2.3.15:
|
||||
resolution: {integrity: sha512-QPeD8UA8axQREpgR5UTAfu2mqQmm97oUqahDtNdBcfj3qAnoXzFdQW+aNf/tD2WVXF8Fhmftxoj0eMIT++gX2w==}
|
||||
dependencies:
|
||||
asn1js: 3.0.6
|
||||
pvtsutils: 1.3.6
|
||||
tslib: 2.8.1
|
||||
dev: false
|
||||
|
||||
/@peculiar/json-schema@1.1.12:
|
||||
resolution: {integrity: sha512-coUfuoMeIB7B8/NMekxaDzLhaYmp0HZNPEjYRm9goRou8UZIC3z21s0sL9AWoCw4EG876QyO3kYrc61WNF9B/w==}
|
||||
engines: {node: '>=8.0.0'}
|
||||
dependencies:
|
||||
tslib: 2.8.1
|
||||
dev: false
|
||||
|
||||
/@pkgjs/parseargs@0.11.0:
|
||||
resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==}
|
||||
engines: {node: '>=14'}
|
||||
@@ -5621,7 +5648,6 @@ packages:
|
||||
estree-walker: 2.0.2
|
||||
picomatch: 4.0.2
|
||||
rollup: 2.79.2
|
||||
dev: true
|
||||
|
||||
/@rushstack/eslint-patch@1.2.0:
|
||||
resolution: {integrity: sha512-sXo/qW2/pAcmT43VoRKOJbDOfV3cYpq3szSVfIThQXNt+E4DfKj361vaAt3c88U5tPUxzEswam7GW48PJqtKAg==}
|
||||
@@ -5713,6 +5739,12 @@ packages:
|
||||
resolution: {integrity: sha512-XExJS3cLqgrmNBIP3bBw6+1oQ1ksGjFh0+oClDKFYpCCqx/hlqwWO5KO/S63fzUo67SxI9dMrF0y5T/Ey7h8Zw==}
|
||||
dev: false
|
||||
|
||||
/@stablelib/binary@1.0.1:
|
||||
resolution: {integrity: sha512-ClJWvmL6UBM/wjkvv/7m5VP3GMr9t0osr4yVgLZsLCOz4hGN9gIAFEqnJ0TsSMAN+n840nf2cHZnA5/KFqHC7Q==}
|
||||
dependencies:
|
||||
'@stablelib/int': 1.0.1
|
||||
dev: false
|
||||
|
||||
/@stablelib/binary@2.0.1:
|
||||
resolution: {integrity: sha512-U9iAO8lXgEDONsA0zPPSgcf3HUBNAqHiJmSHgZz62OvC3Hi2Bhc5kTnQ3S1/L+sthDTHtCMhcEiklmIly6uQ3w==}
|
||||
dependencies:
|
||||
@@ -5742,10 +5774,18 @@ packages:
|
||||
'@stablelib/wipe': 2.0.1
|
||||
dev: false
|
||||
|
||||
/@stablelib/hash@1.0.1:
|
||||
resolution: {integrity: sha512-eTPJc/stDkdtOcrNMZ6mcMK1e6yBbqRBaNW55XA1jU8w/7QdnCF0CmMmOD1m7VSkBR44PWrMHU2l6r8YEQHMgg==}
|
||||
dev: false
|
||||
|
||||
/@stablelib/hash@2.0.0:
|
||||
resolution: {integrity: sha512-u3WPSqGido8lwJuMcrBgM5K54LrPGhkWAdtsyccf7dGsLixAZUds77zOAbu7bvKPwQlmoByH0txBi5rTmEKuHg==}
|
||||
dev: false
|
||||
|
||||
/@stablelib/int@1.0.1:
|
||||
resolution: {integrity: sha512-byr69X/sDtDiIjIV6m4roLVWnNNlRGzsvxw+agj8CIEazqWGOQp2dTYgQhtyVXV9wpO6WyXRQUzLV/JRNumT2w==}
|
||||
dev: false
|
||||
|
||||
/@stablelib/int@2.0.1:
|
||||
resolution: {integrity: sha512-Ht63fQp3wz/F8U4AlXEPb7hfJOIILs8Lq55jgtD7KueWtyjhVuzcsGLSTAWtZs3XJDZYdF1WcSKn+kBtbzupww==}
|
||||
dev: false
|
||||
@@ -5757,6 +5797,14 @@ packages:
|
||||
'@stablelib/wipe': 2.0.1
|
||||
dev: false
|
||||
|
||||
/@stablelib/sha3@1.0.1:
|
||||
resolution: {integrity: sha512-82OHZcxWsJAS34L64VItIbqZdcdYgBJmeToYaou9lUA+iMjajdfOVZDDrditfV8C8yXUDrlS3BuMRWmKf9NQhQ==}
|
||||
dependencies:
|
||||
'@stablelib/binary': 1.0.1
|
||||
'@stablelib/hash': 1.0.1
|
||||
'@stablelib/wipe': 1.0.1
|
||||
dev: false
|
||||
|
||||
/@stablelib/sha512@2.0.1:
|
||||
resolution: {integrity: sha512-DUNe5cbnoH3sSIN+MG04RvTCLXtkbyy/SnQxiNO+GgF/KSXkkUSlF6mUVvCUdZBZ2X3NgogR+tAvaRSn8wxnLw==}
|
||||
dependencies:
|
||||
@@ -5765,6 +5813,10 @@ packages:
|
||||
'@stablelib/wipe': 2.0.1
|
||||
dev: false
|
||||
|
||||
/@stablelib/wipe@1.0.1:
|
||||
resolution: {integrity: sha512-WfqfX/eXGiAd3RJe4VU2snh/ZPwtSjLG4ynQ/vYzvghTh7dHFcI1wl+nrkWG6lGhukOxOsUHfv8dUXr58D0ayg==}
|
||||
dev: false
|
||||
|
||||
/@stablelib/wipe@2.0.1:
|
||||
resolution: {integrity: sha512-1eU2K9EgOcV4qc9jcP6G72xxZxEm5PfeI5H55l08W95b4oRJaqhmlWRc4xZAm6IVSKhVNxMi66V67hCzzuMTAg==}
|
||||
dev: false
|
||||
@@ -6968,7 +7020,7 @@ packages:
|
||||
dependencies:
|
||||
'@unhead/dom': 0.5.1
|
||||
'@unhead/schema': 0.5.1
|
||||
'@vueuse/shared': 13.2.0(vue@3.3.4)
|
||||
'@vueuse/shared': 13.3.0(vue@3.3.4)
|
||||
unhead: 0.5.1
|
||||
vue: 3.3.4
|
||||
dev: false
|
||||
@@ -7640,8 +7692,8 @@ packages:
|
||||
- vue
|
||||
dev: false
|
||||
|
||||
/@vueuse/shared@13.2.0(vue@3.3.4):
|
||||
resolution: {integrity: sha512-vx9ZPDF5HcU9up3Jgt3G62dMUfZEdk6tLyBAHYAG4F4n73vpaA7J5hdncDI/lS9Vm7GA/FPlbOmh9TrDZROTpg==}
|
||||
/@vueuse/shared@13.3.0(vue@3.3.4):
|
||||
resolution: {integrity: sha512-L1QKsF0Eg9tiZSFXTgodYnu0Rsa2P0En2LuLrIs/jgrkyiDuJSsPZK+tx+wU0mMsYHUYEjNsuE41uqqkuR8VhA==}
|
||||
peerDependencies:
|
||||
vue: ^3.5.0
|
||||
dependencies:
|
||||
@@ -7953,6 +8005,10 @@ packages:
|
||||
get-intrinsic: 1.3.0
|
||||
is-array-buffer: 3.0.5
|
||||
|
||||
/asmcrypto.js@2.3.2:
|
||||
resolution: {integrity: sha512-3FgFARf7RupsZETQ1nHnhLUUvpcttcCq1iZCaVAbJZbCZ5VNRrNyvpDyHTOb0KC3llFcsyOT/a99NZcCbeiEsA==}
|
||||
dev: false
|
||||
|
||||
/asn1.js@4.10.1:
|
||||
resolution: {integrity: sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==}
|
||||
dependencies:
|
||||
@@ -7967,6 +8023,15 @@ packages:
|
||||
safer-buffer: 2.1.2
|
||||
dev: false
|
||||
|
||||
/asn1js@3.0.6:
|
||||
resolution: {integrity: sha512-UOCGPYbl0tv8+006qks/dTgV9ajs97X2p0FAbyS2iyCRrmLSRolDaHdp+v/CLgnzHc3fVB+CwYiUmei7ndFcgA==}
|
||||
engines: {node: '>=12.0.0'}
|
||||
dependencies:
|
||||
pvtsutils: 1.3.6
|
||||
pvutils: 1.1.3
|
||||
tslib: 2.8.1
|
||||
dev: false
|
||||
|
||||
/assert-plus@1.0.0:
|
||||
resolution: {integrity: sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==}
|
||||
engines: {node: '>=0.8'}
|
||||
@@ -7975,10 +8040,10 @@ packages:
|
||||
/assert@2.1.0:
|
||||
resolution: {integrity: sha512-eLHpSK/Y4nhMJ07gDaAzoX/XAKS8PSaojml3M0DM4JpV1LAi5JOJ/p6H/XWrl8L+DzVEvVCW1z3vWAaB9oTsQw==}
|
||||
dependencies:
|
||||
call-bind: 1.0.5
|
||||
call-bind: 1.0.8
|
||||
is-nan: 1.3.2
|
||||
object-is: 1.1.6
|
||||
object.assign: 4.1.4
|
||||
object.assign: 4.1.7
|
||||
util: 0.12.5
|
||||
dev: true
|
||||
|
||||
@@ -8031,10 +8096,6 @@ packages:
|
||||
engines: {node: '>= 4.0.0'}
|
||||
dev: true
|
||||
|
||||
/available-typed-arrays@1.0.5:
|
||||
resolution: {integrity: sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==}
|
||||
engines: {node: '>= 0.4'}
|
||||
|
||||
/available-typed-arrays@1.0.7:
|
||||
resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==}
|
||||
engines: {node: '>= 0.4'}
|
||||
@@ -8166,7 +8227,6 @@ packages:
|
||||
|
||||
/bn.js@4.12.1:
|
||||
resolution: {integrity: sha512-k8TVBiPkPJT9uHLdOKfFpqcfprwBFOAAXXozRubr7R7PfIuKvQlzcI4M0pALeqXN09vdaMbUdUj+pass+uULAg==}
|
||||
dev: true
|
||||
|
||||
/bn.js@5.2.1:
|
||||
resolution: {integrity: sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==}
|
||||
@@ -8194,7 +8254,6 @@ packages:
|
||||
|
||||
/brorand@1.1.0:
|
||||
resolution: {integrity: sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==}
|
||||
dev: true
|
||||
|
||||
/browser-or-node@3.0.0:
|
||||
resolution: {integrity: sha512-iczIdVJzGEYhP5DqQxYM9Hh7Ztpqqi+CXZpSmX8ALFs9ecXkQIeqRyM6TfxEfMVpwhl3dSuDvxdzzo9sUOIVBQ==}
|
||||
@@ -8362,13 +8421,6 @@ packages:
|
||||
moment-timezone: 0.5.47
|
||||
dev: false
|
||||
|
||||
/call-bind-apply-helpers@1.0.1:
|
||||
resolution: {integrity: sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==}
|
||||
engines: {node: '>= 0.4'}
|
||||
dependencies:
|
||||
es-errors: 1.3.0
|
||||
function-bind: 1.1.2
|
||||
|
||||
/call-bind-apply-helpers@1.0.2:
|
||||
resolution: {integrity: sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==}
|
||||
engines: {node: '>= 0.4'}
|
||||
@@ -8376,13 +8428,6 @@ packages:
|
||||
es-errors: 1.3.0
|
||||
function-bind: 1.1.2
|
||||
|
||||
/call-bind@1.0.5:
|
||||
resolution: {integrity: sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ==}
|
||||
dependencies:
|
||||
function-bind: 1.1.2
|
||||
get-intrinsic: 1.2.2
|
||||
set-function-length: 1.1.1
|
||||
|
||||
/call-bind@1.0.8:
|
||||
resolution: {integrity: sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==}
|
||||
engines: {node: '>= 0.4'}
|
||||
@@ -8392,13 +8437,6 @@ packages:
|
||||
get-intrinsic: 1.3.0
|
||||
set-function-length: 1.2.2
|
||||
|
||||
/call-bound@1.0.3:
|
||||
resolution: {integrity: sha512-YTd+6wGlNlPxSuri7Y6X8tY2dmm12UMH66RpKMhiX6rsk5wXXnYgbUcOt8kiS31/AjfoTOvCsE+w8nZQLQnzHA==}
|
||||
engines: {node: '>= 0.4'}
|
||||
dependencies:
|
||||
call-bind-apply-helpers: 1.0.1
|
||||
get-intrinsic: 1.2.7
|
||||
|
||||
/call-bound@1.0.4:
|
||||
resolution: {integrity: sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==}
|
||||
engines: {node: '>= 0.4'}
|
||||
@@ -8950,6 +8988,11 @@ packages:
|
||||
requiresBuild: true
|
||||
dev: false
|
||||
|
||||
/core-js@3.42.0:
|
||||
resolution: {integrity: sha512-Sz4PP4ZA+Rq4II21qkNqOEDTDrCvcANId3xpIgB34NDkWc3UduWj2dqEtN9yZIq8Dk3HyPI33x9sqqU5C8sr0g==}
|
||||
requiresBuild: true
|
||||
dev: false
|
||||
|
||||
/core-util-is@1.0.3:
|
||||
resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==}
|
||||
|
||||
@@ -9782,14 +9825,6 @@ packages:
|
||||
clone: 1.0.4
|
||||
dev: true
|
||||
|
||||
/define-data-property@1.1.1:
|
||||
resolution: {integrity: sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ==}
|
||||
engines: {node: '>= 0.4'}
|
||||
dependencies:
|
||||
get-intrinsic: 1.3.0
|
||||
gopd: 1.2.0
|
||||
has-property-descriptors: 1.0.2
|
||||
|
||||
/define-data-property@1.1.4:
|
||||
resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==}
|
||||
engines: {node: '>= 0.4'}
|
||||
@@ -9807,8 +9842,8 @@ packages:
|
||||
resolution: {integrity: sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==}
|
||||
engines: {node: '>= 0.4'}
|
||||
dependencies:
|
||||
define-data-property: 1.1.1
|
||||
has-property-descriptors: 1.0.1
|
||||
define-data-property: 1.1.4
|
||||
has-property-descriptors: 1.0.2
|
||||
object-keys: 1.1.1
|
||||
|
||||
/defined@1.0.1:
|
||||
@@ -9845,7 +9880,6 @@ packages:
|
||||
dependencies:
|
||||
inherits: 2.0.4
|
||||
minimalistic-assert: 1.0.1
|
||||
dev: true
|
||||
|
||||
/destr@2.0.3:
|
||||
resolution: {integrity: sha512-2N3BOUU4gYMpTP24s5rF5iP7BDr7uNTCs4ozw3kf/eKfvWSIu93GEBi5m427YoyJoeOzQ5smuu4nNAPGb8idSQ==}
|
||||
@@ -10191,18 +10225,18 @@ packages:
|
||||
dependencies:
|
||||
array-buffer-byte-length: 1.0.0
|
||||
arraybuffer.prototype.slice: 1.0.2
|
||||
available-typed-arrays: 1.0.5
|
||||
available-typed-arrays: 1.0.7
|
||||
call-bind: 1.0.8
|
||||
es-set-tostringtag: 2.0.2
|
||||
es-to-primitive: 1.2.1
|
||||
function.prototype.name: 1.1.6
|
||||
get-intrinsic: 1.2.2
|
||||
get-intrinsic: 1.3.0
|
||||
get-symbol-description: 1.0.0
|
||||
globalthis: 1.0.3
|
||||
gopd: 1.0.1
|
||||
has-property-descriptors: 1.0.1
|
||||
gopd: 1.2.0
|
||||
has-property-descriptors: 1.0.2
|
||||
has-proto: 1.0.1
|
||||
has-symbols: 1.0.3
|
||||
has-symbols: 1.1.0
|
||||
hasown: 2.0.2
|
||||
internal-slot: 1.0.6
|
||||
is-array-buffer: 3.0.2
|
||||
@@ -10211,14 +10245,14 @@ packages:
|
||||
is-regex: 1.2.1
|
||||
is-shared-array-buffer: 1.0.2
|
||||
is-string: 1.0.7
|
||||
is-typed-array: 1.1.12
|
||||
is-typed-array: 1.1.15
|
||||
is-weakref: 1.0.2
|
||||
object-inspect: 1.13.3
|
||||
object-keys: 1.1.1
|
||||
object.assign: 4.1.4
|
||||
object.assign: 4.1.7
|
||||
regexp.prototype.flags: 1.5.1
|
||||
safe-array-concat: 1.0.1
|
||||
safe-regex-test: 1.0.0
|
||||
safe-regex-test: 1.1.0
|
||||
string.prototype.trim: 1.2.10
|
||||
string.prototype.trimend: 1.0.7
|
||||
string.prototype.trimstart: 1.0.7
|
||||
@@ -10227,7 +10261,7 @@ packages:
|
||||
typed-array-byte-offset: 1.0.0
|
||||
typed-array-length: 1.0.4
|
||||
unbox-primitive: 1.0.2
|
||||
which-typed-array: 1.1.13
|
||||
which-typed-array: 1.1.18
|
||||
dev: false
|
||||
|
||||
/es-abstract@1.23.9:
|
||||
@@ -10238,7 +10272,7 @@ packages:
|
||||
arraybuffer.prototype.slice: 1.0.4
|
||||
available-typed-arrays: 1.0.7
|
||||
call-bind: 1.0.8
|
||||
call-bound: 1.0.3
|
||||
call-bound: 1.0.4
|
||||
data-view-buffer: 1.0.2
|
||||
data-view-byte-length: 1.0.2
|
||||
data-view-byte-offset: 1.0.1
|
||||
@@ -10248,7 +10282,7 @@ packages:
|
||||
es-set-tostringtag: 2.1.0
|
||||
es-to-primitive: 1.3.0
|
||||
function.prototype.name: 1.1.8
|
||||
get-intrinsic: 1.2.7
|
||||
get-intrinsic: 1.3.0
|
||||
get-proto: 1.0.1
|
||||
get-symbol-description: 1.1.0
|
||||
globalthis: 1.0.4
|
||||
@@ -11203,6 +11237,10 @@ packages:
|
||||
is-what: 5.0.2
|
||||
dev: false
|
||||
|
||||
/flexsearch@0.8.167:
|
||||
resolution: {integrity: sha512-iCBbY9npWhNlTCiHha2pwGqtbhpSEHx8+m5FJab+DLr/IKMneLNDgWbu2+IOvsAHo/Euo2Fu/5awrAEhN4q8Jw==}
|
||||
dev: false
|
||||
|
||||
/follow-redirects@1.15.9:
|
||||
resolution: {integrity: sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==}
|
||||
engines: {node: '>=4.0'}
|
||||
@@ -11412,19 +11450,11 @@ packages:
|
||||
resolution: {integrity: sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==}
|
||||
dev: true
|
||||
|
||||
/get-intrinsic@1.2.2:
|
||||
resolution: {integrity: sha512-0gSo4ml/0j98Y3lngkFEot/zhiCeWsbYIlZ+uZOVgzLyLaUw7wxUL+nCTP0XJvJg1AXulJRI3UJi8GsbDuxdGA==}
|
||||
dependencies:
|
||||
function-bind: 1.1.2
|
||||
has-proto: 1.0.1
|
||||
has-symbols: 1.1.0
|
||||
hasown: 2.0.2
|
||||
|
||||
/get-intrinsic@1.2.7:
|
||||
resolution: {integrity: sha512-VW6Pxhsrk0KAOqs3WEd0klDiF/+V7gQOpAvY1jVU/LHmaD/kQO4523aiJuikX/QAKYiW6x8Jh+RJej1almdtCA==}
|
||||
engines: {node: '>= 0.4'}
|
||||
dependencies:
|
||||
call-bind-apply-helpers: 1.0.1
|
||||
call-bind-apply-helpers: 1.0.2
|
||||
es-define-property: 1.0.1
|
||||
es-errors: 1.3.0
|
||||
es-object-atoms: 1.1.1
|
||||
@@ -11434,6 +11464,7 @@ packages:
|
||||
has-symbols: 1.1.0
|
||||
hasown: 2.0.2
|
||||
math-intrinsics: 1.1.0
|
||||
dev: false
|
||||
|
||||
/get-intrinsic@1.3.0:
|
||||
resolution: {integrity: sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==}
|
||||
@@ -11696,7 +11727,8 @@ packages:
|
||||
/gopd@1.0.1:
|
||||
resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==}
|
||||
dependencies:
|
||||
get-intrinsic: 1.2.2
|
||||
get-intrinsic: 1.3.0
|
||||
dev: false
|
||||
|
||||
/gopd@1.2.0:
|
||||
resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==}
|
||||
@@ -11794,11 +11826,6 @@ packages:
|
||||
resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
/has-property-descriptors@1.0.1:
|
||||
resolution: {integrity: sha512-VsX8eaIewvas0xnvinAe9bw4WfIeODpGYikiWYLH+dma0Jw6KHYqWiWfhQlgOVK8D6PvjubK5Uc4P0iIhIcNVg==}
|
||||
dependencies:
|
||||
get-intrinsic: 1.3.0
|
||||
|
||||
/has-property-descriptors@1.0.2:
|
||||
resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==}
|
||||
dependencies:
|
||||
@@ -11807,6 +11834,7 @@ packages:
|
||||
/has-proto@1.0.1:
|
||||
resolution: {integrity: sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==}
|
||||
engines: {node: '>= 0.4'}
|
||||
dev: false
|
||||
|
||||
/has-proto@1.2.0:
|
||||
resolution: {integrity: sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ==}
|
||||
@@ -11814,20 +11842,10 @@ packages:
|
||||
dependencies:
|
||||
dunder-proto: 1.0.1
|
||||
|
||||
/has-symbols@1.0.3:
|
||||
resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==}
|
||||
engines: {node: '>= 0.4'}
|
||||
|
||||
/has-symbols@1.1.0:
|
||||
resolution: {integrity: sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==}
|
||||
engines: {node: '>= 0.4'}
|
||||
|
||||
/has-tostringtag@1.0.0:
|
||||
resolution: {integrity: sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==}
|
||||
engines: {node: '>= 0.4'}
|
||||
dependencies:
|
||||
has-symbols: 1.1.0
|
||||
|
||||
/has-tostringtag@1.0.2:
|
||||
resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==}
|
||||
engines: {node: '>= 0.4'}
|
||||
@@ -11932,7 +11950,6 @@ packages:
|
||||
hash.js: 1.1.7
|
||||
minimalistic-assert: 1.0.1
|
||||
minimalistic-crypto-utils: 1.0.1
|
||||
dev: true
|
||||
|
||||
/homedir-polyfill@1.0.3:
|
||||
resolution: {integrity: sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==}
|
||||
@@ -12212,7 +12229,7 @@ packages:
|
||||
dependencies:
|
||||
get-intrinsic: 1.3.0
|
||||
hasown: 2.0.2
|
||||
side-channel: 1.0.4
|
||||
side-channel: 1.1.0
|
||||
dev: false
|
||||
|
||||
/internal-slot@1.1.0:
|
||||
@@ -12306,7 +12323,7 @@ packages:
|
||||
resolution: {integrity: sha512-7bVbi0huj/wrIAOzb8U1aszg9kdi3KN/CyU19CTI7tAoZYEZoL9yCDXpbXN+uPsuWnP02cyug1gleqq+TU+YCA==}
|
||||
engines: {node: '>= 0.4'}
|
||||
dependencies:
|
||||
call-bound: 1.0.3
|
||||
call-bound: 1.0.4
|
||||
has-tostringtag: 1.0.2
|
||||
|
||||
/is-array-buffer@3.0.2:
|
||||
@@ -12314,7 +12331,7 @@ packages:
|
||||
dependencies:
|
||||
call-bind: 1.0.8
|
||||
get-intrinsic: 1.3.0
|
||||
is-typed-array: 1.1.12
|
||||
is-typed-array: 1.1.15
|
||||
dev: false
|
||||
|
||||
/is-array-buffer@3.0.5:
|
||||
@@ -12468,7 +12485,7 @@ packages:
|
||||
resolution: {integrity: sha512-nPUB5km40q9e8UfN/Zc24eLlzdSf9OfKByBw9CIdw4H1giPMeA0OIJvbchsCu4npfI2QcMVBsGEBHKZ7wLTWmQ==}
|
||||
engines: {node: '>= 0.4'}
|
||||
dependencies:
|
||||
call-bound: 1.0.3
|
||||
call-bound: 1.0.4
|
||||
get-proto: 1.0.1
|
||||
has-tostringtag: 1.0.2
|
||||
safe-regex-test: 1.1.0
|
||||
@@ -12643,7 +12660,7 @@ packages:
|
||||
resolution: {integrity: sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==}
|
||||
engines: {node: '>= 0.4'}
|
||||
dependencies:
|
||||
has-tostringtag: 1.0.0
|
||||
has-tostringtag: 1.0.2
|
||||
dev: false
|
||||
|
||||
/is-string@1.1.1:
|
||||
@@ -12667,12 +12684,6 @@ packages:
|
||||
has-symbols: 1.1.0
|
||||
safe-regex-test: 1.1.0
|
||||
|
||||
/is-typed-array@1.1.12:
|
||||
resolution: {integrity: sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==}
|
||||
engines: {node: '>= 0.4'}
|
||||
dependencies:
|
||||
which-typed-array: 1.1.13
|
||||
|
||||
/is-typed-array@1.1.15:
|
||||
resolution: {integrity: sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==}
|
||||
engines: {node: '>= 0.4'}
|
||||
@@ -13929,7 +13940,6 @@ packages:
|
||||
|
||||
/minimalistic-crypto-utils@1.0.1:
|
||||
resolution: {integrity: sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==}
|
||||
dev: true
|
||||
|
||||
/minimatch@10.0.1:
|
||||
resolution: {integrity: sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==}
|
||||
@@ -14398,15 +14408,6 @@ packages:
|
||||
resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==}
|
||||
engines: {node: '>= 0.4'}
|
||||
|
||||
/object.assign@4.1.4:
|
||||
resolution: {integrity: sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==}
|
||||
engines: {node: '>= 0.4'}
|
||||
dependencies:
|
||||
call-bind: 1.0.8
|
||||
define-properties: 1.2.1
|
||||
has-symbols: 1.0.3
|
||||
object-keys: 1.1.1
|
||||
|
||||
/object.assign@4.1.7:
|
||||
resolution: {integrity: sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==}
|
||||
engines: {node: '>= 0.4'}
|
||||
@@ -14462,7 +14463,7 @@ packages:
|
||||
engines: {node: '>= 0.4'}
|
||||
dependencies:
|
||||
call-bind: 1.0.8
|
||||
call-bound: 1.0.3
|
||||
call-bound: 1.0.4
|
||||
define-properties: 1.2.1
|
||||
es-object-atoms: 1.1.1
|
||||
dev: false
|
||||
@@ -14544,8 +14545,8 @@ packages:
|
||||
hasBin: true
|
||||
dev: false
|
||||
|
||||
/openpgp@6.1.0:
|
||||
resolution: {integrity: sha512-fRTeitP+hoGJD3kbdUlAI++wE6MvfvXw1rBqHwmBMxIpLjowatJ2zb5ThkORpIkSz5F12wO+xCYRSTbT7M4qKA==}
|
||||
/openpgp@6.1.1:
|
||||
resolution: {integrity: sha512-V/DXZ5AGCz3q4X8psUSc3q4SxnH/bfICaTSpNcla7wvBFhrxa9/ajm31rtMwZ1qj7Fu2oMpfX6ZcxKmTBlb6Yg==}
|
||||
engines: {node: '>= 18.0.0'}
|
||||
dev: false
|
||||
|
||||
@@ -14975,7 +14976,6 @@ packages:
|
||||
/picomatch@4.0.2:
|
||||
resolution: {integrity: sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==}
|
||||
engines: {node: '>=12'}
|
||||
dev: true
|
||||
|
||||
/pify@4.0.1:
|
||||
resolution: {integrity: sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==}
|
||||
@@ -15475,6 +15475,17 @@ packages:
|
||||
resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==}
|
||||
engines: {node: '>=6'}
|
||||
|
||||
/pvtsutils@1.3.6:
|
||||
resolution: {integrity: sha512-PLgQXQ6H2FWCaeRak8vvk1GW462lMxB5s3Jm673N82zI4vqtVUPuZdffdZbPDFRoU8kAhItWFtPCWiPpp4/EDg==}
|
||||
dependencies:
|
||||
tslib: 2.8.1
|
||||
dev: false
|
||||
|
||||
/pvutils@1.1.3:
|
||||
resolution: {integrity: sha512-pMpnA0qRdFp32b1sJl1wOJNxZLQ2cbQx+k6tjNtZ8CpvVhNqEPRgivZ2WOUev2YMajecdH7ctUPDvEe87nariQ==}
|
||||
engines: {node: '>=6.0.0'}
|
||||
dev: false
|
||||
|
||||
/pyodide@0.24.1:
|
||||
resolution: {integrity: sha512-fkNolNwiv41E2KKCP2bgW+dwr95B+0KSC/WG9WCmlWM9MNFbRVX0rF9i4OikRM78bGeVUvLdVJw8jY17wxKoRQ==}
|
||||
dependencies:
|
||||
@@ -15589,6 +15600,11 @@ packages:
|
||||
ret: 0.2.2
|
||||
dev: false
|
||||
|
||||
/random-int@3.0.0:
|
||||
resolution: {integrity: sha512-QvewnOwigesW2WFyTHiQzR6XUUcSQO/BqmfgRz5N5GpGrKQnTf7ebMz8UtuwaET8IfO1n0wLx8/fHsI8E0Jpow==}
|
||||
engines: {node: '>=12'}
|
||||
dev: false
|
||||
|
||||
/random-js@2.1.0:
|
||||
resolution: {integrity: sha512-CRUyWmnzmZBA7RZSVGq0xMqmgCyPPxbiKNLFA5ud7KenojVX2s7Gv+V7eB52beKTPGxWRnVZ7D/tCIgYJJ8vNQ==}
|
||||
dev: false
|
||||
@@ -16012,8 +16028,8 @@ packages:
|
||||
engines: {node: '>=0.4'}
|
||||
dependencies:
|
||||
call-bind: 1.0.8
|
||||
call-bound: 1.0.3
|
||||
get-intrinsic: 1.2.7
|
||||
call-bound: 1.0.4
|
||||
get-intrinsic: 1.3.0
|
||||
has-symbols: 1.1.0
|
||||
isarray: 2.0.5
|
||||
|
||||
@@ -16034,14 +16050,6 @@ packages:
|
||||
es-errors: 1.3.0
|
||||
isarray: 2.0.5
|
||||
|
||||
/safe-regex-test@1.0.0:
|
||||
resolution: {integrity: sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==}
|
||||
dependencies:
|
||||
call-bind: 1.0.8
|
||||
get-intrinsic: 1.3.0
|
||||
is-regex: 1.2.1
|
||||
dev: false
|
||||
|
||||
/safe-regex-test@1.1.0:
|
||||
resolution: {integrity: sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==}
|
||||
engines: {node: '>= 0.4'}
|
||||
@@ -16175,15 +16183,6 @@ packages:
|
||||
resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==}
|
||||
dev: false
|
||||
|
||||
/set-function-length@1.1.1:
|
||||
resolution: {integrity: sha512-VoaqjbBJKiWtg4yRcKBQ7g7wnGnLV3M8oLvVWwOk2PdYY6PEFegR1vezXR0tw6fZGF9csVakIRjrJiy2veSBFQ==}
|
||||
engines: {node: '>= 0.4'}
|
||||
dependencies:
|
||||
define-data-property: 1.1.4
|
||||
get-intrinsic: 1.3.0
|
||||
gopd: 1.2.0
|
||||
has-property-descriptors: 1.0.2
|
||||
|
||||
/set-function-length@1.2.2:
|
||||
resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==}
|
||||
engines: {node: '>= 0.4'}
|
||||
@@ -16221,7 +16220,6 @@ packages:
|
||||
dependencies:
|
||||
inherits: 2.0.4
|
||||
safe-buffer: 5.2.1
|
||||
dev: true
|
||||
|
||||
/sharp@0.33.5:
|
||||
resolution: {integrity: sha512-haPVm1EkS9pgvHrQ/F3Xy+hgcuMV0Wm9vfIBSiwZ05k+xgb0PkBQpGsAA/oWdDobNaZTH5ppvHtzCFbnSEwHVw==}
|
||||
@@ -16300,14 +16298,6 @@ packages:
|
||||
object-inspect: 1.13.3
|
||||
side-channel-map: 1.0.1
|
||||
|
||||
/side-channel@1.0.4:
|
||||
resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==}
|
||||
dependencies:
|
||||
call-bind: 1.0.8
|
||||
get-intrinsic: 1.3.0
|
||||
object-inspect: 1.13.3
|
||||
dev: false
|
||||
|
||||
/side-channel@1.1.0:
|
||||
resolution: {integrity: sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==}
|
||||
engines: {node: '>= 0.4'}
|
||||
@@ -16689,7 +16679,7 @@ packages:
|
||||
resolution: {integrity: sha512-699Ibssmj/awVzvdNk4g83/Iu8U9vDohzmA/ly2BrQWGhamuY4Tlvs5XKmKliDt3ky6SKbE1bzPhASKCFlx9Sg==}
|
||||
engines: {node: '>= 0.4'}
|
||||
dependencies:
|
||||
call-bind: 1.0.5
|
||||
call-bind: 1.0.8
|
||||
define-properties: 1.2.1
|
||||
string.prototype.trimstart: 1.0.7
|
||||
dev: false
|
||||
@@ -16698,7 +16688,7 @@ packages:
|
||||
resolution: {integrity: sha512-hoOq56oRFnnfDuXNy2lGHiwT77MehHv9d0zGfRZ8QdC+4zjrkFB9vd5i/zYTd/ymFBd4YxtbdgHt3U6ksGeuBw==}
|
||||
engines: {node: '>= 0.4'}
|
||||
dependencies:
|
||||
call-bind: 1.0.5
|
||||
call-bind: 1.0.8
|
||||
define-properties: 1.2.1
|
||||
string.prototype.trimend: 1.0.7
|
||||
dev: false
|
||||
@@ -17397,7 +17387,7 @@ packages:
|
||||
dependencies:
|
||||
call-bind: 1.0.8
|
||||
get-intrinsic: 1.3.0
|
||||
is-typed-array: 1.1.12
|
||||
is-typed-array: 1.1.15
|
||||
dev: false
|
||||
|
||||
/typed-array-buffer@1.0.3:
|
||||
@@ -17415,7 +17405,7 @@ packages:
|
||||
call-bind: 1.0.8
|
||||
for-each: 0.3.3
|
||||
has-proto: 1.0.1
|
||||
is-typed-array: 1.1.12
|
||||
is-typed-array: 1.1.15
|
||||
dev: false
|
||||
|
||||
/typed-array-byte-length@1.0.3:
|
||||
@@ -17432,11 +17422,11 @@ packages:
|
||||
resolution: {integrity: sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg==}
|
||||
engines: {node: '>= 0.4'}
|
||||
dependencies:
|
||||
available-typed-arrays: 1.0.5
|
||||
available-typed-arrays: 1.0.7
|
||||
call-bind: 1.0.8
|
||||
for-each: 0.3.3
|
||||
has-proto: 1.0.1
|
||||
is-typed-array: 1.1.12
|
||||
is-typed-array: 1.1.15
|
||||
dev: false
|
||||
|
||||
/typed-array-byte-offset@1.0.4:
|
||||
@@ -17456,7 +17446,7 @@ packages:
|
||||
dependencies:
|
||||
call-bind: 1.0.8
|
||||
for-each: 0.3.3
|
||||
is-typed-array: 1.1.12
|
||||
is-typed-array: 1.1.15
|
||||
dev: false
|
||||
|
||||
/typed-array-length@1.0.7:
|
||||
@@ -17648,11 +17638,11 @@ packages:
|
||||
/unimport@3.0.8(rollup@2.79.2):
|
||||
resolution: {integrity: sha512-AOt6xj3QMwqcTZRPB+NhFkyVEjCKnpTVoPm5x6424zz2NYYtCfym2bpJofzPHIJKPNIh5ko2/t2q46ZIMgdmbw==}
|
||||
dependencies:
|
||||
'@rollup/pluginutils': 5.0.2(rollup@2.79.2)
|
||||
'@rollup/pluginutils': 5.1.4(rollup@2.79.2)
|
||||
escape-string-regexp: 5.0.0
|
||||
fast-glob: 3.3.1
|
||||
local-pkg: 0.4.3
|
||||
magic-string: 0.30.2
|
||||
magic-string: 0.30.17
|
||||
mlly: 1.4.0
|
||||
pathe: 1.1.1
|
||||
pkg-types: 1.0.3
|
||||
@@ -17729,6 +17719,15 @@ packages:
|
||||
engines: {node: '>= 10.0.0'}
|
||||
dev: true
|
||||
|
||||
/unixcrypt-browser@2.0.4:
|
||||
resolution: {integrity: sha512-c1Onql8IVzUjQVW0jra39VEa4f8iIr1XAlZ2oOa0U094gM77rcbDbkcWMQux+j2Qqr7wFXByIcvL6CoL0DkkmQ==}
|
||||
engines: {node: '>=18.0.0'}
|
||||
dependencies:
|
||||
buffer: 6.0.3
|
||||
random-int: 3.0.0
|
||||
sha.js: 2.4.11
|
||||
dev: false
|
||||
|
||||
/unocss-preset-scrollbar@0.2.1(unocss@0.57.7):
|
||||
resolution: {integrity: sha512-7ubHdOaUwr7xBn1glPpICNNsM2SZGjvWK5uRPNiQYsrZ9YFjsCGHk9x5S2R8pTkuMDQeiaSa/UQbYhjC8Fra5g==}
|
||||
peerDependencies:
|
||||
@@ -17777,6 +17776,15 @@ packages:
|
||||
- supports-color
|
||||
dev: true
|
||||
|
||||
/unpdf@1.0.5:
|
||||
resolution: {integrity: sha512-f06b1bT0Cu96UpQmU4wQbir4nJrZ8kMU9dC3zUg7Ac+Sy5iKuh/aHq58rlyk6ggue0xjhed2Q5uu0AJVSl7qHA==}
|
||||
peerDependencies:
|
||||
'@napi-rs/canvas': ^0.1.69
|
||||
peerDependenciesMeta:
|
||||
'@napi-rs/canvas':
|
||||
optional: true
|
||||
dev: false
|
||||
|
||||
/unplugin-auto-import@0.16.4(@vueuse/core@10.11.1)(rollup@2.79.2):
|
||||
resolution: {integrity: sha512-xdgBa9NAS3JG8HjkAZHSbGSMlrjKpaWKXGUzaF6RzEtr980RCl1t0Zsu0skUInNYrEQfqaHc7aGWPv41DLTK/w==}
|
||||
engines: {node: '>=14'}
|
||||
@@ -17992,8 +18000,8 @@ packages:
|
||||
inherits: 2.0.4
|
||||
is-arguments: 1.2.0
|
||||
is-generator-function: 1.1.0
|
||||
is-typed-array: 1.1.12
|
||||
which-typed-array: 1.1.13
|
||||
is-typed-array: 1.1.15
|
||||
which-typed-array: 1.1.18
|
||||
dev: true
|
||||
|
||||
/uuid-random@1.3.2:
|
||||
@@ -18168,10 +18176,10 @@ packages:
|
||||
- terser
|
||||
dev: true
|
||||
|
||||
/vite-plugin-node-polyfills@0.22.0(rollup@2.79.2)(vite@4.4.9):
|
||||
resolution: {integrity: sha512-F+G3LjiGbG8QpbH9bZ//GSBr9i1InSTkaulfUHFa9jkLqVGORFBoqc2A/Yu5Mmh1kNAbiAeKeK+6aaQUf3x0JA==}
|
||||
/vite-plugin-node-polyfills@0.23.0(rollup@2.79.2)(vite@4.4.9):
|
||||
resolution: {integrity: sha512-4n+Ys+2bKHQohPBKigFlndwWQ5fFKwaGY6muNDMTb0fSQLyBzS+jjUNRZG9sKF0S/Go4ApG6LFnUGopjkILg3w==}
|
||||
peerDependencies:
|
||||
vite: ^2.0.0 || ^3.0.0 || ^4.0.0 || ^5.0.0
|
||||
vite: ^2.0.0 || ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0
|
||||
dependencies:
|
||||
'@rollup/plugin-inject': 5.0.5(rollup@2.79.2)
|
||||
node-stdlib-browser: 1.3.0
|
||||
@@ -18630,6 +18638,32 @@ packages:
|
||||
- supports-color
|
||||
dev: false
|
||||
|
||||
/webcrypto-core@1.8.1:
|
||||
resolution: {integrity: sha512-P+x1MvlNCXlKbLSOY4cYrdreqPG5hbzkmawbcXLKN/mf6DZW0SdNNkZ+sjwsqVkI4A4Ko2sPZmkZtCKY58w83A==}
|
||||
dependencies:
|
||||
'@peculiar/asn1-schema': 2.3.15
|
||||
'@peculiar/json-schema': 1.1.12
|
||||
asn1js: 3.0.6
|
||||
pvtsutils: 1.3.6
|
||||
tslib: 2.8.1
|
||||
dev: false
|
||||
|
||||
/webcrypto-liner-shim@1.4.8:
|
||||
resolution: {integrity: sha512-ZTHoyFySHpagRM79LODyRZPxZWp022jaECgVpEHZSX4Y0dcMKlQ0Che9R/EgTypAnds6li7qe8Corc1dNgvnxg==}
|
||||
dependencies:
|
||||
'@peculiar/asn1-schema': 2.3.15
|
||||
'@peculiar/json-schema': 1.1.12
|
||||
'@stablelib/sha3': 1.0.1
|
||||
asmcrypto.js: 2.3.2
|
||||
asn1js: 3.0.6
|
||||
core-js: 3.42.0
|
||||
des.js: 1.1.0
|
||||
elliptic: github.com/mahrud/elliptic/75637c76678e83c31682fd967c2fa9ff4761b3fc
|
||||
pvtsutils: 1.3.6
|
||||
tslib: 2.8.1
|
||||
webcrypto-core: 1.8.1
|
||||
dev: false
|
||||
|
||||
/webidl-conversions@3.0.1:
|
||||
resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==}
|
||||
dev: false
|
||||
@@ -18751,16 +18785,6 @@ packages:
|
||||
resolution: {integrity: sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q==}
|
||||
dev: false
|
||||
|
||||
/which-typed-array@1.1.13:
|
||||
resolution: {integrity: sha512-P5Nra0qjSncduVPEAr7xhoF5guty49ArDTwzJ/yNuPIbZppyRxFQsRCWrocxIY+CnMVG+qfbU2FmDKyvSGClow==}
|
||||
engines: {node: '>= 0.4'}
|
||||
dependencies:
|
||||
available-typed-arrays: 1.0.5
|
||||
call-bind: 1.0.8
|
||||
for-each: 0.3.3
|
||||
gopd: 1.0.1
|
||||
has-tostringtag: 1.0.0
|
||||
|
||||
/which-typed-array@1.1.18:
|
||||
resolution: {integrity: sha512-qEcY+KJYlWyLH9vNbsr6/5j59AXk5ni5aakf8ldzBvGde6Iz4sxZGkJyWSAueTG7QhOvNRYb1lDdFmL5Td0QKA==}
|
||||
engines: {node: '>= 0.4'}
|
||||
@@ -19288,3 +19312,17 @@ packages:
|
||||
engines: {node: '>=0.8'}
|
||||
hasBin: true
|
||||
dev: false
|
||||
|
||||
github.com/mahrud/elliptic/75637c76678e83c31682fd967c2fa9ff4761b3fc:
|
||||
resolution: {tarball: https://codeload.github.com/mahrud/elliptic/tar.gz/75637c76678e83c31682fd967c2fa9ff4761b3fc}
|
||||
name: elliptic
|
||||
version: 6.5.0
|
||||
dependencies:
|
||||
bn.js: 4.12.1
|
||||
brorand: 1.1.0
|
||||
hash.js: 1.1.7
|
||||
hmac-drbg: 1.0.1
|
||||
inherits: 2.0.4
|
||||
minimalistic-assert: 1.0.1
|
||||
minimalistic-crypto-utils: 1.0.1
|
||||
dev: false
|
||||
Binary file not shown.
@@ -0,0 +1,575 @@
|
||||
// Copyright 2018 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
"use strict";
|
||||
|
||||
(() => {
|
||||
const enosys = () => {
|
||||
const err = new Error("not implemented");
|
||||
err.code = "ENOSYS";
|
||||
return err;
|
||||
};
|
||||
|
||||
if (!globalThis.fs) {
|
||||
let outputBuf = "";
|
||||
globalThis.fs = {
|
||||
constants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1, O_DIRECTORY: -1 }, // unused
|
||||
writeSync(fd, buf) {
|
||||
outputBuf += decoder.decode(buf);
|
||||
const nl = outputBuf.lastIndexOf("\n");
|
||||
if (nl != -1) {
|
||||
console.log(outputBuf.substring(0, nl));
|
||||
outputBuf = outputBuf.substring(nl + 1);
|
||||
}
|
||||
return buf.length;
|
||||
},
|
||||
write(fd, buf, offset, length, position, callback) {
|
||||
if (offset !== 0 || length !== buf.length || position !== null) {
|
||||
callback(enosys());
|
||||
return;
|
||||
}
|
||||
const n = this.writeSync(fd, buf);
|
||||
callback(null, n);
|
||||
},
|
||||
chmod(path, mode, callback) { callback(enosys()); },
|
||||
chown(path, uid, gid, callback) { callback(enosys()); },
|
||||
close(fd, callback) { callback(enosys()); },
|
||||
fchmod(fd, mode, callback) { callback(enosys()); },
|
||||
fchown(fd, uid, gid, callback) { callback(enosys()); },
|
||||
fstat(fd, callback) { callback(enosys()); },
|
||||
fsync(fd, callback) { callback(null); },
|
||||
ftruncate(fd, length, callback) { callback(enosys()); },
|
||||
lchown(path, uid, gid, callback) { callback(enosys()); },
|
||||
link(path, link, callback) { callback(enosys()); },
|
||||
lstat(path, callback) { callback(enosys()); },
|
||||
mkdir(path, perm, callback) { callback(enosys()); },
|
||||
open(path, flags, mode, callback) { callback(enosys()); },
|
||||
read(fd, buffer, offset, length, position, callback) { callback(enosys()); },
|
||||
readdir(path, callback) { callback(enosys()); },
|
||||
readlink(path, callback) { callback(enosys()); },
|
||||
rename(from, to, callback) { callback(enosys()); },
|
||||
rmdir(path, callback) { callback(enosys()); },
|
||||
stat(path, callback) { callback(enosys()); },
|
||||
symlink(path, link, callback) { callback(enosys()); },
|
||||
truncate(path, length, callback) { callback(enosys()); },
|
||||
unlink(path, callback) { callback(enosys()); },
|
||||
utimes(path, atime, mtime, callback) { callback(enosys()); },
|
||||
};
|
||||
}
|
||||
|
||||
if (!globalThis.process) {
|
||||
globalThis.process = {
|
||||
getuid() { return -1; },
|
||||
getgid() { return -1; },
|
||||
geteuid() { return -1; },
|
||||
getegid() { return -1; },
|
||||
getgroups() { throw enosys(); },
|
||||
pid: -1,
|
||||
ppid: -1,
|
||||
umask() { throw enosys(); },
|
||||
cwd() { throw enosys(); },
|
||||
chdir() { throw enosys(); },
|
||||
}
|
||||
}
|
||||
|
||||
if (!globalThis.path) {
|
||||
globalThis.path = {
|
||||
resolve(...pathSegments) {
|
||||
return pathSegments.join("/");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!globalThis.crypto) {
|
||||
throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)");
|
||||
}
|
||||
|
||||
if (!globalThis.performance) {
|
||||
throw new Error("globalThis.performance is not available, polyfill required (performance.now only)");
|
||||
}
|
||||
|
||||
if (!globalThis.TextEncoder) {
|
||||
throw new Error("globalThis.TextEncoder is not available, polyfill required");
|
||||
}
|
||||
|
||||
if (!globalThis.TextDecoder) {
|
||||
throw new Error("globalThis.TextDecoder is not available, polyfill required");
|
||||
}
|
||||
|
||||
const encoder = new TextEncoder("utf-8");
|
||||
const decoder = new TextDecoder("utf-8");
|
||||
|
||||
globalThis.Go = class {
|
||||
constructor() {
|
||||
this.argv = ["js"];
|
||||
this.env = {};
|
||||
this.exit = (code) => {
|
||||
if (code !== 0) {
|
||||
console.warn("exit code:", code);
|
||||
}
|
||||
};
|
||||
this._exitPromise = new Promise((resolve) => {
|
||||
this._resolveExitPromise = resolve;
|
||||
});
|
||||
this._pendingEvent = null;
|
||||
this._scheduledTimeouts = new Map();
|
||||
this._nextCallbackTimeoutID = 1;
|
||||
|
||||
const setInt64 = (addr, v) => {
|
||||
this.mem.setUint32(addr + 0, v, true);
|
||||
this.mem.setUint32(addr + 4, Math.floor(v / 4294967296), true);
|
||||
}
|
||||
|
||||
const setInt32 = (addr, v) => {
|
||||
this.mem.setUint32(addr + 0, v, true);
|
||||
}
|
||||
|
||||
const getInt64 = (addr) => {
|
||||
const low = this.mem.getUint32(addr + 0, true);
|
||||
const high = this.mem.getInt32(addr + 4, true);
|
||||
return low + high * 4294967296;
|
||||
}
|
||||
|
||||
const loadValue = (addr) => {
|
||||
const f = this.mem.getFloat64(addr, true);
|
||||
if (f === 0) {
|
||||
return undefined;
|
||||
}
|
||||
if (!isNaN(f)) {
|
||||
return f;
|
||||
}
|
||||
|
||||
const id = this.mem.getUint32(addr, true);
|
||||
return this._values[id];
|
||||
}
|
||||
|
||||
const storeValue = (addr, v) => {
|
||||
const nanHead = 0x7FF80000;
|
||||
|
||||
if (typeof v === "number" && v !== 0) {
|
||||
if (isNaN(v)) {
|
||||
this.mem.setUint32(addr + 4, nanHead, true);
|
||||
this.mem.setUint32(addr, 0, true);
|
||||
return;
|
||||
}
|
||||
this.mem.setFloat64(addr, v, true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (v === undefined) {
|
||||
this.mem.setFloat64(addr, 0, true);
|
||||
return;
|
||||
}
|
||||
|
||||
let id = this._ids.get(v);
|
||||
if (id === undefined) {
|
||||
id = this._idPool.pop();
|
||||
if (id === undefined) {
|
||||
id = this._values.length;
|
||||
}
|
||||
this._values[id] = v;
|
||||
this._goRefCounts[id] = 0;
|
||||
this._ids.set(v, id);
|
||||
}
|
||||
this._goRefCounts[id]++;
|
||||
let typeFlag = 0;
|
||||
switch (typeof v) {
|
||||
case "object":
|
||||
if (v !== null) {
|
||||
typeFlag = 1;
|
||||
}
|
||||
break;
|
||||
case "string":
|
||||
typeFlag = 2;
|
||||
break;
|
||||
case "symbol":
|
||||
typeFlag = 3;
|
||||
break;
|
||||
case "function":
|
||||
typeFlag = 4;
|
||||
break;
|
||||
}
|
||||
this.mem.setUint32(addr + 4, nanHead | typeFlag, true);
|
||||
this.mem.setUint32(addr, id, true);
|
||||
}
|
||||
|
||||
const loadSlice = (addr) => {
|
||||
const array = getInt64(addr + 0);
|
||||
const len = getInt64(addr + 8);
|
||||
return new Uint8Array(this._inst.exports.mem.buffer, array, len);
|
||||
}
|
||||
|
||||
const loadSliceOfValues = (addr) => {
|
||||
const array = getInt64(addr + 0);
|
||||
const len = getInt64(addr + 8);
|
||||
const a = new Array(len);
|
||||
for (let i = 0; i < len; i++) {
|
||||
a[i] = loadValue(array + i * 8);
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
const loadString = (addr) => {
|
||||
const saddr = getInt64(addr + 0);
|
||||
const len = getInt64(addr + 8);
|
||||
return decoder.decode(new DataView(this._inst.exports.mem.buffer, saddr, len));
|
||||
}
|
||||
|
||||
const testCallExport = (a, b) => {
|
||||
this._inst.exports.testExport0();
|
||||
return this._inst.exports.testExport(a, b);
|
||||
}
|
||||
|
||||
const timeOrigin = Date.now() - performance.now();
|
||||
this.importObject = {
|
||||
_gotest: {
|
||||
add: (a, b) => a + b,
|
||||
callExport: testCallExport,
|
||||
},
|
||||
gojs: {
|
||||
// Go's SP does not change as long as no Go code is running. Some operations (e.g. calls, getters and setters)
|
||||
// may synchronously trigger a Go event handler. This makes Go code get executed in the middle of the imported
|
||||
// function. A goroutine can switch to a new stack if the current stack is too small (see morestack function).
|
||||
// This changes the SP, thus we have to update the SP used by the imported function.
|
||||
|
||||
// func wasmExit(code int32)
|
||||
"runtime.wasmExit": (sp) => {
|
||||
sp >>>= 0;
|
||||
const code = this.mem.getInt32(sp + 8, true);
|
||||
this.exited = true;
|
||||
delete this._inst;
|
||||
delete this._values;
|
||||
delete this._goRefCounts;
|
||||
delete this._ids;
|
||||
delete this._idPool;
|
||||
this.exit(code);
|
||||
},
|
||||
|
||||
// func wasmWrite(fd uintptr, p unsafe.Pointer, n int32)
|
||||
"runtime.wasmWrite": (sp) => {
|
||||
sp >>>= 0;
|
||||
const fd = getInt64(sp + 8);
|
||||
const p = getInt64(sp + 16);
|
||||
const n = this.mem.getInt32(sp + 24, true);
|
||||
fs.writeSync(fd, new Uint8Array(this._inst.exports.mem.buffer, p, n));
|
||||
},
|
||||
|
||||
// func resetMemoryDataView()
|
||||
"runtime.resetMemoryDataView": (sp) => {
|
||||
sp >>>= 0;
|
||||
this.mem = new DataView(this._inst.exports.mem.buffer);
|
||||
},
|
||||
|
||||
// func nanotime1() int64
|
||||
"runtime.nanotime1": (sp) => {
|
||||
sp >>>= 0;
|
||||
setInt64(sp + 8, (timeOrigin + performance.now()) * 1000000);
|
||||
},
|
||||
|
||||
// func walltime() (sec int64, nsec int32)
|
||||
"runtime.walltime": (sp) => {
|
||||
sp >>>= 0;
|
||||
const msec = (new Date).getTime();
|
||||
setInt64(sp + 8, msec / 1000);
|
||||
this.mem.setInt32(sp + 16, (msec % 1000) * 1000000, true);
|
||||
},
|
||||
|
||||
// func scheduleTimeoutEvent(delay int64) int32
|
||||
"runtime.scheduleTimeoutEvent": (sp) => {
|
||||
sp >>>= 0;
|
||||
const id = this._nextCallbackTimeoutID;
|
||||
this._nextCallbackTimeoutID++;
|
||||
this._scheduledTimeouts.set(id, setTimeout(
|
||||
() => {
|
||||
this._resume();
|
||||
while (this._scheduledTimeouts.has(id)) {
|
||||
// for some reason Go failed to register the timeout event, log and try again
|
||||
// (temporary workaround for https://github.com/golang/go/issues/28975)
|
||||
console.warn("scheduleTimeoutEvent: missed timeout event");
|
||||
this._resume();
|
||||
}
|
||||
},
|
||||
getInt64(sp + 8),
|
||||
));
|
||||
this.mem.setInt32(sp + 16, id, true);
|
||||
},
|
||||
|
||||
// func clearTimeoutEvent(id int32)
|
||||
"runtime.clearTimeoutEvent": (sp) => {
|
||||
sp >>>= 0;
|
||||
const id = this.mem.getInt32(sp + 8, true);
|
||||
clearTimeout(this._scheduledTimeouts.get(id));
|
||||
this._scheduledTimeouts.delete(id);
|
||||
},
|
||||
|
||||
// func getRandomData(r []byte)
|
||||
"runtime.getRandomData": (sp) => {
|
||||
sp >>>= 0;
|
||||
crypto.getRandomValues(loadSlice(sp + 8));
|
||||
},
|
||||
|
||||
// func finalizeRef(v ref)
|
||||
"syscall/js.finalizeRef": (sp) => {
|
||||
sp >>>= 0;
|
||||
const id = this.mem.getUint32(sp + 8, true);
|
||||
this._goRefCounts[id]--;
|
||||
if (this._goRefCounts[id] === 0) {
|
||||
const v = this._values[id];
|
||||
this._values[id] = null;
|
||||
this._ids.delete(v);
|
||||
this._idPool.push(id);
|
||||
}
|
||||
},
|
||||
|
||||
// func stringVal(value string) ref
|
||||
"syscall/js.stringVal": (sp) => {
|
||||
sp >>>= 0;
|
||||
storeValue(sp + 24, loadString(sp + 8));
|
||||
},
|
||||
|
||||
// func valueGet(v ref, p string) ref
|
||||
"syscall/js.valueGet": (sp) => {
|
||||
sp >>>= 0;
|
||||
const result = Reflect.get(loadValue(sp + 8), loadString(sp + 16));
|
||||
sp = this._inst.exports.getsp() >>> 0; // see comment above
|
||||
storeValue(sp + 32, result);
|
||||
},
|
||||
|
||||
// func valueSet(v ref, p string, x ref)
|
||||
"syscall/js.valueSet": (sp) => {
|
||||
sp >>>= 0;
|
||||
Reflect.set(loadValue(sp + 8), loadString(sp + 16), loadValue(sp + 32));
|
||||
},
|
||||
|
||||
// func valueDelete(v ref, p string)
|
||||
"syscall/js.valueDelete": (sp) => {
|
||||
sp >>>= 0;
|
||||
Reflect.deleteProperty(loadValue(sp + 8), loadString(sp + 16));
|
||||
},
|
||||
|
||||
// func valueIndex(v ref, i int) ref
|
||||
"syscall/js.valueIndex": (sp) => {
|
||||
sp >>>= 0;
|
||||
storeValue(sp + 24, Reflect.get(loadValue(sp + 8), getInt64(sp + 16)));
|
||||
},
|
||||
|
||||
// valueSetIndex(v ref, i int, x ref)
|
||||
"syscall/js.valueSetIndex": (sp) => {
|
||||
sp >>>= 0;
|
||||
Reflect.set(loadValue(sp + 8), getInt64(sp + 16), loadValue(sp + 24));
|
||||
},
|
||||
|
||||
// func valueCall(v ref, m string, args []ref) (ref, bool)
|
||||
"syscall/js.valueCall": (sp) => {
|
||||
sp >>>= 0;
|
||||
try {
|
||||
const v = loadValue(sp + 8);
|
||||
const m = Reflect.get(v, loadString(sp + 16));
|
||||
const args = loadSliceOfValues(sp + 32);
|
||||
const result = Reflect.apply(m, v, args);
|
||||
sp = this._inst.exports.getsp() >>> 0; // see comment above
|
||||
storeValue(sp + 56, result);
|
||||
this.mem.setUint8(sp + 64, 1);
|
||||
} catch (err) {
|
||||
sp = this._inst.exports.getsp() >>> 0; // see comment above
|
||||
storeValue(sp + 56, err);
|
||||
this.mem.setUint8(sp + 64, 0);
|
||||
}
|
||||
},
|
||||
|
||||
// func valueInvoke(v ref, args []ref) (ref, bool)
|
||||
"syscall/js.valueInvoke": (sp) => {
|
||||
sp >>>= 0;
|
||||
try {
|
||||
const v = loadValue(sp + 8);
|
||||
const args = loadSliceOfValues(sp + 16);
|
||||
const result = Reflect.apply(v, undefined, args);
|
||||
sp = this._inst.exports.getsp() >>> 0; // see comment above
|
||||
storeValue(sp + 40, result);
|
||||
this.mem.setUint8(sp + 48, 1);
|
||||
} catch (err) {
|
||||
sp = this._inst.exports.getsp() >>> 0; // see comment above
|
||||
storeValue(sp + 40, err);
|
||||
this.mem.setUint8(sp + 48, 0);
|
||||
}
|
||||
},
|
||||
|
||||
// func valueNew(v ref, args []ref) (ref, bool)
|
||||
"syscall/js.valueNew": (sp) => {
|
||||
sp >>>= 0;
|
||||
try {
|
||||
const v = loadValue(sp + 8);
|
||||
const args = loadSliceOfValues(sp + 16);
|
||||
const result = Reflect.construct(v, args);
|
||||
sp = this._inst.exports.getsp() >>> 0; // see comment above
|
||||
storeValue(sp + 40, result);
|
||||
this.mem.setUint8(sp + 48, 1);
|
||||
} catch (err) {
|
||||
sp = this._inst.exports.getsp() >>> 0; // see comment above
|
||||
storeValue(sp + 40, err);
|
||||
this.mem.setUint8(sp + 48, 0);
|
||||
}
|
||||
},
|
||||
|
||||
// func valueLength(v ref) int
|
||||
"syscall/js.valueLength": (sp) => {
|
||||
sp >>>= 0;
|
||||
setInt64(sp + 16, parseInt(loadValue(sp + 8).length));
|
||||
},
|
||||
|
||||
// valuePrepareString(v ref) (ref, int)
|
||||
"syscall/js.valuePrepareString": (sp) => {
|
||||
sp >>>= 0;
|
||||
const str = encoder.encode(String(loadValue(sp + 8)));
|
||||
storeValue(sp + 16, str);
|
||||
setInt64(sp + 24, str.length);
|
||||
},
|
||||
|
||||
// valueLoadString(v ref, b []byte)
|
||||
"syscall/js.valueLoadString": (sp) => {
|
||||
sp >>>= 0;
|
||||
const str = loadValue(sp + 8);
|
||||
loadSlice(sp + 16).set(str);
|
||||
},
|
||||
|
||||
// func valueInstanceOf(v ref, t ref) bool
|
||||
"syscall/js.valueInstanceOf": (sp) => {
|
||||
sp >>>= 0;
|
||||
this.mem.setUint8(sp + 24, (loadValue(sp + 8) instanceof loadValue(sp + 16)) ? 1 : 0);
|
||||
},
|
||||
|
||||
// func copyBytesToGo(dst []byte, src ref) (int, bool)
|
||||
"syscall/js.copyBytesToGo": (sp) => {
|
||||
sp >>>= 0;
|
||||
const dst = loadSlice(sp + 8);
|
||||
const src = loadValue(sp + 32);
|
||||
if (!(src instanceof Uint8Array || src instanceof Uint8ClampedArray)) {
|
||||
this.mem.setUint8(sp + 48, 0);
|
||||
return;
|
||||
}
|
||||
const toCopy = src.subarray(0, dst.length);
|
||||
dst.set(toCopy);
|
||||
setInt64(sp + 40, toCopy.length);
|
||||
this.mem.setUint8(sp + 48, 1);
|
||||
},
|
||||
|
||||
// func copyBytesToJS(dst ref, src []byte) (int, bool)
|
||||
"syscall/js.copyBytesToJS": (sp) => {
|
||||
sp >>>= 0;
|
||||
const dst = loadValue(sp + 8);
|
||||
const src = loadSlice(sp + 16);
|
||||
if (!(dst instanceof Uint8Array || dst instanceof Uint8ClampedArray)) {
|
||||
this.mem.setUint8(sp + 48, 0);
|
||||
return;
|
||||
}
|
||||
const toCopy = src.subarray(0, dst.length);
|
||||
dst.set(toCopy);
|
||||
setInt64(sp + 40, toCopy.length);
|
||||
this.mem.setUint8(sp + 48, 1);
|
||||
},
|
||||
|
||||
"debug": (value) => {
|
||||
console.log(value);
|
||||
},
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
async run(instance) {
|
||||
if (!(instance instanceof WebAssembly.Instance)) {
|
||||
throw new Error("Go.run: WebAssembly.Instance expected");
|
||||
}
|
||||
this._inst = instance;
|
||||
this.mem = new DataView(this._inst.exports.mem.buffer);
|
||||
this._values = [ // JS values that Go currently has references to, indexed by reference id
|
||||
NaN,
|
||||
0,
|
||||
null,
|
||||
true,
|
||||
false,
|
||||
globalThis,
|
||||
this,
|
||||
];
|
||||
this._goRefCounts = new Array(this._values.length).fill(Infinity); // number of references that Go has to a JS value, indexed by reference id
|
||||
this._ids = new Map([ // mapping from JS values to reference ids
|
||||
[0, 1],
|
||||
[null, 2],
|
||||
[true, 3],
|
||||
[false, 4],
|
||||
[globalThis, 5],
|
||||
[this, 6],
|
||||
]);
|
||||
this._idPool = []; // unused ids that have been garbage collected
|
||||
this.exited = false; // whether the Go program has exited
|
||||
|
||||
// Pass command line arguments and environment variables to WebAssembly by writing them to the linear memory.
|
||||
let offset = 4096;
|
||||
|
||||
const strPtr = (str) => {
|
||||
const ptr = offset;
|
||||
const bytes = encoder.encode(str + "\0");
|
||||
new Uint8Array(this.mem.buffer, offset, bytes.length).set(bytes);
|
||||
offset += bytes.length;
|
||||
if (offset % 8 !== 0) {
|
||||
offset += 8 - (offset % 8);
|
||||
}
|
||||
return ptr;
|
||||
};
|
||||
|
||||
const argc = this.argv.length;
|
||||
|
||||
const argvPtrs = [];
|
||||
this.argv.forEach((arg) => {
|
||||
argvPtrs.push(strPtr(arg));
|
||||
});
|
||||
argvPtrs.push(0);
|
||||
|
||||
const keys = Object.keys(this.env).sort();
|
||||
keys.forEach((key) => {
|
||||
argvPtrs.push(strPtr(`${key}=${this.env[key]}`));
|
||||
});
|
||||
argvPtrs.push(0);
|
||||
|
||||
const argv = offset;
|
||||
argvPtrs.forEach((ptr) => {
|
||||
this.mem.setUint32(offset, ptr, true);
|
||||
this.mem.setUint32(offset + 4, 0, true);
|
||||
offset += 8;
|
||||
});
|
||||
|
||||
// The linker guarantees global data starts from at least wasmMinDataAddr.
|
||||
// Keep in sync with cmd/link/internal/ld/data.go:wasmMinDataAddr.
|
||||
const wasmMinDataAddr = 4096 + 8192;
|
||||
if (offset >= wasmMinDataAddr) {
|
||||
throw new Error("total length of command line and environment variables exceeds limit");
|
||||
}
|
||||
|
||||
this._inst.exports.run(argc, argv);
|
||||
if (this.exited) {
|
||||
this._resolveExitPromise();
|
||||
}
|
||||
await this._exitPromise;
|
||||
}
|
||||
|
||||
_resume() {
|
||||
if (this.exited) {
|
||||
throw new Error("Go program has already exited");
|
||||
}
|
||||
this._inst.exports.resume();
|
||||
if (this.exited) {
|
||||
this._resolveExitPromise();
|
||||
}
|
||||
}
|
||||
|
||||
_makeFuncWrapper(id) {
|
||||
const go = this;
|
||||
return function () {
|
||||
const event = { id: id, this: this, args: arguments };
|
||||
go._pendingEvent = event;
|
||||
go._resume();
|
||||
return event.result;
|
||||
};
|
||||
}
|
||||
}
|
||||
})();
|
||||
@@ -7,6 +7,7 @@ const props = defineProps<{
|
||||
multiline?: boolean
|
||||
rows?: number | string
|
||||
autosize?: boolean
|
||||
readonly?: boolean
|
||||
}>();
|
||||
const emit = defineEmits(['update:value']);
|
||||
|
||||
@@ -21,6 +22,7 @@ const tooltipText = computed(() => isJustCopied.value ? 'Copied!' : 'Copy to cli
|
||||
:multiline="multiline"
|
||||
:rows="rows"
|
||||
:autosize="autosize"
|
||||
:readonly="readonly"
|
||||
>
|
||||
<template #suffix>
|
||||
<c-tooltip :tooltip="tooltipText">
|
||||
|
||||
@@ -75,7 +75,10 @@ const { download } = useDownloadFileFromBase64(
|
||||
|
||||
<template>
|
||||
<div style="overflow-x: hidden; width: 100%">
|
||||
<c-card relative>
|
||||
<c-card
|
||||
relative
|
||||
:style="(copyPlacement === 'top-right' || copyPlacement === 'bottom-right') ? `padding-bottom: 50px` : ''"
|
||||
>
|
||||
<n-scrollbar
|
||||
x-scrollable
|
||||
trigger="none"
|
||||
@@ -87,9 +90,10 @@ const { download } = useDownloadFileFromBase64(
|
||||
</n-scrollbar>
|
||||
<div
|
||||
v-if="value && copyPlacement !== 'none'"
|
||||
absolute right-10px
|
||||
|
||||
:top-10px="copyPlacement === 'top-right' ? '' : 'no'"
|
||||
:bottom-10px="copyPlacement === 'bottom-right' ? '' : 'no'"
|
||||
absolute right-10px
|
||||
>
|
||||
<c-tooltip v-if="value && copyPlacement !== 'outside'" :tooltip="tooltipText" position="left">
|
||||
<c-button circle important:h-10 important:w-10 @click="copy()">
|
||||
|
||||
@@ -0,0 +1,223 @@
|
||||
import { type MaybeRef, get } from '@vueuse/core';
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import FlexSearch from 'flexsearch';
|
||||
|
||||
// Define key types to match Fuse.js format
|
||||
type SearchKey = string | { name: string; weight?: number };
|
||||
|
||||
export function useFlexSearch<Data extends Record<string, any>>({
|
||||
search,
|
||||
data,
|
||||
options = {
|
||||
keys: [],
|
||||
},
|
||||
limit = -1,
|
||||
}: {
|
||||
search: MaybeRef<string>
|
||||
data: Data[]
|
||||
options?: {
|
||||
keys: SearchKey[]
|
||||
/**
|
||||
* Whether to show or not show items with an empty search query. `true` won't show any items, `false` will show all items.
|
||||
* @default true
|
||||
*/
|
||||
filterEmpty?: boolean
|
||||
/**
|
||||
* Whether the results should be sorted by similarity score using the Levenshtein distance.
|
||||
* @default true
|
||||
*/
|
||||
shouldSort?: boolean
|
||||
/**
|
||||
* Type of tokenization logic to use (Determines how the search logic will behave).
|
||||
* @default 'forward'
|
||||
* @see {@link https://github.com/nextapps-de/flexsearch?tab=readme-ov-file#tokenizer-partial-match | FlexSearch Tokenizer Documentation}
|
||||
*
|
||||
* Note: The `'tolerant'` tokenizer option mentioned in the documentation doesn't exist anymore in the current version of FlexSearch.
|
||||
*/
|
||||
tokenize?: 'strict' | 'forward' | 'reverse' | 'full'
|
||||
resolution?: number
|
||||
optimize?: boolean
|
||||
cache?: boolean | number
|
||||
}
|
||||
limit?: MaybeRef<number>
|
||||
}) {
|
||||
// Extract options
|
||||
const { keys, filterEmpty = true, shouldSort = true, tokenize = 'forward', ...indexOptions } = options;
|
||||
|
||||
// Normalize keys to include weights
|
||||
const normalizedKeys = keys.map((key) => {
|
||||
if (typeof key === 'string') {
|
||||
return { name: key, weight: 1 };
|
||||
}
|
||||
return { name: key.name, weight: key.weight ?? 1 };
|
||||
});
|
||||
|
||||
// Helper to get unique key for each item (prefer 'id', fallback to index)
|
||||
const getItemKey = (item: Data, idx: number) => (item.id !== undefined ? item.id : idx);
|
||||
|
||||
// Map to store original data items by unique key
|
||||
const dataMap = ref(new Map<any, Data>());
|
||||
|
||||
// Create separate indices for each key with weight info
|
||||
const indices = normalizedKeys.map(({ name, weight }) => ({
|
||||
key: name,
|
||||
weight,
|
||||
index: new FlexSearch.Index({
|
||||
tokenize,
|
||||
preset: 'performance',
|
||||
resolution: 9,
|
||||
optimize: true,
|
||||
cache: 100,
|
||||
fastupdate: true,
|
||||
...indexOptions,
|
||||
}),
|
||||
}));
|
||||
|
||||
// Initialize indices with data
|
||||
const initializeIndices = () => {
|
||||
dataMap.value.clear();
|
||||
indices.forEach(({ index }) => index.clear());
|
||||
|
||||
data.forEach((item, idx) => {
|
||||
const itemKey = getItemKey(item, idx);
|
||||
dataMap.value.set(itemKey, item);
|
||||
|
||||
indices.forEach(({ key, index }) => {
|
||||
// Support nested keys (e.g., 'foo.bar')
|
||||
const value = key.split('.').reduce((obj, path) => obj?.[path], item);
|
||||
if (value) {
|
||||
index.add(itemKey, String(value));
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
// Initialize on creation
|
||||
initializeIndices();
|
||||
|
||||
// Watch for data changes (deep watch for array content)
|
||||
watch(
|
||||
() => data,
|
||||
initializeIndices,
|
||||
{ deep: true },
|
||||
);
|
||||
|
||||
// Function to search across all indices with weight consideration
|
||||
const searchAllIndices = (query: string, searchLimit: number) => {
|
||||
if (!query) {
|
||||
return [];
|
||||
}
|
||||
|
||||
// Use a higher individual limit for each index to ensure we don't miss potential matches
|
||||
const individualLimit = searchLimit > 0 ? searchLimit * 2 : undefined;
|
||||
|
||||
// Search each index and collect results with weights
|
||||
const weightedResults = new Map<any, number>();
|
||||
|
||||
indices.forEach(({ index, weight }) => {
|
||||
const results = index.search(query, individualLimit ? { limit: individualLimit } : undefined);
|
||||
|
||||
results.forEach((id) => {
|
||||
const currentScore = weightedResults.get(id) || 0;
|
||||
weightedResults.set(id, currentScore + weight);
|
||||
});
|
||||
});
|
||||
|
||||
// Sort by weight (higher weight = better match) and convert to array
|
||||
const sortedIds = Array.from(weightedResults.entries())
|
||||
.sort((a, b) => b[1] - a[1])
|
||||
.map(([id]) => id);
|
||||
|
||||
// Apply limit and convert back to original items
|
||||
const limitedIds = searchLimit > 0 ? sortedIds.slice(0, searchLimit) : sortedIds;
|
||||
|
||||
// Return the limited results early if it shouldn't be sorted by similarity
|
||||
if (!shouldSort) {
|
||||
return limitedIds
|
||||
.map(id => dataMap.value.get(id))
|
||||
.filter(Boolean) as Data[];
|
||||
}
|
||||
|
||||
// Calculate Levenshtein distance
|
||||
const levenshteinDistance = (str1: string, str2: string): number => {
|
||||
const matrix = Array(str2.length + 1).fill(null).map(() => Array(str1.length + 1).fill(null));
|
||||
|
||||
for (let i = 0; i <= str1.length; i++) {
|
||||
matrix[0][i] = i;
|
||||
}
|
||||
for (let j = 0; j <= str2.length; j++) {
|
||||
matrix[j][0] = j;
|
||||
}
|
||||
|
||||
for (let j = 1; j <= str2.length; j++) {
|
||||
for (let i = 1; i <= str1.length; i++) {
|
||||
const indicator = str1[i - 1] === str2[j - 1] ? 0 : 1;
|
||||
matrix[j][i] = Math.min(
|
||||
matrix[j][i - 1] + 1, // deletion
|
||||
matrix[j - 1][i] + 1, // insertion
|
||||
matrix[j - 1][i - 1] + indicator, // substitution
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return matrix[str2.length][str1.length];
|
||||
};
|
||||
|
||||
// Calculate similarity score (0-1, where 1 is perfect match)
|
||||
const calculateSimilarity = (str1: string, str2: string): number => {
|
||||
const maxLength = Math.max(str1.length, str2.length);
|
||||
if (maxLength === 0) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
const distance = levenshteinDistance(str1.toLowerCase(), str2.toLowerCase());
|
||||
return 1 - (distance / maxLength);
|
||||
};
|
||||
|
||||
// Sort limited results by similarity score
|
||||
const sortedResults = limitedIds
|
||||
.map((id) => {
|
||||
const item = dataMap.value.get(id);
|
||||
if (!item) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Calculate best similarity score across all searchable fields
|
||||
const similarities = normalizedKeys.map(({ name }) => {
|
||||
const value = name.split('.').reduce((obj, path) => obj?.[path], item);
|
||||
return value ? calculateSimilarity(query, String(value)) : 0;
|
||||
});
|
||||
|
||||
const bestSimilarity = Math.max(...similarities);
|
||||
|
||||
return {
|
||||
item,
|
||||
similarity: bestSimilarity,
|
||||
};
|
||||
})
|
||||
.filter(Boolean)
|
||||
.sort((a, b) => b!.similarity - a!.similarity)
|
||||
.map(result => result!.item);
|
||||
|
||||
return sortedResults as Data[];
|
||||
};
|
||||
|
||||
// Computed results
|
||||
const searchResult = computed<Data[]>(() => {
|
||||
const query = get(search);
|
||||
const searchLimit: number = get(limit);
|
||||
|
||||
// Handle empty query case
|
||||
if (!query && !filterEmpty) {
|
||||
return searchLimit > 0 ? data.slice(0, searchLimit) : data;
|
||||
}
|
||||
|
||||
if (!query) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return searchAllIndices(query, searchLimit);
|
||||
});
|
||||
|
||||
return { searchResult };
|
||||
}
|
||||
@@ -72,7 +72,9 @@ const themeVars = useThemeVars();
|
||||
</div>
|
||||
|
||||
<div class="tool-content">
|
||||
<slot />
|
||||
<Suspense>
|
||||
<slot />
|
||||
</Suspense>
|
||||
</div>
|
||||
|
||||
<div class="tool-footer">
|
||||
|
||||
@@ -4,9 +4,6 @@ import { createHead } from '@vueuse/head';
|
||||
import { library } from '@fortawesome/fontawesome-svg-core';
|
||||
import { fas } from '@fortawesome/free-solid-svg-icons';
|
||||
|
||||
import { install as VueMonacoEditorPlugin, loader } from '@guolao/vue-monaco-editor';
|
||||
import * as monaco from 'monaco-editor';
|
||||
|
||||
import { registerSW } from 'virtual:pwa-register';
|
||||
import shadow from 'vue-shadow-dom';
|
||||
import { plausible } from './plugins/plausible.plugin';
|
||||
@@ -23,14 +20,10 @@ import store from './tools/pomodoro-timer/app/store';
|
||||
|
||||
library.add(fas);
|
||||
|
||||
// loaded monaco-editor from `node_modules`
|
||||
loader.config({ monaco });
|
||||
|
||||
registerSW();
|
||||
|
||||
const app = createApp(App);
|
||||
|
||||
app.use(VueMonacoEditorPlugin);
|
||||
app.use(createPinia());
|
||||
app.use(createHead());
|
||||
app.use(i18nPlugin);
|
||||
|
||||
@@ -0,0 +1,261 @@
|
||||
<script setup lang="ts">
|
||||
import { useScriptTag } from '@vueuse/core';
|
||||
import ageWasmUrl from '/age-wasm/age.wasm?url';
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
generateX25519Identity: () => {
|
||||
privateKey: string
|
||||
publicKey: string
|
||||
}
|
||||
encrypt: (publicKeys: string, message: string) => {
|
||||
error?: string
|
||||
output: string
|
||||
}
|
||||
decrypt: (privateKeys: string, message: string) => {
|
||||
error?: string
|
||||
output: string
|
||||
}
|
||||
encryptBinary: (publicKeys: string, buffer: Uint8Array) => string | Uint8Array
|
||||
decryptBinary: (privateKeys: string, buffer: Uint8Array) => string | Uint8Array
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Go is the class as defined in the Golang `wasm_exec.js` distributable file required for WebAssembly.
|
||||
* Golang WebAssembly wiki: https://github.com/golang/go/wiki/WebAssembly
|
||||
*/
|
||||
declare class Go {
|
||||
argv: string[];
|
||||
env: { [envKey: string]: string };
|
||||
exit: (code: number) => void;
|
||||
importObject: WebAssembly.Imports;
|
||||
exited: boolean;
|
||||
mem: DataView;
|
||||
run(instance: WebAssembly.Instance): Promise<void>;
|
||||
}
|
||||
|
||||
const { load: loadGo } = useScriptTag('/age-wasm/wasm_exec.js', undefined, { type: 'module', manual: true });
|
||||
|
||||
await loadGo();
|
||||
|
||||
const go = new Go();
|
||||
const result = await WebAssembly.instantiateStreaming(fetch(ageWasmUrl), go.importObject);
|
||||
go.run(result.instance);
|
||||
|
||||
const privKey = ref('');
|
||||
const pubKey = ref('');
|
||||
const recipients = ref('');
|
||||
const message = ref('');
|
||||
const encryptedOutput = ref('');
|
||||
const recipientsBinary = ref('');
|
||||
const filesEncrypt = ref<File[]>([]);
|
||||
const identities = ref('');
|
||||
const encryptedText = ref('');
|
||||
const decryptedOutput = ref('');
|
||||
const identitiesBinary = ref('');
|
||||
const filesDecrypt = ref<File[]>([]);
|
||||
const error = ref('');
|
||||
|
||||
function downloadURL(data: string, fileName: string) {
|
||||
const a = document.createElement('a');
|
||||
a.href = data;
|
||||
a.download = fileName;
|
||||
document.body.appendChild(a);
|
||||
a.style.display = 'none';
|
||||
a.click();
|
||||
a.remove();
|
||||
}
|
||||
|
||||
function downloadBlob(data: Uint8Array, fileName: string) {
|
||||
const blob = new Blob([data], {
|
||||
type: 'application/octet-stream',
|
||||
});
|
||||
const url = window.URL.createObjectURL(blob);
|
||||
downloadURL(url, fileName);
|
||||
setTimeout(() => window.URL.revokeObjectURL(url), 1000);
|
||||
}
|
||||
|
||||
function generateKeys() {
|
||||
const keys = window.generateX25519Identity();
|
||||
privKey.value = keys.privateKey;
|
||||
pubKey.value = keys.publicKey;
|
||||
}
|
||||
|
||||
function encrypt() {
|
||||
error.value = '';
|
||||
const result = window.encrypt(recipients.value, message.value);
|
||||
if (result.error) {
|
||||
error.value = result.error;
|
||||
}
|
||||
else {
|
||||
encryptedOutput.value = result.output;
|
||||
}
|
||||
}
|
||||
|
||||
function encryptBinary() {
|
||||
error.value = '';
|
||||
const file = filesEncrypt.value;
|
||||
if (!file.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
file.forEach((f) => {
|
||||
const reader = new FileReader();
|
||||
reader.onload = () => {
|
||||
const buffer = new Uint8Array(reader.result as ArrayBuffer);
|
||||
const result = window.encryptBinary(recipientsBinary.value, buffer);
|
||||
if (typeof result === 'string') {
|
||||
error.value = result;
|
||||
}
|
||||
else {
|
||||
downloadBlob(result, `${f.name}.age`);
|
||||
}
|
||||
};
|
||||
reader.readAsArrayBuffer(f);
|
||||
});
|
||||
|
||||
filesEncrypt.value = [];
|
||||
}
|
||||
|
||||
function decrypt() {
|
||||
error.value = '';
|
||||
const result = window.decrypt(identities.value, encryptedText.value);
|
||||
if (result.error) {
|
||||
error.value = result.error;
|
||||
}
|
||||
else {
|
||||
decryptedOutput.value = result.output;
|
||||
}
|
||||
}
|
||||
|
||||
function decryptBinary() {
|
||||
error.value = '';
|
||||
const file = filesDecrypt.value;
|
||||
if (!file.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
file.forEach((f) => {
|
||||
const reader = new FileReader();
|
||||
reader.onload = () => {
|
||||
const buffer = new Uint8Array(reader.result as ArrayBuffer);
|
||||
const result = window.decryptBinary(identitiesBinary.value, buffer);
|
||||
if (typeof result === 'string') {
|
||||
error.value = result;
|
||||
}
|
||||
else {
|
||||
downloadBlob(result, f.name.replace('.age', ''));
|
||||
}
|
||||
};
|
||||
reader.readAsArrayBuffer(f);
|
||||
});
|
||||
|
||||
filesDecrypt.value = [];
|
||||
}
|
||||
|
||||
function onEncryptFilesUploaded(uploadedFiles: File[]) {
|
||||
filesEncrypt.value = uploadedFiles;
|
||||
}
|
||||
function onDecryptFilesUploaded(uploadedFiles: File[]) {
|
||||
filesDecrypt.value = uploadedFiles;
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<n-tabs type="card">
|
||||
<!-- Generate Keys -->
|
||||
<n-tab-pane name="keys" tab="Generate Keys">
|
||||
<n-card title="Private Key" mb-1>
|
||||
<textarea-copyable v-model:value="privKey" rows="3" multiline placeholder="Your private key will be generated here." />
|
||||
</n-card>
|
||||
<n-card title="Public Key" mb-1>
|
||||
<textarea-copyable v-model:value="pubKey" rows="3" multiline placeholder="Your public key will be generated here." />
|
||||
</n-card>
|
||||
<n-button type="primary" @click="generateKeys">
|
||||
Generate Keys
|
||||
</n-button>
|
||||
</n-tab-pane>
|
||||
|
||||
<!-- Encrypt Text -->
|
||||
<n-tab-pane name="encrypt" tab="Encrypt">
|
||||
<n-card title="Public Keys" mb-1>
|
||||
<n-input v-model:value="recipients" type="textarea" placeholder="Recipient key or keys one per line" required />
|
||||
</n-card>
|
||||
<n-card title="Message" mb-1>
|
||||
<n-input v-model:value="message" type="textarea" placeholder="Message to encrypt" required />
|
||||
</n-card>
|
||||
<n-card title="Output" mb-1>
|
||||
<textarea-copyable v-model:value="encryptedOutput" rows="3" multiline placeholder="Encrypted output will be generated here." />
|
||||
</n-card>
|
||||
<n-button type="primary" @click="encrypt">
|
||||
Encrypt
|
||||
</n-button>
|
||||
</n-tab-pane>
|
||||
|
||||
<!-- Encrypt Binary -->
|
||||
<n-tab-pane name="encryptBinary" tab="Encrypt Binary">
|
||||
<n-card title="Public Keys" mb-1>
|
||||
<n-input v-model:value="recipientsBinary" type="textarea" placeholder="Recipient key or keys one per line" required />
|
||||
</n-card>
|
||||
<n-card title="Files" mb-1>
|
||||
<c-file-upload
|
||||
title="Drag and drop files here, or click to select some files"
|
||||
multiple
|
||||
@files-upload="onEncryptFilesUploaded"
|
||||
/>
|
||||
<ul>
|
||||
<li v-for="(file, index) in filesEncrypt" :key="index">
|
||||
{{ file.name }}
|
||||
</li>
|
||||
</ul>
|
||||
</n-card>
|
||||
<n-card title="Output" mb-1>
|
||||
<p>The encrypted files will be downloaded.</p>
|
||||
</n-card>
|
||||
<n-button type="primary" @click="encryptBinary">
|
||||
Encrypt Binary
|
||||
</n-button>
|
||||
</n-tab-pane>
|
||||
|
||||
<!-- Decrypt Text -->
|
||||
<n-tab-pane name="decrypt" tab="Decrypt">
|
||||
<n-card title="Private Keys" mb-1>
|
||||
<n-input v-model:value="identities" type="textarea" placeholder="Identity key or keys one per line" required />
|
||||
</n-card>
|
||||
<n-card title="Encrypted Text" mb-1>
|
||||
<n-input v-model:value="encryptedText" type="textarea" placeholder="Paste here encrypted text" required />
|
||||
</n-card>
|
||||
<n-card title="Output" mb-1>
|
||||
<textarea-copyable v-model:value="decryptedOutput" rows="3" multiline placeholder="Decrypted output will be generated here." />
|
||||
</n-card>
|
||||
<n-button type="primary" @click="decrypt">
|
||||
Decrypt
|
||||
</n-button>
|
||||
</n-tab-pane>
|
||||
|
||||
<!-- Decrypt Binary -->
|
||||
<n-tab-pane name="decryptBinary" tab="Decrypt Binary">
|
||||
<n-card title="Private Keys" mb-1>
|
||||
<n-input v-model:value="identitiesBinary" type="textarea" placeholder="Identity key or keys one per line" required />
|
||||
</n-card>
|
||||
<n-card title="Encrypted Files" mb-1>
|
||||
<c-file-upload
|
||||
title="Drag and drop files here, or click to select some files"
|
||||
multiple
|
||||
@files-upload="onDecryptFilesUploaded"
|
||||
/>
|
||||
<ul>
|
||||
<li v-for="(file, index) in filesDecrypt" :key="index">
|
||||
{{ file.name }}
|
||||
</li>
|
||||
</ul>
|
||||
</n-card>
|
||||
<n-card title="Output" mb-1>
|
||||
<p>The decrypted files will be downloaded.</p>
|
||||
</n-card>
|
||||
<n-button type="primary" @click="decryptBinary">
|
||||
Decrypt Binary
|
||||
</n-button>
|
||||
</n-tab-pane>
|
||||
</n-tabs>
|
||||
</template>
|
||||
@@ -0,0 +1,13 @@
|
||||
import { EyeOff } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'AGE Cryptography',
|
||||
path: '/age-crypto',
|
||||
description: 'Provides a simple and easy-to-use open-source Age tool for generating keys, encrypting, and decrypting messages.',
|
||||
keywords: ['age'],
|
||||
component: () => import('./age-crypto.vue'),
|
||||
icon: EyeOff,
|
||||
createdAt: new Date('2025-05-08'),
|
||||
category: 'Crypto',
|
||||
});
|
||||
@@ -0,0 +1,573 @@
|
||||
```bash
|
||||
#!/bin/bash
|
||||
##############################################################################
|
||||
# SHORTCUTS and HISTORY
|
||||
##############################################################################
|
||||
|
||||
CTRL+A # move to beginning of line
|
||||
CTRL+B # moves backward one character
|
||||
CTRL+C # halts the current command
|
||||
CTRL+D # deletes one character backward or logs out of current session, similar to exit
|
||||
CTRL+E # moves to end of line
|
||||
CTRL+F # moves forward one character
|
||||
CTRL+G # aborts the current editing command and ring the terminal bell
|
||||
CTRL+H # deletes one character under cursor (same as DELETE)
|
||||
CTRL+J # same as RETURN
|
||||
CTRL+K # deletes (kill) forward to end of line
|
||||
CTRL+L # clears screen and redisplay the line
|
||||
CTRL+M # same as RETURN
|
||||
CTRL+N # next line in command history
|
||||
CTRL+O # same as RETURN, then displays next line in history file
|
||||
CTRL+P # previous line in command history
|
||||
CTRL+Q # resumes suspended shell output
|
||||
CTRL+R # searches backward
|
||||
CTRL+S # searches forward or suspends shell output
|
||||
CTRL+T # transposes two characters
|
||||
CTRL+U # kills backward from point to the beginning of line
|
||||
CTRL+V # makes the next character typed verbatim
|
||||
CTRL+W # kills the word behind the cursor
|
||||
CTRL+X # lists the possible filename completions of the current word
|
||||
CTRL+Y # retrieves (yank) last item killed
|
||||
CTRL+Z # stops the current command, resume with fg in the foreground or bg in the background
|
||||
|
||||
ALT+B # moves backward one word
|
||||
ALT+D # deletes next word
|
||||
ALT+F # moves forward one word
|
||||
ALT+H # deletes one character backward
|
||||
ALT+T # transposes two words
|
||||
ALT+. # pastes last word from the last command. Pressing it repeatedly traverses through command history.
|
||||
ALT+U # capitalizes every character from the current cursor position to the end of the word
|
||||
ALT+L # uncapitalizes every character from the current cursor position to the end of the word
|
||||
ALT+C # capitalizes the letter under the cursor. The cursor then moves to the end of the word.
|
||||
ALT+R # reverts any changes to a command you’ve pulled from your history if you’ve edited it.
|
||||
ALT+? # list possible completions to what is typed
|
||||
ALT+^ # expand line to most recent match from history
|
||||
|
||||
CTRL+X then ( # start recording a keyboard macro
|
||||
CTRL+X then ) # finish recording keyboard macro
|
||||
CTRL+X then E # recall last recorded keyboard macro
|
||||
CTRL+X then CTRL+E # invoke text editor (specified by $EDITOR) on current command line then execute resultes as shell commands
|
||||
CTRL+A then D # logout from screen but don't kill it, if any command exist, it will continue
|
||||
|
||||
BACKSPACE # deletes one character backward
|
||||
DELETE # deletes one character under cursor
|
||||
|
||||
history # shows command line history
|
||||
!! # repeats the last command
|
||||
!<n> # refers to command line 'n'
|
||||
!<string> # refers to command starting with 'string'
|
||||
esc :wq # exits and saves script
|
||||
|
||||
exit # logs out of current session
|
||||
|
||||
|
||||
##############################################################################
|
||||
# BASH BASICS
|
||||
##############################################################################
|
||||
|
||||
env # displays all environment variables
|
||||
|
||||
echo $SHELL # displays the shell you're using
|
||||
echo $BASH_VERSION # displays bash version
|
||||
|
||||
bash # if you want to use bash (type exit to go back to your previously opened shell)
|
||||
whereis bash # locates the binary, source and manual-page for a command
|
||||
which bash # finds out which program is executed as 'bash' (default: /bin/bash, can change across environments)
|
||||
|
||||
clear # clears content on window (hide displayed lines)
|
||||
|
||||
|
||||
##############################################################################
|
||||
# FILE COMMANDS
|
||||
##############################################################################
|
||||
|
||||
|
||||
ls # lists your files in current directory, ls <dir> to print files in a specific directory
|
||||
ls -l # lists your files in 'long format', which contains the exact size of the file, who owns the file and who has the right to look at it, and when it was last modified
|
||||
ls -a # lists all files in 'long format', including hidden files (name beginning with '.')
|
||||
ln -s <filename> <link> # creates symbolic link to file
|
||||
readlink <filename> # shows where a symbolic links points to
|
||||
tree # show directories and subdirectories in easilly readable file tree
|
||||
mc # terminal file explorer (alternative to ncdu)
|
||||
touch <filename> # creates or updates (edit) your file
|
||||
mktemp -t <filename> # make a temp file in /tmp/ which is deleted at next boot (-d to make directory)
|
||||
cat <filename> # displays file raw content (will not be interpreted)
|
||||
cat -n <filename> # shows number of lines
|
||||
nl <file.sh> # shows number of lines in file
|
||||
cat filename1 > filename2 # Copy filename1 to filename2
|
||||
cat filename1 >> filename2 # merge two files texts together
|
||||
any_command > <filename> # '>' is used to perform redirections, it will set any_command's stdout to file instead of "real stdout" (generally /dev/stdout)
|
||||
more <filename> # shows the first part of a file (move with space and type q to quit)
|
||||
head <filename> # outputs the first lines of file (default: 10 lines)
|
||||
tail <filename> # outputs the last lines of file (useful with -f option) (default: 10 lines)
|
||||
vim <filename> # opens a file in VIM (VI iMproved) text editor, will create it if it doesn't exist
|
||||
mv <filename1> <dest> # moves a file to destination, behavior will change based on 'dest' type (dir: file is placed into dir; file: file will replace dest (tip: useful for renaming))
|
||||
cp <filename1> <dest> # copies a file
|
||||
rm <filename> # removes a file
|
||||
find . -name <name> <type> # searches for a file or a directory in the current directory and all its sub-directories by its name
|
||||
diff <filename1> <filename2> # compares files, and shows where they differ
|
||||
wc <filename> # tells you how many lines, words and characters there are in a file. Use -lwc (lines, word, character) to ouput only 1 of those informations
|
||||
sort <filename> # sorts the contents of a text file line by line in alphabetical order, use -n for numeric sort and -r for reversing order.
|
||||
sort -t -k <filename> # sorts the contents on specific sort key field starting from 1, using the field separator t.
|
||||
rev # reverse string characters (hello becomes olleh)
|
||||
chmod -options <filename> # lets you change the read, write, and execute permissions on your files (more infos: SUID, GUID)
|
||||
gzip <filename> # compresses files using gzip algorithm
|
||||
gunzip <filename> # uncompresses files compressed by gzip
|
||||
gzcat <filename> # lets you look at gzipped file without actually having to gunzip it
|
||||
lpr <filename> # prints the file
|
||||
lpq # checks out the printer queue
|
||||
lprm <jobnumber> # removes something from the printer queue
|
||||
genscript # converts plain text files into postscript for printing and gives you some options for formatting
|
||||
dvips <filename> # prints .dvi files (i.e. files produced by LaTeX)
|
||||
grep <pattern> <filenames> # looks for the string in the files
|
||||
grep -r <pattern> <dir> # search recursively for pattern in directory
|
||||
head -n file_name | tail +n # Print nth line from file.
|
||||
head -y lines.txt | tail +x # want to display all the lines from x to y. This includes the xth and yth lines.
|
||||
|
||||
sed 's/<pattern>/<replacement>/g' <filename> # replace pattern in file with replacement value to std output the character after s (/) is the delimeter
|
||||
sed -i 's/<pattern>/<replacement>/g' <filename> # replace pattern in file with replacement value in place
|
||||
echo "this" | sed 's/is/at/g' # replace pattern from input stream with replacement value
|
||||
|
||||
##############################################################################
|
||||
# DIRECTORY COMMANDS
|
||||
##############################################################################
|
||||
|
||||
|
||||
mkdir <dirname> # makes a new directory
|
||||
rmdir <dirname> # remove an empty directory
|
||||
rmdir -rf <dirname> # remove a non-empty directory
|
||||
mv <dir1> <dir2> # rename a directory from <dir1> to <dir2>
|
||||
cd # changes to home
|
||||
cd .. # changes to the parent directory
|
||||
cd <dirname> # changes directory
|
||||
cp -r <dir1> <dir2> # copy <dir1> into <dir2> including sub-directories
|
||||
pwd # tells you where you currently are
|
||||
cd ~ # changes to home.
|
||||
cd - # changes to previous working directory
|
||||
|
||||
##############################################################################
|
||||
# SSH, SYSTEM INFO & NETWORK COMMANDS
|
||||
##############################################################################
|
||||
|
||||
|
||||
ssh user@host # connects to host as user
|
||||
ssh -p <port> user@host # connects to host on specified port as user
|
||||
ssh-copy-id user@host # adds your ssh key to host for user to enable a keyed or passwordless login
|
||||
|
||||
whoami # returns your username
|
||||
su <user> # switch to a different user
|
||||
su - # switch to root, likely needs to be sudo su -
|
||||
sudo <command> # execute command as the root user
|
||||
passwd # lets you change your password
|
||||
quota -v # shows what your disk quota is
|
||||
date # shows the current date and time
|
||||
cal # shows the month's calendar
|
||||
uptime # shows current uptime
|
||||
w # displays whois online
|
||||
finger <user> # displays information about user
|
||||
uname -a # shows kernel information
|
||||
man <command> # shows the manual for specified command
|
||||
info <command> # shows another documentation system for the specific command
|
||||
help # shows documentation about built-in commands and functions
|
||||
df # shows disk usage
|
||||
du <filename> # shows the disk usage of the files and directories in filename (du -s give only a total)
|
||||
resize2fs # ext2/ext3/ext4 file system resizer
|
||||
last <yourUsername> # lists your last logins
|
||||
ps -u yourusername # lists your processes
|
||||
kill <PID> # kills the processes with the ID you gave
|
||||
killall <processname> # kill all processes with the name
|
||||
top # displays your currently active processes
|
||||
lsof # lists open files
|
||||
bg # lists stopped or background jobs ; resume a stopped job in the background
|
||||
fg # brings the most recent job in the foreground
|
||||
fg <job> # brings job to the foreground
|
||||
|
||||
ping <host> # pings host and outputs results
|
||||
whois <domain> # gets whois information for domain
|
||||
dig <domain> # gets DNS information for domain
|
||||
dig -x <host> # reverses lookup host
|
||||
wget <file> # downloads file
|
||||
netstat # Print network connections, routing tables, interface statistics, masquerade connections, and multicast memberships
|
||||
|
||||
time <command> # report time consumed by command execution
|
||||
|
||||
|
||||
##############################################################################
|
||||
# VARIABLES
|
||||
##############################################################################
|
||||
|
||||
|
||||
varname=value # defines a variable
|
||||
varname=value command # defines a variable to be in the environment of a particular subprocess
|
||||
echo $varname # checks a variable's value
|
||||
echo $$ # prints process ID of the current shell
|
||||
echo $! # prints process ID of the most recently invoked background job
|
||||
echo $? # displays the exit status of the last command
|
||||
read <varname> # reads a string from the input and assigns it to a variable
|
||||
read -p "prompt" <varname> # same as above but outputs a prompt to ask user for value
|
||||
column -t <filename> # display info in pretty columns (often used with pipe)
|
||||
let <varname> = <equation> # performs mathematical calculation using operators like +, -, *, /, %
|
||||
export VARNAME=value # defines an environment variable (will be available in subprocesses)
|
||||
export -f <funcname> # Exports function 'funcname'
|
||||
export var1="var1 value" # Export and assign in the same statement
|
||||
export <varname> # Copy Bash variable
|
||||
declare -x <varname> # Copy Bash variable
|
||||
|
||||
array[0]=valA # how to define an array
|
||||
array[1]=valB
|
||||
array[2]=valC
|
||||
array=([2]=valC [0]=valA [1]=valB) # another way
|
||||
array=(valA valB valC) # and another
|
||||
|
||||
${array[i]} # displays array's value for this index. If no index is supplied, array element 0 is assumed
|
||||
${#array[i]} # to find out the length of any element in the array
|
||||
${#array[@]} # to find out how many values there are in the array
|
||||
|
||||
declare -a # the variables are treated as arrays
|
||||
declare -f # uses function names only
|
||||
declare -F # displays function names without definitions
|
||||
declare -i # the variables are treated as integers
|
||||
declare -r # makes the variables read-only
|
||||
declare -x # marks the variables for export via the environment
|
||||
declare -l # uppercase values in the variable are converted to lowercase
|
||||
declare -A # makes it an associative array
|
||||
|
||||
${varname:-word} # if varname exists and isn't null, return its value; otherwise return word
|
||||
${varname:word} # if varname exists and isn't null, return its value; otherwise return word
|
||||
${varname:=word} # if varname exists and isn't null, return its value; otherwise set it word and then return its value
|
||||
${varname:?message} # if varname exists and isn't null, return its value; otherwise print varname, followed by message and abort the current command or script
|
||||
${varname:+word} # if varname exists and isn't null, return word; otherwise return null
|
||||
${varname:offset:length} # performs substring expansion. It returns the substring of $varname starting at offset and up to length characters
|
||||
|
||||
${variable#pattern} # if the pattern matches the beginning of the variable's value, delete the shortest part that matches and return the rest
|
||||
${variable##pattern} # if the pattern matches the beginning of the variable's value, delete the longest part that matches and return the rest
|
||||
${variable%pattern} # if the pattern matches the end of the variable's value, delete the shortest part that matches and return the rest
|
||||
${variable%%pattern} # if the pattern matches the end of the variable's value, delete the longest part that matches and return the rest
|
||||
${variable/pattern/string} # the longest match to pattern in variable is replaced by string. Only the first match is replaced
|
||||
${variable//pattern/string} # the longest match to pattern in variable is replaced by string. All matches are replaced
|
||||
|
||||
${#varname} # returns the length of the value of the variable as a character string
|
||||
|
||||
*(patternlist) # matches zero or more occurrences of the given patterns
|
||||
+(patternlist) # matches one or more occurrences of the given patterns
|
||||
?(patternlist) # matches zero or one occurrence of the given patterns
|
||||
@(patternlist) # matches exactly one of the given patterns
|
||||
!(patternlist) # matches anything except one of the given patterns
|
||||
|
||||
$(UNIX command) # command substitution: runs the command and returns standard output
|
||||
|
||||
typeset -l <x> # makes variable local - <x> must be an interger
|
||||
|
||||
##############################################################################
|
||||
# FUNCTIONS
|
||||
##############################################################################
|
||||
|
||||
|
||||
# The function refers to passed arguments by position (as if they were positional parameters), that is, $1, $2, and so forth.
|
||||
# $@ is equal to "$1" "$2"... "$N", where N is the number of positional parameters. $# holds the number of positional parameters.
|
||||
|
||||
|
||||
function functname() {
|
||||
shell commands
|
||||
}
|
||||
|
||||
unset -f functname # deletes a function definition
|
||||
declare -f # displays all defined functions in your login session
|
||||
|
||||
|
||||
##############################################################################
|
||||
# FLOW CONTROLS
|
||||
##############################################################################
|
||||
|
||||
|
||||
statement1 && statement2 # and operator
|
||||
statement1 || statement2 # or operator
|
||||
|
||||
-a # and operator inside a test conditional expression
|
||||
-o # or operator inside a test conditional expression
|
||||
|
||||
# STRINGS
|
||||
|
||||
str1 == str2 # str1 matches str2
|
||||
str1 != str2 # str1 does not match str2
|
||||
str1 < str2 # str1 is less than str2 (alphabetically)
|
||||
str1 > str2 # str1 is greater than str2 (alphabetically)
|
||||
str1 \> str2 # str1 is sorted after str2
|
||||
str1 \< str2 # str1 is sorted before str2
|
||||
-n str1 # str1 is not null (has length greater than 0)
|
||||
-z str1 # str1 is null (has length 0)
|
||||
|
||||
# FILES
|
||||
|
||||
-a file # file exists or its compilation is successful
|
||||
-d file # file exists and is a directory
|
||||
-e file # file exists; same -a
|
||||
-f file # file exists and is a regular file (i.e., not a directory or other special type of file)
|
||||
-r file # you have read permission
|
||||
-s file # file exists and is not empty
|
||||
-w file # your have write permission
|
||||
-x file # you have execute permission on file, or directory search permission if it is a directory
|
||||
-N file # file was modified since it was last read
|
||||
-O file # you own file
|
||||
-G file # file's group ID matches yours (or one of yours, if you are in multiple groups)
|
||||
file1 -nt file2 # file1 is newer than file2
|
||||
file1 -ot file2 # file1 is older than file2
|
||||
|
||||
# NUMBERS
|
||||
|
||||
-lt # less than
|
||||
-le # less than or equal
|
||||
-eq # equal
|
||||
-ge # greater than or equal
|
||||
-gt # greater than
|
||||
-ne # not equal
|
||||
|
||||
if condition
|
||||
then
|
||||
statements
|
||||
[elif condition
|
||||
then statements...]
|
||||
[else
|
||||
statements]
|
||||
fi
|
||||
|
||||
for x in {1..10}
|
||||
do
|
||||
statements
|
||||
done
|
||||
|
||||
for name [in list]
|
||||
do
|
||||
statements that can use $name
|
||||
done
|
||||
|
||||
for (( initialisation ; ending condition ; update ))
|
||||
do
|
||||
statements...
|
||||
done
|
||||
|
||||
case expression in
|
||||
pattern1 )
|
||||
statements ;;
|
||||
pattern2 )
|
||||
statements ;;
|
||||
esac
|
||||
|
||||
select name [in list]
|
||||
do
|
||||
statements that can use $name
|
||||
done
|
||||
|
||||
while condition; do
|
||||
statements
|
||||
done
|
||||
|
||||
until condition; do
|
||||
statements
|
||||
done
|
||||
|
||||
##############################################################################
|
||||
# COMMAND-LINE PROCESSING CYCLE
|
||||
##############################################################################
|
||||
|
||||
|
||||
# The default order for command lookup is functions, followed by built-ins, with scripts and executables last.
|
||||
# There are three built-ins that you can use to override this order: `command`, `builtin` and `enable`.
|
||||
|
||||
command # removes alias and function lookup. Only built-ins and commands found in the search path are executed
|
||||
builtin # looks up only built-in commands, ignoring functions and commands found in PATH
|
||||
enable # enables and disables shell built-ins
|
||||
|
||||
eval # takes arguments and run them through the command-line processing steps all over again
|
||||
|
||||
|
||||
##############################################################################
|
||||
# INPUT/OUTPUT REDIRECTORS
|
||||
##############################################################################
|
||||
|
||||
|
||||
cmd1|cmd2 # pipe; takes standard output of cmd1 as standard input to cmd2
|
||||
< file # takes standard input from file
|
||||
> file # directs standard output to file
|
||||
>> file # directs standard output to file; append to file if it already exists
|
||||
>|file # forces standard output to file even if noclobber is set
|
||||
n>|file # forces output to file from file descriptor n even if noclobber is set
|
||||
<> file # uses file as both standard input and standard output
|
||||
n<>file # uses file as both input and output for file descriptor n
|
||||
n>file # directs file descriptor n to file
|
||||
n<file # takes file descriptor n from file
|
||||
n>>file # directs file description n to file; append to file if it already exists
|
||||
n>& # duplicates standard output to file descriptor n
|
||||
n<& # duplicates standard input from file descriptor n
|
||||
n>&m # file descriptor n is made to be a copy of the output file descriptor
|
||||
n<&m # file descriptor n is made to be a copy of the input file descriptor
|
||||
&>file # directs standard output and standard error to file
|
||||
<&- # closes the standard input
|
||||
>&- # closes the standard output
|
||||
n>&- # closes the ouput from file descriptor n
|
||||
n<&- # closes the input from file descriptor n
|
||||
|
||||
|tee <file># output command to both terminal and a file (-a to append to file)
|
||||
|
||||
|
||||
##############################################################################
|
||||
# PROCESS HANDLING
|
||||
##############################################################################
|
||||
|
||||
|
||||
# To suspend a job, type CTRL+Z while it is running. You can also suspend a job with CTRL+Y.
|
||||
# This is slightly different from CTRL+Z in that the process is only stopped when it attempts to read input from terminal.
|
||||
# Of course, to interrupt a job, type CTRL+C.
|
||||
|
||||
myCommand & # runs job in the background and prompts back the shell
|
||||
|
||||
jobs # lists all jobs (use with -l to see associated PID)
|
||||
|
||||
fg # brings a background job into the foreground
|
||||
fg %+ # brings most recently invoked background job
|
||||
fg %- # brings second most recently invoked background job
|
||||
fg %N # brings job number N
|
||||
fg %string # brings job whose command begins with string
|
||||
fg %?string # brings job whose command contains string
|
||||
|
||||
kill -l # returns a list of all signals on the system, by name and number
|
||||
kill PID # terminates process with specified PID
|
||||
kill -s SIGKILL 4500 # sends a signal to force or terminate the process
|
||||
kill -15 913 # Ending PID 913 process with signal 15 (TERM)
|
||||
kill %1 # Where %1 is the number of job as read from 'jobs' command.
|
||||
|
||||
ps # prints a line of information about the current running login shell and any processes running under it
|
||||
ps -a # selects all processes with a tty except session leaders
|
||||
|
||||
trap cmd sig1 sig2 # executes a command when a signal is received by the script
|
||||
trap "" sig1 sig2 # ignores that signals
|
||||
trap - sig1 sig2 # resets the action taken when the signal is received to the default
|
||||
|
||||
disown <PID|JID> # removes the process from the list of jobs
|
||||
|
||||
wait # waits until all background jobs have finished
|
||||
sleep <number> # wait # of seconds before continuing
|
||||
|
||||
pv # display progress bar for data handling commands. often used with pipe like |pv
|
||||
yes # give yes response everytime an input is requested from script/process
|
||||
|
||||
|
||||
##############################################################################
|
||||
# TIPS & TRICKS
|
||||
##############################################################################
|
||||
|
||||
|
||||
# set an alias
|
||||
cd; nano .bash_profile
|
||||
> alias gentlenode='ssh admin@gentlenode.com -p 3404' # add your alias in .bash_profile
|
||||
|
||||
# to quickly go to a specific directory
|
||||
cd; nano .bashrc
|
||||
> shopt -s cdable_vars
|
||||
> export websites="/Users/mac/Documents/websites"
|
||||
|
||||
source .bashrc
|
||||
cd $websites
|
||||
|
||||
|
||||
##############################################################################
|
||||
# DEBUGGING SHELL PROGRAMS
|
||||
##############################################################################
|
||||
|
||||
|
||||
bash -n scriptname # don't run commands; check for syntax errors only
|
||||
set -o noexec # alternative (set option in script)
|
||||
|
||||
bash -v scriptname # echo commands before running them
|
||||
set -o verbose # alternative (set option in script)
|
||||
|
||||
bash -x scriptname # echo commands after command-line processing
|
||||
set -o xtrace # alternative (set option in script)
|
||||
|
||||
trap 'echo $varname' EXIT # useful when you want to print out the values of variables at the point that your script exits
|
||||
|
||||
function errtrap {
|
||||
es=$?
|
||||
echo "ERROR line $1: Command exited with status $es."
|
||||
}
|
||||
|
||||
trap 'errtrap $LINENO' ERR # is run whenever a command in the surrounding script or function exits with non-zero status
|
||||
|
||||
function dbgtrap {
|
||||
echo "badvar is $badvar"
|
||||
}
|
||||
|
||||
trap dbgtrap DEBUG # causes the trap code to be executed before every statement in a function or script
|
||||
# ...section of code in which the problem occurs...
|
||||
trap - DEBUG # turn off the DEBUG trap
|
||||
|
||||
function returntrap {
|
||||
echo "A return occurred"
|
||||
}
|
||||
|
||||
trap returntrap RETURN # is executed each time a shell function or a script executed with the . or source commands finishes executing
|
||||
|
||||
##############################################################################
|
||||
# COLORS AND BACKGROUNDS
|
||||
##############################################################################
|
||||
# note: \e or \x1B also work instead of \033
|
||||
# Reset
|
||||
Color_Off='\033[0m' # Text Reset
|
||||
|
||||
# Regular Colors
|
||||
Black='\033[0;30m' # Black
|
||||
Red='\033[0;31m' # Red
|
||||
Green='\033[0;32m' # Green
|
||||
Yellow='\033[0;33m' # Yellow
|
||||
Blue='\033[0;34m' # Blue
|
||||
Purple='\033[0;35m' # Purple
|
||||
Cyan='\033[0;36m' # Cyan
|
||||
White='\033[0;97m' # White
|
||||
|
||||
# Additional colors
|
||||
LGrey='\033[0;37m' # Light Gray
|
||||
DGrey='\033[0;90m' # Dark Gray
|
||||
LRed='\033[0;91m' # Light Red
|
||||
LGreen='\033[0;92m' # Light Green
|
||||
LYellow='\033[0;93m'# Light Yellow
|
||||
LBlue='\033[0;94m' # Light Blue
|
||||
LPurple='\033[0;95m'# Light Purple
|
||||
LCyan='\033[0;96m' # Light Cyan
|
||||
|
||||
|
||||
# Bold
|
||||
BBlack='\033[1;30m' # Black
|
||||
BRed='\033[1;31m' # Red
|
||||
BGreen='\033[1;32m' # Green
|
||||
BYellow='\033[1;33m'# Yellow
|
||||
BBlue='\033[1;34m' # Blue
|
||||
BPurple='\033[1;35m'# Purple
|
||||
BCyan='\033[1;36m' # Cyan
|
||||
BWhite='\033[1;37m' # White
|
||||
|
||||
# Underline
|
||||
UBlack='\033[4;30m' # Black
|
||||
URed='\033[4;31m' # Red
|
||||
UGreen='\033[4;32m' # Green
|
||||
UYellow='\033[4;33m'# Yellow
|
||||
UBlue='\033[4;34m' # Blue
|
||||
UPurple='\033[4;35m'# Purple
|
||||
UCyan='\033[4;36m' # Cyan
|
||||
UWhite='\033[4;37m' # White
|
||||
|
||||
# Background
|
||||
On_Black='\033[40m' # Black
|
||||
On_Red='\033[41m' # Red
|
||||
On_Green='\033[42m' # Green
|
||||
On_Yellow='\033[43m'# Yellow
|
||||
On_Blue='\033[44m' # Blue
|
||||
On_Purple='\033[45m'# Purple
|
||||
On_Cyan='\033[46m' # Cyan
|
||||
On_White='\033[47m' # White
|
||||
|
||||
# Example of usage
|
||||
echo -e "${Green}This is GREEN text${Color_Off} and normal text"
|
||||
echo -e "${Red}${On_White}This is Red test on White background${Color_Off}"
|
||||
# option -e is mandatory, it enable interpretation of backslash escapes
|
||||
printf "${Red} This is red \n"
|
||||
```
|
||||
@@ -0,0 +1,22 @@
|
||||
<script setup lang="ts">
|
||||
import { useThemeVars } from 'naive-ui';
|
||||
import Memo from './bash-memo.content.md';
|
||||
|
||||
const themeVars = useThemeVars();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<Memo />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
::v-deep(pre) {
|
||||
margin: 0;
|
||||
padding: 15px 22px;
|
||||
background-color: v-bind('themeVars.cardColor');
|
||||
border-radius: 4px;
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,13 @@
|
||||
import { Command } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'Bash Cheatsheet',
|
||||
path: '/bash-memo',
|
||||
description: 'Bash common commands',
|
||||
keywords: ['bash', 'shell'],
|
||||
component: () => import('./bash-memo.vue'),
|
||||
icon: Command,
|
||||
createdAt: new Date('2025-05-08'),
|
||||
category: 'Cheatsheets',
|
||||
});
|
||||
@@ -5,6 +5,7 @@ import type {
|
||||
Key,
|
||||
PrivateKey, Signature,
|
||||
} from 'sshpk';
|
||||
import 'webcrypto-liner-shim';
|
||||
import type * as openpgp from 'openpgp';
|
||||
import * as forge from 'node-forge';
|
||||
import oids from './oids.json';
|
||||
@@ -63,6 +64,11 @@ export function getPublicKeyLabelValues(publicKey: Key) {
|
||||
value: onErrorReturnErrorMessage(() => publicKey.fingerprint('sha512')),
|
||||
multiline: true,
|
||||
},
|
||||
{
|
||||
label: 'Key (PEM):',
|
||||
value: onErrorReturnErrorMessage(() => publicKey.toString('pem')),
|
||||
multiline: true,
|
||||
},
|
||||
] as LabelValue[];
|
||||
}
|
||||
|
||||
@@ -99,6 +105,11 @@ export function getPrivateKeyLabelValues(privateKey: PrivateKey) {
|
||||
value: onErrorReturnErrorMessage(() => privateKey.fingerprint('sha512')),
|
||||
multiline: true,
|
||||
},
|
||||
{
|
||||
label: 'Key (PEM):',
|
||||
value: onErrorReturnErrorMessage(() => privateKey.toString('pem')),
|
||||
multiline: true,
|
||||
},
|
||||
] as LabelValue[];
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ import type {
|
||||
PrivateKey, Signature, SignatureFormatType,
|
||||
} from 'sshpk';
|
||||
import { Base64 } from 'js-base64';
|
||||
import 'webcrypto-liner-shim';
|
||||
import * as openpgp from 'openpgp';
|
||||
import * as forge from 'node-forge';
|
||||
import { type LabelValue, getCSRLabelValues, getCertificateLabelValues, getFingerprintLabelValues, getPGPPrivateKeyLabelValuesAsync, getPGPPublicKeyLabelValuesAsync, getPrivateKeyLabelValues, getPublicKeyLabelValues, getSignatureLabelValues } from './certificate-key-parser.infos';
|
||||
|
||||
@@ -47,14 +47,21 @@ const parsedSections = computedAsync<LabelValue[][]>(async () => {
|
||||
else if (inputType.value === 'content' && inputContent) {
|
||||
inputKeyOrCertificateValue = inputContent;
|
||||
}
|
||||
const parsed = await getKeysOrCertificatesInfosAsync(inputKeyOrCertificateValue, passphrase.value);
|
||||
if (parsed.length === 1) {
|
||||
const { values, certificateX509DER: certPEM } = parsed[0];
|
||||
certificateX509DER.value = certPEM || '';
|
||||
return [values];
|
||||
try {
|
||||
const parsed = await getKeysOrCertificatesInfosAsync(inputKeyOrCertificateValue, passphrase.value);
|
||||
if (parsed.length === 1) {
|
||||
const { values, certificateX509DER: certPEM } = parsed[0];
|
||||
certificateX509DER.value = certPEM || '';
|
||||
return [values];
|
||||
}
|
||||
else {
|
||||
return parsed.map(p => p.values);
|
||||
}
|
||||
}
|
||||
else {
|
||||
return parsed.map(p => p.values);
|
||||
catch (e: any) {
|
||||
return [
|
||||
[{ label: 'Parsing Error', value: e.toString() }],
|
||||
];
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -21,7 +21,7 @@ function getCountDownHref(c: CountDown) {
|
||||
|
||||
const days = useQueryParam({ name: 'd', defaultValue: 0 });
|
||||
const hours = useQueryParam({ name: 'h', defaultValue: 0 });
|
||||
const minutes = useQueryParam({ name: 'm', defaultValue: 15 });
|
||||
const minutes = useQueryParam({ name: 'm', defaultValue: 0 });
|
||||
const seconds = useQueryParam({ name: 's', defaultValue: 0 });
|
||||
const history = useStorage<CountDown[]>('countdown:hst', []);
|
||||
|
||||
@@ -72,6 +72,23 @@ function ended() {
|
||||
if (status.value === 'running') {
|
||||
status.value = 'ended';
|
||||
}
|
||||
if (document.fullscreenElement) {
|
||||
document.exitFullscreen?.();
|
||||
}
|
||||
}
|
||||
|
||||
const fullScreenElement = ref<HTMLElement>();
|
||||
function toggleFullScreen() {
|
||||
const element = fullScreenElement.value;
|
||||
if (!element) {
|
||||
return;
|
||||
}
|
||||
if (!document.fullscreenElement) {
|
||||
element?.requestFullscreen();
|
||||
}
|
||||
else {
|
||||
document.exitFullscreen?.();
|
||||
}
|
||||
}
|
||||
|
||||
const isEnded = computed(() => status.value === 'ended');
|
||||
@@ -112,19 +129,19 @@ const isEnded = computed(() => status.value === 'ended');
|
||||
</div>
|
||||
</c-card>
|
||||
|
||||
<Countdown :deadline="deadlineFormatted" :stop="status !== 'running'" mb-2 @time-elapsed="ended()" />
|
||||
<div id="fullScreenElement" ref="fullScreenElement" mb-2>
|
||||
<div>
|
||||
<Countdown :deadline="deadlineFormatted" :stop="status !== 'running'" mb-2 countdown-size="4rem" @time-elapsed="ended()" />
|
||||
|
||||
<n-p align="center">
|
||||
Alarm at: {{ deadlineDate }}
|
||||
</n-p>
|
||||
|
||||
<div mb-2 flex justify-center>
|
||||
<c-button
|
||||
:disabled="status === 'stopped'"
|
||||
@click="stop"
|
||||
>
|
||||
Stop
|
||||
</c-button>
|
||||
<div mb-2 flex justify-center>
|
||||
<c-button
|
||||
:disabled="status === 'stopped'"
|
||||
@click="toggleFullScreen"
|
||||
>
|
||||
Toggle Fullscreen
|
||||
</c-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<n-modal v-model:show="isEnded" mask-closable="false">
|
||||
@@ -145,6 +162,19 @@ const isEnded = computed(() => status.value === 'ended');
|
||||
</n-card>
|
||||
</n-modal>
|
||||
|
||||
<div mb-2 flex justify-center>
|
||||
<c-button
|
||||
:disabled="status === 'stopped'"
|
||||
@click="stop"
|
||||
>
|
||||
Stop
|
||||
</c-button>
|
||||
</div>
|
||||
|
||||
<n-p align="center">
|
||||
Alarm at: {{ deadlineDate }}
|
||||
</n-p>
|
||||
|
||||
<c-card v-if="history" title="History">
|
||||
<div flex justify-center gap-1>
|
||||
<template v-for="(entry, index) in history" :key="index">
|
||||
@@ -162,3 +192,12 @@ const isEnded = computed(() => status.value === 'ended');
|
||||
<audio ref="audio" loop src="/Beep.mp3" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
#fullScreenElement:fullscreen {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,190 @@
|
||||
<script setup lang="ts">
|
||||
import { Countdown } from 'vue3-flip-countdown';
|
||||
import { parseExpression } from 'cron-parser';
|
||||
import moment from 'moment';
|
||||
import { useQueryParam } from '@/composable/queryParams';
|
||||
|
||||
const allDays = '0,1,2,3,4,5,6';
|
||||
const alarmAt = useQueryParam({ name: 'at', defaultValue: '17:30:00' });
|
||||
const alarmDays = useQueryParam({ name: 'days', defaultValue: allDays });
|
||||
const history = useStorage<{ days: string; at: string }[]>('cronalarm:hst', []);
|
||||
|
||||
function getTimeHref(at: string, days: string) {
|
||||
const parsedUrl = new URL(window.location.href);
|
||||
parsedUrl.searchParams.set('at', at);
|
||||
parsedUrl.searchParams.set('days', days);
|
||||
return parsedUrl.toString();
|
||||
}
|
||||
|
||||
const status = ref<'stopped' | 'ended' | 'running'>('stopped');
|
||||
|
||||
const audio = ref<HTMLAudioElement | null>(null);
|
||||
|
||||
watchEffect(() => {
|
||||
if (status.value === 'ended') {
|
||||
audio.value?.play();
|
||||
}
|
||||
});
|
||||
|
||||
const now = ref(moment());
|
||||
const daysArray = computed<string[]>({
|
||||
get() {
|
||||
return (alarmDays.value || allDays).split(',').map(s => s.trim());
|
||||
},
|
||||
set(newValue) {
|
||||
alarmDays.value = newValue.join(',');
|
||||
},
|
||||
});
|
||||
const cronExpression = computed(() => {
|
||||
const [h, m, s] = alarmAt.value.split(':');
|
||||
return `${s} ${m} ${h} * * ${alarmDays.value}`;
|
||||
});
|
||||
const alarmAtDate = computed(() => {
|
||||
const interval = parseExpression(cronExpression.value);
|
||||
return interval.next().toDate();
|
||||
});
|
||||
|
||||
const fmt = 'YYYY-MM-DD HH:mm:ss';
|
||||
const alarmAtFormatted = computed(() => {
|
||||
return moment(alarmAtDate.value).format(fmt);
|
||||
});
|
||||
|
||||
function start() {
|
||||
now.value = moment();
|
||||
status.value = 'running';
|
||||
const histoEntry = { at: alarmAt.value, days: alarmDays.value };
|
||||
if (!history.value.find(h => h.at === histoEntry.at && h.days === histoEntry.days)) {
|
||||
history.value = [histoEntry, ...history.value];
|
||||
}
|
||||
}
|
||||
|
||||
function stop() {
|
||||
status.value = 'stopped';
|
||||
audio.value?.pause();
|
||||
}
|
||||
|
||||
function ended() {
|
||||
if (status.value === 'running') {
|
||||
status.value = 'ended';
|
||||
}
|
||||
if (document.fullscreenElement) {
|
||||
document.exitFullscreen?.();
|
||||
}
|
||||
}
|
||||
|
||||
const fullScreenElement = ref<HTMLElement>();
|
||||
function toggleFullScreen() {
|
||||
const element = fullScreenElement.value;
|
||||
if (!element) {
|
||||
return;
|
||||
}
|
||||
if (!document.fullscreenElement) {
|
||||
element?.requestFullscreen();
|
||||
}
|
||||
else {
|
||||
document.exitFullscreen?.();
|
||||
}
|
||||
}
|
||||
|
||||
const isEnded = computed(() => status.value === 'ended');
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div max-w-600px>
|
||||
<c-card :disabled="status !== 'stopped'" title="Alarm" mb-4>
|
||||
<div mb-1 flex justify-center>
|
||||
<n-form-item label="Alarm at:" label-placement="left">
|
||||
<n-time-picker v-model:formatted-value="alarmAt" />
|
||||
</n-form-item>
|
||||
</div>
|
||||
<div flex justify-center>
|
||||
<n-checkbox-group v-model:value="daysArray">
|
||||
<n-space item-style="display: flex;">
|
||||
<n-checkbox value="1" label="Monday" />
|
||||
<n-checkbox value="2" label="Tuesday" />
|
||||
<n-checkbox value="3" label="Wednesday" />
|
||||
<n-checkbox value="4" label="Thursday" />
|
||||
<n-checkbox value="5" label="Friday" />
|
||||
<n-checkbox value="6" label="Saturday" />
|
||||
<n-checkbox value="0" label="Sunday" />
|
||||
</n-space>
|
||||
</n-checkbox-group>
|
||||
</div>
|
||||
|
||||
<div flex justify-center>
|
||||
<c-button
|
||||
@click="start"
|
||||
>
|
||||
Start
|
||||
</c-button>
|
||||
</div>
|
||||
</c-card>
|
||||
|
||||
<div id="fullScreenElement" ref="fullScreenElement" mb-2>
|
||||
<div>
|
||||
<Countdown :deadline="alarmAtFormatted" :stop="status !== 'running'" mb-2 @time-elapsed="ended()" />
|
||||
<div mb-2 flex justify-center>
|
||||
<c-button
|
||||
:disabled="status === 'stopped'"
|
||||
@click="toggleFullScreen"
|
||||
>
|
||||
Toggle Fullscreen
|
||||
</c-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div mb-2 flex justify-center>
|
||||
<c-button
|
||||
:disabled="status === 'stopped'"
|
||||
@click="stop"
|
||||
>
|
||||
Stop
|
||||
</c-button>
|
||||
</div>
|
||||
|
||||
<n-p align="center">
|
||||
Next alarm at: {{ alarmAtDate }}
|
||||
</n-p>
|
||||
|
||||
<n-modal v-model:show="isEnded" mask-closable="false">
|
||||
<n-card
|
||||
style="width: 600px"
|
||||
title="Timer finished"
|
||||
:bordered="false"
|
||||
size="huge"
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
>
|
||||
<p>Timer elapsed!</p>
|
||||
<template #footer>
|
||||
<n-button @click="stop()">
|
||||
OK
|
||||
</n-button>
|
||||
</template>
|
||||
</n-card>
|
||||
</n-modal>
|
||||
|
||||
<c-card v-if="history" title="History">
|
||||
<div flex justify-center gap-1>
|
||||
<template v-for="(entry, index) in history" :key="index">
|
||||
{{ index > 0 ? ' / ' : '' }}
|
||||
<n-a :href="getTimeHref(entry.at, entry.days)">
|
||||
At: {{ entry.at }} ; Days: {{ entry.days || '*' }}
|
||||
</n-a>
|
||||
</template>
|
||||
</div>
|
||||
</c-card>
|
||||
|
||||
<audio ref="audio" loop src="/Beep.mp3" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
#fullScreenElement:fullscreen {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,13 @@
|
||||
import { Alarm } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'Cron/Weekday Alarm',
|
||||
path: '/cron-alarm',
|
||||
description: 'Alarm based on time and weekdays expression',
|
||||
keywords: ['cron', 'week', 'day', 'alarm'],
|
||||
component: () => import('./cron-alarm.vue'),
|
||||
icon: Alarm,
|
||||
createdAt: new Date('2025-04-21'),
|
||||
category: 'Datetime',
|
||||
});
|
||||
@@ -0,0 +1,26 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { generateHtpasswd } from './htpasswd-generator.service';
|
||||
|
||||
describe('htpasswd-generator', () => {
|
||||
it('generate correct entries', () => {
|
||||
const commonValues = { username: 'a', password: 'a' };
|
||||
|
||||
expect(generateHtpasswd({ ...commonValues, saltRounds: 10, algorithm: 'bcrypt' })).toContain('a:$2a$10$');
|
||||
expect(generateHtpasswd({ ...commonValues, salt: 'k9azwE5H', algorithm: 'apr1' })).toBe('a:$apr1$k9azwE5H$zIyj4gqCWXiwB2Iof6jHf1');
|
||||
expect(generateHtpasswd({ ...commonValues, salt: 'xs4x6VWJ', algorithm: 'md5' })).toBe('a:$1$xs4x6VWJ$lOH0fBF6QyWdTOEeqcFnP/');
|
||||
expect(generateHtpasswd({ ...commonValues, salt: 'grEPbuEp', algorithm: 'sha256' })).toBe('a:$5$grEPbuEp$DUmEMT5C4TRgZCs9ZFKOJZ/IgR5FJIOUH0dasQFPw57');
|
||||
expect(generateHtpasswd({ ...commonValues, salt: 'ud.q0DEx', algorithm: 'sha512' })).toBe('a:$6$ud.q0DEx$qEMZW6k/1q3ABm4af1WrFdUj1Mc2vCFxnVNHy/pDyk1L8JjoNwzRABgAHnpRON/xrdD/f9Neo6HNIU1z1LQk9.');
|
||||
expect(generateHtpasswd({ ...commonValues, salt: 'Uk8SVGLsBuSmD75R', algorithm: 'sha512' })).toBe('a:$6$Uk8SVGLsBuSmD75R$GKnMHXxioi7K97EOtIypnjBLQQVLRyMzF1FTjNhvULyuEDOWdYngkgNTxxAdYchQ9Q0BRC3gka/NSA5RoOFzY.');
|
||||
});
|
||||
|
||||
it('generate correct entries (unicode)', () => {
|
||||
const commonValues = { username: 'a', password: 'àùé' };
|
||||
|
||||
expect(generateHtpasswd({ ...commonValues, saltRounds: 10, algorithm: 'bcrypt' })).toContain('a:$2a$10$');
|
||||
expect(() => generateHtpasswd({ ...commonValues, salt: 'mL016JCr', algorithm: 'apr1' })).toThrow();
|
||||
expect(() => generateHtpasswd({ ...commonValues, salt: 'YshCU1p1', algorithm: 'md5' })).toThrow();
|
||||
expect(generateHtpasswd({ ...commonValues, salt: 'Rojf48Kp', algorithm: 'sha256' })).toBe('a:$5$Rojf48Kp$/dY3S.yDqW2ZH/YKrF85q6JszyP.bhIF/Qu31Q49Oa5');
|
||||
expect(generateHtpasswd({ ...commonValues, salt: '1BPDHHko', algorithm: 'sha512' })).toBe('a:$6$1BPDHHko$jKZNRvgloMD2eAyyPRZt59hOifLwCK0FCSNr35eVgQd0tK0LJQWIp1IsmomVjHWUjiSWjSiP9AGO.G8FbkV3a.');
|
||||
expect(generateHtpasswd({ ...commonValues, salt: 'Uk8SVGLsBuSmD75R', algorithm: 'sha512' })).toBe('a:$6$Uk8SVGLsBuSmD75R$j7tejonAnUpOkwVTzTwQnfmq14SDJsGaFvW67m2pLCeaCjy.IT0aniZaRFnx3Azh9x5Lui60F76F9K6mZRbma.');
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,56 @@
|
||||
import { hashSync } from 'bcryptjs';
|
||||
import { encrypt } from 'unixcrypt-browser';
|
||||
import md5 from 'apache-md5';
|
||||
import { multiRandFromArray } from '@/utils/random';
|
||||
|
||||
const itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
|
||||
|
||||
export function generateHtpasswd({
|
||||
username,
|
||||
password,
|
||||
algorithm,
|
||||
salt = null,
|
||||
saltRounds = 10,
|
||||
}: {
|
||||
username: string
|
||||
password: string
|
||||
algorithm: 'bcrypt' | 'md5' | 'apr1' | 'sha256' | 'sha512'
|
||||
salt?: string | null
|
||||
saltRounds?: number
|
||||
}): string {
|
||||
const generateSalt = (length: number) => multiRandFromArray([...itoa64], length).join('');
|
||||
let hash: string;
|
||||
const finalSalt = salt || generateSalt(algorithm === 'sha512' ? 16 : 8);
|
||||
// eslint-disable-next-line no-control-regex
|
||||
const non_ascii = /[^\x00-\x7F]/;
|
||||
|
||||
switch (algorithm) {
|
||||
case 'bcrypt':
|
||||
hash = hashSync(password, saltRounds);
|
||||
break;
|
||||
case 'md5':
|
||||
|
||||
if (non_ascii.test(password)) {
|
||||
throw new Error('MD5 does not currently support non ASCII characters');
|
||||
}
|
||||
hash = md5(password, `$1$${finalSalt}`);
|
||||
break;
|
||||
case 'apr1':
|
||||
|
||||
if (non_ascii.test(password)) {
|
||||
throw new Error('MD5 does not currently support non ASCII characters');
|
||||
}
|
||||
hash = md5(password, `$apr1$${finalSalt}`);
|
||||
break;
|
||||
case 'sha256':
|
||||
hash = encrypt(password, `$5$${finalSalt}`);
|
||||
break;
|
||||
case 'sha512':
|
||||
hash = encrypt(password, `$6$${finalSalt}`);
|
||||
break;
|
||||
default:
|
||||
throw new Error('Unsupported algorithm');
|
||||
}
|
||||
|
||||
return `${username}:${hash}`;
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { hashSync } from 'bcryptjs';
|
||||
import md5 from 'apache-md5';
|
||||
import { generateHtpasswd } from './htpasswd-generator.service';
|
||||
import TextareaCopyable from '@/components/TextareaCopyable.vue';
|
||||
|
||||
const username = ref('');
|
||||
@@ -8,18 +7,25 @@ const password = ref('');
|
||||
const hashMethod = ref('bcrypt');
|
||||
const saltCount = ref(10);
|
||||
|
||||
const algos = [
|
||||
{ value: 'bcrypt', label: 'Bcrypt' },
|
||||
{ value: 'md5', label: 'MD5' },
|
||||
{ value: 'apr1', label: 'Apache MD5 (apr1)' },
|
||||
{ value: 'sha256', label: 'SHA256' },
|
||||
{ value: 'sha512', label: 'SHA512' },
|
||||
];
|
||||
|
||||
const htpasswd = computed(() => {
|
||||
if (username.value === '' || password.value === '') {
|
||||
return '# username and password must not be empty';
|
||||
}
|
||||
let hash;
|
||||
if (hashMethod.value === 'md5') {
|
||||
hash = md5(password.value);
|
||||
}
|
||||
else {
|
||||
hash = hashSync(password.value, saltCount.value);
|
||||
}
|
||||
return `${username.value}:${hash}`;
|
||||
|
||||
return generateHtpasswd({
|
||||
username: username.value,
|
||||
password: password.value,
|
||||
saltRounds: saltCount.value,
|
||||
algorithm: hashMethod.value as never,
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -44,10 +50,11 @@ const htpasswd = computed(() => {
|
||||
<c-select
|
||||
v-model:value="hashMethod"
|
||||
label="Hash method:"
|
||||
:options="['bcrypt', 'md5']"
|
||||
:options="algos"
|
||||
mb-2
|
||||
/>
|
||||
|
||||
<n-form-item v-if="hashMethod === 'bcrypt'" label="Salt count: " label-placement="left" label-width="120">
|
||||
<n-form-item v-if="hashMethod === 'bcrypt'" label="Salt rounds: " label-placement="left" label-width="120">
|
||||
<n-input-number v-model:value="saltCount" placeholder="Salt rounds..." :max="100" :min="0" w-full />
|
||||
</n-form-item>
|
||||
|
||||
|
||||
@@ -1,20 +1,16 @@
|
||||
<script setup lang="ts">
|
||||
import iesData from './ies-lighting-data.json';
|
||||
import { useFuzzySearch } from '@/composable/fuzzySearch';
|
||||
import useDebouncedRef from '@/composable/debouncedref';
|
||||
import { useFlexSearch } from '@/composable/flexSearch';
|
||||
|
||||
const data = iesData.map(i => ({ ...i, all: `${i.industryType} - ${i.industryApplication}` }));
|
||||
const searchQuery = useDebouncedRef('', 500);
|
||||
const data = iesData;
|
||||
const searchQuery = useDebouncedRef('', 250);
|
||||
|
||||
const { searchResult } = useFuzzySearch({
|
||||
const { searchResult } = useFlexSearch({
|
||||
search: searchQuery,
|
||||
data,
|
||||
options: {
|
||||
keys: ['all'],
|
||||
threshold: 0.2,
|
||||
isCaseSensitive: false,
|
||||
minMatchCharLength: 3,
|
||||
useExtendedSearch: true,
|
||||
keys: ['industryType', 'industryApplication', 'footCandlesRange', 'recommendedLighting'],
|
||||
filterEmpty: false,
|
||||
},
|
||||
});
|
||||
@@ -25,7 +21,7 @@ const { searchResult } = useFuzzySearch({
|
||||
<div flex items-center gap-3>
|
||||
<c-input-text
|
||||
v-model:value="searchQuery"
|
||||
placeholder="Search IES recommandation by industry or application"
|
||||
placeholder="Search IES recommendation by industry or application"
|
||||
mx-auto max-w-600px
|
||||
>
|
||||
<template #prefix>
|
||||
@@ -64,16 +60,16 @@ const { searchResult } = useFuzzySearch({
|
||||
<tbody>
|
||||
<tr v-for="(result, ix) in searchResult" :key="ix">
|
||||
<td>
|
||||
<input-copyable :value="result.industryType" />
|
||||
<input-copyable :readonly="true" :value="result.industryType" />
|
||||
</td>
|
||||
<td>
|
||||
<input-copyable :value="result.industryApplication" />
|
||||
<input-copyable :readonly="true" :value="result.industryApplication" />
|
||||
</td>
|
||||
<td>
|
||||
<input-copyable :value="result.footCandlesRange" />
|
||||
<input-copyable :readonly="true" :value="result.footCandlesRange" />
|
||||
</td>
|
||||
<td>
|
||||
<input-copyable :value="result.recommendedLighting" />
|
||||
<input-copyable :readonly="true" :value="result.recommendedLighting" />
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
@@ -1,30 +1,19 @@
|
||||
<script setup lang="ts">
|
||||
import CountriesDB from 'countries-db';
|
||||
import ISO6391 from 'iso-639-1';
|
||||
import { useFuzzySearch } from '@/composable/fuzzySearch';
|
||||
import useDebouncedRef from '@/composable/debouncedref';
|
||||
import { useFlexSearch } from '@/composable/flexSearch';
|
||||
|
||||
const searchQuery = useDebouncedRef('', 500);
|
||||
const countriesSearchData = Object.entries(CountriesDB.getAllCountries()).map(([_, info]) => {
|
||||
return {
|
||||
iso2: info.iso2,
|
||||
iso3: info.iso3,
|
||||
domain: info.domain,
|
||||
name: `${info.name} ${info.officialName}`,
|
||||
info,
|
||||
};
|
||||
});
|
||||
const limit = ref(100);
|
||||
const { searchResult } = useFuzzySearch({
|
||||
const searchQuery = useDebouncedRef('', 250);
|
||||
const countriesSearchData = Object.values(CountriesDB.getAllCountries());
|
||||
const limit = ref(20);
|
||||
const { searchResult } = useFlexSearch({
|
||||
search: searchQuery,
|
||||
data: countriesSearchData,
|
||||
options: {
|
||||
keys: ['name', { name: 'iso3', weight: 3 }, { name: 'iso2', weight: 2 }, 'domain'],
|
||||
threshold: 0.3,
|
||||
isCaseSensitive: false,
|
||||
useExtendedSearch: true,
|
||||
},
|
||||
limit: limit.value,
|
||||
limit,
|
||||
});
|
||||
|
||||
function langToName(code: string) {
|
||||
@@ -39,10 +28,7 @@ function langToName(code: string) {
|
||||
<template>
|
||||
<div mx-auto max-w-2400px important:flex-1>
|
||||
<div mx-auto max-w-600px flex justify-center gap-3>
|
||||
<c-input-text
|
||||
v-model:value="searchQuery"
|
||||
placeholder="Search Countries by name, iso2, iso3..."
|
||||
>
|
||||
<c-input-text v-model:value="searchQuery" placeholder="Search Countries by name, iso2, iso3...">
|
||||
<template #prefix>
|
||||
<icon-mdi-search mr-6px color-black op-70 dark:color-white />
|
||||
</template>
|
||||
@@ -53,12 +39,7 @@ function langToName(code: string) {
|
||||
</div>
|
||||
|
||||
<div v-if="searchQuery.trim().length > 0">
|
||||
<div
|
||||
v-if="searchResult.length === 0"
|
||||
mt-4
|
||||
text-20px
|
||||
font-bold
|
||||
>
|
||||
<div v-if="searchResult.length === 0" mt-4 text-20px font-bold>
|
||||
No results
|
||||
</div>
|
||||
|
||||
@@ -75,27 +56,132 @@ function langToName(code: string) {
|
||||
<tbody>
|
||||
<tr v-for="(result, ix) in searchResult" :key="ix">
|
||||
<td style="vertical-align: top">
|
||||
<input-copyable :value="result.iso2" />
|
||||
<input-copyable :value="result.iso3" />
|
||||
<input-copyable :value="result.iso2" :readonly="true" />
|
||||
<input-copyable :value="result.iso3" :readonly="true" />
|
||||
</td>
|
||||
<td>
|
||||
<input-copyable label-width="150px" label="Name" label-position="left" :value="result.name" mb-1 />
|
||||
<input-copyable label-width="150px" label="Official Name" label-position="left" :value="result.info.officialName" mb-1 />
|
||||
<input-copyable label-width="150px" label="Domain" label-position="left" :value="result.info.domain" mb-1 />
|
||||
<input-copyable label-width="150px" label="Emoji" label-position="left" :value="`${result.info.emoji} (${result.info.emojiUnicode})`" mb-1 />
|
||||
<input-copyable label-width="150px" label="ISO Num" label-position="left" :value="result.info.isoNumeric" mb-1 />
|
||||
<input-copyable label-width="150px" label="Continent" label-position="left" :value="result.info.continentId" mb-1 />
|
||||
<input-copyable label-width="150px" label="Elevation (m)" label-position="left" :value="result.info.elevation" mb-1 />
|
||||
<input-copyable label-width="150px" label="Population" label-position="left" :value="result.info.population" mb-1 />
|
||||
<input-copyable label-width="150px" label="Area (km²)" label-position="left" :value="result.info.areaSqKm" mb-1 />
|
||||
<input-copyable label-width="150px" label="Timezones" label-position="left" :value="result.info.timezones.join('\n')" mb-1 />
|
||||
<input-copyable label-width="150px" label="Currency" label-position="left" :value="`${result.info.currencyCode} / ${result.info.currencyName}`" mb-1 />
|
||||
<input-copyable label-width="150px" label="Postal Code" label-position="left" :value="`${result.info.postalCodeFormat} / ${result.info.postalCodeRegex}`" mb-1 />
|
||||
<input-copyable label-width="150px" label="Phone Code" label-position="left" :value="result.info.phoneCode" mb-1 />
|
||||
<input-copyable label-width="150px" label="Neighbor Countries" label-position="left" :value="result.info.neighborCountryIds.map(id => CountriesDB.getCountry(id, 'name')?.toString() || id).join(', ')" mb-1 />
|
||||
<input-copyable label-width="150px" label="Languages" label-position="left" :value="result.info.languages.map(langToName).join(', ')" mb-1 />
|
||||
<input-copyable label-width="150px" label="Locales" label-position="left" :value="result.info.locales.map(langToName).join(', ')" mb-1 />
|
||||
<!-- //NOSONAR --><n-a :href="`https://www.openstreetmap.org/#map=5/${result.info.coordinates.latitude}/${result.info.coordinates.longitude}`" target="_blank">
|
||||
<input-copyable label-width="150px" label="Name" label-position="left" :value="result.name" :readonly="true" mb-1 />
|
||||
<input-copyable
|
||||
label-width="150px"
|
||||
label="Official Name"
|
||||
label-position="left"
|
||||
:value="result.officialName"
|
||||
:readonly="true"
|
||||
mb-1
|
||||
/>
|
||||
<input-copyable label-width="150px" label="Domain" label-position="left" :value="result.domain" :readonly="true" mb-1 />
|
||||
<input-copyable
|
||||
label-width="150px"
|
||||
label="Emoji"
|
||||
label-position="left"
|
||||
:value="`${result.emoji} (${result.emojiUnicode})`"
|
||||
:readonly="true"
|
||||
mb-1
|
||||
/>
|
||||
<input-copyable
|
||||
label-width="150px"
|
||||
label="ISO Num"
|
||||
label-position="left"
|
||||
:value="result.isoNumeric"
|
||||
:readonly="true"
|
||||
mb-1
|
||||
/>
|
||||
<input-copyable
|
||||
label-width="150px"
|
||||
label="Continent"
|
||||
label-position="left"
|
||||
:value="result.continentId"
|
||||
:readonly="true"
|
||||
mb-1
|
||||
/>
|
||||
<input-copyable
|
||||
label-width="150px"
|
||||
label="Elevation (m)"
|
||||
label-position="left"
|
||||
:value="result.elevation"
|
||||
:readonly="true"
|
||||
mb-1
|
||||
/>
|
||||
<input-copyable
|
||||
label-width="150px"
|
||||
label="Population"
|
||||
label-position="left"
|
||||
:value="result.population"
|
||||
:readonly="true"
|
||||
mb-1
|
||||
/>
|
||||
<input-copyable
|
||||
label-width="150px"
|
||||
label="Area (km²)"
|
||||
label-position="left"
|
||||
:value="result.areaSqKm"
|
||||
:readonly="true"
|
||||
mb-1
|
||||
/>
|
||||
<input-copyable
|
||||
label-width="150px"
|
||||
label="Timezones"
|
||||
label-position="left"
|
||||
:value="result.timezones.join('\n')"
|
||||
:readonly="true"
|
||||
mb-1
|
||||
/>
|
||||
<input-copyable
|
||||
label-width="150px"
|
||||
label="Currency"
|
||||
label-position="left"
|
||||
:value="`${result.currencyCode} / ${result.currencyName}`"
|
||||
:readonly="true"
|
||||
mb-1
|
||||
/>
|
||||
<input-copyable
|
||||
label-width="150px"
|
||||
label="Postal Code"
|
||||
label-position="left"
|
||||
:value="`${result.postalCodeFormat} / ${result.postalCodeRegex}`"
|
||||
:readonly="true"
|
||||
mb-1
|
||||
/>
|
||||
<input-copyable
|
||||
label-width="150px"
|
||||
label="Phone Code"
|
||||
label-position="left"
|
||||
:value="result.phoneCode"
|
||||
:readonly="true"
|
||||
mb-1
|
||||
/>
|
||||
<input-copyable
|
||||
label-width="150px"
|
||||
label="Neighbor Countries"
|
||||
label-position="left"
|
||||
:value="
|
||||
result.neighborCountryIds
|
||||
.map((id) => CountriesDB.getCountry(id, 'name')?.toString() || id)
|
||||
.join(', ')
|
||||
"
|
||||
:readonly="true"
|
||||
mb-1
|
||||
/>
|
||||
<input-copyable
|
||||
label-width="150px"
|
||||
label="Languages"
|
||||
label-position="left"
|
||||
:value="result.languages.map(langToName).join(', ')"
|
||||
:readonly="true"
|
||||
mb-1
|
||||
/>
|
||||
<input-copyable
|
||||
label-width="150px"
|
||||
label="Locales"
|
||||
label-position="left"
|
||||
:value="result.locales.map(langToName).join(', ')"
|
||||
:readonly="true"
|
||||
mb-1
|
||||
/>
|
||||
<!-- //NOSONAR --><n-a
|
||||
:href="`https://www.openstreetmap.org/#map=5/${result.coordinates.latitude}/${result.coordinates.longitude}`"
|
||||
target="_blank"
|
||||
>
|
||||
> See on OpenStreetMap
|
||||
</n-a>
|
||||
</td>
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
import { Cloud } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'K8s Cheatsheet',
|
||||
path: '/k8s-memo',
|
||||
description: 'Kubernetes useful commands',
|
||||
keywords: ['k8s', 'kubernetes'],
|
||||
component: () => import('./k8s-memo.vue'),
|
||||
icon: Cloud,
|
||||
createdAt: new Date('2025-05-19'),
|
||||
category: 'Cheatsheets',
|
||||
});
|
||||
@@ -0,0 +1,183 @@
|
||||
# Kubernetes
|
||||
|
||||
* PDF: https://sematext.com/kubernetes-cheat-sheet/
|
||||
* WEBSITE: https://kubernetes.io/
|
||||
* DOCUMENTATION: https://kubernetes.io/docs/home
|
||||
|
||||
## Client Configuration
|
||||
|
||||
* Setup autocomplete in bash; bash-completion package should be installed first
|
||||
```
|
||||
source <(kubectl completion bash)
|
||||
```
|
||||
|
||||
* View Kubernetes config
|
||||
```
|
||||
kubectl config view
|
||||
```
|
||||
|
||||
* View specific config items by json path
|
||||
```
|
||||
kubectl config view -o jsonpath='{.users[?(@.name == "k8s")].user.password}'
|
||||
```
|
||||
|
||||
* Set credentials for `foo.kuberntes.com`
|
||||
```
|
||||
kubectl config set-credentials kubeuser/foo.kubernetes.com --username=kubeuser --password=kubepassword
|
||||
```
|
||||
|
||||
* Set active namespace
|
||||
```
|
||||
kubectl config set-context --current --namespace=namespace_name
|
||||
```
|
||||
|
||||
## Viewing, Finding resources
|
||||
|
||||
* List all services in the namespace
|
||||
```
|
||||
kubectl get services
|
||||
```
|
||||
|
||||
* List all pods in all namespaces in wide format
|
||||
```
|
||||
kubectl get pods -o wide --all-namespaces
|
||||
```
|
||||
|
||||
* List all pods in json (or yaml) format
|
||||
```
|
||||
kubectl get pods -o json
|
||||
```
|
||||
|
||||
* Describe resource details (node, pod, svc)
|
||||
```
|
||||
kubectl describe nodes my-node
|
||||
```
|
||||
|
||||
* List services sorted by name
|
||||
```
|
||||
kubectl get services --sort-by=.metadata.name
|
||||
```
|
||||
|
||||
* List pods sorted by restart count
|
||||
```
|
||||
kubectl get pods --sort-by='.status.containerStatuses[0].restartCount'
|
||||
```
|
||||
|
||||
* Rolling update pods for frontend-v1
|
||||
```
|
||||
kubectl rolling-update frontend-v1 -f frontend-v2.json
|
||||
```
|
||||
|
||||
* Scale a replicaset named 'foo' to 3
|
||||
```
|
||||
kubectl scale --replicas=3 rs/foo
|
||||
```
|
||||
|
||||
* Scale a resource specified in "foo.yaml" to 3
|
||||
```
|
||||
kubectl scale --replicas=3 -f foo.yaml
|
||||
```
|
||||
|
||||
* Execute a command in every pod / replica
|
||||
```
|
||||
for i in 0 1; do kubectl exec foo-$i -- sh -c 'echo $(hostname) > /usr/share/nginx/html/index.html'; done
|
||||
```
|
||||
|
||||
## Manage Resources
|
||||
|
||||
* Get documentation for pod or service
|
||||
```
|
||||
kubectl explain pods,svc
|
||||
```
|
||||
|
||||
* Create resource(s) like pods, services or daemonsets
|
||||
```
|
||||
kubectl create -f ./my-manifest.yaml
|
||||
```
|
||||
|
||||
* Apply a configuration to a resource
|
||||
```
|
||||
kubectl apply -f ./my-manifest.yaml
|
||||
```
|
||||
|
||||
* Start a single instance of Nginx
|
||||
```
|
||||
kubectl run nginx --image=nginx
|
||||
```
|
||||
|
||||
* Create a secret with several keys
|
||||
```
|
||||
cat <<EOF | kubectl create -f -
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: mysecret
|
||||
type: Opaque
|
||||
data:
|
||||
password: $(echo "s33msi4" | base64)
|
||||
username: $(echo "jane"| base64)
|
||||
EOF
|
||||
```
|
||||
|
||||
* Delete a resource
|
||||
```
|
||||
kubectl delete -f ./my-manifest.yaml
|
||||
```
|
||||
|
||||
## Monitoring & Logging
|
||||
|
||||
* Deploy Heapster from Github repository
|
||||
```
|
||||
kubectl create -f deploy/kube-config/standalone/
|
||||
```
|
||||
|
||||
* Show metrics for nodes
|
||||
```
|
||||
kubectl top node
|
||||
```
|
||||
|
||||
* Show metrics for pods
|
||||
```
|
||||
kubectl top pod
|
||||
```
|
||||
|
||||
* Show metrics for a given pod and its containers
|
||||
```
|
||||
kubectl top pod pod_name --containers
|
||||
```
|
||||
|
||||
* Dump pod logs (stdout)
|
||||
```
|
||||
kubectl logs pod_name
|
||||
```
|
||||
|
||||
* Stream pod container logs (stdout, multi-container case)
|
||||
```
|
||||
kubectl logs -f pod_name -c my-container
|
||||
```
|
||||
|
||||
## Interacting with running pods
|
||||
|
||||
* Run command in pod
|
||||
```
|
||||
kubectl exec pod_name -- command_name
|
||||
```
|
||||
|
||||
* Run command in pod with multiple containers
|
||||
```
|
||||
kubectl exec pod_name -c container_name -- command_name
|
||||
```
|
||||
|
||||
* Get terminal of pod
|
||||
```
|
||||
kubectl exec -it pod_name /bin/sh
|
||||
```
|
||||
|
||||
* Get terminal of a container running in pod with multiple containers
|
||||
```
|
||||
kubectl exec -it pod_name -c container_name /bin/sh
|
||||
```
|
||||
|
||||
### Credits
|
||||
|
||||
https://raw.githubusercontent.com/LeCoupa/awesome-cheatsheets/refs/heads/master/tools/kubernetes.md
|
||||
@@ -0,0 +1,22 @@
|
||||
<script setup lang="ts">
|
||||
import { useThemeVars } from 'naive-ui';
|
||||
import Memo from './k8s-memo.content.md';
|
||||
|
||||
const themeVars = useThemeVars();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<Memo />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
::v-deep(pre) {
|
||||
margin: 0;
|
||||
padding: 15px 22px;
|
||||
background-color: v-bind('themeVars.cardColor');
|
||||
border-radius: 4px;
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,13 @@
|
||||
import { DeviceDesktop } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'Nginx Cheatsheet',
|
||||
path: '/nginx-memo',
|
||||
description: 'Nginx configuration and useful commands',
|
||||
keywords: ['nginx'],
|
||||
component: () => import('./nginx-memo.vue'),
|
||||
icon: DeviceDesktop,
|
||||
createdAt: new Date('2025-05-08'),
|
||||
category: 'Cheatsheets',
|
||||
});
|
||||
@@ -0,0 +1,218 @@
|
||||
```bash
|
||||
##############################################################################
|
||||
# NGINX
|
||||
# DOCUMENTATION: https://nginx.org/en/docs/
|
||||
##############################################################################
|
||||
|
||||
sudo nginx -t # Check syntax
|
||||
sudo systemctl status nginx # nginx current status
|
||||
sudo systemctl reload nginx # Reload nginx
|
||||
sudo systemctl restart nginx # Restart nginx
|
||||
sudo ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/ # Link website
|
||||
sudo tail -f /var/log/nginx/access.log # Tail logs to inspect requests
|
||||
|
||||
# *****************************************************************************
|
||||
# General Settings
|
||||
# *****************************************************************************
|
||||
|
||||
# Ports
|
||||
|
||||
server {
|
||||
# Use HTTP protocol
|
||||
listen 80;
|
||||
|
||||
# Use HTTPS protocol
|
||||
listen 443 ssl;
|
||||
|
||||
# Listen on port 80 using IPv6
|
||||
listen [::]:80;
|
||||
|
||||
# Listen on port 80 using **only** IPv6
|
||||
listen [::]:80 ipv6only=on;
|
||||
}
|
||||
|
||||
# Domain name (server_name)
|
||||
|
||||
server {
|
||||
# Listen to example.com
|
||||
server_name example.com;
|
||||
|
||||
# Listen to multiple domains
|
||||
server_name example.com www.example.com;
|
||||
|
||||
# Listen to all sub-domains
|
||||
server_name *.example.com;
|
||||
|
||||
# Listen to all top-level domains
|
||||
server_name example.*;
|
||||
|
||||
# Listen to unspecified hostnames (listens to IP address itself)
|
||||
server_name "";
|
||||
}
|
||||
|
||||
# *****************************************************************************
|
||||
# Serving Files
|
||||
# *****************************************************************************
|
||||
|
||||
# Static assets (traditional web server)
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name example.com;
|
||||
|
||||
root /path/to/website;
|
||||
# root /www/data/ for example
|
||||
|
||||
# If there's no 'root' inside, it will look for /www/data/index.html
|
||||
location / {
|
||||
}
|
||||
|
||||
# If there's no 'root' inside, it will look for /www/data/images/index.html
|
||||
location /images/ {
|
||||
}
|
||||
|
||||
# Since there's 'root' inside, it will look for /www/media/videos/index.html
|
||||
location /videos/ {
|
||||
root /www/media;
|
||||
}
|
||||
}
|
||||
|
||||
# *****************************************************************************
|
||||
# Redirects
|
||||
# *****************************************************************************
|
||||
|
||||
# 301 Permanent
|
||||
|
||||
server {
|
||||
# Redirect www.example.com to example.com
|
||||
listen 80;
|
||||
server_name www.example.com;
|
||||
return 301 http://example.com$request_uri;
|
||||
}
|
||||
|
||||
server {
|
||||
# Redirect http to https
|
||||
listen 80;
|
||||
server_name example.com;
|
||||
return 301 https://example.com$request_uri;
|
||||
}
|
||||
|
||||
# 302 Temporary
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name yourdomain.com;
|
||||
return 302 http://otherdomain.com;
|
||||
}
|
||||
|
||||
# *****************************************************************************
|
||||
# Reverse proxy
|
||||
# *****************************************************************************
|
||||
|
||||
# Useful for Node.js, Streamlit, Jupyter, etc
|
||||
|
||||
# Basic
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name example.com;
|
||||
|
||||
location / {
|
||||
proxy_pass http://0.0.0.0:3000;
|
||||
# where 0.0.0.0:3000 is your Node.js Server bound on 0.0.0.0 listing on port 3000
|
||||
}
|
||||
}
|
||||
|
||||
# Basic + (upstream)
|
||||
|
||||
upstream node_js {
|
||||
server 0.0.0.0:3000;
|
||||
# where 0.0.0.0:3000 is your Node.js Server bound on 0.0.0.0 listing on port 3000
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name example.com;
|
||||
|
||||
location / {
|
||||
proxy_pass http://node_js;
|
||||
}
|
||||
}
|
||||
|
||||
# Upgraded Connection (useful for applications with support for WebSockets)
|
||||
|
||||
upstream node_js {
|
||||
server 0.0.0.0:3000;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name example.com;
|
||||
|
||||
location / {
|
||||
proxy_pass http://node_js;
|
||||
proxy_redirect off;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Host $host;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
# *****************************************************************************
|
||||
# HTTPS Protocol
|
||||
# *****************************************************************************
|
||||
|
||||
# The majority of SSL options depend on what your application does or needs
|
||||
|
||||
server {
|
||||
listen 443 ssl http2;
|
||||
server_name example.com;
|
||||
|
||||
ssl on;
|
||||
|
||||
ssl_certificate /path/to/cert.pem;
|
||||
ssl_certificate_key /path/to/privkey.pem;
|
||||
|
||||
ssl_stapling on;
|
||||
ssl_stapling_verify on;
|
||||
ssl_trusted_certificate /path/to/fullchain.pem;
|
||||
|
||||
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
|
||||
ssl_session_timeout 1d;
|
||||
ssl_session_cache shared:SSL:50m;
|
||||
add_header Strict-Transport-Security max-age=15768000;
|
||||
}
|
||||
|
||||
# Permanent redirect to HTTPS secured domain
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name yourdomain.com;
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
|
||||
# You can easily secure you website/app using Let's Encrypt.
|
||||
# Go https://certbot.eff.org/lets-encrypt/ubuntuxenial-nginx.html for more information
|
||||
|
||||
# *****************************************************************************
|
||||
# Load Balancing
|
||||
# *****************************************************************************
|
||||
|
||||
# Useful for large applications running in multiple instances. Below example is for reverse proxy
|
||||
upstream node_js {
|
||||
server 0.0.0.0:3000;
|
||||
server 0.0.0.0:4000;
|
||||
server 127.155.142.421;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name example.com;
|
||||
|
||||
location / {
|
||||
proxy_pass http://node_js;
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -0,0 +1,22 @@
|
||||
<script setup lang="ts">
|
||||
import { useThemeVars } from 'naive-ui';
|
||||
import Memo from './nginx-memo.content.md';
|
||||
|
||||
const themeVars = useThemeVars();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<Memo />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
::v-deep(pre) {
|
||||
margin: 0;
|
||||
padding: 15px 22px;
|
||||
background-color: v-bind('themeVars.cardColor');
|
||||
border-radius: 4px;
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,13 @@
|
||||
import { FileExport } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'PDF Text Extractor',
|
||||
path: '/pdf-text-extractor',
|
||||
description: 'Extract text from PDF',
|
||||
keywords: ['pdf', 'text', 'extractor'],
|
||||
component: () => import('./pdf-text-extractor.vue'),
|
||||
icon: FileExport,
|
||||
createdAt: new Date('2025-05-08'),
|
||||
category: 'PDF',
|
||||
});
|
||||
@@ -0,0 +1,81 @@
|
||||
<script setup lang="ts">
|
||||
import { definePDFJSModule, extractText, getDocumentProxy } from 'unpdf';
|
||||
import * as pdfJS from 'pdfjs-dist';
|
||||
import pdfJSWorkerURL from 'pdfjs-dist/build/pdf.worker?url';
|
||||
|
||||
pdfJS.GlobalWorkerOptions.workerSrc = pdfJSWorkerURL;
|
||||
|
||||
// Define the PDF.js build before using any other unpdf method
|
||||
await definePDFJSModule(() => import('pdfjs-dist'));
|
||||
|
||||
const status = ref<'idle' | 'done' | 'error' | 'processing'>('idle');
|
||||
const file = ref<File | null>(null);
|
||||
const totalPages = ref(0);
|
||||
const text = ref('');
|
||||
const errorMessage = ref('');
|
||||
const mergePages = ref(false);
|
||||
|
||||
function onFileUploaded(uploadedFile: File) {
|
||||
file.value = uploadedFile;
|
||||
totalPages.value = 0;
|
||||
text.value = '';
|
||||
}
|
||||
|
||||
async function processPDF() {
|
||||
if (!file.value) {
|
||||
return;
|
||||
}
|
||||
status.value = 'idle';
|
||||
errorMessage.value = '';
|
||||
try {
|
||||
status.value = 'processing';
|
||||
const fileBuffer = await file.value.arrayBuffer();
|
||||
const pdf = await getDocumentProxy(new Uint8Array(fileBuffer));
|
||||
const data = await extractText(pdf, { mergePages: mergePages.value as never });
|
||||
totalPages.value = data.totalPages;
|
||||
text.value = Array.isArray(data.text) ? data.text.join('\n') : data.text;
|
||||
status.value = 'done';
|
||||
}
|
||||
catch (e: any) {
|
||||
errorMessage.value = e.toString();
|
||||
status.value = 'error';
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<div style="flex: 0 0 100%" mb-1>
|
||||
<div mx-auto max-w-600px>
|
||||
<c-file-upload title="Drag and drop a PDF file here, or click to select a file" accept=".pdf" @file-upload="onFileUploaded" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div flex justify-center>
|
||||
<n-form-item label="Merge pages" label-placement="left">
|
||||
<n-checkbox v-model:checked="mergePages" />
|
||||
</n-form-item>
|
||||
</div>
|
||||
<div flex justify-center>
|
||||
<c-button mb-1 :disabled="!file" @click="processPDF">
|
||||
Extract text
|
||||
</c-button>
|
||||
</div>
|
||||
|
||||
<div mb-1 mt-3 flex justify-center>
|
||||
<c-alert v-if="errorMessage" type="error">
|
||||
{{ errorMessage }}
|
||||
</c-alert>
|
||||
<n-spin
|
||||
v-if="status === 'processing'"
|
||||
size="small"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<c-card v-if="file && text" title="Output">
|
||||
<input-copyable label="File name:" :value="file?.name" mb-1 />
|
||||
<textarea-copyable label="Text:" :value="text" mb-1 />
|
||||
<input-copyable label="Total Pages:" :value="totalPages.toString()" mb-1 />
|
||||
</c-card>
|
||||
</div>
|
||||
</template>
|
||||
@@ -1,7 +1,10 @@
|
||||
<script setup lang="ts">
|
||||
import 'webcrypto-liner-shim';
|
||||
import * as openpgp from 'openpgp';
|
||||
import { computedCatchAsync } from '@/composable/computed/catchedComputed';
|
||||
|
||||
openpgp.config.rejectCurves = new Set();
|
||||
|
||||
const cryptInput = ref('');
|
||||
const cryptPublicKey = ref('');
|
||||
const cryptPrivateKey = ref('');
|
||||
@@ -79,11 +82,20 @@ const [decryptOutput, decryptError] = computedCatchAsync(async () => {
|
||||
defaultValue: { decryptedText: '', signatureError: '' },
|
||||
defaultErrorMessage: 'Unable to encrypt your text',
|
||||
});
|
||||
|
||||
function isWindowSecureContext() {
|
||||
return window.isSecureContext;
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<c-card title="Encrypt">
|
||||
<c-alert v-if="!isWindowSecureContext()" mb-2>
|
||||
Your browser is not in <n-a href="https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts" target="_blank">
|
||||
"Secure Context" (HTTPS)
|
||||
</n-a>. This tool may not work correctly and require HTTPS to work fully.
|
||||
</c-alert>
|
||||
<c-card title="Encrypt" mb-2>
|
||||
<div>
|
||||
<c-input-text
|
||||
v-model:value="cryptInput"
|
||||
|
||||
@@ -1,23 +1,38 @@
|
||||
<script setup lang="ts">
|
||||
import 'webcrypto-liner-shim';
|
||||
import * as openpgp from 'openpgp';
|
||||
import TextareaCopyable from '@/components/TextareaCopyable.vue';
|
||||
import { useValidation } from '@/composable/validation';
|
||||
import { computedRefreshableAsync } from '@/composable/computedRefreshable';
|
||||
|
||||
openpgp.config.rejectCurves = new Set();
|
||||
|
||||
function isWindowSecureContext() {
|
||||
return window.isSecureContext;
|
||||
}
|
||||
|
||||
const bits = ref(4096);
|
||||
const username = ref('');
|
||||
const useremail = ref('');
|
||||
const password = ref('');
|
||||
|
||||
const format = useStorage('pgp-key-pair-generator:format', 'curve25519');
|
||||
const formats = [
|
||||
'rsa',
|
||||
'curve25519',
|
||||
'ed25519',
|
||||
'p256', 'p384', 'p521',
|
||||
'brainpoolP256r1', 'brainpoolP384r1', 'brainpoolP512r1',
|
||||
'secp256k1',
|
||||
];
|
||||
const format = useStorage('pgp-key-pair-generator:format', isWindowSecureContext() ? 'curve25519' : 'p256');
|
||||
|
||||
const formats = isWindowSecureContext()
|
||||
? [
|
||||
'rsa',
|
||||
'curve25519',
|
||||
'curve448',
|
||||
'ed25519',
|
||||
'p256', 'p384', 'p521',
|
||||
'brainpoolP256r1', 'brainpoolP384r1', 'brainpoolP512r1',
|
||||
'secp256k1',
|
||||
]
|
||||
: [
|
||||
'p256', 'p384', 'p521',
|
||||
'brainpoolP256r1', 'brainpoolP384r1', 'brainpoolP512r1',
|
||||
'secp256k1',
|
||||
];
|
||||
|
||||
const { attrs: bitsValidationAttrs } = useValidation({
|
||||
source: bits,
|
||||
@@ -51,7 +66,7 @@ const [certs, refreshCerts] = computedRefreshableAsync(
|
||||
}
|
||||
|
||||
const { privateKey, publicKey, revocationCertificate } = await openpgp.generateKey({
|
||||
type: 'ecc', // Type of the key, defaults to ECC
|
||||
type: format.value === 'curve448' ? 'curve448' : 'ecc', // Type of the key, defaults to ECC
|
||||
curve: formatValue as openpgp.EllipticCurveName, // ECC curve name, defaults to curve25519
|
||||
userIDs: [{ name, email }], // you can pass multiple user IDs
|
||||
passphrase, // protects the private key
|
||||
@@ -69,6 +84,11 @@ const [certs, refreshCerts] = computedRefreshableAsync(
|
||||
<template>
|
||||
<div>
|
||||
<div mb-4>
|
||||
<c-alert v-if="!isWindowSecureContext()" mb-2>
|
||||
Your browser is not in <n-a href="https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts" target="_blank">
|
||||
"Secure Context" (HTTPS)
|
||||
</n-a>. This tool may not work correctly and require HTTPS to work fully.
|
||||
</c-alert>
|
||||
<div style="flex: 0 0 100%">
|
||||
<div item-style="flex: 1 1 0" style="max-width: 600px" mx-auto flex gap-3>
|
||||
<c-select
|
||||
@@ -77,6 +97,7 @@ const [certs, refreshCerts] = computedRefreshableAsync(
|
||||
label="Format:"
|
||||
:options="formats"
|
||||
placeholder="Select a key format"
|
||||
style="min-width: 150px"
|
||||
/>
|
||||
|
||||
<n-form-item v-if="format === 'rsa'" label="RSA Bits :" v-bind="bitsValidationAttrs as any" label-placement="left">
|
||||
|
||||
@@ -61,6 +61,23 @@ function ended() {
|
||||
if (status.value === 'running') {
|
||||
status.value = 'ended';
|
||||
}
|
||||
if (document.fullscreenElement) {
|
||||
document.exitFullscreen?.();
|
||||
}
|
||||
}
|
||||
|
||||
const fullScreenElement = ref<HTMLElement>();
|
||||
function toggleFullScreen() {
|
||||
const element = fullScreenElement.value;
|
||||
if (!element) {
|
||||
return;
|
||||
}
|
||||
if (!document.fullscreenElement) {
|
||||
element?.requestFullscreen();
|
||||
}
|
||||
else {
|
||||
document.exitFullscreen?.();
|
||||
}
|
||||
}
|
||||
|
||||
const isEnded = computed(() => status.value === 'ended');
|
||||
@@ -84,19 +101,18 @@ const isEnded = computed(() => status.value === 'ended');
|
||||
</div>
|
||||
</c-card>
|
||||
|
||||
<Countdown :deadline="alarmAtFormatted" :stop="status !== 'running'" mb-2 @time-elapsed="ended()" />
|
||||
|
||||
<n-p align="center">
|
||||
Alarm at: {{ alarmAtDate }}
|
||||
</n-p>
|
||||
|
||||
<div mb-2 flex justify-center>
|
||||
<c-button
|
||||
:disabled="status === 'stopped'"
|
||||
@click="stop"
|
||||
>
|
||||
Stop
|
||||
</c-button>
|
||||
<div id="fullScreenElement" ref="fullScreenElement" mb-2>
|
||||
<div>
|
||||
<Countdown :deadline="alarmAtFormatted" :stop="status !== 'running'" mb-2 countdown-size="5rem" @time-elapsed="ended()" />
|
||||
<div mb-2 flex justify-center>
|
||||
<c-button
|
||||
:disabled="status === 'stopped'"
|
||||
@click="toggleFullScreen"
|
||||
>
|
||||
Toggle Fullscreen
|
||||
</c-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<n-modal v-model:show="isEnded" mask-closable="false">
|
||||
@@ -117,6 +133,19 @@ const isEnded = computed(() => status.value === 'ended');
|
||||
</n-card>
|
||||
</n-modal>
|
||||
|
||||
<div mb-2 flex justify-center>
|
||||
<c-button
|
||||
:disabled="status === 'stopped'"
|
||||
@click="stop"
|
||||
>
|
||||
Stop
|
||||
</c-button>
|
||||
</div>
|
||||
|
||||
<n-p align="center">
|
||||
Alarm at: {{ alarmAtDate }}
|
||||
</n-p>
|
||||
|
||||
<c-card v-if="history" title="History">
|
||||
<div flex justify-center gap-1>
|
||||
<template v-for="(entry, index) in history" :key="index">
|
||||
@@ -131,3 +160,12 @@ const isEnded = computed(() => status.value === 'ended');
|
||||
<audio ref="audio" loop src="/Beep.mp3" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
#fullScreenElement:fullscreen {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
</style>
|
||||
@@ -3,7 +3,7 @@ import unicodeNames from '@unicode/unicode-15.1.0/Names/index.js';
|
||||
import unicodeCategories from '@unicode/unicode-15.1.0/General_Category';
|
||||
import utf8 from 'utf8';
|
||||
|
||||
import { useFuzzySearch } from '@/composable/fuzzySearch';
|
||||
import { useFlexSearch } from '@/composable/flexSearch';
|
||||
import useDebouncedRef from '@/composable/debouncedref';
|
||||
|
||||
function toPaddedHex(num: number) {
|
||||
@@ -12,10 +12,11 @@ function toPaddedHex(num: number) {
|
||||
|
||||
function toUTF8(codePoint: number) {
|
||||
const utf8String = utf8.encode(String.fromCodePoint(codePoint));
|
||||
return [...utf8String].map(c => `\\x${c.codePointAt(0)?.toString(16).toUpperCase()}`);
|
||||
const bytes = [...utf8String].map(c => `\\x${c.codePointAt(0)?.toString(16).toUpperCase()}`);
|
||||
return bytes.join(''); // Join the string array into a single string to fix a bug where it would otherwise join the array items with a comma
|
||||
}
|
||||
|
||||
const searchQuery = useDebouncedRef('', 500);
|
||||
const searchQuery = useDebouncedRef('', 250);
|
||||
const parsedSearchQuery = computed(() => {
|
||||
const parsedRegex = /^\s*(?:\&#x(?<hex1>[\da-f]+);|\&#(?<dec>\d+);|(?:U\+|\\u)?\s*(?<hex2>[\da-f]+))\s*$/gi; // NOSONAR
|
||||
const parsedQuery = parsedRegex.exec(searchQuery.value);
|
||||
@@ -39,18 +40,19 @@ const unicodeSearchData = [...unicodeNames].map(([codePoint, characterName]) =>
|
||||
};
|
||||
});
|
||||
|
||||
const limit = ref(100);
|
||||
const { searchResult } = useFuzzySearch({
|
||||
const limit = ref(40);
|
||||
// Using FlexSearch instead of FuzzySearch for better performance
|
||||
const { searchResult } = useFlexSearch({
|
||||
search: parsedSearchQuery,
|
||||
data: unicodeSearchData,
|
||||
options: {
|
||||
keys: ['characterName', 'hex'],
|
||||
threshold: 0.2,
|
||||
isCaseSensitive: false,
|
||||
minMatchCharLength: 3,
|
||||
useExtendedSearch: true,
|
||||
filterEmpty: false,
|
||||
cache: true,
|
||||
resolution: 9,
|
||||
optimize: true,
|
||||
},
|
||||
limit: limit.value,
|
||||
limit,
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -71,12 +73,7 @@ const { searchResult } = useFuzzySearch({
|
||||
</div>
|
||||
|
||||
<div v-if="searchQuery.trim().length > 0">
|
||||
<div
|
||||
v-if="searchResult.length === 0"
|
||||
mt-4
|
||||
text-20px
|
||||
font-bold
|
||||
>
|
||||
<div v-if="searchResult.length === 0" mt-4 text-20px font-bold>
|
||||
No results
|
||||
</div>
|
||||
|
||||
@@ -89,34 +86,37 @@ const { searchResult } = useFuzzySearch({
|
||||
<thead>
|
||||
<th>UCOD</th>
|
||||
<th>Display/UTF8</th>
|
||||
<th style="width:30%">
|
||||
<th style="width: 30%">
|
||||
Category
|
||||
</th>
|
||||
<th>Html</th>
|
||||
<th style="width:30%">
|
||||
<th style="width: 30%">
|
||||
Name
|
||||
</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(result, ix) in searchResult" :key="ix">
|
||||
<td>
|
||||
<input-copyable :value="`U+${toPaddedHex(result.codePoint)}`" mb-1 />
|
||||
<!-- //NOSONAR --><n-a :href="`https://unicodeplus.com/U+${toPaddedHex(result.codePoint)}`" target="_blank">
|
||||
<input-copyable :value="`U+${toPaddedHex(result.codePoint)}`" :readonly="true" mb-1 />
|
||||
<!-- //NOSONAR --><n-a
|
||||
:href="`https://unicodeplus.com/U+${toPaddedHex(result.codePoint)}`"
|
||||
target="_blank"
|
||||
>
|
||||
> More info
|
||||
</n-a>
|
||||
</td>
|
||||
<td>
|
||||
<input-copyable :value="String.fromCodePoint(result.codePoint)" mb-1 />
|
||||
<input-copyable :value="toUTF8(result.codePoint)" />
|
||||
<input-copyable :value="String.fromCodePoint(result.codePoint)" :readonly="true" mb-1 />
|
||||
<input-copyable :value="toUTF8(result.codePoint)" :readonly="true" />
|
||||
</td>
|
||||
<td>
|
||||
<input-copyable :value="unicodeCategories.get(result.codePoint)" />
|
||||
<input-copyable :value="unicodeCategories.get(result.codePoint)" :readonly="true" />
|
||||
</td>
|
||||
<td>
|
||||
<input-copyable :value="`\&\#x${toPaddedHex(result.codePoint)};`" mb-1 />
|
||||
<input-copyable :value="`\&\#${result.codePoint};`" />
|
||||
<input-copyable :value="`\&\#x${toPaddedHex(result.codePoint)};`" :readonly="true" mb-1 />
|
||||
<input-copyable :value="`\&\#${result.codePoint};`" :readonly="true" />
|
||||
</td>
|
||||
<td><input-copyable :value="result.characterName" /></td>
|
||||
<td><input-copyable :value="result.characterName" :readonly="true" /></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</n-table>
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
import { FileText } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'VIM Cheatsheet',
|
||||
path: '/vim-memo',
|
||||
description: 'Vim text editor commands',
|
||||
keywords: ['vim', 'editor'],
|
||||
component: () => import('./vim-memo.vue'),
|
||||
icon: FileText,
|
||||
createdAt: new Date('2025-05-08'),
|
||||
category: 'Cheatsheets',
|
||||
});
|
||||
@@ -0,0 +1,722 @@
|
||||
```
|
||||
##############################################################################
|
||||
# VIM CHEATSHEET
|
||||
# WEBSITE: http://www.vim.org/
|
||||
# DOCUMENTATION: https://vim.sourceforge.io/docs.php
|
||||
##############################################################################
|
||||
|
||||
|
||||
##############################################################################
|
||||
# CURSOR MOVEMENTS
|
||||
##############################################################################
|
||||
|
||||
|
||||
h move left
|
||||
j move down
|
||||
k move up
|
||||
l move right
|
||||
w jump by start of words (punctuation considered words)
|
||||
W jump by words (spaces separate words)
|
||||
e jump to end of words (punctuation considered words)
|
||||
E jump to end of words (no punctuation)
|
||||
b jump backward by words (punctuation considered words)
|
||||
B jump backward by words (no punctuation)
|
||||
ge jump backward to end of a word
|
||||
gE jump backwards to the end of a word (words can contain punctuation)
|
||||
0 (zero) start of line
|
||||
^ first non-blank character of line
|
||||
$ jump to the end of the line
|
||||
g_ jump to the last non-blank character of the line
|
||||
- move line upwards, on the first non-blank character
|
||||
+ move line downwards, on the first non-blank character
|
||||
<enter> move line downwards, on the first non-blank character
|
||||
gg go to first line
|
||||
G go to last line
|
||||
ngg go to line n
|
||||
nG go To line n
|
||||
:n go To line n
|
||||
) move the cursor forward to the next sentence.
|
||||
( move the cursor backward by a sentence.
|
||||
{ move the cursor a paragraph backwards
|
||||
} move the cursor a paragraph forwards
|
||||
]] move the cursor a section forwards or to the next {
|
||||
[[ move the cursor a section backwards or the previous {
|
||||
H move the cursor to the top of the screen.
|
||||
M move the cursor to the middle of the screen.
|
||||
L move the cursor to the bottom of the screen.
|
||||
fx search line forward for 'x'
|
||||
Fx search line backward for 'x'
|
||||
tx search line forward before 'x'
|
||||
Tx search line backward before 'x'
|
||||
CTRL-y moves screen up one line
|
||||
CTRL-e moves screen down one line
|
||||
CTRL-u moves cursor & screen up ½ page
|
||||
CTRL-d moves cursor & screen down ½ page
|
||||
CTRL-b moves screen up one page, cursor to last line
|
||||
CTRL-f moves screen down one page, cursor to first line
|
||||
zz shift current line to middle of screen
|
||||
z. same as zz but also jumps to the first non-black character
|
||||
zt shift current line to top of screen
|
||||
zb shift current line to bottom of screen
|
||||
|
||||
|
||||
##############################################################################
|
||||
# BOOKMARKS
|
||||
##############################################################################
|
||||
|
||||
|
||||
:marks list all the current marks
|
||||
ma make a bookmark named a at the current cursor position
|
||||
`a go to position of bookmark a
|
||||
'a go to the line with bookmark a
|
||||
`0 go to the position where Vim was previously exited
|
||||
`" go to the position when last editing this file
|
||||
`. go to the line that you last edited
|
||||
`` go to the position before the last jump
|
||||
g, go to newer position in change list
|
||||
g; go to older position in change list
|
||||
|
||||
# Tip: To jump to a mark you can either use a backtick (`) or an apostrophe (').
|
||||
# Using an apostrophe jumps to the beginning (first non-blank) of the line holding the mark.
|
||||
|
||||
##############################################################################
|
||||
# INSERT MODE
|
||||
##############################################################################
|
||||
|
||||
|
||||
i start insert mode at cursor
|
||||
I insert at the beginning of the line
|
||||
gi return to insert mode where you inserted text the last time
|
||||
gI like "I", but always start in column 1
|
||||
a append after the cursor
|
||||
A append at the end of the line
|
||||
o open (append) blank line below current line
|
||||
O open blank line above current line
|
||||
CTRL-o Temporarily enter normal mode to issue one normal-mode command(while in insert mode)
|
||||
Esc exit insert mode
|
||||
|
||||
|
||||
##############################################################################
|
||||
# EDITING
|
||||
##############################################################################
|
||||
|
||||
|
||||
r replace a single character (does not use insert mode)
|
||||
R enter Insert mode, replacing characters rather than inserting
|
||||
J join line below to the current one with one space in between
|
||||
gJ join line below to the current one without space in between
|
||||
cc change (replace) an entire line
|
||||
cw change (replace) to the end of word (same as ce)
|
||||
2cw change (replace) repeat cw twice
|
||||
ciw change (replace) word under the cursor
|
||||
caw change (replace) word under the cursor and the space after or before it
|
||||
ci" change (replace) word inside ""
|
||||
cit change (replace) html tag content
|
||||
cat change (replace) html tag
|
||||
cis change (replace) sentence under the cursor
|
||||
cas change (replace) sentence under the cursor and the space after or before it
|
||||
cib change (replace) inside a block with ()
|
||||
cab change (replace) a block with ()
|
||||
ciB change (replace) inside a block with {}
|
||||
caB change (replace) a block with {}
|
||||
C change (replace) to the end of line(same as c$)
|
||||
cG change (replace) to the end of the file
|
||||
cgg change (replace) from first line to current line
|
||||
ct' change (replace) until the ' character (can change ' for any character)
|
||||
s delete character at cursor and substitute text
|
||||
S delete line at cursor and substitute text (same as cc)
|
||||
xp transpose two letters (delete and paste, technically)
|
||||
u undo
|
||||
CTRL-r redo
|
||||
. repeat last command
|
||||
~ switch case
|
||||
g~iw switch case of current word
|
||||
gUiw make current word uppercase
|
||||
guiw make current word lowercase
|
||||
gU$ make uppercase until end of line
|
||||
gu$ make lowercase until end of line
|
||||
>> indent line one column to right
|
||||
>i{ indent everything in the {}
|
||||
<< indent line one column to left
|
||||
== auto-indent current line
|
||||
ddp swap current line with next
|
||||
ddkP swap current line with previous
|
||||
:%retab fix spaces / tabs issues in whole file
|
||||
:r [name] insert the file [name] below the cursor.
|
||||
:r !{cmd} execute {cmd} and insert its standard output below the cursor.
|
||||
|
||||
# Tip: Instead of b or B one can also use ( or { respectively.
|
||||
|
||||
##############################################################################
|
||||
# DELETING TEXT
|
||||
##############################################################################
|
||||
|
||||
|
||||
x delete current character
|
||||
X delete previous character
|
||||
dw delete (cut) to the end of word (same as de)
|
||||
diw delete (cut) word under the cursor
|
||||
daw delete (cut) word under the cursor and the space after or before it
|
||||
dap delete (cut) a paragraph
|
||||
dd delete (cut) a line
|
||||
dt' delete (cut) until the next ' character on the line (replace ' by any character)
|
||||
dG delete (cut) to the end of the file
|
||||
dgg delete (cut) from first line to current line
|
||||
D delete (cut) from cursor to end of line (same as d$)
|
||||
:[range]d delete [range] lines
|
||||
|
||||
|
||||
##############################################################################
|
||||
# COPYING AND MOVING TEXT
|
||||
##############################################################################
|
||||
|
||||
|
||||
yw yank word
|
||||
yy yank (copy) a line
|
||||
2yy yank 2 lines
|
||||
y$ yank to end of line
|
||||
p put (paste) the clipboard after cursor/current line
|
||||
P put (paste) before cursor/current line
|
||||
gp put (paste) the clipboard after cursor and leave cursor after the new text
|
||||
gP put (paste) before cursor and leave cursor after the new text
|
||||
"+y yank into the system clipboard register
|
||||
"+p paste from the system clipboard register
|
||||
:set paste avoid unexpected effects in pasting
|
||||
:registers display the contents of all registers
|
||||
"xyw yank word into register x
|
||||
"xyy yank line into register x
|
||||
:[range]y x yank [range] lines into register x
|
||||
"xp put the text from register x after the cursor
|
||||
"xP put the text from register x before the cursor
|
||||
"xgp just like "p", but leave the cursor just after the new text
|
||||
"xgP just like "P", but leave the cursor just after the new text
|
||||
:[line]put x put the text from register x after [line]
|
||||
|
||||
# Tip: if you are using vim extension on vs code, you can enable
|
||||
"vim.useSystemClipboard": true
|
||||
in setting.json, this will allow to Use system clipboard for unnamed register.
|
||||
|
||||
|
||||
|
||||
|
||||
##############################################################################
|
||||
# MACROS
|
||||
##############################################################################
|
||||
|
||||
|
||||
qa start recording macro 'a'
|
||||
q end recording macro
|
||||
@a replay macro 'a'
|
||||
@: replay last command
|
||||
@@ repeat macro
|
||||
|
||||
|
||||
##############################################################################
|
||||
# VISUAL MODE
|
||||
##############################################################################
|
||||
|
||||
|
||||
v start visual mode, mark lines, then do command (such as y-yank)
|
||||
V start linewise visual mode
|
||||
o move to other end of marked area
|
||||
U upper case of marked area
|
||||
CTRL-v start visual block mode
|
||||
O move to other corner of block
|
||||
aw mark a word
|
||||
ab a () block (with braces)
|
||||
aB a {} block (with brackets)
|
||||
at a block with <> tags
|
||||
ib inner () block
|
||||
iB inner {} block
|
||||
it inner <> block
|
||||
Esc exit visual mode
|
||||
|
||||
VISUAL MODE COMMANDS
|
||||
--------------------
|
||||
|
||||
> shift right
|
||||
< shift left
|
||||
c change (replace) marked text
|
||||
y yank (copy) marked text
|
||||
d delete marked text
|
||||
~ switch case
|
||||
|
||||
VISUAL MODE SHORTCUTS
|
||||
---------------------
|
||||
|
||||
v% selects matching parenthesis
|
||||
vi{ selects matching curly brace
|
||||
vi" selects text between double quotes
|
||||
vi' selects text between single quotes
|
||||
gv reselect the last selected area
|
||||
|
||||
##############################################################################
|
||||
# SPELLING
|
||||
##############################################################################
|
||||
|
||||
|
||||
]s next misspelled word
|
||||
[s previous misspelled word
|
||||
zg add word to wordlist
|
||||
zug undo last add word
|
||||
z= suggest word
|
||||
|
||||
|
||||
##############################################################################
|
||||
# EXITING
|
||||
##############################################################################
|
||||
|
||||
|
||||
:q quit Vim. This fails when changes have been made.
|
||||
:q! quit without writing.
|
||||
:cq quit always, without writing.
|
||||
:w save without exiting.
|
||||
:wq write the current file and exit.
|
||||
:wq! write the current file and exit always.
|
||||
:wq {file} write to {file}. Exit if not editing the last
|
||||
:wq! {file} write to {file} and exit always.
|
||||
:[range]wq[!] same as above, but only write the lines in [range].
|
||||
ZZ write current file, if modified, and exit.
|
||||
ZQ quit current file and exit (same as ":q!").
|
||||
|
||||
|
||||
##############################################################################
|
||||
# SEARCH/REPLACE
|
||||
##############################################################################
|
||||
|
||||
|
||||
/pattern search for pattern
|
||||
?pattern search backward for pattern
|
||||
n repeat search in same direction
|
||||
N repeat search in opposite direction
|
||||
* search forward, word under cursor
|
||||
# search backward, word under cursor
|
||||
set ic ignore case: turn on
|
||||
set noic ignore case: turn off
|
||||
:%s/old/new/g replace all old with new throughout file
|
||||
:%s/old/new/gc replace all old with new throughout file with confirmation
|
||||
:argdo %s/old/new/gc | wq open multiple files and run this command to replace old
|
||||
with new in every file with confirmation, save and quit
|
||||
|
||||
|
||||
##############################################################################
|
||||
# MULTIPLE FILES
|
||||
##############################################################################
|
||||
|
||||
|
||||
:e filename edit a file in a new buffer
|
||||
:tabe filename edit a file in a new tab (Vim7, gVim)
|
||||
:ls list all buffers
|
||||
:bn go to next buffer
|
||||
:bp go to previous buffer
|
||||
:bd delete a buffer (close a file)
|
||||
:b1 show buffer 1
|
||||
:b vimrc show buffer whose filename begins with "vimrc"
|
||||
:bufdo <command> run 'command(s)' in all buffers
|
||||
:[range]bufdo <command> run 'command(s)' for buffers in 'range'
|
||||
|
||||
|
||||
##############################################################################
|
||||
# WINDOWS
|
||||
##############################################################################
|
||||
|
||||
|
||||
:sp f split open f
|
||||
:vsp f vsplit open f
|
||||
CTRL-w s split windows
|
||||
CTRL-w w switch between windows
|
||||
CTRL-w q quit a window
|
||||
CTRL-w v split windows vertically
|
||||
CTRL-w x swap windows
|
||||
CTRL-w h left window
|
||||
CTRL-w j down window
|
||||
CTRL-w k up window
|
||||
CTRL-w l right window
|
||||
CTRL-w + increase window height
|
||||
CTRL-w - decrease window height
|
||||
CTRL-w < increase window width
|
||||
CTRL-w > decrease window width
|
||||
CTRL-w = equal window
|
||||
CTRL-w o close other windows
|
||||
|
||||
|
||||
##############################################################################
|
||||
# QUICKFIX WINDOW
|
||||
##############################################################################
|
||||
|
||||
|
||||
copen open quickfix window
|
||||
cclose close quickfix window
|
||||
cc [nr] display error [nr]
|
||||
cfirst display the first error
|
||||
clast display the last error
|
||||
[count]cn display [count] next error
|
||||
[count]cp display [count] previous error
|
||||
|
||||
|
||||
##############################################################################
|
||||
# PROGRAMMING
|
||||
##############################################################################
|
||||
|
||||
|
||||
% show matching brace, bracket, or parenthese
|
||||
gf edit the file whose name is under the cursor
|
||||
gF edit the file whose name is under the cursor and jump to the line number
|
||||
gd when the cursor is on a local variable or function, jump to its declaration
|
||||
'' return to the line where the cursor was before the latest jump
|
||||
CTRL-o move to previous position you were at
|
||||
CTRL-i move to more recent position you were at
|
||||
:set nu display numbers (short for :set number)
|
||||
:set nonu hide numbers (short for :set nonumber)
|
||||
|
||||
|
||||
##############################################################################
|
||||
# PLUGINS > ACK
|
||||
##############################################################################
|
||||
|
||||
|
||||
:Ack Search recursively in directory
|
||||
o to open (same as enter)
|
||||
go to preview file (open but maintain focus on ack.vim results)
|
||||
t to open in new tab
|
||||
T to open in new tab silently
|
||||
q to close the quickfix window
|
||||
|
||||
|
||||
##############################################################################
|
||||
# PLUGINS > CHEAT
|
||||
##############################################################################
|
||||
|
||||
|
||||
:Cheat open cheat sheet (with autocomplete)
|
||||
<leader>ch open cheat sheet for word under the cursor
|
||||
|
||||
|
||||
##############################################################################
|
||||
# PLUGINS > GIST
|
||||
##############################################################################
|
||||
|
||||
|
||||
:Gist post whole text to gist
|
||||
:Gist XXXXX get gist XXXXX
|
||||
:Gist -l list my gists
|
||||
|
||||
|
||||
##############################################################################
|
||||
# PLUGINS > GUNDO
|
||||
##############################################################################
|
||||
|
||||
|
||||
:GundoToggle show undo tree
|
||||
|
||||
|
||||
##############################################################################
|
||||
# PLUGINS > LUSTYJUGGLER
|
||||
##############################################################################
|
||||
|
||||
|
||||
<Leader>lj show open buffers
|
||||
|
||||
|
||||
##############################################################################
|
||||
# PLUGINS > NERDCOMMENTER
|
||||
##############################################################################
|
||||
|
||||
|
||||
<leader>cc comment out line(s)
|
||||
<leader>c<space> toggle the comment state of the selected line(s)
|
||||
|
||||
|
||||
##############################################################################
|
||||
# PLUGINS > NERDTREE
|
||||
##############################################################################
|
||||
|
||||
|
||||
:NERDTreeToggle show / hide file browser
|
||||
:NERDTreeFind show current file in file browser
|
||||
:Bookmark name bookmark the current node as "name"
|
||||
|
||||
FILE
|
||||
----
|
||||
|
||||
o open in prev window
|
||||
go preview
|
||||
t open in new tab
|
||||
T open in new tab silently
|
||||
i open split
|
||||
gi preview split
|
||||
s open vsplit
|
||||
gs preview vsplit
|
||||
|
||||
DIRECTORY
|
||||
---------
|
||||
|
||||
o open & close node
|
||||
O recursively open node
|
||||
x close parent of node
|
||||
X close all child nodes of current node recursively
|
||||
e explore selected dir
|
||||
|
||||
BOOKMARK
|
||||
--------
|
||||
|
||||
o open bookmark
|
||||
t open in new tab
|
||||
T open in new tab silently
|
||||
D delete bookmark
|
||||
|
||||
TREE NAVIGATION
|
||||
---------------
|
||||
|
||||
P go to root
|
||||
p go to parent
|
||||
K go to first child
|
||||
J go to last child
|
||||
CTRL-j go to next sibling
|
||||
CTRL-k go to prev sibling
|
||||
|
||||
FILESYSTEM
|
||||
----------
|
||||
|
||||
C change tree root to the selected dir
|
||||
u move tree root up a dir
|
||||
U move tree root up a dir but leave old root open
|
||||
r refresh cursor dir
|
||||
R refresh current root
|
||||
m show menu
|
||||
cd change the CWD to the selected dir
|
||||
|
||||
TREE FILTERING
|
||||
--------------
|
||||
|
||||
I hidden files
|
||||
f file filters
|
||||
F files
|
||||
B bookmarks
|
||||
|
||||
OTHER
|
||||
-----
|
||||
|
||||
q close the NERDTree window
|
||||
A zoom (maximize-minimize) the NERDTree window
|
||||
? toggle help
|
||||
|
||||
|
||||
##############################################################################
|
||||
# PLUGINS > PDV
|
||||
##############################################################################
|
||||
|
||||
|
||||
CTRL-P generate PHP DOC
|
||||
|
||||
|
||||
##############################################################################
|
||||
# PLUGINS > PICKACOLOR
|
||||
##############################################################################
|
||||
|
||||
|
||||
:PickHEX choose color in system color picker
|
||||
|
||||
|
||||
##############################################################################
|
||||
# PLUGINS > SNIPMATE
|
||||
##############################################################################
|
||||
|
||||
|
||||
<tab> expand snippet
|
||||
|
||||
|
||||
##############################################################################
|
||||
# PLUGINS > SPARKUP
|
||||
##############################################################################
|
||||
|
||||
|
||||
CTRL-e execute sparkup (zen coding expansion)
|
||||
CTRL-n jump to the next empty tag / attribute
|
||||
|
||||
|
||||
##############################################################################
|
||||
# PLUGINS > SURROUND
|
||||
##############################################################################
|
||||
|
||||
|
||||
cs'" change surrounding quotes to double-quotes
|
||||
cs(} change surrounding parens to braces
|
||||
cs({ change surrounding parens to braces with space
|
||||
ds' delete surrounding quotes
|
||||
dst delete surrounding tags
|
||||
ysiw[ surround inner word with brackets
|
||||
vees' surround 2 words (ee) with quotes '
|
||||
|
||||
|
||||
##############################################################################
|
||||
# PLUGINS > TABULAR
|
||||
##############################################################################
|
||||
|
||||
|
||||
:Tabularize /, line the selected lines up on the commas
|
||||
|
||||
|
||||
##############################################################################
|
||||
# PLUGINS > TAGLIST
|
||||
##############################################################################
|
||||
|
||||
|
||||
:TlistToggle open / close taglist window
|
||||
<enter> jump to tag or file
|
||||
<space> display the tag prototype
|
||||
|
||||
|
||||
##############################################################################
|
||||
# PLUGINS > UNIMPAIRED
|
||||
##############################################################################
|
||||
|
||||
|
||||
[space new line above
|
||||
]space new line below
|
||||
[e exchange line above
|
||||
]e exchange line below
|
||||
[x XML encode
|
||||
]x XML decode (with htmlentities)
|
||||
[q jump to previous quickfix item
|
||||
]q jump to next quickfix item
|
||||
[Q jump to first quickfix item
|
||||
]Q jump to last quickfix item
|
||||
|
||||
|
||||
##############################################################################
|
||||
# PLUGINS > VIM-FUGITIVE
|
||||
##############################################################################
|
||||
|
||||
|
||||
:Git run a git command
|
||||
:Gstatus git status : - to (un)stage , p to patch, C to commit
|
||||
:Gcommit git commit
|
||||
:Gread empty the buffer and revert to the last commit
|
||||
:Gwrite write the current file and stage the results
|
||||
:Gmove git mv
|
||||
:Gremove git rm
|
||||
:Glog git log
|
||||
:Gdiff perform a vimdiff against the current file of a certain revision
|
||||
:Gblame open blame information in a scroll bound vertical splitt
|
||||
:Gbrowse open github
|
||||
|
||||
|
||||
##############################################################################
|
||||
# PLUGINS > VIM-MARKDOWN-PREVIEW
|
||||
##############################################################################
|
||||
|
||||
|
||||
:Mm preview markdown document in webbrowser
|
||||
|
||||
|
||||
##############################################################################
|
||||
# PLUGINS > VIM-PEEPOPEN
|
||||
##############################################################################
|
||||
|
||||
|
||||
<Leader>p open the current directory with the peepopen application (fuzzy search)
|
||||
|
||||
|
||||
##############################################################################
|
||||
# PLUGINS > VIM-SYMFONY
|
||||
##############################################################################
|
||||
|
||||
|
||||
:Sview open template file
|
||||
:Saction open action file
|
||||
:Smodel open model file
|
||||
:Sfilter open filter file
|
||||
:Sform open form file
|
||||
:Spartial open partial file / write selected content in partial + include
|
||||
:Scomponent open component file / write selected content in component + include
|
||||
:Salternate open alternate model file (class - table class)
|
||||
:Symfony execute task
|
||||
|
||||
|
||||
##############################################################################
|
||||
# PERSONAL .VIMRC
|
||||
##############################################################################
|
||||
|
||||
|
||||
<leader>ev edit vimrc file
|
||||
<leader>sv reload vimrc file
|
||||
<leader>sh show syntax highlighting groups for word under cursor
|
||||
|
||||
<space> page down
|
||||
jj exit insertion mode
|
||||
<leader>q close the current window
|
||||
|
||||
<leader>/ clear the search register
|
||||
|
||||
<leader>h toggle hidden characters
|
||||
|
||||
<leader>W strip all trailing whitespace
|
||||
|
||||
CTRL-h go to left window
|
||||
CTRL-j go to down window
|
||||
CTRL-k go to top window
|
||||
CTRL-l go to right window
|
||||
<leader>w open vertical split window and activate
|
||||
|
||||
%% will expand to current directory
|
||||
<leader>ew open file from current directory
|
||||
<leader>es open file in split window from current directory
|
||||
<leader>cd change directory to parent dir of current file
|
||||
## will expand to webroot
|
||||
|
||||
:Wrap wrap text
|
||||
<F2> toggle wrapped text
|
||||
|
||||
<F3> toggle spell check
|
||||
|
||||
<F4> toggle light/dark background
|
||||
|
||||
<F5> underline with dashes
|
||||
<F6> underline with double lines
|
||||
|
||||
<leader><up> bubble line(s) up
|
||||
<leader><down> bublle line(s) down
|
||||
|
||||
:Ltag load tags file
|
||||
:Project cd to project and load tags file
|
||||
<leader>t show current tag for word under cursor
|
||||
<leader>st show current tag for word under cursor in split window
|
||||
<leader>tj show current tag list for word under cursor
|
||||
<leader>stj show current tag list for word under cursor in split window
|
||||
|
||||
CTRL-<space> show omnicomplete menu
|
||||
|
||||
<leader>b surround with strong tags
|
||||
<leader>i surround with em tags
|
||||
|
||||
CTRL-p generate PHP DOC
|
||||
|
||||
<leader>a run Ack
|
||||
|
||||
<leader>md preview markdown
|
||||
|
||||
<leader>s preview in safari
|
||||
|
||||
<leader>x colorpicker
|
||||
|
||||
<leader>n toggle Nerdtree
|
||||
<leader>N close Nerdtree
|
||||
<leader>f find current file in Nerdtree
|
||||
|
||||
<leader>l toggle Taglist
|
||||
<leader>L close Taglist
|
||||
|
||||
<leader>ph set filetype to php.html
|
||||
<leader>r reload all snipmate snippets
|
||||
|
||||
CTRL-<tab> switch between buffers
|
||||
|
||||
CTRL-y go to next tag of attribute in sparkup plugin
|
||||
|
||||
<leader>g toggle Gundo window
|
||||
|
||||
IMG<CR> show image browser to insert image tag with src, width and height
|
||||
b insert image tag with dimensions from NERDTree
|
||||
(http://stackoverflow.com/questions/5707925/vim-image-placement)
|
||||
```
|
||||
@@ -0,0 +1,22 @@
|
||||
<script setup lang="ts">
|
||||
import { useThemeVars } from 'naive-ui';
|
||||
import Memo from './vim-memo.content.md';
|
||||
|
||||
const themeVars = useThemeVars();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<Memo />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
::v-deep(pre) {
|
||||
margin: 0;
|
||||
padding: 15px 22px;
|
||||
background-color: v-bind('themeVars.cardColor');
|
||||
border-radius: 4px;
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
@@ -33,16 +33,21 @@ function toBase64(file: File) {
|
||||
|
||||
const fileInput = ref<HTMLInputElement | null>(null);
|
||||
const imgPreview = ref<HTMLImageElement | null>(null);
|
||||
async function handlePreview(image: File) {
|
||||
if (imgPreview.value) {
|
||||
imgPreview.value.src = await toBase64(image);
|
||||
}
|
||||
}
|
||||
function clearPreview() {
|
||||
if (imgPreview.value) {
|
||||
imgPreview.value.src = '';
|
||||
}
|
||||
}
|
||||
async function handlePreview(image: File) {
|
||||
if (imgPreview.value) {
|
||||
if (image.type?.includes('image/')) {
|
||||
imgPreview.value.src = await toBase64(image);
|
||||
}
|
||||
else {
|
||||
clearPreview();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function triggerFileInput() {
|
||||
fileInput.value?.click();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import * as monacoEditor from 'monaco-editor';
|
||||
import { VueMonacoEditor, loader } from '@guolao/vue-monaco-editor';
|
||||
import type { MonacoEditor } from '@guolao/vue-monaco-editor';
|
||||
import EditorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker';
|
||||
import JsonWorker from 'monaco-editor/esm/vs/language/json/json.worker?worker';
|
||||
@@ -53,6 +54,9 @@ globalThis.MonacoEnvironment = {
|
||||
},
|
||||
};
|
||||
|
||||
// loaded monaco-editor from `node_modules`
|
||||
loader.config({ monaco: monacoEditor });
|
||||
|
||||
export interface EditorProps {
|
||||
defaultValue?: string
|
||||
defaultPath?: string
|
||||
@@ -113,7 +117,7 @@ export default {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<vue-monaco-editor
|
||||
<VueMonacoEditor
|
||||
v-bind="inheritedAttrs"
|
||||
v-model:value="value"
|
||||
@before-mount="(monaco: MonacoEditor) => emits('beforeMount', monaco)"
|
||||
|
||||
@@ -2,6 +2,8 @@ const random = () => Math.random();
|
||||
|
||||
const randFromArray = (array: unknown[]) => array[Math.floor(random() * array.length)];
|
||||
|
||||
const multiRandFromArray = (array: unknown[], length: number) => Array.from({ length }, () => array[Math.floor(random() * array.length)]);
|
||||
|
||||
const randIntFromInterval = (min: number, max: number) => Math.floor(random() * (max - min) + min);
|
||||
|
||||
// Durstenfeld shuffle
|
||||
@@ -22,6 +24,7 @@ const generateRandomId = () => `id-${random().toString(36).substring(2, 12)}`;
|
||||
|
||||
export {
|
||||
randFromArray,
|
||||
multiRandFromArray,
|
||||
randIntFromInterval,
|
||||
random,
|
||||
shuffleArray,
|
||||
|
||||
+19
-17
@@ -116,6 +116,8 @@ export default defineConfig({
|
||||
'@babel/core': fileURLToPath(new URL('./src/_empty.ts', import.meta.url)),
|
||||
'isolated-vm': fileURLToPath(new URL('./src/_empty.ts', import.meta.url)),
|
||||
'onnxruntime-node': fileURLToPath(new URL('./src/_empty.ts', import.meta.url)),
|
||||
'unpdf/pdfjs': fileURLToPath(new URL('./src/_empty.ts', import.meta.url)),
|
||||
'webcrypto-liner-shim': !process.env.VERCEL ? 'webcrypto-liner-shim' : fileURLToPath(new URL('./src/_empty.ts', import.meta.url)),
|
||||
},
|
||||
},
|
||||
define: {
|
||||
@@ -130,31 +132,31 @@ export default defineConfig({
|
||||
minify: !process.env.VERCEL,
|
||||
reportCompressedSize: !process.env.VERCEL,
|
||||
// cssMinify: false,
|
||||
modulePreload: false,
|
||||
// modulePreload: false,
|
||||
rollupOptions: {
|
||||
external: ['regex', './out/isolated_vm', 'isolated-vm', 'onnxruntime-node'],
|
||||
external: ['regex', './out/isolated_vm', 'isolated-vm', 'onnxruntime-node', 'unpdf/pdfjs', ...(process.env.VERCEL ? ['webcrypto-liner-shim'] : [])],
|
||||
output: {
|
||||
format: 'es',
|
||||
manualChunks: (id) => {
|
||||
if (id.includes('monaco-editor')) return 'monaco-editor';
|
||||
if (id.includes('tesseract.js')) return 'tesseract.js';
|
||||
if (id.includes('pdfjs')) return 'pdfjs';
|
||||
if (id.includes('unicode')) return 'unicode';
|
||||
// if (id.includes('transformers')) return 'transformers';
|
||||
// if (id.includes("node_modules")) {
|
||||
// return "vendor";
|
||||
// }
|
||||
},
|
||||
sourcemapIgnoreList: (relativeSourcePath) => {
|
||||
const normalizedPath = path.normalize(relativeSourcePath);
|
||||
return normalizedPath.includes("node_modules");
|
||||
},
|
||||
// manualChunks: (id) => {
|
||||
// // if (id.includes('monaco-editor')) return 'monaco-editor';
|
||||
// // if (id.includes('tesseract.js')) return 'tesseract.js';
|
||||
// // if (id.includes('pdfjs')) return 'pdfjs';
|
||||
// // if (id.includes('unicode')) return 'unicode';
|
||||
// // if (id.includes('transformers')) return 'transformers';
|
||||
// // if (id.includes("node_modules")) {
|
||||
// // return "vendor";
|
||||
// // }
|
||||
// },
|
||||
// sourcemapIgnoreList: (relativeSourcePath) => {
|
||||
// const normalizedPath = path.normalize(relativeSourcePath);
|
||||
// return normalizedPath.includes("node_modules");
|
||||
// },
|
||||
},
|
||||
cache: false,
|
||||
},
|
||||
},
|
||||
optimizeDeps: {
|
||||
include: ['isolated-vm', 'pdfjs-dist', 'onnxruntime-node'], // optionally specify dependency name
|
||||
include: ['isolated-vm', 'pdfjs-dist', 'onnxruntime-node', 'unpdf', 'unpdf/pdfjs', ...(process.env.VERCEL ? ['webcrypto-liner-shim'] : [])], // optionally specify dependency name
|
||||
esbuildOptions: {
|
||||
supported: {
|
||||
'top-level-await': true,
|
||||
|
||||
Reference in new issue
Block a user