|
21 | 21 | <v-icon>fas fa-file</v-icon> |
22 | 22 | </v-list-item-icon> |
23 | 23 |
|
24 | | - <v-list-item-title>{{item}}</v-list-item-title> |
| 24 | + <v-list-item-title>{{ item }}</v-list-item-title> |
25 | 25 |
|
26 | 26 | <v-spacer></v-spacer> |
27 | 27 | <v-btn link icon x-small color="warning" @click="deleteVault(item)"> |
|
31 | 31 | </v-list-item-group> |
32 | 32 | </v-list> |
33 | 33 | </v-col> |
34 | | - <v-col class="main-panel fill-parent-height"> |
35 | | - <!-- <v-card color="FloralWhite" style="position: relative" width="100%"> |
36 | | - <v-form v-model="valid" ref="newVaultForm"> |
37 | | - <v-container> |
38 | | - <h2>New KeyNode</h2> |
39 | | - <span>Use this form to initialize a new keynode state</span> |
40 | | - <v-row> |
41 | | - <v-col> |
42 | | - <v-list outlined> |
43 | | - <v-text-field |
44 | | - v-model="secretName" |
45 | | - :rules="secretNameRules" |
46 | | - label="Full Name" |
47 | | - counter="100" |
48 | | - required |
49 | | - outlined |
50 | | - style="padding-left: 10px; padding-right: 10px" |
51 | | - placeholder="Enter your full name" |
52 | | - /> |
53 | | -
|
54 | | - <v-textarea |
55 | | - v-model="secretContent" |
56 | | - label="Secret Content" |
57 | | - required |
58 | | - outlined |
59 | | - style="padding-left: 10px; padding-right: 10px" |
60 | | - placeholder="Enter the content of the secret" |
61 | | - ></v-textarea> |
62 | | - </v-list> |
63 | | - </v-col> |
64 | | - </v-row> |
65 | | - </v-container> |
66 | | -
|
67 | | - <v-card-actions> |
68 | | - <v-btn @click="cancel">Cancel</v-btn> |
69 | | - <v-btn color="warning" @click="resetValidation">Clear</v-btn> |
70 | | - <v-spacer></v-spacer> |
71 | | - <v-btn color="success" @click="newSecret">Create</v-btn> |
72 | | - </v-card-actions> |
73 | | - </v-form> |
74 | | - </v-card> --> |
75 | | - </v-col> |
76 | 34 | </v-row> |
77 | 35 | </v-container> |
78 | 36 | </template> |
79 | 37 |
|
80 | 38 | <script lang="ts"> |
81 | 39 | import { defineComponent } from 'vue' |
| 40 | +import PolykeyClient from '@/store/PolykeyClient' |
82 | 41 |
|
83 | 42 | export default defineComponent({ |
84 | | - setup () { |
| 43 | + setup() { |
| 44 | + // // try to start polykey |
| 45 | + // try { |
| 46 | + // const pid: number = PolykeyClient.StartAgent() |
| 47 | + // console.log(`Agent has been started with a pid of: ${pid}`) |
| 48 | + // // prompt user to unlock polykey node |
| 49 | +
|
| 50 | + // /** Ask for passphrase or popup*/ |
| 51 | + // const { passphrase } = user.prompt() |
| 52 | +
|
| 53 | + // await PolykeyClient.RegisterNode(passphrase) |
| 54 | +
|
| 55 | + // console.log('new node is unlocked and ready to go') |
| 56 | + // /** Then just close it and user can freely navigate */ |
| 57 | +
|
| 58 | + // } catch (error) { |
| 59 | +
|
| 60 | + // if (error.message.includes('not been initialized')) { |
| 61 | + // // need to prompt user for new node details |
| 62 | + // const { userId, passphrase, nbits } = user.prompt() |
| 63 | + // /** By default 1024 nbits */ |
| 64 | + // /** So only ask for the userId and passphrase */ |
| 65 | + // await PolykeyClient.NewNode({ userId, passphrase, nbits }) |
| 66 | + // console.log('new node is unlocked and ready to go') |
| 67 | +
|
| 68 | + // } else if (error.message.includes('already running')) { |
| 69 | + // // polykey agent is already running, prompt for passphrase to unlock |
| 70 | + // const { passphrase } = user.prompt() |
| 71 | + // /** popup also */ |
| 72 | + // await PolykeyClient.UnlockNode({ passphrase }) |
| 73 | + // console.log('new node is unlocked and ready to go') |
| 74 | + // } else { |
| 75 | + // // some other error |
| 76 | + // throw Error(`something else went wrong: ${error.message}`) |
| 77 | + // } |
| 78 | + // } |
85 | 79 | return { |
86 | 80 | newKeyNode: () => {}, |
87 | 81 | deleteVault: () => {} |
|
0 commit comments