GUI Functionality

This commit is contained in:
Leon Etienne (ubuntu wsl)
2020-09-30 20:57:12 +02:00
parent ad7eac5343
commit c33216f2dd
40 changed files with 4727 additions and 44 deletions

View File

@@ -75,8 +75,8 @@
<Spacer height="50px"/>
<div class="button">Clear downloads</div>
<div class="button mt-2">Clear logs</div>
<div class="button" v-on:click="clearDLCache">Clear downloads</div>
<div class="button mt-2" v-on:click="clearLogs">Clear logs</div>
</div>
@@ -94,6 +94,7 @@
</template>
<script>
import axios from "axios";
import Toggle from "~/components/Toggle.vue";
import LogBox from "~/components/LogBox.vue";
import Spacer from "~/components/Spacer.vue";
@@ -104,6 +105,35 @@ export default {
Toggle,
LogBox,
Spacer
},
methods: {
clearDLCache: function() {
const that = this;
axios.post("/api", {
request: "clear_download_cache",
}).then(function(response){
if (response.data.status === "OK") {
that.$store.dispatch("dlcache/update", that);
}
});
return;
},
clearLogs: function() {
const that = this;
axios.post("/api", {
request: "clear_logs",
}).then(function(response){
if (response.data.status === "OK") {
that.$store.dispatch("logs/update", that);
}
});
return;
},
}
};
</script>