-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add group create form API + move all pages to template
- Loading branch information
Showing
107 changed files
with
326 additions
and
6,055 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import axios from 'axios' | ||
import { Severity, type AlertInterface } from '@userfrosting/sprinkle-core/types' | ||
|
||
// Interfaces | ||
interface GroupCreateForm { | ||
slug: string | ||
name: string | ||
description: string | ||
icon: string | ||
} | ||
|
||
// Variables | ||
function getDefaultForm(): GroupCreateForm { | ||
return { | ||
slug: '', | ||
name: '', | ||
description: '', | ||
icon: 'users' | ||
} | ||
} | ||
|
||
// TODO : Add validation | ||
// 'schema://requests/group/create.yaml' | ||
|
||
// Actions | ||
async function sendForm(form: GroupCreateForm) { | ||
return axios | ||
.post('/api/groups', form) | ||
.then((response) => { | ||
return response.data.message | ||
}) | ||
.catch((err) => { | ||
const error: AlertInterface = { | ||
...{ | ||
description: 'An error as occurred', | ||
style: Severity.Danger, | ||
closeBtn: true | ||
}, | ||
...err.response.data | ||
} | ||
|
||
throw error | ||
}) | ||
} | ||
|
||
export type { GroupCreateForm } | ||
export { getDefaultForm, sendForm } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
import type { App } from 'vue' | ||
|
||
/* Install plugins */ | ||
export default { | ||
install: (app: App, options: {}) => {} | ||
install: () => {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,3 @@ | ||
<script setup> | ||
import moment from 'moment' | ||
</script> | ||
|
||
<template> | ||
<UFHeaderPage title="Activities" caption="A listing of user activities." /> | ||
|
||
<UFCardBox> | ||
<UFSprunjeTable | ||
dataUrl="/api/activities" | ||
searchColumn="user" | ||
:defaultSorts="{ occurred_at: 'desc' }"> | ||
<template #header> | ||
<UFSprunjeHeader sort="occurred_at">Activity Time</UFSprunjeHeader> | ||
<UFSprunjeHeader sort="user">User</UFSprunjeHeader> | ||
<UFSprunjeHeader sort="description">Description</UFSprunjeHeader> | ||
</template> | ||
|
||
<template #body="{ item }"> | ||
<UFSprunjeColumn> | ||
<div>{{ moment(item.occurred_at).format('dddd') }}</div> | ||
<div>{{ moment(item.occurred_at).format('MMM Do, YYYY h:mm a') }}</div> | ||
</UFSprunjeColumn> | ||
<UFSprunjeColumn> | ||
<strong> | ||
<RouterLink | ||
:to="{ | ||
name: 'admin.user', | ||
params: { user_name: item.user.user_name } | ||
}"> | ||
{{ item.user.full_name }} ({{ item.user.user_name }}) | ||
</RouterLink> | ||
</strong> | ||
<div class="uk-text-meta">{{ item.user.email }}</div> | ||
</UFSprunjeColumn> | ||
<UFSprunjeColumn> | ||
<div> | ||
{{ item.ip_address }} | ||
</div> | ||
<div> | ||
<i>{{ item.description }}</i> | ||
</div> | ||
</UFSprunjeColumn> | ||
</template> | ||
</UFSprunjeTable> | ||
</UFCardBox> | ||
<UFAdminActivitiesPag /> | ||
</template> |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,3 @@ | ||
<script lang="ts" setup> | ||
import { useDashboardApi } from '../composable/dashboard' | ||
import DashboardStats from './Dashboard/DashboardStats.vue' | ||
import DashboardRecentUsers from './Dashboard/DashboardRecentUsers.vue' | ||
import DashboardSystemInfo from './Dashboard/DashboardSystemInfo.vue' | ||
import DashboardActivities from './Dashboard/DashboardActivities.vue' | ||
const dashboard = useDashboardApi() | ||
dashboard.load() | ||
</script> | ||
|
||
<template> | ||
<UFHeaderPage title="Dashboard" /> | ||
<div class="uk-child-width-expand" uk-grid> | ||
<DashboardStats | ||
:users="dashboard.data.counter.users" | ||
:roles="dashboard.data.counter.roles" | ||
:groups="dashboard.data.counter.groups" /> | ||
</div> | ||
<div class="uk-child-width-1-2" uk-grid> | ||
<div> | ||
<div class="uk-child-width-1-1" uk-grid> | ||
<div> | ||
<DashboardRecentUsers :users="dashboard.data.users" /> | ||
</div> | ||
<div> | ||
<DashboardSystemInfo | ||
:info="dashboard.data.info" | ||
:sprinkles="dashboard.data.sprinkles" /> | ||
</div> | ||
</div> | ||
</div> | ||
<div> | ||
<DashboardActivities /> | ||
</div> | ||
</div> | ||
<UFAdminDashboardPage /> | ||
</template> |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.