fix ssh-key displays
This commit is contained in:
parent
2accdd5626
commit
b32ce35a05
|
@ -4,7 +4,20 @@ SshKeyComponent = Ember.Component.extend
|
||||||
|
|
||||||
classNames: ['settings-sshkey']
|
classNames: ['settings-sshkey']
|
||||||
|
|
||||||
isCustom: () ->
|
isDeleting: false
|
||||||
false
|
|
||||||
|
actions:
|
||||||
|
delete: ->
|
||||||
|
console.log('isDeleting')
|
||||||
|
|
||||||
|
# return if @get('isDeleting')
|
||||||
|
# @set('isDeleting', true)
|
||||||
|
|
||||||
|
# deletingDone = => @set('isDeleting', false)
|
||||||
|
|
||||||
|
# @get('model').deleteRecord()
|
||||||
|
# @get('model').save().then(deletingDone, deletingDone).then =>
|
||||||
|
# @set('model', null)
|
||||||
|
|
||||||
|
|
||||||
`export default SshKeyComponent`
|
`export default SshKeyComponent`
|
||||||
|
|
|
@ -5,5 +5,6 @@ SshKey = Model.extend
|
||||||
value: DS.attr()
|
value: DS.attr()
|
||||||
description: DS.attr()
|
description: DS.attr()
|
||||||
fingerprint: DS.attr()
|
fingerprint: DS.attr()
|
||||||
|
isCustom: true
|
||||||
|
|
||||||
`export default SshKey`
|
`export default SshKey`
|
||||||
|
|
|
@ -12,7 +12,7 @@ Route = TravisRoute.extend
|
||||||
repo = @modelFor('repo')
|
repo = @modelFor('repo')
|
||||||
repo.get('envVars.promise')
|
repo.get('envVars.promise')
|
||||||
|
|
||||||
fetchSshKey: () ->
|
fetchCustomSshKey: () ->
|
||||||
repo = @modelFor('repo')
|
repo = @modelFor('repo')
|
||||||
self = this
|
self = this
|
||||||
@store.find('sshKey', repo.get('id')).then ( (result) -> result unless result.get('isNew') ), (xhr) ->
|
@store.find('sshKey', repo.get('id')).then ( (result) -> result unless result.get('isNew') ), (xhr) ->
|
||||||
|
@ -22,7 +22,7 @@ Route = TravisRoute.extend
|
||||||
# ssh_key.new or ssh_key.no_key
|
# ssh_key.new or ssh_key.no_key
|
||||||
return false
|
return false
|
||||||
|
|
||||||
fetchCustomSshKey: () ->
|
fetchSshKey: () ->
|
||||||
repo = @modelFor('repo')
|
repo = @modelFor('repo')
|
||||||
Ajax.get "/repos/#{repo.get('id')}/key", (data) =>
|
Ajax.get "/repos/#{repo.get('id')}/key", (data) =>
|
||||||
Ember.Object.create(fingerprint: data.fingerprint)
|
Ember.Object.create(fingerprint: data.fingerprint)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{{#if isCustom}}
|
{{#if key.isCustom}}
|
||||||
<div class="ssh-key-name">
|
<div class="ssh-key-name">
|
||||||
<span class="icon-key"></span>
|
<span class="icon-key"></span>
|
||||||
<span>{{key.description}}</span>
|
<span>{{key.description}}</span>
|
||||||
|
@ -6,11 +6,10 @@
|
||||||
<div class="ssh-key-value">
|
<div class="ssh-key-value">
|
||||||
<span class="icon-fingerprint"></span>
|
<span class="icon-fingerprint"></span>
|
||||||
<span>{{key.fingerprint}}</span>
|
<span>{{key.fingerprint}}</span>
|
||||||
<span>{{fingerprint}}</span>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="ssh-key-action">
|
<div class="ssh-key-action">
|
||||||
<div class="tooltip">
|
<div class="tooltip">
|
||||||
<a href="#" title="">
|
<a href="#" title="" {{action "delete"}}>
|
||||||
<span class="icon-delete"></span>
|
<span class="icon-delete"></span>
|
||||||
</a>
|
</a>
|
||||||
<div class="tooltip-bubble">Delete</div>
|
<div class="tooltip-bubble">Delete</div>
|
||||||
|
@ -24,13 +23,10 @@
|
||||||
<div class="ssh-key-value">
|
<div class="ssh-key-value">
|
||||||
<span class="icon-fingerprint"></span>
|
<span class="icon-fingerprint"></span>
|
||||||
<span>{{key.fingerprint}}</span>
|
<span>{{key.fingerprint}}</span>
|
||||||
<span>{{fingerprint}}</span>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="ssh-key-action">
|
<div class="ssh-key-action">
|
||||||
<div class="tooltip--height">
|
<div class="tooltip--height">
|
||||||
<a href="#" title="">
|
<span class="icon-delete-disabled"></span>
|
||||||
<span class="icon-delete-disabled"></span>
|
|
||||||
</a>
|
|
||||||
<div class="tooltip-bubble">Default keys <br>cannot be deleted</div>
|
<div class="tooltip-bubble">Default keys <br>cannot be deleted</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -31,11 +31,11 @@
|
||||||
<section class="settings-section">
|
<section class="settings-section">
|
||||||
<h2 class="small-title">SSH Key</h2>
|
<h2 class="small-title">SSH Key</h2>
|
||||||
|
|
||||||
{{#if sshKey}}
|
{{#if model.customSshKey}}
|
||||||
{{ssh-key key=sshKey}}
|
{{ssh-key key=model.customSshKey}}
|
||||||
|
{{else}}
|
||||||
|
{{ssh-key key=model.sshKey}}
|
||||||
<div class="form--sshkey">
|
<div class="form--sshkey">
|
||||||
<a href="" class="button">Add custom SSH Key</a>
|
|
||||||
<form action="">
|
<form action="">
|
||||||
<div class="form-elem">
|
<div class="form-elem">
|
||||||
<input type="text" placeholder="Description">
|
<input type="text" placeholder="Description">
|
||||||
|
@ -48,8 +48,6 @@
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
{{else}}
|
|
||||||
{{ssh-key key=customSshKey}}
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user