+
+
+
+
\ No newline at end of file
diff --git a/src/components/tag-list/remove-image.riot b/src/components/tag-list/remove-image.riot
index 899386c..49c1bea 100644
--- a/src/components/tag-list/remove-image.riot
+++ b/src/components/tag-list/remove-image.riot
@@ -52,46 +52,5 @@ along with this program. If not, see .
this.props.handleCheckboxChange(checked, this.props.image);
}
}
-
- export function deleteImage(image, opts) {
- const {
- registryUrl,
- ignoreError,
- onNotify,
- onAuthentication
- } = opts;
- if (!image.digest) {
- onNotify(`Information for ${name}:${tag} are not yet loaded.`);
- return;
- }
- const name = image.name;
- const tag = image.tag;
- const oReq = new Http({
- onAuthentication: onAuthentication
- });
- oReq.addEventListener('loadend', function () {
- if (this.status == 200 || this.status == 202) {
- router.taglist(name);
- onNotify(`Deleting ${name}:${tag} image. Run \`registry garbage-collect config.yml\` on your registry`);
- } else if (this.status == 404) {
- ignoreError || onNotify({
- message: 'Digest not found for this image in your registry.',
- isError: true
- });
- } else {
- onNotify(this.responseText);
- }
- });
- oReq.open('DELETE', `${registryUrl}/v2/${name}/manifests/${image.digest}`);
- oReq.setRequestHeader('Accept',
- 'application/vnd.docker.distribution.manifest.v2+json, application/vnd.oci.image.manifest.v1+json');
- oReq.addEventListener('error', function () {
- onNotify({
- message: 'An error occurred when deleting image. Check if your server accept DELETE methods Access-Control-Allow-Methods: [\'DELETE\'].',
- isError: true
- });
- });
- oReq.send();
- }
\ No newline at end of file
diff --git a/src/components/tag-list/tag-table.riot b/src/components/tag-list/tag-table.riot
index d69fc8d..ef7bd6e 100644
--- a/src/components/tag-list/tag-table.riot
+++ b/src/components/tag-list/tag-table.riot
@@ -15,6 +15,9 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
-->
+
@@ -87,12 +90,11 @@ along with this program. If not, see .
import ImageContentDigest from './image-content-digest.riot';
import CopyToClipboard from './copy-to-clipboard.riot';
import TagHistoryButton from './tag-history-button.riot';
- import RemoveImage, {
- deleteImage
- } from './remove-image.riot';
+ import RemoveImage from './remove-image.riot';
import {
matchSearch
} from '../search-bar.riot';
+ import ConfirmDeleteImage from '../dialogs/confirm-delete-image.riot';
export default {
components: {
ImageDate,
@@ -102,6 +104,7 @@ along with this program. If not, see .
CopyToClipboard,
RemoveImage,
TagHistoryButton,
+ ConfirmDeleteImage,
},
onBeforeMount(props) {
this.state = {
@@ -117,10 +120,14 @@ along with this program. If not, see .
state.page = props.page
},
bulkDelete() {
- this.state.toDelete.forEach(image => deleteImage(image, {
- ...this.props,
- ignoreError: true
- }))
+ this.update({
+ confirmDeleteImage: true
+ })
+ },
+ onConfirmDeleteImageClick() {
+ this.update({
+ confirmDeleteImage: false
+ })
},
onRemoveImageHeaderChange(checked, event) {
if (event.altKey === true) {