Implement routes and transitions
This commit is contained in:
@ -20,6 +20,22 @@ export const useTreeState = defineStore('treeState', {
|
||||
selectClient(id: string) {
|
||||
this.selected = { objectType: SshecretObjectType.Client, id: id }
|
||||
},
|
||||
/*
|
||||
* Fetch and select a specific client.
|
||||
*/
|
||||
async loadClientName(name: string) {
|
||||
const existing = this.clients?.clients.find(c => c.name === name)
|
||||
if (existing) {
|
||||
this.selected = { objectType: SshecretObjectType.Client, id: existing.id, param: name }
|
||||
} else {
|
||||
const result = await this.queryClients(name, 0, 1)
|
||||
if (result === 1 && this.clients) {
|
||||
this.selected = { objectType: SshecretObjectType.Client, id: this.clients.clients[0].id, param: name }
|
||||
} else {
|
||||
throw new Error("The selected client could not be found.")
|
||||
}
|
||||
}
|
||||
},
|
||||
selectSecret(name: string, parent?: string) {
|
||||
this.selected = { objectType: SshecretObjectType.ClientSecret, id: name }
|
||||
if (parent) {
|
||||
|
||||
Reference in New Issue
Block a user