Browse Source

fix: adjust button positioning and improve padding in UpstreamCards

0xJacky 3 weeks ago
parent
commit
352a2943c0

+ 1 - 1
app/src/components/LLM/ChatMessageInput.vue

@@ -132,7 +132,7 @@ function handleButtonClick() {
   .send-btn {
     position: absolute;
     right: 16px;
-    bottom: 16px;
+    bottom: 19px;
   }
 }
 

+ 1 - 2
app/src/components/UpstreamCards/UpstreamCards.vue

@@ -1,4 +1,3 @@
-<!-- Upstream cards component that displays upstream targets as cards instead of tags -->
 <script setup lang="ts">
 import type { ProxyTarget } from '@/api/site'
 import UpstreamDetailModal from '@/components/UpstreamDetailModal/UpstreamDetailModal.vue'
@@ -89,7 +88,7 @@ function getCardStatusColor(target: ProxyTarget): string {
 
 <style scoped lang="less">
 .upstream-cards {
-  padding: 0 12px;
+  padding: 24px 12px 0 12px;
   margin-bottom: 16px;
 
   .upstream-header {

+ 1 - 1
app/src/views/stream/components/RightPanel/Chat.vue

@@ -14,7 +14,7 @@ const { configText, filepath } = storeToRefs(store)
 <template>
   <div class="mt--6">
     <LLM
-      :content="configText"
+      :nginx-config="configText"
       :path="filepath"
       :height="chatHeight"
     />

+ 12 - 1
app/src/views/stream/components/StreamEditor.vue

@@ -9,6 +9,7 @@ import { ConfigStatus } from '@/constants'
 import { useStreamEditorStore } from '../store'
 
 const router = useRouter()
+const { message } = App.useApp()
 
 const store = useStreamEditorStore()
 const { name, status, configText, filepath, saving, parseErrorStatus, parseErrorMessage, advanceMode, loading, data } = storeToRefs(store)
@@ -18,6 +19,16 @@ const showHistory = ref(false)
 const upstreamTargets = computed(() => {
   return data.value.proxy_targets || []
 })
+
+async function save() {
+  try {
+    await store.save()
+    message.success($gettext('Saved successfully'))
+  }
+  catch {
+    // do nothing
+  }
+}
 </script>
 
 <template>
@@ -125,7 +136,7 @@ const upstreamTargets = computed(() => {
           <AButton
             type="primary"
             :loading="saving"
-            @click="store.save"
+            @click="save"
           >
             {{ $gettext('Save') }}
           </AButton>

+ 0 - 4
app/src/views/stream/store.ts

@@ -8,8 +8,6 @@ import { useNgxConfigStore } from '@/components/NgxConfigEditor'
 import { ConfigStatus } from '@/constants'
 
 export const useStreamEditorStore = defineStore('streamEditor', () => {
-  const { message } = App.useApp()
-
   const name = ref('')
   const advanceMode = ref(false)
   const parseErrorStatus = ref(false)
@@ -67,8 +65,6 @@ export const useStreamEditorStore = defineStore('streamEditor', () => {
       })
 
       handleResponse(response)
-
-      message.success($gettext('Saved successfully'))
     }
     catch (error) {
       handleParseError(error as { error?: string, message: string })