Skip to content

Commit

Permalink
- Fixed reading params from link
Browse files Browse the repository at this point in the history
  • Loading branch information
639852 committed Aug 8, 2024
1 parent 95355e9 commit ebbf541
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
12 changes: 6 additions & 6 deletions src/components/cloud/modules/keyweb/panels/os.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
:label="`${capitalize($t('clientinfo.username'))}:`"
>
<a-input
v-model:value="authData.username"
:value="authData.username"
:style="{
boxShadow: (authData.username.length < 2) ? '0 0 2px 2px var(--err)' : null
}"
@change="setOptions('config.username', $event)"
@update:value="authData.username = $event; setOptions('config.username', $event)"
/>

<div v-if="authData.username.length < 2" style="line-height: 1.5; color: var(--err)">
Expand All @@ -43,11 +43,11 @@
:label="`${capitalize($t('hostname'))}:`"
>
<a-input
v-model:value="authData.hostname"
:value="authData.hostname"
:style="{
boxShadow: (authData.hostname.length < 2) ? '0 0 2px 2px var(--err)' : null
}"
@change="setOptions('config.hostname', $event)"
@update:value="authData.hostname = $event; setOptions('config.hostname', $event)"
/>

<div v-if="authData.hostname.length < 2" style="line-height: 1.5; color: var(--err)">
Expand All @@ -68,9 +68,9 @@
/>

<a-input-password
v-model:value="authData.password"
:value="authData.password"
class="password"
@change="setOptions('config.password', $event)"
@update:value="authData.password = $event; setOptions('config.password', $event)"
/>
</a-form-item>
</a-col>
Expand Down
14 changes: 12 additions & 2 deletions src/components/cloud/modules/keyweb/panels/plan.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@

<script setup>
import { inject, nextTick, watch, computed, ref } from 'vue'
import { useRoute } from 'vue-router'
import { EditorContainer } from 'nocloud-ui'
import { useCloudStore } from '@/stores/cloud.js'
import { getPeriods } from '@/functions.js'
import { useSlider } from '@/hooks/utils'
Expand All @@ -59,13 +61,21 @@ watch(() => props.productSize, (value) => {
emits('update:periods', getPeriods(value, props.plans))
})
const route = useRoute()
const cloudStore = useCloudStore()
const [product] = inject('useProduct', () => [])()
const [, setOptions] = inject('useOptions', () => [])()
const [, setPrice] = inject('usePriceOVH', () => [])()
if (props.products.length > 0) setProduct(props.products[1] ?? props.products[0])
else resetData()
if (props.products.length > 0) {
const data = localStorage.getItem('data') ?? route.query.data
const { productSize } = JSON.parse(data ?? '{}')
if (productSize) setProduct(productSize)
else setProduct(props.products[1] ?? props.products[0])
} else {
resetData()
}
watch(() => props.products, (value) => {
if (value.length < 1) resetData()
Expand Down
3 changes: 2 additions & 1 deletion src/components/services/custom/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,8 @@ export default {

this.checkedType = group
this.options.size = data.productSize
} else return
return
}

if (keys && this.options.period) {
this.options.size = keys[this.options.period]
Expand Down

0 comments on commit ebbf541

Please sign in to comment.