Skip to content

Commit

Permalink
Add White Bread Crumb
Browse files Browse the repository at this point in the history
  • Loading branch information
ingalls committed Oct 25, 2024
1 parent 967e636 commit 9341ac2
Show file tree
Hide file tree
Showing 17 changed files with 57 additions and 41 deletions.
2 changes: 1 addition & 1 deletion api/web/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class='page h-100'>
<div class='page h-100 cloudtak-gradient'>
<header
v-if='navShown'
class='navbar navbar-expand-md d-print-none'
Expand Down
14 changes: 0 additions & 14 deletions api/web/src/components/Admin.vue
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
<template>
<div style='overflow: auto;'>
<div class='page-wrapper'>
<div class='page-header d-print-none'>
<div class='container-xl'>
<div class='row g-2 align-items-center'>
<div class='col d-flex'>
<TablerBreadCrumb />
</div>
</div>
</div>
</div>
</div>

<div class='page-body'>
<div class='container-xl'>
<div class='row row-deck row-cards'>
Expand Down Expand Up @@ -200,7 +188,6 @@ import PageFooter from './PageFooter.vue';
import {
TablerAlert,
TablerLoading,
TablerBreadCrumb,
} from '@tak-ps/vue-tabler'
import {
IconNetwork,
Expand Down Expand Up @@ -241,7 +228,6 @@ export default {
IconNetwork,
PageFooter,
TablerLoading,
TablerBreadCrumb,
}
}
</script>
54 changes: 42 additions & 12 deletions api/web/src/components/Admin/AdminUser.vue
Original file line number Diff line number Diff line change
@@ -1,32 +1,46 @@
<template>
<div>
<div class='card-header'>
<IconCircleArrowLeft
class='cursor-pointer'
:size='32'
stroke='1'
<TablerIconButton
title='Back'
@click='$router.push("/admin/user")'
/>
><IconCircleArrowLeft :size='32' stroke='1'/></TablerIconButton>

<h1
class='card-title mx-2'
v-text='`User: ${$route.params.user}`'
/>

<div class='ms-auto btn-list'>
<TablerIconButton
v-if='!edit'
title='Edit User'
@click='edit = true'
><IconSettings :size='32' stroke='1' /></TablerIconButton>
<TablerIconButton
title='Refresh'
@click='fetchUserLoading'
>
<IconRefresh
:size='32'
stroke='1'
/>
</TablerIconButton>
><IconRefresh :size='32' stroke='1' /></TablerIconButton>
</div>
</div>
<div class='card-body'>
<TablerLoading v-if='loading' />
<template v-else-if='edit'>
<div class='col-12'>
<TablerToggle
label='System Administrator'
v-model='user.system_admin'
/>
</div>

<div class='col-12 d-flex align-items-center'>
<button @click='fetchUserLoading' class='btn btn-secondary'>Cancel</button>

