96
96
v-icon( v-else color ='error' ) mdi-alert-circle-outline
97
97
v-list-item
98
98
v-list-item-content Icon Set
99
- v-list-item-content {{ apistate[item.key].icon }}
99
+ v-list-item-content
100
100
v-icon( v-if ="apistate[item.key].icon" color ='success' ) {{ apistate[item.key].icon }}
101
101
v-icon( v-else color ='error' ) mdi-alert-circle-outline
102
102
v-divider
103
- // img(:src="`https://${item.hostname}/img/misc/onepixel.png`" @error="imgError('http', item)" style="display:none")
104
- // img(:src="`http://${item.hostname}/img/misc/onepixel.png`" @error="imgError('https', item)" style="display:none")
105
-
103
+ v-list( dense )
104
+ v-list-item
105
+ v-list-item-content SSL Status
106
+ v-list-item-content
107
+ v-icon( v-if ="apistate[item.key].sslstate === true" color ='success' ) mdi-check-circle-outline
108
+ v-icon( v-else color ='error' ) mdi-alert-circle-outline
109
+ v-list-item( v-if ="apistate[item.key].sslstate !== true" )
110
+ v-list-item-content
111
+ v-btn( color ="primary" @click ="setupSsl(item.key)" ) Setup SSL
112
+
106
113
v-dialog( v-model ="dialog" max-width ="600px" )
107
114
v-card
108
115
v-card-title.headline ( class ="primary" primary-title )
126
133
v-btn.ma-2 ( color ="success" @click ="createConnection()" ) Create Connection
127
134
v-btn.ma-2 ( color ="error" @click ="dialog = false" ) Cancel
128
135
136
+ v-dialog( v-model ="sslDialog" max-width ="600px" overlay-opacity =0.85 )
137
+ v-card
138
+ v-card-title.headline.primary ( primary-title )
139
+ span SSL Setup
140
+ v-spacer( v-if ="sslitem" )
141
+ span.subtitle-1 ( v-if ="sslitem" ) {{ sslitem.name }}
142
+ v-card-text( v-if ="sslitem" )
143
+ v-container
144
+ // Download CA cert step
145
+ v-row
146
+ v-col( cols ="12" sm ="12" md ="12" )
147
+ div 1. Please click on the button below to download the SSL Certificate
148
+ v-btn( color ="primary" small :href ="`http://${sslitem.hostname}/security/mavCA.crt`" ) Download SSL CA Certificate
149
+ // Firefox ssl guide
150
+ v-row( v-if ="$browserDetect.isFirefox" )
151
+ v-col( cols ="12" sm ="12" md ="12" )
152
+ div 2. In Firefox, a dialog should popup asking which permissions to give the certificate:
153
+ img( src ="img/ssl/firefox-sslca.png" )
154
+ div Click to enable 'Trust this CA to identify web sites'
155
+ // MacOS Chrome/Safari ssl guide
156
+ v-row( v-else-if ="($browserDetect.isChrome || $browserDetect.isSafari) && (/OS X/.test($browserDetect.meta.ua) || /OSX/.test($browserDetect.meta.ua))" )
157
+ v-col( cols ="12" sm ="12" md ="12" )
158
+ div 2. In MacOS Chrome or Safari, click on the downloaded file in the footer of the browser.
159
+ img( src ="img/ssl/macffsafari-1.png" )
160
+ div This will import the certificate into MacOS system Keychain Access app.
161
+ img( src ="img/ssl/macffsafari-2.png" )
162
+ div Choose the default 'login' option and click Add
163
+ v-col( cols ="12" sm ="12" md ="12" )
164
+ div 3. Double click on the untrusted certificate (with red X)
165
+ img( src ="img/ssl/macffsafari-3.png" )
166
+ v-col( cols ="12" sm ="12" md ="12" )
167
+ div 4. Open the 'Trust' section and change 'When using this certificate' to 'Always Trust'
168
+ img( src ="img/ssl/macffsafari-4.png" )
169
+ div Close the window and it will ask you to authenticate, to verify the system certificate update.
170
+ // Undetected browser ssl guide
171
+ v-row( v-else )
172
+ v-col( cols ="12" sm ="12" md ="12" )
173
+ div 2. Unknown browser - please search on the internet for installation instructions for your OS/Browser:
174
+ div {{ $browserDetect.meta.ua }}
175
+ // Add reload step
176
+ v-row
177
+ v-col( cols ="12" sm ="12" md ="12" )
178
+ div 3. Reload the website to activate the new certificate.
179
+ v-btn( color ="primary" small @click ="reloadPage()" ) Reload
180
+
181
+ v-divider
182
+ v-card-actions
183
+ v-spacer
184
+ v-btn.ma-2 ( color ="error" @click ="sslDialog = false" ) Close
185
+
129
186
v-dialog( v-if ="deleteitem" v-model ="deleteDialog" max-width ="400" )
130
187
v-card
131
188
v-card-title
@@ -150,8 +207,10 @@ export default {
150
207
filter: {},
151
208
dialog: false ,
152
209
deleteDialog: false ,
210
+ sslDialog: false ,
153
211
newitem: {},
154
212
deleteitem: null ,
213
+ sslitem: null ,
155
214
expand: true
156
215
}
157
216
},
@@ -190,22 +249,13 @@ export default {
190
249
}
191
250
this .$store .commit (' data/addApi' , {key: data .key , data: data})
192
251
},
193
- /*
194
- imgError (protocol, item) {
195
- this.logDebug(`protocol: ${protocol}`)
196
- this.logDebug(item)
197
- if (event.type == "error" && item.hasOwnProperty('hostname')) {
198
- this.logError(`Error connecting to API (${item.name}) over SSL.`)
199
- this.logDebug(event)
200
- } else if (! item.hasOwnProperty('hostname')) {
201
- this.logError(`Error: This API definition (${item.name}) does not have a hostname set. Please update maverick-api.`)
202
- }
203
- },
204
- */
205
252
lastseen (api ) {
206
253
let lastseen = (this .$store .state .core .apiSeen .hasOwnProperty (api)) ? this .$store .state .core .apiSeen [api] : 0
207
254
return (performance .now () - lastseen)
208
255
},
256
+ reloadPage (){
257
+ window .location .reload ()
258
+ },
209
259
remove (item ) {
210
260
this .deleteitem = item
211
261
this .deleteDialog = true
@@ -228,6 +278,11 @@ export default {
228
278
// delete this.$apollo.provider.clients[apiData.key]
229
279
// this.createClient(apiData.key+'new', apiData)
230
280
},
281
+ setupSsl (api ) {
282
+ this .logDebug (` Opening setupSsl for Api: ${ this .apis [api].name } ` )
283
+ this .sslitem = this .apis [api]
284
+ this .sslDialog = true
285
+ },
231
286
async testSsl (api ) {
232
287
// Define an internal method function promise that fetches the image and watches for completion or error
233
288
function testImage (imgPath ) {
0 commit comments