Skip to content

Commit

Permalink
Merge pull request #170 from SelfhostedPro/updating
Browse files Browse the repository at this point in the history
fixed app update issue; fixed 422 error on page load (checks for auth…
  • Loading branch information
SelfhostedPro authored Oct 15, 2020
2 parents 0e128fc + 2c022fd commit abca524
Show file tree
Hide file tree
Showing 21 changed files with 278 additions and 214 deletions.
2 changes: 1 addition & 1 deletion frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default {
})
},
created() {
this.authCheck()
this.authCheck();
}
};
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<v-card-title>
Select a template to deploy from
</v-card-title>
<v-card v-if="templates.length <1 || templates == undefined">
<v-card v-if="templates.length < 1 || templates == undefined">
<v-card-title>No Templates Found!</v-card-title>
<v-card-text
> No templates available. <a href="/#/templates/new">Add</a> one to view
<v-card-text>
No templates available. <a href="/#/templates/new">Add</a> one to view
information and launch apps from here.</v-card-text
>
</v-card>
Expand Down Expand Up @@ -360,15 +360,15 @@ export default {
appDetailsDialog: false,
selectedApp: null,
search: "",
tab: null,
tab: null
};
},
computed: {
...mapState("templates", ["templates", "isLoading"]),
...mapState("templates", ["templates", "isLoading"])
},
methods: {
...mapActions({
readTemplates: "templates/readTemplatesAndItems",
readTemplates: "templates/readTemplatesAndItems"
}),
filterItems(items) {
if (!items) {
Expand All @@ -378,7 +378,7 @@ export default {
return items;
}
let regex = new RegExp(this.search, "i");
return items.filter((item) => {
return items.filter(item => {
return regex.test(item.title);
});
},
Expand All @@ -387,11 +387,11 @@ export default {
return [...result].sort((a, b) => {
return a.title.localeCompare(b.title);
});
},
}
},
mounted() {
this.readTemplates();
},
}
};
</script>

Expand Down
22 changes: 11 additions & 11 deletions frontend/src/components/applications/ApplicationsForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ import { ValidationObserver, ValidationProvider } from "vee-validate";
export default {
components: {
ValidationProvider,
ValidationObserver,
ValidationObserver
},
data() {
return {
Expand All @@ -695,7 +695,7 @@ export default {
devices: [],
labels: [],
sysctls: [],
cap_add: [],
cap_add: []
},
network_modes: ["bridge", "none", "host"],
isLoading: false,
Expand All @@ -722,21 +722,21 @@ export default {
"SYS_BOOT",
"LEASE",
"WAKE_ALARM",
"BLOCK_SUSPEND",
],
"BLOCK_SUSPEND"
]
};
},
calculated: {
...mapState("networks", ["networks"]),
...mapState("volumes", ["volumes"]),
...mapState("volumes", ["volumes"])
},
methods: {
...mapActions({
readApp: "templates/readApp",
readNetworks: "networks/_readNetworks",
readNetworks: "networks/_readNetworks"
}),
...mapMutations({
setErr: "snackbar/setErr",
setErr: "snackbar/setErr"
}),
addPort() {
this.form.ports.push({ hport: "", cport: "", proto: "tcp" });
Expand Down Expand Up @@ -798,7 +798,7 @@ export default {
this.isLoading = false;
this.$router.push({ name: "View Applications" });
})
.catch((err) => {
.catch(err => {
this.isLoading = false;
this.setErr(err);
});
Expand All @@ -824,7 +824,7 @@ export default {
devices: app.devices || [],
labels: app.labels || [],
sysctls: app.sysctls || [],
cap_add: app.cap_add || [],
cap_add: app.cap_add || []
};
this.notes = app.notes || null;
} catch (error) {
Expand All @@ -834,12 +834,12 @@ export default {
} else {
console.log("No app selected");
}
},
}
},
async created() {
await this.populateForm();
await this.populateNetworks();
},
}
};
</script>

