mirror of https://github.com/nocodb/nocodb
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.0 KiB
43 lines
1.0 KiB
2 years ago
|
<script lang="ts" setup>
|
||
|
import { message } from 'ant-design-vue'
|
||
2 years ago
|
import { extractSdkResponseErrorMsg, useApi } from '#imports'
|
||
2 years ago
|
|
||
|
const { api, isLoading } = useApi()
|
||
|
|
||
2 years ago
|
let key = $ref('')
|
||
2 years ago
|
|
||
2 years ago
|
const loadLicense = async () => {
|
||
|
try {
|
||
|
const response = await api.orgLicense.get()
|
||
2 years ago
|
|
||
2 years ago
|
key = response.key
|
||
|
} catch (e) {
|
||
|
message.error(await extractSdkResponseErrorMsg(e))
|
||
|
}
|
||
|
}
|
||
|
const setLicense = async () => {
|
||
2 years ago
|
try {
|
||
2 years ago
|
await api.orgLicense.set({ key: key })
|
||
|
message.success('License key updated')
|
||
|
} catch (e) {
|
||
2 years ago
|
message.error(await extractSdkResponseErrorMsg(e))
|
||
|
}
|
||
|
}
|
||
|
|
||
2 years ago
|
loadLicense()
|
||
2 years ago
|
|
||
|
</script>
|
||
|
|
||
|
<template>
|
||
2 years ago
|
<div class="h-full overflow-y-scroll scrollbar-thin-dull">
|
||
2 years ago
|
<div class="text-xl mt-4">License</div>
|
||
|
<a-divider class="!my-3" />
|
||
2 years ago
|
<div class="">
|
||
2 years ago
|
<a-textarea v-model:value="key" placeholder="License key" class="!mt-2 !max-w-[600px]"></a-textarea>
|
||
|
</div>
|
||
2 years ago
|
<a-button class="mt-4" @click="setLicense" type="primary">Save license key</a-button>
|
||
2 years ago
|
</div>
|
||
|
</template>
|
||
|
|
||
|
<style scoped></style>
|