Skip to content

armgit / dashy

Public Imported from GitHub
0

πŸš€ A self-hostable personal dashboard built for you. Includes status-checking, widgets, themes, icon packs, a UI editor and tons more!

🎨 Remove code duplicated from the mixin, will inherit instead

Alicia Sykes8e4153dd557d
diff --git a/src/components/Widgets/TacticalRMM.vue b/src/components/Widgets/TacticalRMM.vue
index eef84d43..adfff6bd 100644
--- a/src/components/Widgets/TacticalRMM.vue
+++ b/src/components/Widgets/TacticalRMM.vue
@@ -81,18 +81,10 @@
</template>
<script>
-import request from '@/utils/request';
import WidgetMixin from '@/mixins/WidgetMixin';
-import { serviceEndpoints } from '@/utils/defaults';
export default {
mixins: [WidgetMixin],
- props: {
- options: {
- type: Object,
- default: () => ({}),
- },
- },
data() {
return {
statusData: null,
@@ -119,10 +111,6 @@ export default {
'Content-Type': 'application/json',
};
},
- proxyReqEndpoint() {
- const baseUrl = process.env.VUE_APP_DOMAIN || window.location.origin;
- return `${baseUrl}${serviceEndpoints.corsProxy}`;
- },
},
methods: {
update() {
@@ -130,34 +118,16 @@ export default {
this.fetchData();
},
fetchData() {
- const {
- authHeaders, url, token, proxyReqEndpoint,
- } = this;
-
+ const { authHeaders, url, token } = this;
if (!this.optionsValid({ url, token })) {
return;
}
-
- const targetURL = url;
- const customHeaders = JSON.stringify(authHeaders);
-
- request.get(
- proxyReqEndpoint,
- {
- headers: {
- 'Target-URL': targetURL,
- CustomHeaders: customHeaders,
- },
- },
- )
+ this.makeRequest(url, authHeaders)
.then((response) => {
- this.processData(response.data);
+ this.processData(response);
})
.catch(() => {
this.errorMessage = 'Failed to fetch data';
- })
- .finally(() => {
- this.finishLoading();
});
},
processData(response) {