Expand Down
49 changes: 27 additions & 22 deletions frontend/src/components/applications/ApplicationsList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@
>
<template v-slot:item.name="{ item }">
<div class="namecell">
<v-menu :close-on-click="true" :close-on-content-click="true" offset-y>
<v-menu
:close-on-click="true"
:close-on-content-click="true"
offset-y
>
<template v-slot:activator="{ on, attrs }">
<v-btn icon size="small" v-bind="attrs" v-on="on" class="">
<v-icon>mdi-chevron-down</v-icon>
Expand Down Expand Up @@ -135,14 +139,15 @@
</v-list-item-icon>
<v-list-item-title>Kill</v-list-item-title>
</v-list-item>

<v-list-item @click="AppAction({ Name: item.name, Action: 'remove' })">
<v-list-item-icon>
<v-icon>mdi-delete</v-icon>
</v-list-item-icon>
<v-list-item-title>Remove</v-list-item-title>
</v-list-item>


<v-list-item
@click="AppAction({ Name: item.name, Action: 'remove' })"
>
<v-list-item-icon>
<v-icon>mdi-delete</v-icon>
</v-list-item-icon>
<v-list-item-title>Remove</v-list-item-title>
</v-list-item>
</v-list>
</v-menu>
<span class="nametext ml-1">{{ item.name }}</span>
Expand Down Expand Up @@ -246,44 +251,44 @@ export default {
text: "Name",
value: "name",
sortable: true,
align: "start",
align: "start"
// width: "30%",
},
project: {
text: "Project",
value: "project",
sortable: true,
sortable: true
},
status: {
text: "Status",
value: "status",
sortable: true,
sortable: true
// width: "10%",
},
image: {
text: "Image",
value: "image",
sortable: true,
sortable: true
},
ports: {
text: "Ports",
value: "ports",
sortable: true,
sortable: true
},
created: {
text: "Created At",
value: "created",
sortable: true,
},
sortable: true
}
},
selectedHeaders: [],
selectedHeaders: []
};
},
methods: {
...mapActions({
readApps: "apps/readApps",
AppAction: "apps/AppAction",
checkUpdates: "apps/checkAppsUpdates",
checkUpdates: "apps/checkAppsUpdates"
}),
handleRowClick(appName) {
this.$router.push({ path: `/apps${appName.Name}/info` });
Expand All @@ -303,13 +308,13 @@ export default {
},
refresh() {
this.readApps();
},
}
},
computed: {
...mapState("apps", ["apps", "isLoading", "action", "updatable"]),
showHeaders() {
return this.headers.filter((s) => this.selectedHeaders.includes(s));
},
return this.headers.filter(s => this.selectedHeaders.includes(s));
}
},
created() {
console.log(this.headersMap);
Expand All @@ -318,7 +323,7 @@ export default {
},
mounted() {
this.readApps();
},
}
};
</script>

Expand Down
12 changes: 6 additions & 6 deletions frontend/src/components/auth/LoginForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,33 +70,33 @@ import { mapActions } from "vuex";
export default {
components: {
ValidationProvider,
ValidationObserver,
ValidationObserver
},
data() {
return {
username: "",
password: "",
show: false,
show: false
};
},
methods: {
...mapActions({
login: "auth/AUTH_REQUEST",
authCheck: "auth/AUTH_CHECK",
authCheck: "auth/AUTH_CHECK"
}),
onSubmit() {
this.login({
username: this.username,
password: this.password,
password: this.password
});
},
mounted() {
this.authCheck();
},
created() {
this.authCheck();
},
},
}
}
};
</script>

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/nav/Sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export default {
to: "/resources/volumes",
icon: "mdi-database"
},
{
{
text: "Networks",
to: "/resources/networks",
icon: "mdi-network"
Expand Down
Loading

0 comments on commit abca524

Please sign in to comment.