Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
ee172a90
Commit
ee172a90
authored
Jan 08, 2018
by
Kushal Pandya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GeoNodeActions Component
parent
6128b119
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
105 additions
and
0 deletions
+105
-0
ee/app/assets/javascripts/geo_nodes/components/geo_node_actions.vue
...ets/javascripts/geo_nodes/components/geo_node_actions.vue
+105
-0
No files found.
ee/app/assets/javascripts/geo_nodes/components/geo_node_actions.vue
0 → 100644
View file @
ee172a90
<
script
>
import
{
__
,
s__
}
from
'
~/locale
'
;
import
loadingIcon
from
'
~/vue_shared/components/loading_icon.vue
'
;
import
{
NODE_ACTION_BASE_PATH
,
NODE_ACTIONS
}
from
'
../constants
'
;
export
default
{
props
:
{
node
:
{
type
:
Object
,
required
:
true
,
},
nodeEditAllowed
:
{
type
:
Boolean
,
required
:
true
,
},
nodeMissingOauth
:
{
type
:
Boolean
,
required
:
true
,
},
},
data
()
{
return
{
isNodeToggleInProgress
:
false
,
};
},
components
:
{
loadingIcon
,
},
computed
:
{
isToggleAllowed
()
{
return
!
this
.
node
.
primary
&&
this
.
nodeEditAllowed
;
},
nodeToggleLabel
()
{
return
this
.
node
.
enabled
?
__
(
'
Disable
'
)
:
__
(
'
Enable
'
);
},
nodeDisableMessage
()
{
return
this
.
node
.
enabled
?
s__
(
'
GeoNodes|Disabling a node stops the sync process. Are you sure?
'
)
:
''
;
},
nodePath
()
{
return
`
${
NODE_ACTION_BASE_PATH
}${
this
.
node
.
id
}
`
;
},
nodeRepairAuthPath
()
{
return
`
${
this
.
nodePath
}${
NODE_ACTIONS
.
REPAIR
}
`
;
},
nodeTogglePath
()
{
return
`
${
this
.
nodePath
}${
NODE_ACTIONS
.
TOGGLE
}
`
;
},
nodeEditPath
()
{
return
`
${
this
.
nodePath
}${
NODE_ACTIONS
.
EDIT
}
`
;
},
},
};
</
script
>
<
template
>
<div
class=
"geo-node-actions"
>
<div
v-if=
"nodeMissingOauth"
class=
"node-action-container"
>
<a
class=
"btn btn-default btn-sm btn-node-action"
data-method=
"post"
:href=
"nodeRepairAuthPath"
>
{{
s__
(
'
Repair authentication
'
)
}}
</a>
</div>
<div
v-if=
"isToggleAllowed"
class=
"node-action-container"
>
<a
class=
"btn btn-sm btn-node-action"
data-method=
"post"
:href=
"nodeTogglePath"
:data-confirm=
"nodeDisableMessage"
:class=
"
{ 'btn-warning': node.enabled, 'btn-success': !node.enabled }"
>
{{
nodeToggleLabel
}}
</a>
</div>
<div
v-if=
"nodeEditAllowed"
class=
"node-action-container"
>
<a
class=
"btn btn-sm btn-node-action"
:href=
"nodeEditPath"
>
{{
__
(
'
Edit
'
)
}}
</a>
</div>
<div
class=
"node-action-container"
>
<a
class=
"btn btn-sm btn-node-action btn-danger"
data-method=
"delete"
:href=
"nodePath"
>
{{
__
(
'
Remove
'
)
}}
</a>
</div>
</div>
</
template
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment