<commit_before><template>
<div class="container">
    <div class="col-md-8 col-md-offset-2">
        <div class="panel panel-primary">
            <div class="panel-heading">
                Data
            </div>
            <div class="panel-body">
                <ul class="list-group">
                    <li class="list-group-item" v-for="snapshot in data">
                        {{snapshot.data}}
                        <span class = "pull-right delete-data" v-if="isUser(snapshot)"@click="deleteData(snapshot)"><i class="fa fa-trash"></i></span>
                    </li>
                </ul>
            </div>
            <div class="panel-footer">
                <div class="input-group">
                    <input type="text" class = "form-control" v-model = "newData" v-on:keyup.enter="addData()" placeholder="Write something...">
                    <div class="input-group-btn">
                        <button class="btn btn-primary" @click = "addData()">Add</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</template>
<script>
import navbar from './../components/partials/Navbar.vue'

export default {
    mounted() {
        this.$auth.state({
            forward: '/app',
            redirect: '/login',
            then: (user) => {
                console.log("Logged in")
                this.userEmail = this.$auth.user().email
            },
            catch: () => {
                this.$destroy()
            }
        })
    },
    firebase() {
        return {
            data: this.$store.state.database.child('data')

        }
    },
    data() {
        return {
            message: "welcome",
            newData: ''
        }
    },
    methods: {
        addData() {
            this.$firebaseRefs.data.onDisconnect().cancel((err) => {
                if (err) {
                    console.log("Connection lost")
                } else {
                    console.log("Passed")
                }
            })
            this.$firebaseRefs.data.push({
                data: this.newData,
                userEmail: this.$auth.user().email
            });
            this.newData = ''
        },
        logout() {
            this.$auth.logout();
            this.$destroy();
        },
        deleteData(data)
        {
            this.$firebaseRefs.data.child(data['.key']).remove()
        },
        isUser(data){
            return data.userEmail == this.$auth.user().email ? true : false
        }
    },
    components: {
        navbar
    }
}
</script>

<style>
    .delete-data{
        cursor: pointer;
        color: red;
    }

</style><commit_msg>update App component<commit_after><template>
<div class="container">
    <div class="col-md-8 col-md-offset-2">
        <div class="panel panel-primary">
            <div class="panel-heading">
                Data
            </div>
            <div class="panel-body">
                <ul class="list-group">
                    <li class="list-group-item" v-for="snapshot in data">
                        {{snapshot.data}}
                        <span class = "pull-right delete-data" v-if="isUser(snapshot)"@click="deleteData(snapshot)"><i class="fa fa-trash"></i></span>
                    </li>
                </ul>
            </div>
            <div class="panel-footer">
                <div class="input-group">
                    <input type="text" class = "form-control" v-model = "newData" v-on:keyup.enter="addData()" placeholder="Write something...">
                    <div class="input-group-btn">
                        <button class="btn btn-primary" @click = "addData()">Add</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</template>
<script>
export default {
    mounted() {
        this.$auth.state({
            forward: '/app',
            redirect: '/login',
            then: (user) => {
                console.log("Logged in")
                this.userEmail = this.$auth.user().email
            },
            catch: () => {
                this.$destroy()
            }
        })
    },
    firebase() {
        return {
            data: this.$store.state.database.child('data')

        }
    },
    data() {
        return {
            message: "welcome",
            newData: ''
        }
    },
    methods: {
        addData() {
            this.$firebaseRefs.data.onDisconnect().cancel((err) => {
                if (err) {
                    console.log("Connection lost")
                } else {
                    console.log("Passed")
                }
            })
            this.$firebaseRefs.data.push({
                data: this.newData,
                userEmail: this.$auth.user().email
            });
            this.newData = ''
        },
        logout() {
            this.$auth.logout();
            this.$destroy();
        },
        deleteData(data)
        {
            this.$firebaseRefs.data.child(data['.key']).remove()
        },
        isUser(data){
            return data.userEmail == this.$auth.user().email ? true : false
        }
    }
}
</script>

<style>
    .delete-data{
        cursor: pointer;
        color: red;
    }

</style>
{'fraction_non_alphanumeric': 0.15530662616290108, 'fraction_numerical': 0.0007594456047085627, 'mean_word_length': 1.224662162162162, 'pattern_counts': {'":': 0, '<': 69, '<?xml version=': 0, '>': 75, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1411433', 'n_tokens_mistral': 1480, 'n_tokens_neox': 1434, 'n_words': 247}