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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
13c86bb4
Commit
13c86bb4
authored
Sep 15, 2017
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Init store for registry
parent
cd61d6e6
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
205 additions
and
0 deletions
+205
-0
app/assets/javascripts/registry/components/app.vue
app/assets/javascripts/registry/components/app.vue
+0
-0
app/assets/javascripts/registry/components/collapsible_container.vue
...javascripts/registry/components/collapsible_container.vue
+42
-0
app/assets/javascripts/registry/components/registry_table.vue
...assets/javascripts/registry/components/registry_table.vue
+0
-0
app/assets/javascripts/registry/index.js
app/assets/javascripts/registry/index.js
+0
-0
app/assets/javascripts/registry/stores/actions.js
app/assets/javascripts/registry/stores/actions.js
+39
-0
app/assets/javascripts/registry/stores/index.js
app/assets/javascripts/registry/stores/index.js
+37
-0
app/assets/javascripts/registry/stores/mutation_types.js
app/assets/javascripts/registry/stores/mutation_types.js
+9
-0
app/assets/javascripts/registry/stores/mutations.js
app/assets/javascripts/registry/stores/mutations.js
+38
-0
app/assets/javascripts/vue_shared/components/clipboard_button.vue
...ts/javascripts/vue_shared/components/clipboard_button.vue
+40
-0
No files found.
app/assets/javascripts/registry/components/app.vue
0 → 100644
View file @
13c86bb4
app/assets/javascripts/registry/components/collapsible_container.vue
0 → 100644
View file @
13c86bb4
<
script
>
export
default
{
name
:
'
collapsibeContainerRegisty
'
,
props
:
{
canDelete
:
{
type
:
Boolean
,
required
:
true
,
},
title
:
{
type
:
String
,
required
:
true
,
},
},
components
:
{
},
data
()
{
return
{
isOpen
:
false
,
};
},
methods
:
{
}
}
</
script
>
<
template
>
<div
class=
"container-image"
>
<i
class=
"fa"
:class=
"
{
'chevron-left': !isOpen,
'chevron-up': isOpen,
}"
aria-hidden="true">
</i>
{{
title
}}
</div>
</
template
>
app/assets/javascripts/registry/components/registry_table.vue
0 → 100644
View file @
13c86bb4
app/assets/javascripts/registry/index.js
0 → 100644
View file @
13c86bb4
app/assets/javascripts/registry/stores/actions.js
0 → 100644
View file @
13c86bb4
import
Vue
from
'
vue
'
;
import
VueResource
from
'
vue-resource
'
;
import
*
as
types
from
'
./mutation_types
'
;
Vue
.
use
(
VueResource
);
export
const
fetchRepos
=
({
commit
,
state
})
=>
{
commit
(
types
.
TOGGLE_MAIN_LOADING
);
return
Vue
.
http
.
get
(
state
.
endpoint
)
.
then
(
res
=>
res
.
json
())
.
then
((
response
)
=>
{
commit
(
types
.
TOGGLE_MAIN_LOADING
);
commit
(
types
.
SET_REPOS_LIST
,
response
);
});
};
export
const
fetchList
=
({
commit
},
list
)
=>
{
commit
(
types
.
TOGGLE_IMAGE_LOADING
,
list
);
return
Vue
.
http
.
get
(
list
.
path
)
.
then
(
res
=>
res
.
json
())
.
then
((
response
)
=>
{
commit
(
types
.
TOGGLE_IMAGE_LOADING
,
list
);
commit
(
types
.
SET_IMAGES_LIST
,
list
,
response
);
});
};
export
const
deleteRepo
=
({
commit
},
repo
)
=>
Vue
.
http
.
delete
(
repo
.
path
)
.
then
(
res
=>
res
.
json
())
.
then
(()
=>
{
commit
(
types
.
DELETE_REPO
,
repo
);
});
export
const
deleteImage
=
({
commit
},
image
)
=>
Vue
.
http
.
delete
(
image
.
path
)
.
then
(
res
=>
res
.
json
())
.
then
(()
=>
{
commit
(
types
.
DELETE_IMAGE
,
image
);
});
app/assets/javascripts/registry/stores/index.js
0 → 100644
View file @
13c86bb4
import
Vue
from
'
vue
'
;
import
Vuex
from
'
vuex
'
;
import
actions
from
'
./actions
'
;
import
mutations
from
'
./mutations
'
;
Vue
.
use
(
Vuex
);
export
default
new
Vuex
.
Store
({
state
:
{
isLoading
:
false
,
endpoint
:
''
,
// initial endpoint to fetch the repos list
/**
* Each object in `repos` has the following strucure:
* {
* name: String,
* isLoading: Boolean,
* tagsPath: String // endpoint to request the list
* destroyPath: String // endpoit to delete the repo
* list: Array // List of the registry images
* }
*
* Each registry image inside `list` has the following structure:
* {
* tag: String,
* revision: String
* shortRevision: String
* size: Number
* layers: Number
* createdAt: String
* destroyPath: String // endpoit to delete each image
* }
*/
repos
:
[],
actions
,
mutations
,
},
});
app/assets/javascripts/registry/stores/mutation_types.js
0 → 100644
View file @
13c86bb4
export
const
FETCH_REPOS_LIST
=
'
FETCH_REPOS_LIST
'
;
export
const
DELETE_REPO
=
'
DELETE_REPO
'
;
export
const
SET_REPOS_LIST
=
'
SET_REPOS_LIST
'
;
export
const
TOGGLE_MAIN_LOADING
=
'
TOGGLE_MAIN_LOADING
'
;
export
const
FETCH_IMAGES_LIST
=
'
FETCH_IMAGES_LIST
'
;
export
const
SET_IMAGES_LIST
=
'
SET_IMAGES_LIST
'
;
export
const
DELETE_IMAGE
=
'
DELETE_IMAGE
'
;
export
const
TOGGLE_IMAGE_LOADING
=
'
TOGGLE_MAIN_LOADING
'
;
app/assets/javascripts/registry/stores/mutations.js
0 → 100644
View file @
13c86bb4
import
*
as
types
from
'
./mutation_types
'
;
export
default
{
[
types
.
SET_REPOS_LIST
](
state
,
list
)
{
Object
.
assign
(
state
,
{
repos
:
list
.
map
(
el
=>
({
name
:
el
.
name
,
isLoading
:
false
,
canDelete
:
!!
el
.
destroy_path
,
destroyPath
:
el
.
destroy_path
,
list
:
[],
})),
});
},
[
types
.
TOGGLE_MAIN_LOADING
](
state
)
{
Object
.
assign
(
state
,
{
isLoading
:
!
state
.
isLoading
});
},
[
types
.
SET_IMAGES_LIST
](
state
,
image
,
list
)
{
const
listToUpdate
=
state
.
repos
.
find
(
el
=>
el
.
name
===
image
.
name
);
listToUpdate
.
list
=
list
.
map
(
element
=>
({
tag
:
element
.
name
,
revision
:
element
.
revision
,
shortRevision
:
element
.
short_revision
,
size
:
element
.
size
,
layers
:
element
.
layers
,
createdAt
:
element
.
created_at
,
destroyPath
:
element
.
destroy_path
,
canDelete
:
!!
element
.
destroy_path
,
}));
},
[
types
.
TOGGLE_IMAGE_LOADING
](
state
,
image
)
{
const
listToUpdate
=
state
.
repos
.
find
(
el
=>
el
.
name
===
image
.
name
);
listToUpdate
.
isLoading
=
!
listToUpdate
.
isLoading
;
},
};
app/assets/javascripts/vue_shared/components/clipboard_button.vue
0 → 100644
View file @
13c86bb4
import Clipboard from 'vendor/clipboard';
<
script
>
export
default
{
name
:
'
clipboardButton
'
,
props
:
{
text
:
{
type
:
String
,
required
:
true
,
},
title
:
{
type
:
String
,
required
:
true
,
},
},
mounted
()
{
return
new
Clipboard
(
this
.
$refs
.
btn
,
{
text
:
()
=>
{
return
this
.
text
;
},
});
}
};
</
script
>
<
template
>
<button
type=
"button"
class=
"btn btn-transparent btn-clipboard"
:data-title=
"title"
:data-clipboard-text=
"text"
ref=
"btn"
>
<i
aria-hidden=
"true"
class=
"fa fa-clipboard"
>
</i>
</button>
</
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