Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
devhaozi committed Nov 1, 2024
1 parent e2fb108 commit ff34cc7
Show file tree
Hide file tree
Showing 11 changed files with 85 additions and 25 deletions.
16 changes: 11 additions & 5 deletions web/src/components/common/CodeEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,22 @@ import { languageByPath } from '@/utils/file'
import Editor from '@guolao/vue-monaco-editor'
const props = defineProps({
path: String,
readOnly: Boolean
path: {
type: String,
required: true
},
readOnly: {
type: Boolean,
required: true
}
})
const disabled = ref(false) // 在出现错误的情况下禁用保存
const data = ref('')
const get = async () => {
await file
.content(props.path!)
.content(props.path)
.then((res) => {
data.value = res.data
window.$message.success('获取成功')
Expand All @@ -28,7 +34,7 @@ const save = async () => {
window.$message.error('当前状态下不可保存')
return
}
await file.save(props.path!, data.value)
await file.save(props.path, data.value)
window.$message.success('保存成功')
}
Expand All @@ -45,7 +51,7 @@ defineExpose({
<template>
<Editor
v-model:value="data"
:language="languageByPath(props.path!)"
:language="languageByPath(props.path)"
theme="vs-dark"
height="60vh"
:options="{
Expand Down
5 changes: 4 additions & 1 deletion web/src/components/common/RealtimeLog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import ws from '@/api/ws'
import type { LogInst } from 'naive-ui'
const props = defineProps({
path: String
path: {
type: String,
required: true
}
})
const log = ref('')
Expand Down
5 changes: 4 additions & 1 deletion web/src/components/common/RealtimeLogModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import type { LogInst } from 'naive-ui'
const show = defineModel<boolean>('show', { type: Boolean, required: true })
const props = defineProps({
path: String
path: {
type: String,
required: true
}
})
const log = ref('')
Expand Down
5 changes: 4 additions & 1 deletion web/src/views/apps/php/PhpView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ import systemctl from '@/api/panel/systemctl'
import { renderIcon } from '@/utils'
const props = defineProps({
version: Number
version: {
type: Number,
required: true
}
})
const { version } = toRefs(props)
Expand Down
12 changes: 9 additions & 3 deletions web/src/views/cert/AccountView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,14 @@ import cert from '@/api/panel/cert'
import type { Account } from '@/views/cert/types'
const props = defineProps({
caProviders: Array<any>,
algorithms: Array<any>
caProviders: {
type: Array<any>,
required: true
},
algorithms: {
type: Array<any>,
required: true
}
})
const { caProviders, algorithms } = toRefs(props)
Expand Down Expand Up @@ -54,7 +60,7 @@ const columns: any = [
},
{
default: () => {
return caProviders?.value?.find((item: any) => item.value === row.ca)?.label
return caProviders.value?.find((item: any) => item.value === row.ca)?.label
}
}
)
Expand Down
22 changes: 17 additions & 5 deletions web/src/views/cert/CertView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,22 @@ import ObtainModal from '@/views/cert/ObtainModal.vue'
import type { Cert } from '@/views/cert/types'
const props = defineProps({
algorithms: Array<any>,
websites: Array<any>,
accounts: Array<any>,
dns: Array<any>
algorithms: {
type: Array<any>,
required: true
},
websites: {
type: Array<any>,
required: true
},
accounts: {
type: Array<any>,
required: true
},
dns: {
type: Array<any>,
required: true
}
})
const { algorithms, websites, accounts, dns } = toRefs(props)
Expand Down Expand Up @@ -114,7 +126,7 @@ const columns: any = [
default: () =>
row.account_id == 0
? ''
: accounts?.value?.find((item: any) => item.value === row.account_id)?.label
: accounts.value?.find((item: any) => item.value === row.account_id)?.label
})
]
})
Expand Down
10 changes: 8 additions & 2 deletions web/src/views/cert/CreateAccountModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@ import { NButton, NInput, NSpace } from 'naive-ui'
const show = defineModel<boolean>('show', { type: Boolean, required: true })
const props = defineProps({
caProviders: Array<any>,
algorithms: Array<any>
caProviders: {
type: Array<any>,
required: true
},
algorithms: {
type: Array<any>,
required: true
}
})
const { caProviders, algorithms } = toRefs(props)
Expand Down
20 changes: 16 additions & 4 deletions web/src/views/cert/CreateCertModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,22 @@ import { NButton, NSpace } from 'naive-ui'
const show = defineModel<boolean>('show', { type: Boolean, required: true })
const props = defineProps({
algorithms: Array<any>,
websites: Array<any>,
accounts: Array<any>,
dns: Array<any>
algorithms: {
type: Array<any>,
required: true
},
websites: {
type: Array<any>,
required: true
},
accounts: {
type: Array<any>,
required: true
},
dns: {
type: Array<any>,
required: true
}
})
const { algorithms, websites, accounts, dns } = toRefs(props)
Expand Down
5 changes: 4 additions & 1 deletion web/src/views/cert/CreateDnsModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ import { NButton, NInput, NSpace } from 'naive-ui'
const show = defineModel<boolean>('show', { type: Boolean, required: true })
const props = defineProps({
dnsProviders: Array<any>
dnsProviders: {
type: Array<any>,
required: true
}
})
const { dnsProviders } = toRefs(props)
Expand Down
5 changes: 4 additions & 1 deletion web/src/views/cert/DnsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ import cert from '@/api/panel/cert'
import type { DNS } from '@/views/cert/types'
const props = defineProps({
dnsProviders: Array<any>
dnsProviders: {
type: Array<any>,
required: true
}
})
const { dnsProviders } = toRefs(props)
Expand Down
5 changes: 4 additions & 1 deletion web/src/views/container/ContainerCreate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
import container from '@/api/panel/container'
const props = defineProps({
show: Boolean
show: {
type: Boolean,
required: true
}
})
const { show } = toRefs(props)
Expand Down

0 comments on commit ff34cc7

Please sign in to comment.