@@ -1,11 +1,9 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue'
|
import { reactive, ref } from 'vue'
|
||||||
|
|
||||||
const dbVersions = ref(['18', '17', '16', '15', '14', '13', '12', '11', '10'])
|
const dbVersions = ref(['18', '17', '16', '15', '14', '13', '12', '11', '10'])
|
||||||
const dbVersion = ref('18')
|
|
||||||
|
|
||||||
const osTypes = ref(['Linux', 'Windows', 'OS X'])
|
const osTypes = ref(['Linux', 'Windows', 'OS X'])
|
||||||
const osType = ref('Linux')
|
|
||||||
|
|
||||||
const dbTypes = ref([
|
const dbTypes = ref([
|
||||||
'Web application',
|
'Web application',
|
||||||
@@ -14,15 +12,8 @@ const dbTypes = ref([
|
|||||||
'Desktop application',
|
'Desktop application',
|
||||||
'Mixed type of application',
|
'Mixed type of application',
|
||||||
])
|
])
|
||||||
const dbType = ref('Web application')
|
|
||||||
|
|
||||||
const totalRam = ref()
|
|
||||||
const ramUnits = ref(['TB', 'GB', 'MB'])
|
const ramUnits = ref(['TB', 'GB', 'MB'])
|
||||||
const ramUnit = ref('GB')
|
|
||||||
|
|
||||||
const totalCPUs = ref(1)
|
|
||||||
|
|
||||||
const totalConnections = ref(100)
|
|
||||||
|
|
||||||
const dataStorages = ref([
|
const dataStorages = ref([
|
||||||
'NVME storage',
|
'NVME storage',
|
||||||
@@ -30,31 +21,41 @@ const dataStorages = ref([
|
|||||||
'Network (SAN) storage',
|
'Network (SAN) storage',
|
||||||
'HDD storage',
|
'HDD storage',
|
||||||
])
|
])
|
||||||
const dataStorage = ref('SSD storage')
|
|
||||||
|
|
||||||
const dataSizes = ref(['Less than RAM', 'RAM - 3xRAM', 'More than 3xRAM'])
|
const dataSizes = ref(['Less than RAM', 'RAM - 3xRAM', 'More than 3xRAM'])
|
||||||
const dataSize = ref('Less than RAM')
|
|
||||||
|
const state = reactive({
|
||||||
|
dbVersion: 18,
|
||||||
|
osType: 'Linux',
|
||||||
|
dbType: 'Web application',
|
||||||
|
totalRAM: undefined,
|
||||||
|
ramUnit: 'GB',
|
||||||
|
totalCPUs: 1,
|
||||||
|
totalConnections: 100,
|
||||||
|
dataStorage: 'SSD storage',
|
||||||
|
dataSize: 'Less than RAM',
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<UForm class="space-y-4">
|
<UForm class="space-y-4" :state>
|
||||||
<UFormField
|
<UFormField
|
||||||
label="DB version"
|
label="DB version"
|
||||||
help="PostgreSQL version (find out via 'SELECT version();')"
|
help="PostgreSQL version (find out via 'SELECT version();')"
|
||||||
>
|
>
|
||||||
<USelect v-model="dbVersion" :items="dbVersions" class="w-full" />
|
<USelect v-model="state.dbVersion" :items="dbVersions" class="w-full" />
|
||||||
</UFormField>
|
</UFormField>
|
||||||
<UFormField
|
<UFormField
|
||||||
label="OS Type"
|
label="OS Type"
|
||||||
help="Operation system of the PostgreSQL server host"
|
help="Operation system of the PostgreSQL server host"
|
||||||
>
|
>
|
||||||
<USelect v-model="osType" :items="osTypes" class="w-full" />
|
<USelect v-model="state.osType" :items="osTypes" class="w-full" />
|
||||||
</UFormField>
|
</UFormField>
|
||||||
<UFormField
|
<UFormField
|
||||||
label="DB type"
|
label="DB type"
|
||||||
help="What type of application is PostgreSQL used for"
|
help="What type of application is PostgreSQL used for"
|
||||||
>
|
>
|
||||||
<USelect v-model="dbType" :items="dbTypes" class="w-full" />
|
<USelect v-model="state.dbType" :items="dbTypes" class="w-full" />
|
||||||
</UFormField>
|
</UFormField>
|
||||||
<UFormField
|
<UFormField
|
||||||
label="Total memory (RAM)"
|
label="Total memory (RAM)"
|
||||||
@@ -63,11 +64,11 @@ const dataSize = ref('Less than RAM')
|
|||||||
>
|
>
|
||||||
<div class="flex items-center gap-4">
|
<div class="flex items-center gap-4">
|
||||||
<UInputNumber
|
<UInputNumber
|
||||||
v-model="totalRam"
|
v-model="state.totalRAM"
|
||||||
class="grow"
|
class="grow"
|
||||||
placeholder="Total memory (RAM) (* required)"
|
placeholder="Total memory (RAM) (* required)"
|
||||||
/>
|
/>
|
||||||
<USelect v-model="ramUnit" :items="ramUnits" />
|
<USelect v-model="state.ramUnit" :items="ramUnits" />
|
||||||
</div>
|
</div>
|
||||||
</UFormField>
|
</UFormField>
|
||||||
<UFormField
|
<UFormField
|
||||||
@@ -75,7 +76,7 @@ const dataSize = ref('Less than RAM')
|
|||||||
help="Number of CPUs, which PostgreSQL can use. CPUs = N threads per core * N cores per socket * N sockets"
|
help="Number of CPUs, which PostgreSQL can use. CPUs = N threads per core * N cores per socket * N sockets"
|
||||||
>
|
>
|
||||||
<UInputNumber
|
<UInputNumber
|
||||||
v-model="totalCPUs"
|
v-model="state.totalCPUs"
|
||||||
class="w-full"
|
class="w-full"
|
||||||
placeholder="Number of CPUs"
|
placeholder="Number of CPUs"
|
||||||
/>
|
/>
|
||||||
@@ -85,19 +86,23 @@ const dataSize = ref('Less than RAM')
|
|||||||
help="Maximum number of PostgreSQL client connections"
|
help="Maximum number of PostgreSQL client connections"
|
||||||
>
|
>
|
||||||
<UInputNumber
|
<UInputNumber
|
||||||
v-model="totalConnections"
|
v-model="state.totalConnections"
|
||||||
class="w-full"
|
class="w-full"
|
||||||
placeholder="Number of connections"
|
placeholder="Number of connections"
|
||||||
/>
|
/>
|
||||||
</UFormField>
|
</UFormField>
|
||||||
<UFormField label="Data storage" help="Type of data storage device">
|
<UFormField label="Data storage" help="Type of data storage device">
|
||||||
<USelect v-model="dataStorage" :items="dataStorages" class="w-full" />
|
<USelect
|
||||||
|
v-model="state.dataStorage"
|
||||||
|
:items="dataStorages"
|
||||||
|
class="w-full"
|
||||||
|
/>
|
||||||
</UFormField>
|
</UFormField>
|
||||||
<UFormField
|
<UFormField
|
||||||
label="Total data size"
|
label="Total data size"
|
||||||
help="Estimated total size of your database compared to total server RAM"
|
help="Estimated total size of your database compared to total server RAM"
|
||||||
>
|
>
|
||||||
<USelect v-model="dataSize" :items="dataSizes" class="w-full" />
|
<USelect v-model="state.dataSize" :items="dataSizes" class="w-full" />
|
||||||
</UFormField>
|
</UFormField>
|
||||||
<UButton size="xl" label="GENERATE" block type="submit" class="h-16" />
|
<UButton size="xl" label="GENERATE" block type="submit" class="h-16" />
|
||||||
</UForm>
|
</UForm>
|
||||||
|
|||||||
Reference in New Issue
Block a user