|
| 1 | +import { ref } from "vue" |
| 2 | + |
| 3 | +const AnalyticsUi = { |
| 4 | + template: ` |
| 5 | + <section> |
| 6 | + <div id="analytics" class="bg-white dark:bg-black pb-12"> |
| 7 | + <div class="py-8"> |
| 8 | + <div class="mx-auto max-w-7xl px-6 lg:px-8"> |
| 9 | + <div class="mx-auto max-w-2xl text-center"> |
| 10 | + <h1 class="text-balance text-4xl font-bold tracking-tight text-gray-900 sm:text-6xl"> |
| 11 | + {{ adminUis[routes.page]?.title || adminUis.dashboard.title }} |
| 12 | + </h1> |
| 13 | + <p class="mt-4 text-lg leading-8 text-gray-600"> |
| 14 | + {{ adminUis[routes.page]?.summary || adminUis.dashboard.summary }} |
| 15 | + </p> |
| 16 | + </div> |
| 17 | + |
| 18 | + <nav class="py-4 flex items-center justify-between px-4 sm:px-0"> |
| 19 | + <div class="-mt-px flex w-0 flex-1 select-none"> |
| 20 | + <a @click="navTo(adminUiKeys[adminUiKeys.findIndex(x => x == routes.page) - 1] ?? adminUiKeys[adminUiKeys.length-1])" class="cursor-pointer inline-flex items-center pr-1 pt-4 text-sm font-medium text-gray-500 hover:border-gray-300 hover:text-gray-700"> |
| 21 | + <svg class="mr-3 h-5 w-5 text-gray-400" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" data-slot="icon"> |
| 22 | + <path fill-rule="evenodd" d="M18 10a.75.75 0 0 1-.75.75H4.66l2.1 1.95a.75.75 0 1 1-1.02 1.1l-3.5-3.25a.75.75 0 0 1 0-1.1l3.5-3.25a.75.75 0 1 1 1.02 1.1l-2.1 1.95h12.59A.75.75 0 0 1 18 10Z" clip-rule="evenodd" /> |
| 23 | + </svg> |
| 24 | + Previous |
| 25 | + </a> |
| 26 | + </div> |
| 27 | + <div class="hidden md:-mt-px md:flex select-none"> |
| 28 | + <!-- Current: "border-indigo-500 text-indigo-600", Default: "border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300" --> |
| 29 | + <div> |
| 30 | + <nav class="flex items-center justify-center" aria-label="Progress"> |
| 31 | + <ol role="list" class="ml-8 flex items-center space-x-5"> |
| 32 | + <li v-for="(label,id,index) in adminUis"> |
| 33 | + <a @click="navTo(id)" class="cursor-pointer block h-2.5 w-2.5 rounded-full bg-gray-200 hover:bg-gray-400"> |
| 34 | + <span class="sr-only">Step 1</span> |
| 35 | + <span v-if="(routes.page) == id" class="relative block h-2.5 w-2.5 rounded-full bg-indigo-600" aria-hidden="true"></span> |
| 36 | + </a> |
| 37 | + </li> |
| 38 | + </ol> |
| 39 | + </nav> |
| 40 | + </div> |
| 41 | + </div> |
| 42 | + <div class="-mt-px flex w-0 flex-1 justify-end select-none"> |
| 43 | + <a @click="navTo(adminUiKeys[adminUiKeys.findIndex(x => x == routes.page) + 1])" class="cursor-pointer inline-flex items-center pl-1 pt-4 text-sm font-medium text-gray-500 hover:border-gray-300 hover:text-gray-700"> |
| 44 | + Next |
| 45 | + <svg class="ml-3 h-5 w-5 text-gray-400" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" data-slot="icon"> |
| 46 | + <path fill-rule="evenodd" d="M2 10a.75.75 0 0 1 .75-.75h12.59l-2.1-1.95a.75.75 0 1 1 1.02-1.1l3.5 3.25a.75.75 0 0 1 0 1.1l-3.5 3.25a.75.75 0 1 1-1.02-1.1l2.1-1.95H2.75A.75.75 0 0 1 2 10Z" clip-rule="evenodd" /> |
| 47 | + </svg> |
| 48 | + </a> |
| 49 | + </div> |
| 50 | + </nav> |
| 51 | + |
| 52 | + <div class="mt-8 flow-root select-none"> |
| 53 | + <div v-on:click="onNav()" class="cursor-pointer -m-2 rounded-xl bg-gray-900/5 p-2 ring-1 ring-inset ring-gray-900/10 lg:-m-4 lg:rounded-2xl lg:p-4"> |
| 54 | + <img :src="'/img/pages/admin-ui/carousel/'+(routes.page || 'dashboard')+'.webp'" alt="Admin UI Screenshot" width="2432" height="1442" class="rounded-md shadow-2xl ring-1 ring-gray-900/10"> |
| 55 | + </div> |
| 56 | + </div> |
| 57 | + </div> |
| 58 | + </div> |
| 59 | +
|
| 60 | + </div> |
| 61 | + </section> |
| 62 | + `, |
| 63 | + setup() { |
| 64 | + |
| 65 | + const routes = ref({ page: 'dashboard' }) |
| 66 | + |
| 67 | + const adminUis = { |
| 68 | + 'dashboard': { |
| 69 | + title: 'Dashboard', |
| 70 | + summary: 'High-level overview stats on number and type of APIs and internal counters', |
| 71 | + href: 'https://docs.servicestack.net/admin-ui', |
| 72 | + }, |
| 73 | + 'analytics': { |
| 74 | + title: 'Analytics', |
| 75 | + summary: 'Comprehensive In Depth & Interactive API Analytics', |
| 76 | + href: 'https://docs.servicestack.net/admin-ui-analytics', |
| 77 | + }, |
| 78 | + 'users': { |
| 79 | + title: 'IdentityAuth Users', |
| 80 | + summary: 'Customizable ASP.NET Core Identity Auth User Management', |
| 81 | + href: 'https://docs.servicestack.net/admin-ui-identity-users', |
| 82 | + }, |
| 83 | + 'roles': { |
| 84 | + title: 'IdentityAuth Roles', |
| 85 | + summary: 'Manage App ASP.NET Core Identity Auth Roles and Claims', |
| 86 | + href: 'https://docs.servicestack.net/admin-ui-identity-roles', |
| 87 | + }, |
| 88 | + 'apikeys': { |
| 89 | + title: 'API Keys', |
| 90 | + summary: 'Customizable, fine-grain and integrated API Key management', |
| 91 | + href: 'https://docs.servicestack.net/auth/apikeys', |
| 92 | + }, |
| 93 | + 'logging': { |
| 94 | + title: 'Request Logging', |
| 95 | + summary: 'Rich, detailed, queryable and rolling Request Logs', |
| 96 | + href: 'https://docs.servicestack.net/admin-ui-profiling', |
| 97 | + }, |
| 98 | + 'profiling': { |
| 99 | + title: 'Profiling', |
| 100 | + summary: 'Observable, Diagnostic Source profiling event viewer', |
| 101 | + href: 'https://docs.servicestack.net/admin-ui-profiling', |
| 102 | + }, |
| 103 | + 'commands': { |
| 104 | + title: 'Commands', |
| 105 | + summary: 'Use Commands as building blocks for robust and observable systems', |
| 106 | + href: 'https://docs.servicestack.net/commands', |
| 107 | + }, |
| 108 | + 'backgroundjobs': { |
| 109 | + title: 'Background Jobs', |
| 110 | + summary: 'Effortless management of Background Jobs and Scheduled Tasks', |
| 111 | + href: 'https://docs.servicestack.net/background-jobs', |
| 112 | + }, |
| 113 | + 'validation': { |
| 114 | + title: 'DB Validation Rules', |
| 115 | + summary: 'Manage dynamic Type and Property Rule Validators', |
| 116 | + href: 'https://docs.servicestack.net/admin-ui-validation', |
| 117 | + }, |
| 118 | + 'database': { |
| 119 | + title: 'Database Browser', |
| 120 | + summary: "Browse RDBMS tables of all App's configured databases", |
| 121 | + href: 'https://docs.servicestack.net/admin-ui-database', |
| 122 | + }, |
| 123 | + 'redis': { |
| 124 | + title: 'Redis Admin', |
| 125 | + summary: "Inspect, browse and modify the App's configured Redis instance", |
| 126 | + href: 'https://docs.servicestack.net/admin-ui-redis', |
| 127 | + }, |
| 128 | + } |
| 129 | + const adminUiKeys = Object.keys(adminUis) |
| 130 | + |
| 131 | + function onNav() { |
| 132 | + location.href = adminUis[routes.value.page]?.href || adminUis.dashboard.href |
| 133 | + } |
| 134 | + |
| 135 | + function navTo(page) { |
| 136 | + routes.value.page = page || adminUiKeys[0] |
| 137 | + } |
| 138 | + |
| 139 | + return { |
| 140 | + routes, |
| 141 | + adminUis, |
| 142 | + adminUiKeys, |
| 143 | + onNav, |
| 144 | + navTo, |
| 145 | + } |
| 146 | + } |
| 147 | +} |
| 148 | + |
| 149 | +export default { |
| 150 | + components: { |
| 151 | + AnalyticsUi, |
| 152 | + }, |
| 153 | +} |
0 commit comments