Skip to content

Commit

Permalink
Merge pull request #229 from heckenmann/qodana
Browse files Browse the repository at this point in the history
Qodana
  • Loading branch information
heckenmann authored Feb 19, 2023
2 parents d54a2a7 + 79ada47 commit 92f4b73
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 47 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -54,7 +54,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -68,4 +68,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2
18 changes: 0 additions & 18 deletions .github/workflows/dependabot-auto-merge.yml

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:

# Workaround: https://github.com/docker/build-push-action/issues/461
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v2.2.1
uses: docker/setup-buildx-action@v2.4.1

# Login against a Docker registry except on PR
# https://github.com/docker/login-action
Expand All @@ -61,15 +61,15 @@ jobs:
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v4.1.1
uses: docker/metadata-action@v4.3.0
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v3.2.0
uses: docker/build-push-action@v4.0.0
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/qodana-code-quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Qodana
on:
workflow_dispatch:
pull_request:
push:
branches:
- master
- '*'

jobs:
qodana:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: 'Qodana Scan'
uses: JetBrains/[email protected]
env:
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
![Docker](https://github.com/heckenmann/docker-swarm-dashboard/actions/workflows/docker-publish.yml/badge.svg?branch=master)
![CodeQL](https://github.com/heckenmann/docker-swarm-dashboard/actions/workflows/codeql.yml/badge.svg?branch=master)
![qodana](https://github.com/heckenmann/docker-swarm-dashboard/actions/workflows/qodana-code-quality.yml/badge.svg?branch=master)
[![Qodana](https://github.com/heckenmann/docker-swarm-dashboard/actions/workflows/qodana-code-quality.yml/badge.svg?branch=master)](https://github.com/heckenmann/docker-swarm-dashboard/actions/workflows/qodana-code-quality.yml)

# docker-swarm-dashboard
Dashboard for Docker Swarm Cluster

Expand Down
2 changes: 1 addition & 1 deletion app-src/src/common/store/atoms.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const servicesAtom = atomWithReducer(fetchServices(), () => fetchServices
export const tasksAtom = atomWithReducer(fetchTasks(), () => fetchTasks());
export const viewAtom = atomWithHash('view', {'id': dashboardHId});
export const messagesAtom = atomWithReducer([], MessageReducer);
export const useNewApiToogleAtom = atomWithHash('newapi', false);
export const useNewApiToogleAtom = atomWithHash('newapi', true);
export const tableSizeAtom = atomWithHash('tablesize', 'sm');

// New API
Expand Down
14 changes: 7 additions & 7 deletions app-src/src/components/DashboardComponent.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
import {Table, Badge, Button} from 'react-bootstrap';
import {Badge, Button, Table} from 'react-bootstrap';
import {getStyleClassForState} from '../Helper';
import {FontAwesomeIcon} from '@fortawesome/react-fontawesome';
import {DashboardSettingsComponent} from './DashboardSettingsComponent';
import {
currentVariantAtom,
dashboardHAtom,
isDarkModeAtom,
nodesAtom,
servicesAtom,
tableSizeAtom,
tasksAtom,
viewDetailIdAtom,
viewAtom,
useNewApiToogleAtom,
dashboardHAtom,
tableSizeAtom
viewAtom
} from '../common/store/atoms';
import {useAtom, useAtomValue} from 'jotai';
import {nodesDetailId, servicesDetailId} from '../common/navigationConstants';
import {waitForAll} from 'jotai/utils';

function DashboardComponent() {
const isDarkMode = useAtomValue(isDarkModeAtom);
Expand Down Expand Up @@ -100,7 +98,9 @@ function DashboardComponent() {
}
)
} else {
const [services, nodes, tasks] = useAtomValue(waitForAll([servicesAtom, nodesAtom, tasksAtom]));
const services = useAtomValue(servicesAtom);
const nodes = useAtomValue(nodesAtom);
const tasks = useAtomValue(tasksAtom);
// Columns
services.forEach(service => {
theads.push(
Expand Down
17 changes: 9 additions & 8 deletions app-src/src/components/DashboardVerticalComponent.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
import {Table, Badge, Button} from 'react-bootstrap';
import {Badge, Table} from 'react-bootstrap';
import {getStyleClassForState} from '../Helper';
import {DashboardSettingsComponent} from './DashboardSettingsComponent';
import {
currentVariantAtom,
dashboardVAtom,
isDarkModeAtom,
nodesAtom,
servicesAtom,
tableSizeAtom,
tasksAtom,
viewDetailId,
viewDetailIdAtom,
viewAtom,
useNewApiToogleAtom, dashboardHAtom, dashboardVAtom, tableSizeAtom
useNewApiToogleAtom,
viewAtom
} from '../common/store/atoms';
import {useAtom, useAtomValue} from 'jotai';
import {nodesDetailId, servicesDetailId} from '../common/navigationConstants';
import {waitForAll} from 'jotai/utils';
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";

function DashboardVerticalComponent() {
const [services, nodes, tasks] = useAtomValue(waitForAll([servicesAtom, nodesAtom, tasksAtom]));

const isDarkMode = useAtomValue(isDarkModeAtom);
const currentVariant = useAtomValue(currentVariantAtom);
const useNewApi = useAtomValue(useNewApiToogleAtom);
Expand Down Expand Up @@ -77,6 +75,9 @@ function DashboardVerticalComponent() {
}
)
} else {
const services = useAtomValue(servicesAtom);
const nodes = useAtomValue(nodesAtom);
const tasks = useAtomValue(tasksAtom);
// Columns
nodes.forEach(node => {
theads.push(
Expand Down
14 changes: 8 additions & 6 deletions app-src/src/components/TasksComponent.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import {useAtom, useAtomValue} from 'jotai';
import {waitForAll} from 'jotai/utils';
import {Table, Badge, Card} from 'react-bootstrap';
import {Badge, Card, Table} from 'react-bootstrap';
import {toDefaultDateTimeString} from '../common/DefaultDateTimeFormat';
import {nodesDetailId, servicesDetailId} from '../common/navigationConstants';
import {
currentVariantAtom,
currentVariantClassesAtom,
nodesAtom,
servicesAtom,
tableSizeAtom,
tasksAtom,
viewDetailIdAtom,
viewAtom,
tableSizeAtom, useNewApiToogleAtom, tasksAtomNew
tasksAtomNew,
useNewApiToogleAtom,
viewAtom
} from '../common/store/atoms';
import {getStyleClassForState} from '../Helper';

Expand Down Expand Up @@ -45,7 +45,9 @@ function TasksComponent() {
</tr>
);
} else {
const [services, nodes, tasks] = useAtomValue(waitForAll([servicesAtom, nodesAtom, tasksAtom]));
const services = useAtomValue(servicesAtom);
const nodes = useAtomValue(nodesAtom);
const tasks = useAtomValue(tasksAtom);
rows = tasks.map(task => {
const currentNode = nodes.find(node => node['ID'] === task['NodeID']);
const currentService = services.find(service => service['ID'] === task['ServiceID']);
Expand Down

0 comments on commit 92f4b73

Please sign in to comment.