Преглед изворни кода

naming, remove unnecessary disabled flag from serverconfig dialog

Martin Kunz пре 10 месеци
родитељ
комит
9bde637e2b
1 измењених фајлова са 13 додато и 13 уклоњено
  1. 13 13
      src/components/TheModels.vue

+ 13 - 13
src/components/TheModels.vue

@@ -13,9 +13,9 @@ import type { IMappingValue } from '@/ua/IAddressSpace';
 import { ServerConfig } from '@/ServerConfig';
 
 const store = useStore()
-const newDialogOpen = ref(false);
-const newServerConfigOpen = ref(false);
-const newDialogDisabled = ref(false); //Disables buttons while loading project
+const newProjectOpen = ref(false);
+const newProjectDisabled = ref(false); //Disables buttons while loading project
+const serverConfigOpen = ref(false);
 const projectType = ref("ua");
 const { serverConfig } = storeToRefs(store)
 
@@ -46,7 +46,7 @@ function downloadBlob(blob: Blob, filename: string) {
 }
 
 async function newProject() {
-  newDialogDisabled.value = true;
+  newProjectDisabled.value = true;
   store.addressSpace = new AddressSpace([] as UANodeSet[])
   let nodesets: string[] = [];
   switch (projectType.value) {
@@ -64,8 +64,8 @@ async function newProject() {
   }
   let as = await AddressSpace.load(nodesets.reverse());
   store.setAddressSpace(as);
-  newDialogOpen.value = false;
-  newDialogDisabled.value = false;
+  newProjectOpen.value = false;
+  newProjectDisabled.value = false;
 }
 
 async function handleDrop(e: DragEvent) {
@@ -110,8 +110,8 @@ async function  loadZip(file: File){
           <h5 class="card-title d-inline">Models</h5>
           <div class="btn-group">
             <button class="btn btn-light" @click.prevent="exportProject()">Export</button>
-            <button class="btn btn-light" @click="newDialogOpen = true">New project</button>
-            <button class="btn btn-light" @click="newServerConfigOpen = true">Server Config</button>
+            <button class="btn btn-light" @click="newProjectOpen = true">New project</button>
+            <button class="btn btn-light" @click="serverConfigOpen = true">Server Config</button>
           </div>
         </div>
         <p class="card-text">
@@ -132,7 +132,7 @@ async function  loadZip(file: File){
     </div>
   </div>
 
-  <v-dialog :open="newDialogOpen" @cancel="newDialogOpen = false">
+  <v-dialog :open="newProjectOpen" @cancel="newProjectOpen = false">
     <h5>New project</h5>
     <p></p>
     <div class="form-check">
@@ -153,12 +153,12 @@ async function  loadZip(file: File){
       <label class="form-check-label" for="emco">Full EMCO Project</label>
     </div>
     <div class="btn-group d-flex justify-content-end">
-      <button class="btn btn-light" @click="newDialogOpen = false" :disabled="newDialogDisabled">Cancel</button>
-      <button class="btn btn-light" @click="newProject()" :disabled="newDialogDisabled">OK</button>
+      <button class="btn btn-light" @click="newProjectOpen = false" :disabled="newProjectDisabled">Cancel</button>
+      <button class="btn btn-light" @click="newProject()" :disabled="newProjectDisabled">OK</button>
     </div>
   </v-dialog>
 
-  <v-dialog :open="newServerConfigOpen" @cancel="newServerConfigOpen = false">
+  <v-dialog :open="serverConfigOpen" @cancel="serverConfigOpen = false">
     <h5>Server Configuration</h5>
     <p></p>
     <div v-if="serverConfig">
@@ -218,7 +218,7 @@ async function  loadZip(file: File){
         </div>
       </div>
       <div class="btn-group d-flex justify-content-end">
-        <button class="btn btn-light" @click="newServerConfigOpen = false" :disabled="newDialogDisabled">OK</button>
+        <button class="btn btn-light" @click="serverConfigOpen = false">OK</button>
       </div>
   </v-dialog>
 </template>