Skip to content

Commit

Permalink
Merge pull request #189 from SelfhostedPro/theming
Browse files Browse the repository at this point in the history
Theming
  • Loading branch information
SelfhostedPro authored Oct 21, 2020
2 parents 486df5a + 464b99c commit 73ef7bf
Show file tree
Hide file tree
Showing 33 changed files with 207 additions and 182 deletions.
6 changes: 3 additions & 3 deletions backend/api/db/crud/templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def add_template(db: Session, template: models.containers.Template):
# Optional use classmethod from_dict
try:
template_content = models.containers.TemplateItem(
type=int(entry['type']),
type=int(entry.get('type', 1)),
title=entry['title'],
platform=entry['platform'],
description=entry.get('description', ''),
Expand Down Expand Up @@ -95,7 +95,7 @@ def add_template(db: Session, template: models.containers.Template):

# Optional use classmethod from_dict
template_content = models.containers.TemplateItem(
type=int(entry['type']),
type=int(entry.get('type', 1)),
title=entry['title'],
platform=entry['platform'],
description=entry.get('description', ''),
Expand All @@ -119,7 +119,7 @@ def add_template(db: Session, template: models.containers.Template):
# Optional handle KeyError here too.
print('data request failed', err)
raise HTTPException(
status_code=exc.response.status_code, detail=exc.explanation
status_code=err.status_code, detail=err.explanation
)

try:
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/components/applications/ApplicationDetails.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<template lang="html">
<v-card class="d-flex mx-auto page">
<v-card color='foreground' class="d-flex mx-auto page">
<v-container fluid class="component">
<Nav :isLoading="isLoading" />
<v-card tile>
<v-card color="foreground" tile>
<v-row>
<v-col class="flex-grow-1 flex-shrink-0">
<v-card-title>
Expand All @@ -13,7 +13,7 @@
<v-icon>mdi-chevron-down</v-icon>
</v-btn>
</template>
<v-list dense>
<v-list color='foreground' dense>
<v-list-item
@click="AppAction({ Name: app.name, Action: 'start' })"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
General container information
</v-card-subtitle> -->
<v-divider />
<v-list class="secondary px-5">
<v-list class="foreground px-5">
<v-list-item>
<v-list-item-content
><v-list-item-title class="font-weight-bold"
Expand All @@ -23,7 +23,20 @@
</v-list-item>

<v-divider />
<v-list-item>
<v-list-item-content
><v-list-item-title class="font-weight-bold"
>Container Image</v-list-item-title
></v-list-item-content
>
<v-list-item-content>
<v-list-item-title>
<a :href="'https://'+'hub.docker.com/r/' + app.Config.Image.split(':')[0]">{{ app.Config.Image.split(':')[0] }}</a>
</v-list-item-title>
</v-list-item-content>
</v-list-item>

<v-divider />
<v-list-item>
<v-list-item-content
><v-list-item-title class="font-weight-bold"
Expand Down Expand Up @@ -75,11 +88,11 @@
<v-divider />
<v-card-text
v-if="app.State.Status != 'running'"
class="secondary text-center px-5 py-5"
class="foreground text-center px-5 py-5"
>
Start the app to view ports
</v-card-text>
<v-simple-table v-else class="secondary px-0 text-center">
<v-simple-table v-else class="foreground px-0 text-center">
<template v-slot:default>
<thead>
<tr>
Expand Down Expand Up @@ -129,7 +142,7 @@
>
Start the app to view volumes
</v-card-text>
<v-simple-table v-else class="secondary px-0 text-center">
<v-simple-table v-else class="foreground px-0 text-center">
<template v-slot:default>
<thead>
<tr>
Expand Down Expand Up @@ -159,7 +172,7 @@
>
Start the app to view volumes
</v-card-text>
<v-simple-table v-else class="secondary px-0 text-center">
<v-simple-table v-else class="foreground px-0 text-center">
<template v-slot:default>
<thead>
<tr>
Expand Down Expand Up @@ -192,7 +205,7 @@
General container information
</v-card-subtitle> -->
<v-divider />
<v-list class="secondary px-5">
<v-list class="foreground px-5">
<v-list-item v-if="app.HostConfig.CapAdd">
<v-list-item-content
><v-list-item-title class="font-weight-bold"
Expand Down Expand Up @@ -254,7 +267,7 @@
<v-card-title class="subheading teal darken-1 font-weight-bold">
Container Labels
</v-card-title>
<v-simple-table class="secondary px-0 text-center">
<v-simple-table class="foreground px-0 text-center">
<template v-slot:default>
<thead>
<tr>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<v-card raised>
<v-card color="foreground" raised>
<v-card-title class="primary font-weight-bold">
Logs
</v-card-title>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
<template>
<v-card raised>
<v-card color="foreground" raised>
<v-card-title class="primary font-weight-bold">
Processes
</v-card-title>
<v-card-text
v-if="app.State.Status != 'running'"
class="secondary text-center px-5 py-5"
class="text-center px-5 py-5"
>
Start the app to view processes
</v-card-text>
<v-simple-table v-else-if="processes">
<v-simple-table class="foreground" v-else-if="processes">
<template v-slot:default>
<thead>
<tr>
<th
class="secondary"
class="foreground"
v-for="(title, index) in processes.Titles"
:key="index"
>
{{ title }}
</th>
</tr>
</thead>
<tbody class="secondary">
<tbody class="foreground">
<tr v-for="(item, index) in processes.Processes" :key="index">
<td v-for="(field, index) in item" :key="index">{{ field }}</td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<v-card raised>
<v-card color="foreground" raised>
<v-card-title class="primary font-weight-bold">
Stats
</v-card-title>
Expand All @@ -10,7 +10,7 @@
Start the app to view stats
</v-card-text>
<div v-else>
<v-card flat>
<v-card color="foreground" flat>
<v-card-title>
CPU Usage {{ stats.cpu_percent[stats.cpu_percent.length - 1] }}%
</v-card-title>
Expand All @@ -20,7 +20,7 @@
</v-card-subtitle>
<PercentLineChart :chartData="fillCPU(stats.cpu_percent, stats.time)" />
</v-card>
<v-card flat>
<v-card color="foreground" flat>
<v-card-title>
Memory Usage {{ stats.mem_percent[stats.mem_percent.length - 1] }}%,
{{ formatBytes(stats.mem_current[stats.mem_current.length - 1]) }}/{{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div>
<v-tabs mobile-breakpoint="sm">
<v-tabs background-color='tabs' mobile-breakpoint="sm">
<v-tab class="text-left" @click="$router.go(-1)">
<v-icon left class="mr-1">mdi-arrow-left-bold-outline</v-icon> Back
</v-tab>
Expand Down
18 changes: 9 additions & 9 deletions frontend/src/components/applications/ApplicationsForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<v-card-title>Note:</v-card-title>
<v-card-text v-html="notes"></v-card-text>
</v-card>
<v-stepper v-model="deployStep" alt-labels non-linear>
<v-stepper class="foreground" v-model="deployStep" alt-labels non-linear>
<v-fade-transition>
<v-progress-linear
indeterminate
Expand Down Expand Up @@ -437,15 +437,15 @@
</v-card-title>
<v-expansion-panels flat accordion multiple focusable>
<v-expansion-panel>
<v-expansion-panel-header color="secondary">
<v-expansion-panel-header color='foreground'>
<v-row no-gutters>
<v-col cols="2">Devices</v-col>
<v-col cols="4" class="text--secondary">
(Passthrough Devices)
</v-col>
</v-row>
</v-expansion-panel-header>
<v-expansion-panel-content color="secondary">
<v-expansion-panel-content color='foreground'>
<form>
<transition-group
name="slide"
Expand Down Expand Up @@ -505,15 +505,15 @@
</v-expansion-panel-content>
</v-expansion-panel>
<v-expansion-panel>
<v-expansion-panel-header color="secondary">
<v-expansion-panel-header color='foreground'>
<v-row no-gutters>
<v-col cols="2">Labels</v-col>
<v-col cols="4" class="text--secondary">
(Container Labels)
</v-col>
</v-row>
</v-expansion-panel-header>
<v-expansion-panel-content color="secondary">
<v-expansion-panel-content color='foreground'>
<form>
<transition-group
name="slide"
Expand Down Expand Up @@ -572,13 +572,13 @@
</v-expansion-panel-content>
</v-expansion-panel>
<v-expansion-panel>
<v-expansion-panel-header color="secondary">
<v-expansion-panel-header color='foreground'>
<v-row no-gutters>
<v-col cols="2">Sysctls</v-col>
<v-col cols="4" class="text--secondary"> (Kernel Options) </v-col>
</v-row>
</v-expansion-panel-header>
<v-expansion-panel-content color="secondary">
<v-expansion-panel-content color='foreground'>
<form>
<transition-group
name="slide"
Expand Down Expand Up @@ -638,15 +638,15 @@
</v-expansion-panel-content>
</v-expansion-panel>
<v-expansion-panel>
<v-expansion-panel-header color="secondary">
<v-expansion-panel-header color='foreground'>
<v-row no-gutters>
<v-col cols="2">Capabilities</v-col>
<v-col cols="4" class="text--secondary">
(Special Permissions/Capabilities)
</v-col>
</v-row></v-expansion-panel-header
>
<v-expansion-panel-content color="secondary">
<v-expansion-panel-content color='foreground'>
<form>
<v-select
v-model="form['cap_add']"
Expand Down
12 changes: 6 additions & 6 deletions frontend/src/components/applications/ApplicationsList.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template lang="html">
<div class="apps-list component" style="max-width: 90%">
<v-card>
<v-card color='foreground'>
<v-fade-transition>
<v-progress-linear
indeterminate
Expand All @@ -23,7 +23,7 @@
<v-icon>mdi-chevron-down</v-icon>
</v-btn>
</template>
<v-list dense>
<v-list color='foreground' dense>
<v-list-item @click="refresh()">
<v-list-item-icon><v-icon>mdi-refresh</v-icon></v-list-item-icon>
<v-list-item-title>Refresh Apps</v-list-item-title>
Expand All @@ -49,11 +49,11 @@
color="secondary"
>
<template v-slot:activator="{ on, attrs }">
<v-btn v-bind="attrs" v-on="on" class="ml-2">
<v-btn color="secondary" v-bind="attrs" v-on="on" class="ml-2">
Columns
</v-btn>
</template>
<v-list>
<v-list color='foreground'>
<v-list-item
color="primary"
v-for="(item, index) in headers"
Expand All @@ -73,7 +73,7 @@
<v-card-subtitle v-if="action">{{ action }} </v-card-subtitle>
<v-data-table
style="width: 99%"
class="mx-auto"
class="mx-auto foreground"
:headers="selectedHeaders"
:items="apps"
:items-per-page="10"
Expand All @@ -93,7 +93,7 @@
<v-icon>mdi-chevron-down</v-icon>
</v-btn>
</template>
<v-list dense>
<v-list color='foreground' dense>
<v-list-item
@click="AppAction({ Name: item.name, Action: 'start' })"
>
Expand Down
22 changes: 10 additions & 12 deletions frontend/src/components/auth/LoginForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/>
<v-row align="center" justify="center" class="mt-12">
<v-col cols="12" sm="8" md="4">
<v-card class="elevation-12 pb-8">
<v-card color="foreground" class="elevation-12 pb-8">
<v-toolbar color="primary" dark flat>
<v-toolbar-title>Login</v-toolbar-title>
<v-spacer></v-spacer>
Expand Down Expand Up @@ -72,24 +72,25 @@ 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() {
Expand All @@ -99,13 +100,10 @@ export default {
this.authCheck();
},
themeLogo() {
if (
!process.env.VUE_APP_THEME ||
process.env.VUE_APP_THEME == "Default"
) {
return darkLogo
} else if (process.env.VUE_APP_THEME == "DigitalOcean") {
return lightLogo
if (this.$vuetify.theme.dark == true) {
return darkLogo;
} else if (this.$vuetify.theme.dark == false) {
return lightLogo;
}
},
},
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/nav/Appbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<v-icon> mdi-chevron-down </v-icon>
</v-btn>
</template>
<v-list>
<v-list color="foreground">
<v-list-item :to="{ path: `/user/info` }">
<v-list-item-icon>
<v-icon>mdi-account-settings-outline</v-icon>
Expand Down
Loading

0 comments on commit 73ef7bf

Please sign in to comment.