<div class='ms-auto'>
<button @click='saveUser' class='btn btn-primary'>Save</button>
</div>
</div>
</template>
<template v-else>
<div class='datagrid'>
<template v-for='ele in getKeys(user)'>
Expand Down Expand Up @@ -70,10 +84,12 @@ import { std, stdurl } from '../../std.ts';
import type { User } from '../../types.ts';
import {
TablerLoading,
TablerToggle,
TablerIconButton
} from '@tak-ps/vue-tabler';
import {
IconRefresh,
IconSettings,
IconCircleArrowLeft,
} from '@tabler/icons-vue'
Expand All @@ -88,11 +104,25 @@ async function fetchUser(): Promise<User> {
}
const loading = ref(false);
const edit = ref(false);
const user = ref<User>(await fetchUser());
const getKeys = <T extends object>(obj: T) => Object.keys(obj) as Array<keyof T>
async function saveUser(): Promise<void> {
edit.value = false;
loading.value = true;
const url = stdurl(`/api/user/${route.params.user}`);
user.value = await std(url, {
method: 'PATCH',
body: {
system_admin: user.value.system_admin
}
}) as User;
loading.value = false;
}
async function fetchUserLoading(): Promise<void> {
edit.value = false;
loading.value = true;
const url = stdurl(`/api/user/${route.params.user}`);
user.value = await std(url) as User;
Expand Down
2 changes: 1 addition & 1 deletion api/web/src/components/Connection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class='page-header d-print-none'>
<div class='container-xl'>
<div class='row g-2 align-items-center'>
<div class='col d-flex'>
<div class='col d-flex text-white'>
<TablerBreadCrumb />
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion api/web/src/components/ConnectionEdit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class='page-header d-print-none'>
<div class='container-xl'>
<div class='row g-2 align-items-center'>
<div class='col d-flex'>
<div class='col d-flex text-white'>
<TablerBreadCrumb />
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion api/web/src/components/ConnectionSink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class='page-header d-print-none'>
<div class='container-xl'>
<div class='row g-2 align-items-center'>
<div class='col d-flex'>
<div class='col d-flex text-white'>
<TablerBreadCrumb />
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion api/web/src/components/ConnectionSinkEdit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class='page-header d-print-none'>
<div class='container-xl'>
<div class='row g-2 align-items-center'>
<div class='col d-flex'>
<div class='col d-flex text-white'>
<TablerBreadCrumb />
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion api/web/src/components/ConnectionSinks.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class='page-header d-print-none'>
<div class='container-xl'>
<div class='row g-2 align-items-center'>
<div class='col d-flex'>
<div class='col d-flex text-white'>
<TablerBreadCrumb />
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion api/web/src/components/Connections.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class='page-header d-print-none'>
<div class='container-xl'>
<div class='row g-2 align-items-center'>
<div class='col d-flex'>
<div class='col d-flex text-white'>
<TablerBreadCrumb />

<div class='ms-auto'>
Expand Down
2 changes: 1 addition & 1 deletion api/web/src/components/Data.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class='page-header d-print-none'>
<div class='container-xl'>
<div class='row g-2 align-items-center'>
<div class='col d-flex'>
<div class='col d-flex text-white'>
<TablerBreadCrumb />
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion api/web/src/components/DataEdit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class='page-header d-print-none'>
<div class='container-xl'>
<div class='row g-2 align-items-center'>
<div class='col d-flex'>
<div class='col d-flex text-white'>
<TablerBreadCrumb />
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion api/web/src/components/DataJob.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class='page-header d-print-none'>
<div class='container-xl'>
<div class='row g-2 align-items-center'>
<div class='col d-flex'>
<div class='col d-flex text-white'>
<TablerBreadCrumb />
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion api/web/src/components/Layer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class='page-header d-print-none'>
<div class='container-xl'>
<div class='row g-2 align-items-center'>
<div class='col d-flex'>
<div class='col d-flex text-white'>
<TablerBreadCrumb />
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion api/web/src/components/LayerAlerts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class='page-header d-print-none'>
<div class='container-xl'>
<div class='row g-2 align-items-center'>
<div class='col d-flex'>
<div class='col d-flex text-white'>
<TablerBreadCrumb />
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion api/web/src/components/LayerEdit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class='page-header d-print-none'>
<div class='container-xl'>
<div class='row g-2 align-items-center'>
<div class='col d-flex'>
<div class='col d-flex text-white'>
<TablerBreadCrumb />
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion api/web/src/components/LayerQuery.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class='page-header d-print-none'>
<div class='container-xl'>
<div class='row g-2 align-items-center'>
<div class='col d-flex'>
<div class='col d-flex text-white'>
<TablerBreadCrumb />
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion api/web/src/components/LayerQueryFeature.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class='page-header d-print-none'>
<div class='container-xl'>
<div class='row g-2 align-items-center'>
<div class='col d-flex'>
<div class='col d-flex text-white'>
<TablerBreadCrumb />
</div>
</div>
Expand Down

0 comments on commit 9341ac2

Please sign in to comment.