This is an automated email from the ASF dual-hosted git repository.

qiuxiafan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-banyandb.git


The following commit(s) were added to refs/heads/main by this push:
     new 0af505e1 feat: Add `NoSort` Field to IndexRule page (#568)
0af505e1 is described below

commit 0af505e18a612ecdf022086d0b1fd6defa0ef468
Author: Fine0830 <[email protected]>
AuthorDate: Tue Dec 10 10:23:08 2024 +0800

    feat: Add `NoSort` Field to IndexRule page (#568)
---
 CHANGES.md                            |  1 +
 ui/src/components/IndexRule/index.vue | 37 ++++++++++++++++++-----------------
 2 files changed, 20 insertions(+), 18 deletions(-)

diff --git a/CHANGES.md b/CHANGES.md
index e9525650..cc1ca646 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -21,6 +21,7 @@ Release Notes.
 - UI: Polish Index Rule Binding Page and Index Page.
 - Fix: View configuration on Property page.
 - UI: Add `indexMode` to display on the measure page.
+- UI: Add `NoSort` Field to IndexRule page.
 
 ### Documentation
 
diff --git a/ui/src/components/IndexRule/index.vue 
b/ui/src/components/IndexRule/index.vue
index b663f2be..79c09011 100644
--- a/ui/src/components/IndexRule/index.vue
+++ b/ui/src/components/IndexRule/index.vue
@@ -49,24 +49,22 @@ watch(() => route, () => {
   deep: true
 })
 
-function initData() {
-  if (data.type && data.group && data.name) {
-    $loadingCreate()
-    getSecondaryDataModel(data.type, data.group, data.name)
-      .then(result => {
-        data.indexRule = result.data.indexRule
-      })
-      .catch(err => {
-        ElMessage({
-          message: 'Please refresh and try again. Error: ' + err,
-          type: "error",
-          duration: 3000
-        })
-      })
-      .finally(() => {
-        $loadingClose()
-      })
+async function initData() {
+  if (!(data.type && data.group && data.name)) {
+    return;
   }
+  $loadingCreate()
+  const result = await getSecondaryDataModel(data.type, data.group, data.name)
+  $loadingClose()
+  if (!(result.data && result.data.indexRule)) {
+    ElMessage({
+      message: `Please refresh and try again.`,
+      type: "error",
+      duration: 3000
+    })
+    return;
+  }
+  data.indexRule = {...result.data.indexRule, noSort: 
String(result.data.indexRule.noSort)}
 }
 </script>
 
@@ -84,7 +82,10 @@ function initData() {
           <el-select v-model="data.indexRule.tags" style="width: 100%;" 
:disabled="true" multiple></el-select>
         </el-form-item>
         <el-form-item label="Type">
-          <el-input v-model="data.indexRule.type" :disabled="true"></el-input>
+          <el-input v-model="data.indexRule.type" disabled></el-input>
+        </el-form-item>
+        <el-form-item label="No Sort">
+          <el-input v-model="data.indexRule.noSort" disabled></el-input>
         </el-form-item>
       </el-form>
     </el-card>

Reply via email to