-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
Hermes console vue
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Console CI | ||
|
||
# Configured for all pushes and PRs for the sake of new console development on dev branches. | ||
# Later it could be changed to pushes and PRs only to master branch to match main CI config. | ||
on: [ push, pull_request ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./hermes-console-vue | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
- name: Run linter | ||
run: yarn && yarn lint | ||
- name: Run frontend tests | ||
run: yarn test:unit |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package pl.allegro.tech.hermes.api; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
import java.util.Objects; | ||
|
||
public class Stats { | ||
private final TopicStats topicStats; | ||
private final SubscriptionStats subscriptionStats; | ||
|
||
@JsonCreator | ||
public Stats(@JsonProperty("topicStats") TopicStats topicStats, @JsonProperty("subscriptionStats") SubscriptionStats subscriptionStats) { | ||
Check warning on line 13 in hermes-api/src/main/java/pl/allegro/tech/hermes/api/Stats.java GitHub Actions / checkstyle-hermes-api[checkstyle-hermes-api] hermes-api/src/main/java/pl/allegro/tech/hermes/api/Stats.java#L13 <com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck>
Raw output
|
||
this.topicStats = topicStats; | ||
this.subscriptionStats = subscriptionStats; | ||
} | ||
|
||
public TopicStats getTopicStats() { | ||
return topicStats; | ||
} | ||
|
||
public SubscriptionStats getSubscriptionStats() { | ||
return subscriptionStats; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
Check warning on line 28 in hermes-api/src/main/java/pl/allegro/tech/hermes/api/Stats.java GitHub Actions / checkstyle-hermes-api[checkstyle-hermes-api] hermes-api/src/main/java/pl/allegro/tech/hermes/api/Stats.java#L28 <com.puppycrawl.tools.checkstyle.checks.blocks.NeedBracesCheck>
Raw output
|
||
if (o == null || getClass() != o.getClass()) return false; | ||
Check warning on line 29 in hermes-api/src/main/java/pl/allegro/tech/hermes/api/Stats.java GitHub Actions / checkstyle-hermes-api[checkstyle-hermes-api] hermes-api/src/main/java/pl/allegro/tech/hermes/api/Stats.java#L29 <com.puppycrawl.tools.checkstyle.checks.blocks.NeedBracesCheck>
Raw output
|
||
Stats stats = (Stats) o; | ||
return Objects.equals(topicStats, stats.topicStats) && Objects.equals(subscriptionStats, stats.subscriptionStats); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(topicStats, subscriptionStats); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "Stats{" + | ||
Check warning on line 41 in hermes-api/src/main/java/pl/allegro/tech/hermes/api/Stats.java GitHub Actions / checkstyle-hermes-api[checkstyle-hermes-api] hermes-api/src/main/java/pl/allegro/tech/hermes/api/Stats.java#L41 <com.puppycrawl.tools.checkstyle.checks.whitespace.OperatorWrapCheck>
Raw output
|
||
"topicStats=" + topicStats + | ||
Check warning on line 42 in hermes-api/src/main/java/pl/allegro/tech/hermes/api/Stats.java GitHub Actions / checkstyle-hermes-api[checkstyle-hermes-api] hermes-api/src/main/java/pl/allegro/tech/hermes/api/Stats.java#L42 <com.puppycrawl.tools.checkstyle.checks.whitespace.OperatorWrapCheck>
Raw output
|
||
", subscriptionStats=" + subscriptionStats + | ||
Check warning on line 43 in hermes-api/src/main/java/pl/allegro/tech/hermes/api/Stats.java GitHub Actions / checkstyle-hermes-api[checkstyle-hermes-api] hermes-api/src/main/java/pl/allegro/tech/hermes/api/Stats.java#L43 <com.puppycrawl.tools.checkstyle.checks.whitespace.OperatorWrapCheck>
Raw output
|
||
'}'; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package pl.allegro.tech.hermes.api; | ||
|
||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
import java.util.Objects; | ||
|
||
public class SubscriptionStats { | ||
private final long subscriptionCount; | ||
private final long trackingEnabledSubscriptionCount; | ||
private final long avroSubscriptionCount; | ||
|
||
@JsonCreator | ||
public SubscriptionStats( | ||
@JsonProperty("subscriptionCount") long subscriptionCount, | ||
@JsonProperty("trackingEnabledSubscriptionCount") long trackingEnabledSubscriptionCount, | ||
@JsonProperty("avroSubscriptionCount") long avroSubscriptionCount) { | ||
this.subscriptionCount = subscriptionCount; | ||
this.trackingEnabledSubscriptionCount = trackingEnabledSubscriptionCount; | ||
this.avroSubscriptionCount = avroSubscriptionCount; | ||
} | ||
|
||
public long getSubscriptionCount() { | ||
return subscriptionCount; | ||
} | ||
|
||
public long getTrackingEnabledSubscriptionCount() { | ||
return trackingEnabledSubscriptionCount; | ||
} | ||
|
||
public long getAvroSubscriptionCount() { | ||
return avroSubscriptionCount; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
Check warning on line 38 in hermes-api/src/main/java/pl/allegro/tech/hermes/api/SubscriptionStats.java GitHub Actions / checkstyle-hermes-api[checkstyle-hermes-api] hermes-api/src/main/java/pl/allegro/tech/hermes/api/SubscriptionStats.java#L38 <com.puppycrawl.tools.checkstyle.checks.blocks.NeedBracesCheck>
Raw output
|
||
if (o == null || getClass() != o.getClass()) return false; | ||
Check warning on line 39 in hermes-api/src/main/java/pl/allegro/tech/hermes/api/SubscriptionStats.java GitHub Actions / checkstyle-hermes-api[checkstyle-hermes-api] hermes-api/src/main/java/pl/allegro/tech/hermes/api/SubscriptionStats.java#L39 <com.puppycrawl.tools.checkstyle.checks.blocks.NeedBracesCheck>
Raw output
|
||
SubscriptionStats that = (SubscriptionStats) o; | ||
return subscriptionCount == that.subscriptionCount && trackingEnabledSubscriptionCount == that.trackingEnabledSubscriptionCount && avroSubscriptionCount == that.avroSubscriptionCount; | ||
Check warning on line 41 in hermes-api/src/main/java/pl/allegro/tech/hermes/api/SubscriptionStats.java GitHub Actions / checkstyle-hermes-api[checkstyle-hermes-api] hermes-api/src/main/java/pl/allegro/tech/hermes/api/SubscriptionStats.java#L41 <com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck>
Raw output
|
||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(subscriptionCount, trackingEnabledSubscriptionCount, avroSubscriptionCount); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "SubscriptionStats{" + | ||
Check warning on line 51 in hermes-api/src/main/java/pl/allegro/tech/hermes/api/SubscriptionStats.java GitHub Actions / checkstyle-hermes-api[checkstyle-hermes-api] hermes-api/src/main/java/pl/allegro/tech/hermes/api/SubscriptionStats.java#L51 <com.puppycrawl.tools.checkstyle.checks.whitespace.OperatorWrapCheck>
Raw output
|
||
"subscriptionCount=" + subscriptionCount + | ||
Check warning on line 52 in hermes-api/src/main/java/pl/allegro/tech/hermes/api/SubscriptionStats.java GitHub Actions / checkstyle-hermes-api[checkstyle-hermes-api] hermes-api/src/main/java/pl/allegro/tech/hermes/api/SubscriptionStats.java#L52 <com.puppycrawl.tools.checkstyle.checks.whitespace.OperatorWrapCheck>
Raw output
|
||
", trackingEnabledSubscriptionCount=" + trackingEnabledSubscriptionCount + | ||
Check warning on line 53 in hermes-api/src/main/java/pl/allegro/tech/hermes/api/SubscriptionStats.java GitHub Actions / checkstyle-hermes-api[checkstyle-hermes-api] hermes-api/src/main/java/pl/allegro/tech/hermes/api/SubscriptionStats.java#L53 <com.puppycrawl.tools.checkstyle.checks.whitespace.OperatorWrapCheck>
Raw output
|
||
", avroSubscriptionCount=" + avroSubscriptionCount + | ||
Check warning on line 54 in hermes-api/src/main/java/pl/allegro/tech/hermes/api/SubscriptionStats.java GitHub Actions / checkstyle-hermes-api[checkstyle-hermes-api] hermes-api/src/main/java/pl/allegro/tech/hermes/api/SubscriptionStats.java#L54 <com.puppycrawl.tools.checkstyle.checks.whitespace.OperatorWrapCheck>
Raw output
|
||
'}'; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package pl.allegro.tech.hermes.api; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
import java.util.Objects; | ||
|
||
public class TopicStats { | ||
private final long topicCount; | ||
private final long ackAllTopicCount; | ||
private final long trackingEnabledTopicCount; | ||
private final long avroTopicCount; | ||
|
||
@JsonCreator | ||
public TopicStats(@JsonProperty("topicCount") long topicCount, | ||
@JsonProperty("ackAllTopicCount") long ackAllTopicCount, | ||
@JsonProperty("trackingEnabledTopicCount") long trackingEnabledTopicCount, | ||
@JsonProperty("avroTopicCount") long avroTopicCount) { | ||
this.topicCount = topicCount; | ||
this.ackAllTopicCount = ackAllTopicCount; | ||
this.trackingEnabledTopicCount = trackingEnabledTopicCount; | ||
this.avroTopicCount = avroTopicCount; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
Check warning on line 27 in hermes-api/src/main/java/pl/allegro/tech/hermes/api/TopicStats.java GitHub Actions / checkstyle-hermes-api[checkstyle-hermes-api] hermes-api/src/main/java/pl/allegro/tech/hermes/api/TopicStats.java#L27 <com.puppycrawl.tools.checkstyle.checks.blocks.NeedBracesCheck>
Raw output
|
||
if (o == null || getClass() != o.getClass()) return false; | ||
Check warning on line 28 in hermes-api/src/main/java/pl/allegro/tech/hermes/api/TopicStats.java GitHub Actions / checkstyle-hermes-api[checkstyle-hermes-api] hermes-api/src/main/java/pl/allegro/tech/hermes/api/TopicStats.java#L28 <com.puppycrawl.tools.checkstyle.checks.blocks.NeedBracesCheck>
Raw output
|
||
TopicStats that = (TopicStats) o; | ||
return topicCount == that.topicCount && ackAllTopicCount == that.ackAllTopicCount && trackingEnabledTopicCount == that.trackingEnabledTopicCount && avroTopicCount == that.avroTopicCount; | ||
Check warning on line 30 in hermes-api/src/main/java/pl/allegro/tech/hermes/api/TopicStats.java GitHub Actions / checkstyle-hermes-api[checkstyle-hermes-api] hermes-api/src/main/java/pl/allegro/tech/hermes/api/TopicStats.java#L30 <com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck>
Raw output
|
||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(topicCount, ackAllTopicCount, trackingEnabledTopicCount, avroTopicCount); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "TopicStats{" + | ||
Check warning on line 40 in hermes-api/src/main/java/pl/allegro/tech/hermes/api/TopicStats.java GitHub Actions / checkstyle-hermes-api[checkstyle-hermes-api] hermes-api/src/main/java/pl/allegro/tech/hermes/api/TopicStats.java#L40 <com.puppycrawl.tools.checkstyle.checks.whitespace.OperatorWrapCheck>
Raw output
|
||
"topicCount=" + topicCount + | ||
Check warning on line 41 in hermes-api/src/main/java/pl/allegro/tech/hermes/api/TopicStats.java GitHub Actions / checkstyle-hermes-api[checkstyle-hermes-api] hermes-api/src/main/java/pl/allegro/tech/hermes/api/TopicStats.java#L41 <com.puppycrawl.tools.checkstyle.checks.whitespace.OperatorWrapCheck>
Raw output
|
||
", ackAllTopicCount=" + ackAllTopicCount + | ||
Check warning on line 42 in hermes-api/src/main/java/pl/allegro/tech/hermes/api/TopicStats.java GitHub Actions / checkstyle-hermes-api[checkstyle-hermes-api] hermes-api/src/main/java/pl/allegro/tech/hermes/api/TopicStats.java#L42 <com.puppycrawl.tools.checkstyle.checks.whitespace.OperatorWrapCheck>
Raw output
|
||
", trackingEnabledTopicCount=" + trackingEnabledTopicCount + | ||
Check warning on line 43 in hermes-api/src/main/java/pl/allegro/tech/hermes/api/TopicStats.java GitHub Actions / checkstyle-hermes-api[checkstyle-hermes-api] hermes-api/src/main/java/pl/allegro/tech/hermes/api/TopicStats.java#L43 <com.puppycrawl.tools.checkstyle.checks.whitespace.OperatorWrapCheck>
Raw output
|
||
", avroTopicCount=" + avroTopicCount + | ||
Check warning on line 44 in hermes-api/src/main/java/pl/allegro/tech/hermes/api/TopicStats.java GitHub Actions / checkstyle-hermes-api[checkstyle-hermes-api] hermes-api/src/main/java/pl/allegro/tech/hermes/api/TopicStats.java#L44 <com.puppycrawl.tools.checkstyle.checks.whitespace.OperatorWrapCheck>
Raw output
|
||
'}'; | ||
} | ||
|
||
public long getTopicCount() { | ||
return topicCount; | ||
} | ||
|
||
public long getAckAllTopicCount() { | ||
return ackAllTopicCount; | ||
} | ||
|
||
public long getTrackingEnabledTopicCount() { | ||
return trackingEnabledTopicCount; | ||
} | ||
|
||
public long getAvroTopicCount() { | ||
return avroTopicCount; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package pl.allegro.tech.hermes.api.endpoints; | ||
|
||
import jakarta.ws.rs.GET; | ||
import jakarta.ws.rs.Path; | ||
import jakarta.ws.rs.Produces; | ||
import pl.allegro.tech.hermes.api.Stats; | ||
|
||
import static jakarta.ws.rs.core.MediaType.APPLICATION_JSON; | ||
|
||
@Path("stats") | ||
public interface StatsEndpoint { | ||
@GET | ||
@Produces(APPLICATION_JSON) | ||
Stats getStats(); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* eslint-env node */ | ||
require('@rushstack/eslint-patch/modern-module-resolution'); | ||
|
||
module.exports = { | ||
env: { | ||
browser: true, | ||
node: true, | ||
}, | ||
root: true, | ||
extends: [ | ||
'@vue/eslint-config-prettier', | ||
'@vue/eslint-config-typescript', | ||
'eslint:recommended', | ||
'plugin:prettier/recommended', | ||
'plugin:vue/vue3-essential', | ||
], | ||
globals: { | ||
afterAll: true, | ||
afterEach: true, | ||
assert: true, | ||
assertType: true, | ||
beforeAll: true, | ||
beforeEach: true, | ||
describe: true, | ||
expect: true, | ||
expectTypeOf: true, | ||
it: true, | ||
suite: true, | ||
test: true, | ||
vi: true, | ||
vitest: true, | ||
}, | ||
parserOptions: { | ||
ecmaVersion: 'latest', | ||
ecmaFeatures: { | ||
jsx: false, | ||
}, | ||
}, | ||
plugins: ['prettier', 'vue', 'sort-imports-es6-autofix'], | ||
rules: { | ||
'sort-imports-es6-autofix/sort-imports-es6': [ | ||
'warn', | ||
{ | ||
ignoreCase: true, | ||
ignoreMemberSort: false, | ||
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'], | ||
}, | ||
], | ||
'no-unused-vars': 'off', | ||
'@typescript-eslint/no-unused-vars': ['error'], | ||
}, | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
.DS_Store | ||
dist | ||
dist-ssr | ||
coverage | ||
*.local | ||
|
||
/cypress/videos/ | ||
/cypress/screenshots/ | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"singleQuote": true, | ||
"tabWidth": 2, | ||
"trailingComma": "all", | ||
"useTabs": false, | ||
"vueIndentScriptAndStyle": true | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"recommendations": ["Vue.volar", "Vue.vscode-typescript-vue-plugin"] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# hermes-console-vue | ||
|
||
Hermes console migrated from AngularJS to Vue 3. | ||
|
||
## Requirements | ||
|
||
* node >=18.0.0 | ||
* yarn | ||
|
||
## Project Setup | ||
|
||
```sh | ||
yarn | ||
``` | ||
|
||
### Run mocked backend server | ||
|
||
```sh | ||
yarn dev-server | ||
``` | ||
|
||
### Compile and Hot-Reload for Development | ||
|
||
```sh | ||
yarn dev | ||
``` | ||
|
||
### Type-Check, Compile and Minify for Production | ||
|
||
```sh | ||
yarn build | ||
``` | ||
|
||
### Run Unit Tests with [Vitest](https://vitest.dev/) | ||
|
||
```sh | ||
yarn test:unit | ||
``` | ||
|
||
### Lint with [ESLint](https://eslint.org/) | ||
|
||
```sh | ||
yarn lint | ||
``` | ||
|
||
### Lint with [ESLint](https://eslint.org/) and fix | ||
|
||
```sh | ||
yarn lint:fix | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/// <reference types="vite/client" /> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<link rel="icon" href="/favicon.ico"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Hermes Console</title> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
<script type="module" src="/src/main.ts"></script> | ||
</body> | ||
</html> |