index.vue 22 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000
  1. <script setup lang="ts">
  2. import {
  3. defineAsyncComponent,
  4. ref,
  5. watch,
  6. onMounted,
  7. onBeforeUnmount
  8. } from "vue";
  9. import { useRoute, useRouter } from "vue-router";
  10. import { useWebsocketsStore } from "@/stores/websockets";
  11. import { useUserAuthStore } from "@/stores/userAuth";
  12. import keyboardShortcuts from "@/keyboardShortcuts";
  13. const MainHeader = defineAsyncComponent(
  14. () => import("@/components/MainHeader.vue")
  15. );
  16. const MainFooter = defineAsyncComponent(
  17. () => import("@/components/MainFooter.vue")
  18. );
  19. const FloatingBox = defineAsyncComponent(
  20. () => import("@/components/FloatingBox.vue")
  21. );
  22. const route = useRoute();
  23. const router = useRouter();
  24. const { socket } = useWebsocketsStore();
  25. const { hasPermission } = useUserAuthStore();
  26. const currentTab = ref("");
  27. const sidebarActive = ref(true);
  28. const sidebarPadding = ref(0);
  29. const keyboardShortcutsHelper = ref();
  30. const childrenActive = ref({
  31. songs: false,
  32. users: false,
  33. youtube: false,
  34. soundcloud: false
  35. });
  36. const toggleChildren = payload => {
  37. if (typeof payload.force === "undefined")
  38. childrenActive.value[payload.child] =
  39. !childrenActive.value[payload.child];
  40. else childrenActive.value[payload.child] = payload.force;
  41. };
  42. const getTabFromPath = (path?) => {
  43. const localPath = path || route.path;
  44. return localPath.substr(0, 7) === "/admin/"
  45. ? localPath.substr(7, localPath.length)
  46. : null;
  47. };
  48. const onRouteChange = () => {
  49. if (currentTab.value.startsWith("songs")) {
  50. toggleChildren({ child: "songs", force: false });
  51. } else if (currentTab.value.startsWith("users")) {
  52. toggleChildren({ child: "users", force: false });
  53. } else if (currentTab.value.startsWith("youtube")) {
  54. toggleChildren({ child: "youtube", force: false });
  55. } else if (currentTab.value.startsWith("soundcloud")) {
  56. toggleChildren({ child: "soundcloud", force: false });
  57. }
  58. currentTab.value = getTabFromPath();
  59. // if (this.$refs[`${currentTab.value}-tab`])
  60. // this.$refs[`${currentTab.value}-tab`].scrollIntoView({
  61. // inline: "center",
  62. // block: "nearest"
  63. // });
  64. localStorage.setItem("lastAdminPage", currentTab.value);
  65. if (currentTab.value.startsWith("songs"))
  66. toggleChildren({ child: "songs", force: true });
  67. else if (currentTab.value.startsWith("users"))
  68. toggleChildren({ child: "users", force: true });
  69. else if (currentTab.value.startsWith("youtube"))
  70. toggleChildren({ child: "youtube", force: true });
  71. else if (currentTab.value.startsWith("soundcloud"))
  72. toggleChildren({ child: "soundcloud", force: true });
  73. };
  74. const toggleKeyboardShortcutsHelper = () => {
  75. keyboardShortcutsHelper.value.toggleBox();
  76. };
  77. const resetKeyboardShortcutsHelper = () => {
  78. keyboardShortcutsHelper.value.resetBox();
  79. };
  80. const toggleSidebar = () => {
  81. sidebarActive.value = !sidebarActive.value;
  82. localStorage.setItem("admin-sidebar-active", `${sidebarActive.value}`);
  83. };
  84. const calculateSidebarPadding = () => {
  85. const scrollTop = document.documentElement.scrollTop || 0;
  86. if (scrollTop <= 64) sidebarPadding.value = 64 - scrollTop;
  87. else sidebarPadding.value = 0;
  88. };
  89. watch(
  90. () => route.path,
  91. path => {
  92. if (getTabFromPath(path)) onRouteChange();
  93. }
  94. );
  95. onMounted(async () => {
  96. if (getTabFromPath()) {
  97. onRouteChange();
  98. } else if (localStorage.getItem("lastAdminPage")) {
  99. router.push(`/admin/${localStorage.getItem("lastAdminPage")}`);
  100. } else {
  101. router.push(`/admin/songs`);
  102. }
  103. sidebarActive.value = JSON.parse(
  104. localStorage.getItem("admin-sidebar-active")
  105. );
  106. if (sidebarActive.value === null)
  107. sidebarActive.value = !(document.body.clientWidth <= 768);
  108. calculateSidebarPadding();
  109. document.body.addEventListener("scroll", calculateSidebarPadding);
  110. keyboardShortcuts.registerShortcut("admin.toggleKeyboardShortcutsHelper", {
  111. keyCode: 191, // '/' key
  112. ctrl: true,
  113. preventDefault: true,
  114. handler: () => {
  115. toggleKeyboardShortcutsHelper();
  116. }
  117. });
  118. keyboardShortcuts.registerShortcut("admin.resetKeyboardShortcutsHelper", {
  119. keyCode: 191, // '/' key
  120. ctrl: true,
  121. shift: true,
  122. preventDefault: true,
  123. handler: () => {
  124. resetKeyboardShortcutsHelper();
  125. }
  126. });
  127. });
  128. onBeforeUnmount(() => {
  129. socket.dispatch("apis.leaveRooms");
  130. document.body.removeEventListener("scroll", calculateSidebarPadding);
  131. const shortcutNames = [
  132. "admin.toggleKeyboardShortcutsHelper",
  133. "admin.resetKeyboardShortcutsHelper"
  134. ];
  135. shortcutNames.forEach(shortcutName => {
  136. keyboardShortcuts.unregisterShortcut(shortcutName);
  137. });
  138. });
  139. </script>
  140. <template>
  141. <div class="app">
  142. <div class="admin-area">
  143. <main-header :class="{ 'admin-sidebar-active': sidebarActive }" />
  144. <div class="admin-content">
  145. <div
  146. class="admin-sidebar"
  147. :class="{ minimised: !sidebarActive }"
  148. >
  149. <div class="inner">
  150. <div
  151. class="bottom"
  152. :style="`padding-bottom: ${sidebarPadding}px`"
  153. >
  154. <div
  155. class="sidebar-item toggle-sidebar"
  156. @click="toggleSidebar()"
  157. content="Expand"
  158. v-tippy="{ onShow: () => !sidebarActive }"
  159. >
  160. <i class="material-icons">menu_open</i>
  161. <span>Minimise</span>
  162. </div>
  163. <div
  164. v-if="
  165. hasPermission('admin.view.songs') &&
  166. sidebarActive
  167. "
  168. class="sidebar-item with-children"
  169. :class="{ 'is-active': childrenActive.songs }"
  170. >
  171. <span>
  172. <router-link to="/admin/songs">
  173. <i class="material-icons">music_note</i>
  174. <span>Songs</span>
  175. </router-link>
  176. <i
  177. class="material-icons toggle-sidebar-children"
  178. @click="
  179. toggleChildren({ child: 'songs' })
  180. "
  181. >
  182. {{
  183. childrenActive.songs
  184. ? "expand_less"
  185. : "expand_more"
  186. }}
  187. </i>
  188. </span>
  189. <div class="sidebar-item-children">
  190. <router-link
  191. class="sidebar-item-child"
  192. to="/admin/songs"
  193. >
  194. Songs
  195. </router-link>
  196. <router-link
  197. v-if="
  198. hasPermission('admin.view.import')
  199. "
  200. class="sidebar-item-child"
  201. to="/admin/songs/import"
  202. >
  203. Import
  204. </router-link>
  205. </div>
  206. </div>
  207. <router-link
  208. v-else-if="
  209. hasPermission('admin.view.songs') &&
  210. !sidebarActive
  211. "
  212. class="sidebar-item songs"
  213. to="/admin/songs"
  214. content="Songs"
  215. v-tippy="{
  216. theme: 'info',
  217. onShow: () => !sidebarActive
  218. }"
  219. >
  220. <i class="material-icons">music_note</i>
  221. <span>Songs</span>
  222. </router-link>
  223. <router-link
  224. v-if="hasPermission('admin.view.reports')"
  225. class="sidebar-item reports"
  226. to="/admin/reports"
  227. content="Reports"
  228. v-tippy="{
  229. theme: 'info',
  230. onShow: () => !sidebarActive
  231. }"
  232. >
  233. <i class="material-icons">flag</i>
  234. <span>Reports</span>
  235. </router-link>
  236. <router-link
  237. v-if="hasPermission('admin.view.stations')"
  238. class="sidebar-item stations"
  239. to="/admin/stations"
  240. content="Stations"
  241. v-tippy="{
  242. theme: 'info',
  243. onShow: () => !sidebarActive
  244. }"
  245. >
  246. <i class="material-icons">radio</i>
  247. <span>Stations</span>
  248. </router-link>
  249. <router-link
  250. v-if="hasPermission('admin.view.playlists')"
  251. class="sidebar-item playlists"
  252. to="/admin/playlists"
  253. content="Playlists"
  254. v-tippy="{
  255. theme: 'info',
  256. onShow: () => !sidebarActive
  257. }"
  258. >
  259. <i class="material-icons">library_music</i>
  260. <span>Playlists</span>
  261. </router-link>
  262. <div
  263. v-if="
  264. hasPermission('admin.view.users') &&
  265. sidebarActive
  266. "
  267. class="sidebar-item with-children"
  268. :class="{ 'is-active': childrenActive.users }"
  269. >
  270. <span>
  271. <router-link to="/admin/users">
  272. <i class="material-icons">people</i>
  273. <span>Users</span>
  274. </router-link>
  275. <i
  276. class="material-icons toggle-sidebar-children"
  277. @click="
  278. toggleChildren({ child: 'users' })
  279. "
  280. >
  281. {{
  282. childrenActive.users
  283. ? "expand_less"
  284. : "expand_more"
  285. }}
  286. </i>
  287. </span>
  288. <div class="sidebar-item-children">
  289. <router-link
  290. class="sidebar-item-child"
  291. to="/admin/users"
  292. >
  293. Users
  294. </router-link>
  295. <router-link
  296. v-if="
  297. hasPermission(
  298. 'admin.view.dataRequests'
  299. )
  300. "
  301. class="sidebar-item-child"
  302. to="/admin/users/data-requests"
  303. >
  304. Data Requests
  305. </router-link>
  306. <router-link
  307. v-if="
  308. hasPermission(
  309. 'admin.view.punishments'
  310. )
  311. "
  312. class="sidebar-item-child"
  313. to="/admin/users/punishments"
  314. >
  315. Punishments
  316. </router-link>
  317. </div>
  318. </div>
  319. <router-link
  320. v-else-if="
  321. hasPermission('admin.view.users') &&
  322. !sidebarActive
  323. "
  324. class="sidebar-item users"
  325. to="/admin/users"
  326. content="Users"
  327. v-tippy="{
  328. theme: 'info',
  329. onShow: () => !sidebarActive
  330. }"
  331. >
  332. <i class="material-icons">people</i>
  333. <span>Users</span>
  334. </router-link>
  335. <router-link
  336. v-if="hasPermission('admin.view.news')"
  337. class="sidebar-item news"
  338. to="/admin/news"
  339. content="News"
  340. v-tippy="{
  341. theme: 'info',
  342. onShow: () => !sidebarActive
  343. }"
  344. >
  345. <i class="material-icons">chrome_reader_mode</i>
  346. <span>News</span>
  347. </router-link>
  348. <router-link
  349. v-if="hasPermission('admin.view.statistics')"
  350. class="sidebar-item statistics"
  351. to="/admin/statistics"
  352. content="Statistics"
  353. v-tippy="{
  354. theme: 'info',
  355. onShow: () => !sidebarActive
  356. }"
  357. >
  358. <i class="material-icons">show_chart</i>
  359. <span>Statistics</span>
  360. </router-link>
  361. <div
  362. v-if="
  363. (hasPermission('admin.view.youtube') ||
  364. hasPermission(
  365. 'admin.view.youtubeVideos'
  366. )) &&
  367. sidebarActive
  368. "
  369. class="sidebar-item with-children"
  370. :class="{ 'is-active': childrenActive.youtube }"
  371. >
  372. <span>
  373. <router-link
  374. :to="`/admin/youtube${
  375. hasPermission('admin.view.youtube')
  376. ? ''
  377. : '/videos'
  378. }`"
  379. >
  380. <i class="material-icons"
  381. >smart_display</i
  382. >
  383. <span>YouTube</span>
  384. </router-link>
  385. <i
  386. class="material-icons toggle-sidebar-children"
  387. @click="
  388. toggleChildren({ child: 'youtube' })
  389. "
  390. >
  391. {{
  392. childrenActive.youtube
  393. ? "expand_less"
  394. : "expand_more"
  395. }}
  396. </i>
  397. </span>
  398. <div class="sidebar-item-children">
  399. <router-link
  400. v-if="
  401. hasPermission('admin.view.youtube')
  402. "
  403. class="sidebar-item-child"
  404. to="/admin/youtube"
  405. >
  406. YouTube
  407. </router-link>
  408. <router-link
  409. v-if="
  410. hasPermission(
  411. 'admin.view.youtubeVideos'
  412. )
  413. "
  414. class="sidebar-item-child"
  415. to="/admin/youtube/videos"
  416. >
  417. Videos
  418. </router-link>
  419. <router-link
  420. v-if="
  421. hasPermission(
  422. 'admin.view.youtubeChannels'
  423. )
  424. "
  425. class="sidebar-item-child"
  426. to="/admin/youtube/channels"
  427. >
  428. Channels
  429. </router-link>
  430. </div>
  431. </div>
  432. <router-link
  433. v-else-if="
  434. (hasPermission('admin.view.youtube') ||
  435. hasPermission(
  436. 'admin.view.youtubeVideos'
  437. )) &&
  438. !sidebarActive
  439. "
  440. class="sidebar-item youtube"
  441. :to="`/admin/youtube${
  442. hasPermission('admin.view.youtube')
  443. ? ''
  444. : '/videos'
  445. }`"
  446. content="YouTube"
  447. v-tippy="{
  448. theme: 'info',
  449. onShow: () => !sidebarActive
  450. }"
  451. >
  452. <i class="material-icons">smart_display</i>
  453. <span>YouTube</span>
  454. </router-link>
  455. <div
  456. v-if="
  457. (hasPermission('admin.view.soundcloud') ||
  458. hasPermission(
  459. 'admin.view.soundcloudTracks'
  460. )) &&
  461. sidebarActive
  462. "
  463. class="sidebar-item with-children"
  464. :class="{
  465. 'is-active': childrenActive.soundcloud
  466. }"
  467. >
  468. <span>
  469. <router-link
  470. :to="`/admin/soundcloud${
  471. hasPermission(
  472. 'admin.view.soundcloud'
  473. )
  474. ? ''
  475. : '/videos'
  476. }`"
  477. >
  478. <i class="material-icons">music_note</i>
  479. <span>SoundCloud</span>
  480. </router-link>
  481. <i
  482. class="material-icons toggle-sidebar-children"
  483. @click="
  484. toggleChildren({
  485. child: 'soundcloud'
  486. })
  487. "
  488. >
  489. {{
  490. childrenActive.soundcloud
  491. ? "expand_less"
  492. : "expand_more"
  493. }}
  494. </i>
  495. </span>
  496. <div class="sidebar-item-children">
  497. <router-link
  498. v-if="
  499. hasPermission(
  500. 'admin.view.soundcloud'
  501. )
  502. "
  503. class="sidebar-item-child"
  504. to="/admin/soundcloud"
  505. >
  506. SoundCloud
  507. </router-link>
  508. <router-link
  509. v-if="
  510. hasPermission(
  511. 'admin.view.soundcloudTracks'
  512. )
  513. "
  514. class="sidebar-item-child"
  515. to="/admin/soundcloud/tracks"
  516. >
  517. Tracks
  518. </router-link>
  519. </div>
  520. </div>
  521. <router-link
  522. v-else-if="
  523. (hasPermission('admin.view.soundcloud') ||
  524. hasPermission(
  525. 'admin.view.soundcloudTracks'
  526. )) &&
  527. !sidebarActive
  528. "
  529. class="sidebar-item soundcloud"
  530. :to="`/admin/soundcloud${
  531. hasPermission('admin.view.soundcloud')
  532. ? ''
  533. : '/tracks'
  534. }`"
  535. content="SoundCloud"
  536. v-tippy="{
  537. theme: 'info',
  538. onShow: () => !sidebarActive
  539. }"
  540. >
  541. <i class="material-icons">music_note</i>
  542. <span>SoundCloud</span>
  543. </router-link>
  544. </div>
  545. </div>
  546. </div>
  547. <div class="admin-container">
  548. <div class="admin-tab-container">
  549. <router-view></router-view>
  550. </div>
  551. <main-footer />
  552. </div>
  553. </div>
  554. </div>
  555. <floating-box
  556. id="keyboardShortcutsHelper"
  557. ref="keyboardShortcutsHelper"
  558. title="Admin Keyboard Shortcuts"
  559. >
  560. <template #body>
  561. <div>
  562. <div>
  563. <span class="biggest"
  564. ><b>Keyboard shortcuts helper</b></span
  565. >
  566. <span
  567. ><b>Ctrl + /</b> - Toggles this keyboard shortcuts
  568. helper</span
  569. >
  570. <span
  571. ><b>Ctrl + Shift + /</b> - Resets the position of
  572. this keyboard shortcuts helper</span
  573. >
  574. <hr />
  575. </div>
  576. <div>
  577. <span class="biggest"><b>Table</b></span>
  578. <span class="bigger"><b>Navigation</b></span>
  579. <span
  580. ><b>Up / Down arrow keys</b> - Move between
  581. rows</span
  582. >
  583. <hr />
  584. </div>
  585. <div>
  586. <span class="bigger"><b>Page navigation</b></span>
  587. <span
  588. ><b>Ctrl + Left/Right arrow keys</b> - Previous/next
  589. page</span
  590. >
  591. <span
  592. ><b>Ctrl + Shift + Left/Right arrow keys</b> -
  593. First/last page</span
  594. >
  595. <hr />
  596. </div>
  597. <div>
  598. <span class="bigger"><b>Reset localStorage</b></span>
  599. <span><b>Ctrl + F5</b> - Resets localStorage</span>
  600. <hr />
  601. </div>
  602. <div>
  603. <span class="bigger"><b>Selecting</b></span>
  604. <span><b>Space</b> - Selects/unselects a row</span>
  605. <span><b>Ctrl + A</b> - Selects all rows</span>
  606. <span
  607. ><b>Shift + Up/Down arrow keys</b> - Selects all
  608. rows in between</span
  609. >
  610. <span
  611. ><b>Ctrl + Up/Down arrow keys</b> - Unselects all
  612. rows in between</span
  613. >
  614. <hr />
  615. </div>
  616. <div>
  617. <span class="bigger"><b>Popup actions</b></span>
  618. <span><b>Ctrl + 1-9</b> - Execute action 1-9</span>
  619. <span><b>Ctrl + 0</b> - Select action 1</span>
  620. <hr />
  621. </div>
  622. </div>
  623. </template>
  624. </floating-box>
  625. </div>
  626. </template>
  627. <style lang="less" scoped>
  628. .night-mode {
  629. .main-container .admin-area {
  630. .admin-sidebar .inner {
  631. .top {
  632. background-color: var(--dark-grey-3);
  633. }
  634. .bottom {
  635. background-color: var(--dark-grey-2);
  636. .sidebar-item {
  637. background-color: var(--dark-grey-2);
  638. border-color: var(--dark-grey-3);
  639. &,
  640. &.with-children .sidebar-item-child,
  641. &.with-children > span > a {
  642. color: var(--white);
  643. }
  644. }
  645. }
  646. }
  647. :deep(.admin-content .admin-container .admin-tab-container) {
  648. .admin-tab {
  649. .card {
  650. background-color: var(--dark-grey-3);
  651. p {
  652. color: var(--light-grey-2);
  653. }
  654. }
  655. }
  656. }
  657. }
  658. }
  659. .main-container {
  660. height: auto;
  661. .admin-area {
  662. display: flex;
  663. flex-direction: column;
  664. min-height: 100vh;
  665. :deep(.nav) {
  666. .nav-menu.is-active {
  667. left: 45px;
  668. }
  669. &.admin-sidebar-active .nav-menu.is-active {
  670. left: 200px;
  671. }
  672. }
  673. .admin-sidebar {
  674. display: flex;
  675. min-width: 200px;
  676. width: 200px;
  677. @media screen and (max-width: 768px) {
  678. min-width: 45px;
  679. width: 45px;
  680. }
  681. .inner {
  682. display: flex;
  683. flex-direction: column;
  684. max-height: 100vh;
  685. width: 200px;
  686. position: sticky;
  687. top: 0;
  688. bottom: 0;
  689. left: 0;
  690. z-index: 5;
  691. box-shadow: @box-shadow;
  692. .bottom {
  693. overflow-y: auto;
  694. height: 100%;
  695. max-height: 100%;
  696. display: flex;
  697. flex-direction: column;
  698. flex: 1 0 auto;
  699. background-color: var(--white);
  700. .sidebar-item {
  701. display: flex;
  702. padding: 0 20px;
  703. line-height: 40px;
  704. font-size: 16px;
  705. font-weight: 600;
  706. color: var(--primary-color);
  707. background-color: var(--white);
  708. border-bottom: 1px solid var(--light-grey-2);
  709. transition: filter 0.2s ease-in-out;
  710. & > .material-icons {
  711. line-height: 40px;
  712. margin-right: 5px;
  713. }
  714. &:hover,
  715. &:focus,
  716. &.router-link-active,
  717. &.is-active {
  718. filter: brightness(95%);
  719. }
  720. &.toggle-sidebar {
  721. cursor: pointer;
  722. font-weight: 400;
  723. }
  724. &.with-children {
  725. flex-direction: column;
  726. & > span {
  727. display: flex;
  728. line-height: 40px;
  729. cursor: pointer;
  730. & > a {
  731. display: flex;
  732. }
  733. & > .material-icons,
  734. & > a > .material-icons {
  735. line-height: 40px;
  736. margin-right: 5px;
  737. }
  738. }
  739. .toggle-sidebar-children {
  740. margin-left: auto;
  741. }
  742. .sidebar-item-children {
  743. display: none;
  744. }
  745. &.is-active .sidebar-item-children {
  746. display: flex;
  747. flex-direction: column;
  748. .sidebar-item-child {
  749. display: flex;
  750. flex-direction: column;
  751. margin-left: 30px;
  752. font-size: 14px;
  753. line-height: 30px;
  754. position: relative;
  755. &::before {
  756. content: "";
  757. position: absolute;
  758. width: 1px;
  759. height: 30px;
  760. top: 0;
  761. left: -20px;
  762. background-color: var(--light-grey-3);
  763. }
  764. &:last-child::before {
  765. height: 16px;
  766. }
  767. &::after {
  768. content: "";
  769. position: absolute;
  770. width: 15px;
  771. height: 1px;
  772. top: 15px;
  773. left: -20px;
  774. background-color: var(--light-grey-3);
  775. }
  776. &.router-link-active {
  777. filter: brightness(95%);
  778. }
  779. }
  780. }
  781. }
  782. }
  783. }
  784. }
  785. &.minimised {
  786. min-width: 45px;
  787. width: 45px;
  788. .inner {
  789. max-width: 45px;
  790. .top {
  791. justify-content: center;
  792. .full-logo {
  793. display: none;
  794. }
  795. .minimised-logo {
  796. display: flex;
  797. }
  798. }
  799. .sidebar-item {
  800. justify-content: center;
  801. padding: 0;
  802. & > span {
  803. display: none;
  804. }
  805. }
  806. }
  807. }
  808. }
  809. .admin-content {
  810. display: flex;
  811. flex-direction: row;
  812. flex-grow: 1;
  813. .admin-container {
  814. display: flex;
  815. flex-direction: column;
  816. flex-grow: 1;
  817. overflow: hidden;
  818. :deep(.admin-tab-container) {
  819. display: flex;
  820. flex-direction: column;
  821. flex: 1 0 auto;
  822. padding: 10px 10px 20px 10px;
  823. .admin-tab {
  824. display: flex;
  825. flex-direction: column;
  826. width: 100%;
  827. max-width: 1900px;
  828. margin: 0 auto;
  829. padding: 0 10px;
  830. .card {
  831. display: flex;
  832. flex-grow: 1;
  833. flex-direction: column;
  834. padding: 20px;
  835. margin: 10px 0;
  836. border-radius: @border-radius;
  837. background-color: var(--white);
  838. color: var(--dark-grey);
  839. box-shadow: @box-shadow;
  840. h1 {
  841. font-size: 36px;
  842. margin: 0 0 5px 0;
  843. }
  844. h4 {
  845. font-size: 22px;
  846. margin: 0;
  847. }
  848. h5 {
  849. font-size: 18px;
  850. margin: 0;
  851. }
  852. hr {
  853. margin: 10px 0;
  854. }
  855. &.tab-info {
  856. flex-direction: row;
  857. flex-wrap: wrap;
  858. .info-row {
  859. display: flex;
  860. flex-grow: 1;
  861. flex-direction: column;
  862. }
  863. .button-row {
  864. display: flex;
  865. flex-direction: row;
  866. flex-wrap: wrap;
  867. justify-content: center;
  868. margin: auto 0;
  869. padding: 5px 0;
  870. & > .button,
  871. & > span {
  872. margin: auto 0;
  873. &:not(:first-child) {
  874. margin-left: 5px;
  875. }
  876. }
  877. & > span > .control.has-addons {
  878. margin-bottom: 0 !important;
  879. }
  880. }
  881. }
  882. }
  883. @media screen and (min-width: 980px) {
  884. &.container {
  885. margin: 0 auto;
  886. max-width: 960px;
  887. }
  888. }
  889. @media screen and (min-width: 1180px) {
  890. &.container {
  891. max-width: 1200px;
  892. }
  893. }
  894. }
  895. }
  896. }
  897. }
  898. }
  899. }
  900. :deep(.box) {
  901. box-shadow: @box-shadow;
  902. display: block;
  903. &:not(:last-child) {
  904. margin-bottom: 20px;
  905. }
  906. }
  907. #keyboardShortcutsHelper {
  908. .box-body {
  909. .biggest {
  910. font-size: 18px;
  911. }
  912. .bigger {
  913. font-size: 16px;
  914. }
  915. span {
  916. display: block;
  917. }
  918. }
  919. }
  920. </style>