mirror of
https://github.com/sharevb/it-tools.git
synced 2026-11-20 21:23:08 +03:00
Merge branch 'feat/docker-compose-to-kubernetes' into chore/all-my-stuffs
# Conflicts: # components.d.ts # package.json # pnpm-lock.yaml # src/tools/index.ts
This commit is contained in:
commit
e473473863
4 files changed
+81
-3
No files matched your search
+3
-3
@@ -42,6 +42,7 @@
|
||||
"@guyplusplus/turndown-plugin-gfm": "^1.0.7",
|
||||
"@huggingface/transformers": "3.0.0-alpha.14",
|
||||
"@date-fns/utc": "^1.2.0",
|
||||
"@guolao/vue-monaco-editor": "^1.5.1",
|
||||
"@it-tools/bip39": "^0.0.4",
|
||||
"@it-tools/oggen": "^1.3.0",
|
||||
"@regexper/render": "^1.0.0",
|
||||
@@ -139,6 +140,7 @@
|
||||
"dompurify": "^3.0.6",
|
||||
"email-bounce-parser-browser": "^1.1",
|
||||
"date-holidays": "^3.23.12",
|
||||
"docker2kube": "^0.0.14",
|
||||
"dompurify": "^3.0.6",
|
||||
"duration-fns": "^3.0.2",
|
||||
"email-normalizer": "^1.0.0",
|
||||
@@ -324,6 +326,4 @@
|
||||
"zx": "^7.2.1"
|
||||
},
|
||||
"packageManager": "pnpm@8.15.3"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
<script setup lang="ts">
|
||||
import { convert as docker2kube } from 'docker2kube';
|
||||
import TextareaCopyable from '@/components/TextareaCopyable.vue';
|
||||
|
||||
const dockerCompose = ref(
|
||||
`version: '3.3'
|
||||
services:
|
||||
nginx:
|
||||
ports:
|
||||
- '80:80'
|
||||
volumes:
|
||||
- '/var/run/docker.sock:/tmp/docker.sock:ro'
|
||||
restart: always
|
||||
image: nginx`,
|
||||
);
|
||||
|
||||
const conversionResult = computed(() => {
|
||||
try {
|
||||
return { kubeYaml: docker2kube(dockerCompose.value.trim()), errors: [] };
|
||||
}
|
||||
catch (e: any) {
|
||||
return { kubeYaml: '#see error messages', errors: e.toString().split('\n') };
|
||||
}
|
||||
});
|
||||
|
||||
const errors = computed(() => conversionResult.value.errors);
|
||||
const kubeYaml = computed(() => conversionResult.value.kubeYaml);
|
||||
|
||||
const MONACO_EDITOR_OPTIONS = {
|
||||
automaticLayout: true,
|
||||
formatOnType: true,
|
||||
formatOnPaste: true,
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<c-label label="Paste your Docker Compose file content:">
|
||||
<div relative w-full>
|
||||
<c-monaco-editor
|
||||
v-model:value="dockerCompose"
|
||||
theme="vs-dark"
|
||||
language="yaml"
|
||||
height="250px"
|
||||
:options="MONACO_EDITOR_OPTIONS"
|
||||
/>
|
||||
</div>
|
||||
</c-label>
|
||||
|
||||
<div v-if="errors.length > 0">
|
||||
<n-alert title="The following errors occured" type="error" mt-5>
|
||||
<ul>
|
||||
<li v-for="(message, index) of errors" :key="index">
|
||||
{{ message }}
|
||||
</li>
|
||||
</ul>
|
||||
</n-alert>
|
||||
</div>
|
||||
|
||||
<n-divider />
|
||||
|
||||
<TextareaCopyable :value="kubeYaml" language="yaml" copy-placement="outside" />
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,12 @@
|
||||
import { BrandDocker } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'Docker compose to kubernetes',
|
||||
path: '/docker-compose-to-kubernetes',
|
||||
description: 'Docker Compose to Kubernetes manifests',
|
||||
keywords: ['docker', 'compose', 'convert', 'kubernetes'],
|
||||
component: () => import('./docker-compose-to-kubernetes.vue'),
|
||||
icon: BrandDocker,
|
||||
createdAt: new Date('2024-02-18'),
|
||||
});
|
||||
@@ -62,6 +62,7 @@ import { tool as asciiTextDrawer } from './ascii-text-drawer';
|
||||
import { tool as daysCalculator } from './days-calculator';
|
||||
import { tool as dateDurationCalculator } from './date-duration-calculator';
|
||||
import { tool as macAddressConverter } from './mac-address-converter';
|
||||
import { tool as dockerComposeToKubernetesConverter } from './docker-compose-to-kubernetes';
|
||||
import { tool as textToUnicode } from './text-to-unicode';
|
||||
import { tool as certificateKeyParser } from './certificate-key-parser';
|
||||
import { tool as crcCalculator } from './crc-calculator';
|
||||
@@ -343,6 +344,7 @@ export const toolsByCategory: ToolCategory[] = [
|
||||
chmodCalculator,
|
||||
dockerRunToDockerComposeConverter,
|
||||
dockerComposeToDockerRunConverter,
|
||||
dockerComposeToKubernetesConverter,
|
||||
xmlFormatter,
|
||||
xsltTester,
|
||||
yamlViewer,
|
||||
|
||||
Reference in new issue
Block a user