Skip to content
This repository has been archived by the owner on Apr 17, 2024. It is now read-only.

Commit

Permalink
chore: cleanup js deps
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Trost <[email protected]>
  • Loading branch information
galexrt committed Nov 6, 2023
1 parent a206b85 commit 1b17985
Show file tree
Hide file tree
Showing 7 changed files with 449 additions and 534 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,8 @@ jobs:
- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Run Nuxt typecheck
run: yarn typecheck

- name: Run yarn build
run: yarn build
10 changes: 10 additions & 0 deletions docs/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,13 @@ Use the following script to update the data-control-center version:
```console
./internal/scripts/bump_version.sh X.Y.Z
```

After the release has been successfully created make sure to rebase and force push the `develop` branch on `main` branch.

```console
git checkout main
git pull
git checkout develop
git rebase main
git push -u develop --force
```
36 changes: 18 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,37 +1,36 @@
{
"name": "data-control-center",
"private": true,
"version": "0.2.0-alpha",
"version": "0.2.0",
"type": "module",
"scripts": {
"build": "yarn nuxi build",
"dev": "yarn nuxi dev",
"generate": "yarn nuxi generate",
"preview": "yarn nuxi preview",
"postinstall": "yarn nuxi prepare",
"build": "COMMIT_REF=$(git describe --tags --exclude='fivenet-*') yarn nuxi build",
"dev": "COMMIT_REF=$(git describe --tags --exclude='fivenet-*') yarn nuxi dev",
"generate": "COMMIT_REF=$(git describe --tags --exclude='fivenet-*') yarn nuxi generate",
"preview": "COMMIT_REF=$(git describe --tags --exclude='fivenet-*') yarn nuxi preview",
"postinstall": "COMMIT_REF=$(git describe --tags --exclude='fivenet-*') yarn nuxi prepare",
"pretty": "yarn prettier --write ./src/",
"analyze": "yarn nuxi analyze",
"typecheck": "yarn nuxi typecheck",
"lint": "yarn eslint .",
"cephapidummy": "npx ts-node-esm ./node/server.ts"
},
"dependencies": {
"@bufbuild/protobuf": "^1.4.1",
"@bufbuild/protoc-gen-es": "^1.4.1",
"@connectrpc/connect": "^1.1.3",
"@connectrpc/connect-fastify": "^1.1.3",
"@connectrpc/connect-node": "^1.1.3",
"@connectrpc/connect-web": "^1.1.3",
"@fastify/cors": "^8.4.1",
"@fontsource/inter": "^5.0.15",
"@headlessui/vue": "^1.7.16",
"@improbable-eng/grpc-web": "^0.15.0",
"@nuxtjs/robots": "^3.0.0",
"@originjs/vite-plugin-commonjs": "^1.0.3",
"@pinia/nuxt": "^0.5.1",
"@types/uuid": "^9.0.6",
"@vee-validate/nuxt": "^4.11.8",
"@vee-validate/rules": "^4.11.8",
"@vueuse/core": "^10.5.0",
"apexcharts": "^3.44.0",
"chart.js": "^4.4.0",
"d3": "^7.8.5",
"fastify": "^4.24.3",
"flowbite": "^2.0.0",
Expand All @@ -42,14 +41,13 @@
"slugify": "^1.6.6",
"uuid": "^9.0.1",
"vee-validate": "^4.11.8",
"vue": "^3.3.8",
"vue-chartjs": "^5.2.0",
"vue-template-compiler": "^2.7.15",
"vue3-apexcharts": "^1.4.4"
},
"devDependencies": {
"@nuxt/devtools": "^1.0.0",
"@nuxtjs/eslint-config-typescript": "^12.1.0",
"@nuxtjs/eslint-module": "^4.1.0",
"@nuxtjs/tailwindcss": "^6.9.4",
"@pinia-plugin-persistedstate/nuxt": "^1.2.0",
"@tailwindcss/forms": "^0.5.6",
Expand All @@ -58,30 +56,32 @@
"@types/d3": "^7.4.2",
"@types/google-protobuf": "^3.15.9",
"@types/node": "^20.8.10",
"@types/uuid": "^9.0.6",
"@unhead/vue": "^1.8.3",
"@vitejs/plugin-vue": "^4.4.0",
"@volar/typescript": "^1.11.1",
"autoprefixer": "^10.4.16",
"cssnano": "^6.0.1",
"eslint": "^8.53.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-vue": "^9.18.1",
"eslint": "^8.53.0",
"nuxi": "^3.9.1",
"nuxt": "^3.8.1",
"nuxt-typed-router": "^3.3.2",
"postcss": "^8.4.31",
"nuxt": "^3.8.1",
"postcss-custom-properties": "^13.3.2",
"postcss-url": "^10.1.3",
"prettier": "^3.0.3",
"postcss": "^8.4.31",
"prettier-plugin-organize-imports": "^3.2.3",
"prettier": "^3.0.3",
"protoc-gen-js": "^3.21.2",
"sass": "^1.69.5",
"tailwindcss": "^3.3.5",
"ts-node": "^10.9.1",
"typescript": "^5.2.2",
"vite": "^4.5.0",
"vite-plugin-mkcert": "^1.16.0",
"vue-tsc": "^1.8.22"
"vue-router": "^4.2.5",
"vue-tsc": "^1.8.22",
"vue": "^3.3.8"
}
}
28 changes: 16 additions & 12 deletions src/composables/stats/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,22 @@ import { camelCaseToTitleCase, formatBytes } from '~/utils/strings';
import { ClusterStats, PGs } from '~~/gen/ts/api/resources/stats/v1/stats_pb';

