{% extends "settings_page.html" %} {% block header_script_files %} {% endblock %} {% block settings_pane %}
{% endblock %} {% block script %} Vue.component('modals', { props: [], template: `
`, methods: { uploadFile() { let formData = new FormData(); var pluginfile = document.querySelector('#pluginupload'); formData.append("file", pluginfile.files[0]); bootstrap.Modal.getInstance(document.getElementById('modalUpload')).hide(); stashrToast('Uploading Plugin', 'info'); axios.post('{{ url_for('api.api_post_upload_plugin') }}', formData, { headers: { 'Content-Type': 'multipart/form-data' } }) .then(res => { if(res.data.status_code == 200) { stashrToast('Plugin Uploaded', 'success') } else { stashrToast(res.data.message, 'error') } }) }, }, delimiters: ["[[","]]"] }) Vue.component('plugin',{ props:['plugin'], template: ` [[ plugin.plugin_name ]] [[ plugin.plugin_description ]] [[ plugin.plugin_version ]] [[ plugin.plugin_author ]] [[ plugin.plugin_url ]] [[ plugin.plugin_license ]] [[ plugin.plugin_state ]] `, computed: { pluginClass() { let classname = 'btn-danger'; if(this.plugin.plugin_state == 'disabled') { classname = 'btn-success'; }; return classname; }, pluginAction() { let text = 'Disable'; if(this.plugin.plugin_state == 'disabled') { text = 'Enable'; }; return text; } }, delimiters: ["[[","]]"] }) Vue.component('plugins',{ props: ['plugins'], template: `

Plugins


Name Description Version Author URL License State Action
`, delimiters: ["[[","]]"] }) var app = new Vue({ el: '#app', data: { plugins: [], }, created() { this.getPlugins() }, methods: { getPlugins() { axios.get('{{ url_for('api.api_get_plugins') }}') .then(res => { this.plugins = res.data.results }) }, }, delimiters: ["[[","]]"] }) {% endblock %}