<!--
Copyright 2018 IBM Corp. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<!DOCTYPE html>
<html lang="en">

<head>

    <title>FfDL Fashion MNIST - Image Cleanup</title>

    <link rel="shortcut icon" type="image/x-icon" href="static/favicon.ico"/>

    <link rel="stylesheet" href="static/css/bootstrap.min.css">
    <link rel="stylesheet" href="static/css/webapp.css">

    <script src="static/js/jquery-3.3.1.min.js"></script>

</head>

<body>

    <div class="container-fluid ibm-code">

        <div class="row">

            <div class="col-md-7">

                <div id="codait-logo" class="col-md-3">
                    <a href="/">
                        <img src="static/img/ffdl-blue.png"/>
                    </a>
                </div>

                <div class="col-md-4 title-section">
                    <h1>FfDL Fashion MNIST</h1>
                </div>

                <div class="col-md-5">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <div class="panel-title">Image File Cleanup</div>
                        </div>
                        <div class="panel-body">
                            <button onclick="clean_up_imgs()" class="btn btn-primary">Delete User Uploaded Images</button>
                        </div>
                    </div>
                </div>

            </div>

        </div>

        <footer class="footer">
            <hr/>
            <p>Created at the IBM Center for Open-Source Data & AI Technologies</p>
        </footer>

    </div>

</body>

</html>

<script>
function clean_up_imgs() {
    if (confirm("Are you sure you wish to delete all user uploaded images?")) {
        $.ajax({
            url: "/cleanup",
            method: "delete",
            success: function(data) {
                alert("User uploaded images successfully deleted");
            }
        });
    }
}
</script>
