RightPanel.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <script setup lang="ts">
  2. import { PortScannerCompact } from '@/components/PortScanner'
  3. import { useSiteEditorStore } from '../SiteEditor/store'
  4. import Basic from './Basic.vue'
  5. import Chat from './Chat.vue'
  6. import ConfigTemplate from './ConfigTemplate.vue'
  7. const activeKey = ref('basic')
  8. const editorStore = useSiteEditorStore()
  9. const { advanceMode } = storeToRefs(editorStore)
  10. watch(advanceMode, val => {
  11. if (val) {
  12. activeKey.value = 'basic'
  13. }
  14. })
  15. </script>
  16. <template>
  17. <div class="right-settings-container">
  18. <ACard
  19. class="right-settings"
  20. :bordered="false"
  21. >
  22. <ATabs
  23. v-model:active-key="activeKey"
  24. class="mb-24px"
  25. size="small"
  26. >
  27. <ATabPane key="basic" :tab="$gettext('Basic')">
  28. <Basic />
  29. </ATabPane>
  30. <ATabPane
  31. v-if="!advanceMode"
  32. key="config-template"
  33. :tab="$gettext('Config Template')"
  34. >
  35. <ConfigTemplate />
  36. </ATabPane>
  37. <ATabPane key="chat" :tab="$gettext('Chat')">
  38. <Chat />
  39. </ATabPane>
  40. <ATabPane key="port-scanner" :tab="$gettext('Port Scanner')">
  41. <PortScannerCompact />
  42. </ATabPane>
  43. </ATabs>
  44. </ACard>
  45. </div>
  46. </template>
  47. <style scoped lang="less">
  48. .right-settings-container {
  49. position: relative;
  50. .right-settings {
  51. max-height: calc(100vh - 323px);
  52. overflow-y: scroll;
  53. position: relative;
  54. }
  55. :deep(.ant-card-body) {
  56. padding: 19.5px 24px;
  57. }
  58. :deep(.ant-tabs-nav) {
  59. margin: 0;
  60. }
  61. }
  62. :deep(.ant-tabs-content) {
  63. padding-top: 24px;
  64. max-height: calc(100vh - 425px);
  65. overflow-y: scroll;
  66. }
  67. </style>