export class TransformStats {
constructor(private clusterStats: ClusterStats) {}
private clusterStats: ClusterStats;

constructor(clusterStats: ClusterStats) {
this.clusterStats = clusterStats;
}

/**
* Transforms descriptions for display.
* @param {string} title - The title of the data.
* @param {string} _ - The title of the data.
* @param {any} data - The data to transform.
* @returns {DisplayStatsData[]} An array of transformed data.
*/
private transformDescriptions(title: string, data: any): DisplayStatsData[] {
private transformDescriptions(_: string, data: any): DisplayStatsData[] {
return Object.keys(data).map((serviceName) => {
const serviceData = data[serviceName];
const serviceMeta = meta[serviceName] ?? meta['default'];
const serviceMeta = meta[serviceName] ?? meta.default;

if (serviceName === 'volumes') {
return {
Expand Down Expand Up @@ -71,8 +75,8 @@ export class TransformStats {

transformedArray.push({
title: 'Alerts',
icon: meta['alerts'].icon,
color: meta['alerts']?.color,
icon: meta.alerts.icon,
color: meta.alerts.color,

description: this.clusterStats.crashes.map((daemon) => ({
description: daemon.description,
Expand All @@ -85,24 +89,24 @@ export class TransformStats {
if (this.clusterStats.iops) {
transformedArray.push({
title: 'Input / Output',
icon: markRaw(meta['iops'].icon),
color: meta['iops']?.color,
icon: markRaw(meta.iops.icon),
color: meta.iops?.color,
description: [
{
title: 'Read',
description: this.clusterStats.iops.clientRead,
description: this.clusterStats.iops.clientRead.toString(),
},
{
title: 'Read Ops',
description: this.clusterStats.iops.clientReadOps,
description: this.clusterStats.iops.clientReadOps.toString(),
},
{
title: 'Write',
description: this.clusterStats.iops.clientWrite,
description: this.clusterStats.iops.clientWrite.toString(),
},
{
title: 'Write Ops',
description: this.clusterStats.iops.clientWriteOps,
description: this.clusterStats.iops.clientWriteOps.toString(),
},
],
});
Expand Down
3 changes: 2 additions & 1 deletion src/middleware/zauth.global.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { RouteLocationNormalized } from 'vue-router';
import { useAuthStore } from '~/store/auth';
import { useNotificationsStore } from '~/store/notifications';

export default defineNuxtRouteMiddleware(async (to: RouteLocationNormalized, _: RouteLocationNormalized) => {
const authStore = useAuthStore();
Expand Down Expand Up @@ -34,7 +35,7 @@ export default defineNuxtRouteMiddleware(async (to: RouteLocationNormalized, _:

if (accessToken.value !== null) {
return navigateTo({
name: 'overview',
name: 'index',
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/shims.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ declare module '#app' {
interface PageMeta {
title?: string;
requiresAuth?: boolean;
permission?: String;
permission?: string;
authOnlyToken?: boolean;
}
}
Expand Down
Loading

0 comments on commit 1b17985

Please sign in to comment.