@@ -9,6 +9,7 @@ import CodeEditor from '@/components/CodeEditor/CodeEditor.vue'
99import ngx from ' @/api/ngx'
1010import InspectConfig from ' @/views/config/InspectConfig.vue'
1111import ChatGPT from ' @/components/ChatGPT/ChatGPT.vue'
12+ import {formatDateTime } from ' ../../lib/helper'
1213
1314const {$gettext, interpolate} = gettext
1415const route = useRoute ()
@@ -26,13 +27,16 @@ const name = computed(() => {
2627const configText = ref (' ' )
2728const history_chatgpt_record = ref ([])
2829const file_path = ref (' ' )
30+ const active_key = ref ([' 1' , ' 2' ])
31+ const modified_at = ref (' ' )
2932
3033function init() {
3134 if (name .value ) {
3235 config .get (name .value ).then (r => {
3336 configText .value = r .config
3437 history_chatgpt_record .value = r .chatgpt_messages
3538 file_path .value = r .file_path
39+ modified_at .value = r .modified_at
3640 }).catch (r => {
3741 message .error (r .message ?? $gettext (' Server error' ))
3842 })
@@ -90,15 +94,45 @@ function format_code() {
9094 </a-card >
9195 </a-col >
9296
93- <a-col class =" col-right" :xs =" 24" :sm =" 24" :md =" 6" >
94- <a-card >
95- <chat-g-p-t :content =" configText" :path =" file_path"
96- v-model:history_messages =" history_chatgpt_record" />
97+ <a-col :xs =" 24" :sm =" 24" :md =" 6" >
98+ <a-card class =" col-right" >
99+ <a-collapse v-model:activeKey =" active_key" ghost >
100+ <a-collapse-panel key =" 1" :header =" $gettext('Basic')" >
101+ <a-form layout =" vertical" >
102+ <a-form-item :label =" $gettext('Path')" >
103+ {{ file_path }}
104+ </a-form-item >
105+ <a-form-item :label =" $gettext('Updated at')" >
106+ {{ formatDateTime(modified_at) }}
107+ </a-form-item >
108+ </a-form >
109+ </a-collapse-panel >
110+ <a-collapse-panel key =" 2" header =" ChatGPT" >
111+ <chat-g-p-t :content =" configText" :path =" file_path"
112+ v-model:history_messages =" history_chatgpt_record" />
113+ </a-collapse-panel >
114+ </a-collapse >
97115 </a-card >
98116 </a-col >
99117 </a-row >
100118</template >
101119
102120<style lang="less" scoped>
121+ .col-right {
122+ position : sticky ;
123+ top : 78px ;
103124
125+ :deep(.ant-card-body ) {
126+ max-height : 100vh ;
127+ overflow-y : scroll ;
128+ }
129+ }
130+
131+ :deep(.ant-collapse-ghost > .ant-collapse-item > .ant-collapse-content > .ant-collapse-content-box ) {
132+ padding : 0 ;
133+ }
134+
135+ :deep(.ant-collapse > .ant-collapse-item > .ant-collapse-header ) {
136+ padding : 0 0 10px 0 ;
137+ }
104138 </style >
0 commit comments