0
0
Fork 0
mirror of https://github.com/VueTubeApp/VueTube synced 2024-11-16 16:25:17 +00:00

feat: Developer mode pt 3

Add creating registry entries
This commit is contained in:
Front 2022-03-31 21:23:30 -04:00
parent 04717a3ed4
commit dc242fd037

View file

@ -11,6 +11,14 @@
</v-alert> </v-alert>
</center> </center>
<!-- Add New Key Button -->
<center>
<v-btn @click="addDialog = !addDialog">
<v-icon style="margin-right: 0.25em;">mdi-plus</v-icon>
Create Entry
</v-btn>
</center>
<!-- Registry List Loader --> <!-- Registry List Loader -->
<v-list-item v-for="(item, index) in keys" :key="index"> <v-list-item v-for="(item, index) in keys" :key="index">
<v-card class="card rounded-lg" :class="$vuetify.theme.dark ? 'background lighten-1' : 'background darken-1'"> <v-card class="card rounded-lg" :class="$vuetify.theme.dark ? 'background lighten-1' : 'background darken-1'">
@ -33,8 +41,8 @@
<v-divider /> <v-divider />
<v-card-actions> <v-card-actions>
<v-spacer></v-spacer> <v-spacer></v-spacer>
<v-btn color="primary" text @click="deleteDialog = false">No</v-btn> <v-btn color="primary" text @click="deleteDialog = false">Cancel</v-btn>
<v-btn color="primary" text @click="deleteKey()">Yes</v-btn> <v-btn color="primary" text @click="deleteKey()">Delete</v-btn>
</v-card-actions> </v-card-actions>
</v-card> </v-card>
</v-dialog> </v-dialog>
@ -47,7 +55,7 @@
<v-text-field <v-text-field
v-model="selectedKeyData" v-model="selectedKeyData"
label="Solo" label="Value"
solo solo
/> />
@ -56,8 +64,36 @@
<v-divider /> <v-divider />
<v-card-actions> <v-card-actions>
<v-spacer></v-spacer> <v-spacer></v-spacer>
<v-btn color="primary" text @click="editDialog = false">Close</v-btn> <v-btn color="primary" text @click="editDialog = false">Cancel</v-btn>
<v-btn color="primary" text @click="updateKey()">Update</v-btn> <v-btn color="primary" text @click="updateKey()">Change</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<!-- Add Entry Dialog -->
<v-dialog v-model="addDialog" width="500">
<v-card :class="$vuetify.theme.dark ? 'background lighten-1' : 'background darken-1'">
<v-card-title class="text-h5">Create Registry Entry</v-card-title>
<v-card-text>
<v-text-field
v-model="selectedKey"
label="Key"
solo
/>
<v-text-field
v-model="selectedKeyData"
label="Value"
solo
/>
</v-card-text>
<v-divider />
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="primary" text @click="addDialog = false">Cancel</v-btn>
<v-btn color="primary" text @click="createKey()">Create</v-btn>
</v-card-actions> </v-card-actions>
</v-card> </v-card>
</v-dialog> </v-dialog>
@ -75,7 +111,8 @@ export default {
selectedKey: null, selectedKey: null,
selectedKeyData: null, selectedKeyData: null,
deleteDialog: false, deleteDialog: false,
editDialog: false editDialog: false,
addDialog: false
}; };
}, },
mounted() { mounted() {
@ -113,6 +150,11 @@ export default {
this.editDialog = false; this.editDialog = false;
localStorage.setItem(this.selectedKey, this.selectedKeyData); localStorage.setItem(this.selectedKey, this.selectedKeyData);
this.syncRegistry(); this.syncRegistry();
},
createKey() {
this.addDialog = false;
localStorage.setItem(this.selectedKey, this.selectedKeyData);
this.syncRegistry();
} }
} }
}; };