Comments Bastien

pull/888/merge
Marco Kreeft 2025-04-05 15:17:45 +02:00 committed by Bastien Wirtz
parent 042e4a0529
commit 1de57d9423
3 changed files with 6 additions and 18 deletions

View File

@ -116,7 +116,6 @@ It calls the API of DOcker Socket Proxy
- name: Docker - name: Docker
type: "DockerSocketProxy" type: "DockerSocketProxy"
endpoint: "http://192.168.0.151:2375" endpoint: "http://192.168.0.151:2375"
``` ```
## Docuseal ## Docuseal

View File

@ -12,7 +12,7 @@
{{ errors }} {{ errors }}
</strong> </strong>
<strong v-if="serverError" class="notif errors" title="Connection error to Docker Socket Proxy API"> <strong v-if="serverError" class="notif errors" title="Connection error to Docker Socket Proxy API">
? Unavailable
</strong> </strong>
</div> </div>
</template> </template>
@ -21,12 +21,8 @@
<script> <script>
import service from "@/mixins/service.js"; import service from "@/mixins/service.js";
import Generic from "./Generic.vue";
export default { export default {
name: "DockerSocketProxy", name: "DockerSocketProxy",
components: {
Generic,
},
mixins: [service], mixins: [service],
props: { props: {
item: Object, item: Object,
@ -54,8 +50,7 @@ export default {
}; };
// Fetch all containers (including stopped) from Docker Socket Proxy // Fetch all containers (including stopped) from Docker Socket Proxy
fetch(`${this.endpoint}/containers/json?all=true`) // Docker endpoint for container statuses this.fetch('/containers/json?all=true') // Docker endpoint for container statuses
.then((response) => response.json())
.then((containers) => { .then((containers) => {
this.running = containers.filter(container => container.State === "running").length; this.running = containers.filter(container => container.State === "running").length;
this.stopped = containers.filter(container => container.State === "exited").length; this.stopped = containers.filter(container => container.State === "exited").length;

View File

@ -27,12 +27,8 @@
<script> <script>
import service from "@/mixins/service.js"; import service from "@/mixins/service.js";
import Generic from "./Generic.vue";
export default { export default {
name: "Plex", name: "Plex",
components: {
Generic,
},
mixins: [service], mixins: [service],
props: { props: {
item: Object, item: Object,
@ -61,8 +57,7 @@ export default {
this.serverError = true; this.serverError = true;
}; };
fetch(`${this.endpoint}/status/sessions?X-Plex-Token=${this.item.token}`) this.fetch(`/status/sessions?X-Plex-Token=${this.item.token}`, {}, false)
.then((response) => response.text())
.then((str) => { .then((str) => {
const parser = new DOMParser(); const parser = new DOMParser();
const xml = parser.parseFromString(str, "application/xml"); const xml = parser.parseFromString(str, "application/xml");
@ -71,14 +66,13 @@ export default {
}) })
.catch(handleError); .catch(handleError);
fetch(`${this.endpoint}/library/sections?X-Plex-Token=${this.item.token}`) this.fetch(`/library/sections?X-Plex-Token=${this.item.token}`, {}, false)
.then((response) => response.text())
.then((str) => { .then((str) => {
const parser = new DOMParser(); const parser = new DOMParser();
const xml = parser.parseFromString(str, "application/xml"); const xml = parser.parseFromString(str, "application/xml");
const directories = xml.getElementsByTagName("Directory"); const directories = xml.getElementsByTagName("Directory");
let seriesDirIds = []; const seriesDirIds = [];
let movieDirIds = []; const movieDirIds = [];
for (let dir of directories) { for (let dir of directories) {
if (dir.getAttribute("type") === "show") { if (dir.getAttribute("type") === "show") {