Compare commits
7
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a924227805 | ||
|
|
2144d3f8c0 | ||
|
|
fcd6786149 | ||
|
|
ea968ebf3c | ||
|
|
8a7b852974 | ||
|
|
c8d3e3b70c | ||
|
|
7a90a6f9f4 |
No files matched your search
@@ -1,40 +0,0 @@
|
|||||||
name: Build Check (Client & Server)
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-client:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Set up Node
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: 22
|
|
||||||
|
|
||||||
- name: Install client dependencies
|
|
||||||
working-directory: client
|
|
||||||
run: npm install
|
|
||||||
|
|
||||||
- name: Check client build
|
|
||||||
working-directory: client
|
|
||||||
run: npm run build
|
|
||||||
build-server:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Set up Node
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: 22
|
|
||||||
|
|
||||||
- name: Install server dependencies
|
|
||||||
working-directory: server
|
|
||||||
run: npm install
|
|
||||||
|
|
||||||
- name: Check server build
|
|
||||||
working-directory: server
|
|
||||||
run: npm run build
|
|
||||||
@@ -88,4 +88,3 @@ jobs:
|
|||||||
docker compose down
|
docker compose down
|
||||||
docker compose pull
|
docker compose pull
|
||||||
docker compose up -d
|
docker compose up -d
|
||||||
docker system prune -af
|
|
||||||
+1
-5
@@ -1,5 +1 @@
|
|||||||
.idea
|
.vscode
|
||||||
.vscode
|
|
||||||
.VSCodeCounter
|
|
||||||
*.sh
|
|
||||||
mongo
|
|
||||||
+12
-191
@@ -6,35 +6,10 @@ We truly appreciate all kinds of contributions — code, ideas, translations or
|
|||||||
|
|
||||||
Before you start, please take a moment to read the relevant section. It helps us review and accept contributions faster, and makes the whole process smoother for everyone. 💚
|
Before you start, please take a moment to read the relevant section. It helps us review and accept contributions faster, and makes the whole process smoother for everyone. 💚
|
||||||
|
|
||||||
PS: **We work closely with contributors on our [Discord channel](https://discord.com/invite/NAb6H3UTjK)**. You'll find community members, core maintainers, and first-timers helping each other out.
|
PS: **We work closely with contributors on our [Discord channel](https://discord.com/invite/NAb6H3UTjK)**. You’ll find community members, core maintainers, and first-timers helping each other out.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
## 🚀 Quick Setup Checklist
|
|
||||||
|
|
||||||
Before you dive in, make sure you have these installed:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Check Node.js (v16+ required)
|
|
||||||
node --version
|
|
||||||
|
|
||||||
# Check npm
|
|
||||||
npm --version
|
|
||||||
|
|
||||||
# Check Docker
|
|
||||||
docker --version
|
|
||||||
|
|
||||||
# Check Git
|
|
||||||
git --version
|
|
||||||
```
|
|
||||||
|
|
||||||
**New to contributing?** Start here:
|
|
||||||
1. Pick a [`good-first-issue`](https://github.com/bluewave-labs/checkmate/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)
|
|
||||||
2. Comment that you'd like to work on it
|
|
||||||
3. Follow the [setup guide](#set-up-checkmate-locally) below
|
|
||||||
4. Join our [Discord](https://discord.com/invite/NAb6H3UTjK) if you get stuck
|
|
||||||
|
|
||||||
## Table of contents
|
## Table of contents
|
||||||
|
|
||||||
- [How do I...?](#how-do-i)
|
- [How do I...?](#how-do-i)
|
||||||
@@ -57,12 +32,12 @@ git --version
|
|||||||
|
|
||||||
### Get help or ask a question?
|
### Get help or ask a question?
|
||||||
|
|
||||||
Ask anything in our [Discord server](https://discord.com/invite/NAb6H3UTjK) — we're friendly and happy to help. [Our core contributors](https://github.com/bluewave-labs/checkmate?tab=readme-ov-file#-contributing) are active and ready to support you. You can also use [GitHub Discussions](https://github.com/bluewave-labs/Checkmate/discussions) section to ask your questions.
|
Ask anything in our [Discord server](https://discord.com/invite/NAb6H3UTjK) — we’re friendly and happy to help. [Our core contributors](https://github.com/bluewave-labs/checkmate?tab=readme-ov-file#-contributing) are active and ready to support you. You can also use [GitHub Discussions](https://github.com/bluewave-labs/Checkmate/discussions) section to ask your questions.
|
||||||
|
|
||||||
### Report a bug?
|
### Report a bug?
|
||||||
|
|
||||||
1. Search [existing issues](https://github.com/bluewave-labs/checkmate/issues).
|
1. Search [existing issues](https://github.com/bluewave-labs/checkmate/issues).
|
||||||
2. If it's not listed, open a **new issue**.
|
2. If it’s not listed, open a **new issue**.
|
||||||
3. Include as much detail as possible: what happened, what you expected, and steps to reproduce. Logs and screenshots help.
|
3. Include as much detail as possible: what happened, what you expected, and steps to reproduce. Logs and screenshots help.
|
||||||
|
|
||||||
### Suggest a new feature?
|
### Suggest a new feature?
|
||||||
@@ -73,175 +48,19 @@ Ask anything in our [Discord server](https://discord.com/invite/NAb6H3UTjK) —
|
|||||||
|
|
||||||
### Set up Checkmate locally?
|
### Set up Checkmate locally?
|
||||||
|
|
||||||
#### Prerequisites
|
Frontend & backend:
|
||||||
|
|
||||||
- Node.js (with npm)
|
|
||||||
- Docker
|
|
||||||
- Git
|
|
||||||
|
|
||||||
#### Step 1: Clone the Repository
|
|
||||||
|
|
||||||
```bash
|
|
||||||
git clone https://github.com/bluewave-labs/Checkmate.git
|
|
||||||
cd Checkmate
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Step 2: Set Up Docker Containers (MongoDB)
|
|
||||||
|
|
||||||
Navigate to the Docker dev directory:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
cd docker/dev
|
|
||||||
```
|
|
||||||
|
|
||||||
Build the Docker images:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
./build_images.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
Run MongoDB container:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
docker run -d -p 27017:27017 -v uptime_mongo_data:/data/db --name uptime_database_mongo mongo:6.0
|
|
||||||
```
|
|
||||||
|
|
||||||
Navigate back to the root directory:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
cd ../..
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Step 3: Set Up the Backend (Server)
|
|
||||||
|
|
||||||
Navigate to the server directory:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
cd server
|
|
||||||
```
|
|
||||||
|
|
||||||
Install dependencies:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm install
|
npm install
|
||||||
```
|
|
||||||
|
|
||||||
Create a `.env` file in the `server` directory with the following minimum required configuration:
|
|
||||||
|
|
||||||
```env
|
|
||||||
CLIENT_HOST="http://localhost:5173"
|
|
||||||
JWT_SECRET="my_secret_key_change_this"
|
|
||||||
DB_CONNECTION_STRING="mongodb://localhost:27017/uptime_db"
|
|
||||||
TOKEN_TTL="99d"
|
|
||||||
ORIGIN="localhost"
|
|
||||||
LOG_LEVEL="debug"
|
|
||||||
```
|
|
||||||
|
|
||||||
**Environment Variables Explained:**
|
|
||||||
|
|
||||||
- `CLIENT_HOST`: Frontend URL (default: http://localhost:5173)
|
|
||||||
- `JWT_SECRET`: Secret key for JWT tokens (change to something secure)
|
|
||||||
- `DB_CONNECTION_STRING`: MongoDB connection URL
|
|
||||||
- `ORIGIN`: Origin for CORS purposes
|
|
||||||
- `TOKEN_TTL`: Token time to live (in vercel/ms format)
|
|
||||||
- `LOG_LEVEL`: Debug level (debug, info, warn, error)
|
|
||||||
|
|
||||||
Start the backend server:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npm run dev
|
npm run dev
|
||||||
```
|
```
|
||||||
|
|
||||||
The server will run at `http://localhost:52345`.
|
By default, the frontend expects the backend on `http://localhost:3001`. Update configs if needed.
|
||||||
|
|
||||||
#### Step 4: Set Up the Frontend (Client)
|
|
||||||
|
|
||||||
Open a new terminal window and navigate to the client directory from the root:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
cd client
|
|
||||||
```
|
|
||||||
|
|
||||||
Install dependencies:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npm install
|
|
||||||
```
|
|
||||||
|
|
||||||
Create a `.env` file in the `client` directory:
|
|
||||||
|
|
||||||
```env
|
|
||||||
VITE_APP_API_BASE_URL="http://localhost:52345/api/v1"
|
|
||||||
VITE_APP_LOG_LEVEL="debug"
|
|
||||||
```
|
|
||||||
|
|
||||||
**Environment Variables Explained:**
|
|
||||||
|
|
||||||
- `VITE_APP_API_BASE_URL`: Backend API URL
|
|
||||||
- `VITE_APP_LOG_LEVEL`: Log level (none, error, warn, debug, info)
|
|
||||||
|
|
||||||
Start the frontend:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npm run dev
|
|
||||||
```
|
|
||||||
|
|
||||||
The client will run at `http://localhost:5173`.
|
|
||||||
|
|
||||||
#### Step 5: Access the Application
|
|
||||||
|
|
||||||
Open your browser and navigate to:
|
|
||||||
|
|
||||||
- **Frontend**: http://localhost:5173
|
|
||||||
- **Backend API**: http://localhost:52345
|
|
||||||
- **API Documentation**: http://localhost:52345/api-docs
|
|
||||||
|
|
||||||
#### Managing Docker Containers
|
|
||||||
|
|
||||||
Stop containers:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
docker stop uptime_database_mongo
|
|
||||||
```
|
|
||||||
|
|
||||||
Start containers:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
docker start uptime_database_mongo
|
|
||||||
```
|
|
||||||
|
|
||||||
Remove containers (if needed):
|
|
||||||
|
|
||||||
```bash
|
|
||||||
docker rm uptime_database_mongo
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Troubleshooting
|
|
||||||
|
|
||||||
**Port already in use:**
|
|
||||||
|
|
||||||
- Check if another service is using ports 5173, 52345, 27017, or 6379
|
|
||||||
- Stop the conflicting service or change the port in `.env` files
|
|
||||||
|
|
||||||
**MongoDB connection issues:**
|
|
||||||
|
|
||||||
- Verify container is running: `docker ps`
|
|
||||||
- Check container logs: `docker logs uptime_database_mongo`
|
|
||||||
|
|
||||||
**Module not found errors:**
|
|
||||||
|
|
||||||
- Ensure you ran `npm install` in both `client` and `server` directories
|
|
||||||
|
|
||||||
**Need more help?**
|
|
||||||
|
|
||||||
- Check the [full documentation](https://docs.checkmate.so)
|
|
||||||
- Ask on [Discord](https://discord.com/invite/NAb6H3UTjK)
|
|
||||||
|
|
||||||
### Start contributing code?
|
### Start contributing code?
|
||||||
|
|
||||||
1. Pick or open an issue (check `good-first-issue`s first)
|
1. Pick or open an issue (check `good-first-issue`s first)
|
||||||
2. (optional but highly suggested) Read a detailed structure of [Checkmate](https://deepwiki.com/bluewave-labs/Checkmate) if you would like to deep dive into the architecture.
|
2. (optional but highly suggested) Read a detailed structure of [Checkmate](https://deepwiki.com/bluewave-labs/Checkmate) if you would like to deep dive into the architecture.
|
||||||
3. Ask to be assigned. If there is already someone assigned and it's been more than 7 days, you can raise the flag and ask to be assigned as well.
|
3. Ask to be assigned. If there is alrady someone assigned and it's been more than 7 days, you can raise the flag and ask to be assigned as well.
|
||||||
4. Create a branch from `develop`.
|
4. Create a branch from `develop`.
|
||||||
5. Write your code.
|
5. Write your code.
|
||||||
6. Run and test locally.
|
6. Run and test locally.
|
||||||
@@ -256,7 +75,6 @@ Docs live in [checkmate-documentation](https://github.com/bluewave-labs/checkmat
|
|||||||
### Help with translations?
|
### Help with translations?
|
||||||
|
|
||||||
We use [PoEditor](https://poeditor.com) for translations. You can:
|
We use [PoEditor](https://poeditor.com) for translations. You can:
|
||||||
|
|
||||||
- [Sign up and join your language team](https://poeditor.com/join/project/lRUoGZFCsJ).
|
- [Sign up and join your language team](https://poeditor.com/join/project/lRUoGZFCsJ).
|
||||||
- Translate UI strings.
|
- Translate UI strings.
|
||||||
- Ask questions on Discord in the relevant #translations channel.
|
- Ask questions on Discord in the relevant #translations channel.
|
||||||
@@ -266,7 +84,6 @@ Make sure all new UI strings in code use `t('key')`.
|
|||||||
### Submit a pull request?
|
### Submit a pull request?
|
||||||
|
|
||||||
Follow the [pull request checklist](#pull-request-checklist). Your PR should:
|
Follow the [pull request checklist](#pull-request-checklist). Your PR should:
|
||||||
|
|
||||||
- Be focused on one issue.
|
- Be focused on one issue.
|
||||||
- Be tested locally.
|
- Be tested locally.
|
||||||
- Use our linting and translation rules.
|
- Use our linting and translation rules.
|
||||||
@@ -306,6 +123,7 @@ If one or more of these are missing, we may ask you to update your pull request
|
|||||||
|
|
||||||
## Branching model
|
## Branching model
|
||||||
|
|
||||||
|
|
||||||
- Code contributions should go to the `develop` branch.
|
- Code contributions should go to the `develop` branch.
|
||||||
- `master` is used for stable releases.
|
- `master` is used for stable releases.
|
||||||
- Use descriptive branch names, like `fix/login-error` or `feat/add-alerts`.
|
- Use descriptive branch names, like `fix/login-error` or `feat/add-alerts`.
|
||||||
@@ -319,10 +137,13 @@ If one or more of these are missing, we may ask you to update your pull request
|
|||||||
|
|
||||||
## Thank you
|
## Thank you
|
||||||
|
|
||||||
Thanks for making Checkmate better. We mean it. Whether it's your first pull request or your 50th, we're excited to build with you.
|
Thanks for making Checkmate better. We mean it. Whether it’s your first pull request or your 50th, we’re excited to build with you.
|
||||||
|
|
||||||
PS: feel free to introduce yourself on [Discord](https://discord.gg/NAb6H3UTjK) and say hi.
|
|
||||||
|
PS: feel free to introduce yourself on [Discord](https://discord.gg/YOUR-DISCORD-LINK) and say hi.
|
||||||
|
|
||||||
-- Checkmate team
|
-- Checkmate team
|
||||||
|
|
||||||
Also make sure you read the [document about how to make a good pull request](/PULLREQUESTS.md).
|
Also make sure you read the [document about how to make a good pull request](/PULLREQUESTS.md).
|
||||||
|
|
||||||
|
|
||||||
-11325
File diff suppressed because it is too large.
Load diff
@@ -52,7 +52,7 @@ Usage instructions can be found [here](https://docs.checkmate.so/checkmate-2.1).
|
|||||||
|
|
||||||
See installation instructions in [Checkmate documentation portal](https://docs.checkmate.so/checkmate-2.1/users-guide/quickstart).
|
See installation instructions in [Checkmate documentation portal](https://docs.checkmate.so/checkmate-2.1/users-guide/quickstart).
|
||||||
|
|
||||||
Alternatively, you can also use [Elestio](https://elest.io/open-source/checkmate), [K8s](./charts/helm/checkmate/INSTALLATION.md), [Sive Host](https://sive.host) (South Africa) or [Pikapods](https://www.pikapods.com/) to quickly spin off a Checkmate instance. If you would like to monitor your server infrastructure, you'll need [Capture agent](https://github.com/bluewave-labs/capture). Capture repository also contains the installation instructions.
|
Alternatively, you can also use [Coolify](https://coolify.io/), [Elestio](https://elest.io/open-source/checkmate), [K8s](./charts/helm/checkmate/INSTALLATION.md), [Sive Host](https://sive.host) (South Africa) or [Pikapods](https://www.pikapods.com/) to quickly spin off a Checkmate instance. If you would like to monitor your server infrastructure, you'll need [Capture agent](https://github.com/bluewave-labs/capture). Capture repository also contains the installation instructions.
|
||||||
|
|
||||||
### Using a Custom CA
|
### Using a Custom CA
|
||||||
|
|
||||||
@@ -91,7 +91,6 @@ Feel free to ask questions or share your ideas - we'd love to hear from you!
|
|||||||
- Website monitoring
|
- Website monitoring
|
||||||
- Page speed monitoring
|
- Page speed monitoring
|
||||||
- Infrastructure monitoring (memory, disk usage, CPU performance, network etc) - requires [Capture](https://github.com/bluewave-labs/capture) agent
|
- Infrastructure monitoring (memory, disk usage, CPU performance, network etc) - requires [Capture](https://github.com/bluewave-labs/capture) agent
|
||||||
- Selective disk monitoring with mountpoint selection
|
|
||||||
- Docker monitoring
|
- Docker monitoring
|
||||||
- Ping monitoring
|
- Ping monitoring
|
||||||
- SSL monitoring
|
- SSL monitoring
|
||||||
@@ -163,7 +162,6 @@ Here's how you can contribute:
|
|||||||
4. Open an issue if you believe you've encountered a bug.
|
4. Open an issue if you believe you've encountered a bug.
|
||||||
5. Check for good-first-issue's if you are a newcomer.
|
5. Check for good-first-issue's if you are a newcomer.
|
||||||
6. Make a pull request to add new features/make quality-of-life improvements/fix bugs.
|
6. Make a pull request to add new features/make quality-of-life improvements/fix bugs.
|
||||||
7. Check out this interactive walkthrough of the `Checkmate` codebase on CodeCanvas [here](https://www.code-canvas.com/?session=unauthenticatedGithub&repo=Checkmate&owner=bluewave-labs&branch=develop&OnboardingTutorial=true). To refine existing dataflow simulation or create new ones, follow the quick tutorial [here](https://docs.code-canvas.com/updating-diagram).
|
|
||||||
|
|
||||||
<a href="https://github.com/bluewave-labs/checkmate/graphs/contributors">
|
<a href="https://github.com/bluewave-labs/checkmate/graphs/contributors">
|
||||||
<img src="https://contrib.rocks/image?repo=bluewave-labs/checkmate" />
|
<img src="https://contrib.rocks/image?repo=bluewave-labs/checkmate" />
|
||||||
|
|||||||
@@ -21,12 +21,7 @@ cd checkmate/charts/helm/checkmate
|
|||||||
Edit `values.yaml` to update:
|
Edit `values.yaml` to update:
|
||||||
- `client.ingress.host` and `server.ingress.host` with your domain names
|
- `client.ingress.host` and `server.ingress.host` with your domain names
|
||||||
- `server.protocol` (usually http or https)
|
- `server.protocol` (usually http or https)
|
||||||
- **If upgrading**: Migrate persistence settings from flat structure to nested:
|
|
||||||
- Old: `persistence.mongodbSize` → New: `persistence.mongo.size`
|
|
||||||
- Old: `persistence.redisSize` → New: `persistence.redis.size`
|
|
||||||
- Add: `persistence.mongo.storageClass` and `persistence.redis.storageClass` (leave empty for default)
|
|
||||||
- Secrets under the `secrets` section (`JWT_SECRET`, email credentials, API keys, etc.) — replace all change_me values
|
- Secrets under the `secrets` section (`JWT_SECRET`, email credentials, API keys, etc.) — replace all change_me values
|
||||||
- **For TLS/HTTPS**: Configure ingress TLS settings (see section below)
|
|
||||||
|
|
||||||
### 3. Deploy the Helm chart
|
### 3. Deploy the Helm chart
|
||||||
```bash
|
```bash
|
||||||
@@ -42,75 +37,3 @@ kubectl get svc
|
|||||||
```
|
```
|
||||||
|
|
||||||
Once all pods are `Running` and `Ready`, you can access Checkmate via the configured ingress hosts.
|
Once all pods are `Running` and `Ready`, you can access Checkmate via the configured ingress hosts.
|
||||||
|
|
||||||
## Enabling TLS/HTTPS with cert-manager
|
|
||||||
|
|
||||||
If you have [cert-manager](https://cert-manager.io/) installed in your cluster, you can enable automatic TLS certificate provisioning using Let's Encrypt or other certificate issuers.
|
|
||||||
|
|
||||||
### Prerequisites
|
|
||||||
- cert-manager installed in your cluster
|
|
||||||
- A ClusterIssuer or Issuer configured (e.g., `letsencrypt-prod`)
|
|
||||||
|
|
||||||
### Configuration
|
|
||||||
|
|
||||||
Edit `values.yaml` to enable TLS (and update protocols to https):
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
client:
|
|
||||||
protocol: https
|
|
||||||
ingress:
|
|
||||||
enabled: true
|
|
||||||
host: checkmate.example.com
|
|
||||||
className: nginx
|
|
||||||
annotations:
|
|
||||||
cert-manager.io/cluster-issuer: "letsencrypt-prod"
|
|
||||||
tls:
|
|
||||||
enabled: true
|
|
||||||
secretName: checkmate-client-tls
|
|
||||||
|
|
||||||
server:
|
|
||||||
protocol: https
|
|
||||||
ingress:
|
|
||||||
enabled: true
|
|
||||||
host: checkmate.example.com
|
|
||||||
className: nginx
|
|
||||||
annotations:
|
|
||||||
cert-manager.io/cluster-issuer: "letsencrypt-prod"
|
|
||||||
tls:
|
|
||||||
enabled: true
|
|
||||||
secretName: checkmate-server-tls
|
|
||||||
```
|
|
||||||
|
|
||||||
### Alternative: Using --set flags
|
|
||||||
|
|
||||||
You can also enable TLS during installation using Helm's `--set` flags:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
helm install checkmate ./charts/helm/checkmate \
|
|
||||||
--set client.protocol=https \
|
|
||||||
--set server.protocol=https \
|
|
||||||
--set client.ingress.annotations."cert-manager\.io/cluster-issuer"="letsencrypt-prod" \
|
|
||||||
--set client.ingress.tls.enabled=true \
|
|
||||||
--set client.ingress.tls.secretName=checkmate-client-tls \
|
|
||||||
--set server.ingress.annotations."cert-manager\.io/cluster-issuer"="letsencrypt-prod" \
|
|
||||||
--set server.ingress.tls.enabled=true \
|
|
||||||
--set server.ingress.tls.secretName=checkmate-server-tls
|
|
||||||
```
|
|
||||||
|
|
||||||
### Verification
|
|
||||||
|
|
||||||
After deployment, cert-manager will automatically create the TLS secrets. You can verify the certificate status:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Check certificates
|
|
||||||
kubectl get certificates
|
|
||||||
|
|
||||||
# Check certificate details
|
|
||||||
kubectl describe certificate checkmate-client-tls
|
|
||||||
kubectl describe certificate checkmate-server-tls
|
|
||||||
|
|
||||||
# Verify the secrets were created
|
|
||||||
kubectl get secrets | grep checkmate-tls
|
|
||||||
```
|
|
||||||
|
|
||||||
The ingress will automatically use these secrets to enable HTTPS access to your Checkmate instance.
|
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
{{- if eq .Values.client.ingress.host "change_me" }}
|
||||||
|
{{- fail "client.ingress.host must be overridden and not set to 'change_me'" }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- if eq .Values.server.ingress.host "change_me" }}
|
||||||
|
{{- fail "server.ingress.host must be overridden and not set to 'change_me'" }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- $protocol := .Values.server.protocol }}
|
||||||
|
{{- if not (or (eq $protocol "http") (eq $protocol "https")) }}
|
||||||
|
{{- fail "server.protocol must be either 'http' or 'https'" }}
|
||||||
|
{{- end }}
|
||||||
@@ -1,25 +1,17 @@
|
|||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: checkmate-client
|
name: client
|
||||||
spec:
|
spec:
|
||||||
replicas: 1
|
replicas: 1
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app: checkmate-client
|
app: client
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
app: checkmate-client
|
app: client
|
||||||
spec:
|
spec:
|
||||||
{{- with .Values.client.affinity }}
|
|
||||||
affinity:
|
|
||||||
{{- tpl ( . | toYaml) $ | nindent 8 }}
|
|
||||||
{{- end }}
|
|
||||||
{{- with .Values.client.tolerations }}
|
|
||||||
tolerations:
|
|
||||||
{{- tpl ( . | toYaml) $ | nindent 8 }}
|
|
||||||
{{- end }}
|
|
||||||
containers:
|
containers:
|
||||||
- name: client
|
- name: client
|
||||||
image: {{ .Values.client.image }}
|
image: {{ .Values.client.image }}
|
||||||
@@ -28,17 +20,3 @@ spec:
|
|||||||
env:
|
env:
|
||||||
- name: UPTIME_APP_API_BASE_URL
|
- name: UPTIME_APP_API_BASE_URL
|
||||||
value: "{{ .Values.server.protocol }}://{{ .Values.server.ingress.host }}/api/v1"
|
value: "{{ .Values.server.protocol }}://{{ .Values.server.ingress.host }}/api/v1"
|
||||||
- name: UPTIME_APP_CLIENT_HOST
|
|
||||||
value: "{{ .Values.client.protocol }}://{{ .Values.client.ingress.host }}"
|
|
||||||
volumeMounts:
|
|
||||||
- name: config-volume
|
|
||||||
mountPath: /etc/nginx/conf.d/default.conf
|
|
||||||
subPath: default.conf
|
|
||||||
{{- with .Values.client.resources }}
|
|
||||||
resources:
|
|
||||||
{{- tpl ( . | toYaml) $ | nindent 12 }}
|
|
||||||
{{- end }}
|
|
||||||
volumes:
|
|
||||||
- name: config-volume
|
|
||||||
configMap:
|
|
||||||
name: checkmate-server-nginx-cm
|
|
||||||
@@ -2,21 +2,10 @@
|
|||||||
apiVersion: networking.k8s.io/v1
|
apiVersion: networking.k8s.io/v1
|
||||||
kind: Ingress
|
kind: Ingress
|
||||||
metadata:
|
metadata:
|
||||||
name: checkmate-client-ingress
|
name: client-ingress
|
||||||
{{- if .Values.client.ingress.annotations }}
|
|
||||||
annotations:
|
annotations:
|
||||||
{{- range $key, $value := .Values.client.ingress.annotations }}
|
nginx.ingress.kubernetes.io/rewrite-target: /
|
||||||
{{ $key }}: {{ $value | quote }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
spec:
|
spec:
|
||||||
ingressClassName: {{ .Values.client.ingress.className }}
|
|
||||||
{{- if .Values.client.ingress.tls.enabled }}
|
|
||||||
tls:
|
|
||||||
- hosts:
|
|
||||||
- {{ .Values.client.ingress.host }}
|
|
||||||
secretName: {{ default (printf "%s-client-tls" .Release.Name) .Values.client.ingress.tls.secretName }}
|
|
||||||
{{- end }}
|
|
||||||
rules:
|
rules:
|
||||||
- host: {{ .Values.client.ingress.host }}
|
- host: {{ .Values.client.ingress.host }}
|
||||||
http:
|
http:
|
||||||
@@ -25,7 +14,7 @@ spec:
|
|||||||
pathType: Prefix
|
pathType: Prefix
|
||||||
backend:
|
backend:
|
||||||
service:
|
service:
|
||||||
name: checkmate-client
|
name: client
|
||||||
port:
|
port:
|
||||||
number: {{ .Values.client.port }}
|
number: {{ .Values.client.port }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
name: checkmate-client
|
name: client
|
||||||
spec:
|
spec:
|
||||||
selector:
|
selector:
|
||||||
app: checkmate-client
|
app: client
|
||||||
ports:
|
ports:
|
||||||
- port: {{ .Values.client.port }}
|
- port: {{ .Values.client.port }}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: mongodb
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: mongodb
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: mongodb
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: mongodb
|
||||||
|
image: {{ .Values.mongodb.image }}
|
||||||
|
ports:
|
||||||
|
- containerPort: {{ .Values.mongodb.port }}
|
||||||
|
command: ["mongod", "--quiet", "--bind_ip_all"]
|
||||||
|
volumeMounts:
|
||||||
|
- name: mongodb-data
|
||||||
|
mountPath: /data/db
|
||||||
|
volumes:
|
||||||
|
- name: mongodb-data
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: mongodb-pvc
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: mongodb-pvc
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: {{ .Values.persistence.mongodbSize }}
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
name: checkmate-mongodb
|
name: mongodb
|
||||||
spec:
|
spec:
|
||||||
selector:
|
selector:
|
||||||
app: checkmate-mongodb
|
app: mongodb
|
||||||
ports:
|
ports:
|
||||||
- port: {{ .Values.mongodb.port }}
|
- port: {{ .Values.mongodb.port }}
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
apiVersion: apps/v1
|
|
||||||
kind: StatefulSet
|
|
||||||
metadata:
|
|
||||||
name: checkmate-mongodb
|
|
||||||
spec:
|
|
||||||
replicas: 1
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
app: checkmate-mongodb
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
app: checkmate-mongodb
|
|
||||||
spec:
|
|
||||||
{{- with .Values.mongodb.affinity }}
|
|
||||||
affinity:
|
|
||||||
{{- tpl ( . | toYaml) $ | nindent 8 }}
|
|
||||||
{{- end }}
|
|
||||||
{{- with .Values.mongodb.tolerations }}
|
|
||||||
tolerations:
|
|
||||||
{{- tpl ( . | toYaml) $ | nindent 8 }}
|
|
||||||
{{- end }}
|
|
||||||
containers:
|
|
||||||
- name: mongodb
|
|
||||||
image: {{ .Values.mongodb.image }}
|
|
||||||
ports:
|
|
||||||
- containerPort: {{ .Values.mongodb.port }}
|
|
||||||
command: ["mongod", "--quiet", "--bind_ip_all"]
|
|
||||||
volumeMounts:
|
|
||||||
- name: checkmate-mongo-persistent-storage
|
|
||||||
mountPath: /data/db
|
|
||||||
{{- with .Values.mongodb.resources }}
|
|
||||||
resources:
|
|
||||||
{{- tpl ( . | toYaml) $ | nindent 12 }}
|
|
||||||
{{- end }}
|
|
||||||
volumeClaimTemplates:
|
|
||||||
- metadata:
|
|
||||||
name: checkmate-mongo-persistent-storage
|
|
||||||
spec:
|
|
||||||
storageClassName: {{ .Values.persistence.mongo.storageClass | quote }}
|
|
||||||
accessModes: ["ReadWriteOnce"]
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
storage: {{ .Values.persistence.mongo.size | default "5Gi" | quote }}
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
{{- if eq .Values.client.ingress.host "change_me" }}
|
|
||||||
{{- fail "client.ingress.host must be overridden and not set to 'change_me'" }}
|
|
||||||
{{- end }}
|
|
||||||
|
|
||||||
{{- if eq .Values.server.ingress.host "change_me" }}
|
|
||||||
{{- fail "server.ingress.host must be overridden and not set to 'change_me'" }}
|
|
||||||
{{- end }}
|
|
||||||
|
|
||||||
{{- $serverProtocol := .Values.server.protocol }}
|
|
||||||
{{- if not (or (eq $serverProtocol "http") (eq $serverProtocol "https")) }}
|
|
||||||
{{- fail "server.protocol must be either 'http' or 'https'" }}
|
|
||||||
{{- end }}
|
|
||||||
|
|
||||||
{{- $clientProtocol := .Values.client.protocol }}
|
|
||||||
{{- if not (or (eq $clientProtocol "http") (eq $clientProtocol "https")) }}
|
|
||||||
{{- fail "client.protocol must be either 'http' or 'https'" }}
|
|
||||||
{{- end }}
|
|
||||||
|
|
||||||
{{/* Enforce protocol when TLS is enabled to avoid mixed-content */}}
|
|
||||||
{{- if and .Values.client.ingress.tls.enabled (ne $clientProtocol "https") }}
|
|
||||||
{{- fail "client.ingress.tls.enabled is true but client.protocol is not 'https'. Set client.protocol: https to avoid mixed content." }}
|
|
||||||
{{- end }}
|
|
||||||
|
|
||||||
{{- if and .Values.server.ingress.tls.enabled (ne $serverProtocol "https") }}
|
|
||||||
{{- fail "server.ingress.tls.enabled is true but server.protocol is not 'https'. Set server.protocol: https to ensure correct API base URL." }}
|
|
||||||
{{- end }}
|
|
||||||
|
|
||||||
{{/* If client runs on https, API must also be https to avoid mixed content */}}
|
|
||||||
{{- if and (eq $clientProtocol "https") (ne $serverProtocol "https") }}
|
|
||||||
{{- fail "client.protocol is 'https' but server.protocol is not. Set server.protocol: https to prevent browser mixed-content issues." }}
|
|
||||||
{{- end }}
|
|
||||||
|
|
||||||
{{/* Fail early if TLS enabled without cert-manager annotations (cluster-issuer or issuer) */}}
|
|
||||||
{{- $cAnn := .Values.client.ingress.annotations | default dict }}
|
|
||||||
{{- $sAnn := .Values.server.ingress.annotations | default dict }}
|
|
||||||
|
|
||||||
{{- $clientHasIssuer := or (hasKey $cAnn "cert-manager.io/cluster-issuer") (hasKey $cAnn "cert-manager.io/issuer") }}
|
|
||||||
{{- $serverHasIssuer := or (hasKey $sAnn "cert-manager.io/cluster-issuer") (hasKey $sAnn "cert-manager.io/issuer") }}
|
|
||||||
|
|
||||||
{{- if and .Values.client.ingress.tls.enabled (not $clientHasIssuer) }}
|
|
||||||
{{- fail "client.ingress.tls.enabled is true but no cert-manager issuer annotation found. Add 'cert-manager.io/cluster-issuer' or 'cert-manager.io/issuer'." }}
|
|
||||||
{{- end }}
|
|
||||||
|
|
||||||
{{- if and .Values.server.ingress.tls.enabled (not $serverHasIssuer) }}
|
|
||||||
{{- fail "server.ingress.tls.enabled is true but no cert-manager issuer annotation found. Add 'cert-manager.io/cluster-issuer' or 'cert-manager.io/issuer'." }}
|
|
||||||
{{- end }}
|
|
||||||
|
|
||||||
{{/* Secret name can be omitted; we default to <release>-client|server-tls in templates */}}
|
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: redis
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: redis
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: redis
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: redis
|
||||||
|
image: {{ .Values.redis.image }}
|
||||||
|
ports:
|
||||||
|
- containerPort: {{ .Values.redis.port }}
|
||||||
|
volumeMounts:
|
||||||
|
- name: redis-data
|
||||||
|
mountPath: /data
|
||||||
|
volumes:
|
||||||
|
- name: redis-data
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: redis-pvc
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: redis-pvc
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: {{ .Values.persistence.redisSize }}
|
||||||
@@ -1,11 +1,9 @@
|
|||||||
{{- if .Values.redis.enabled }}
|
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
name: checkmate-redis
|
name: redis
|
||||||
spec:
|
spec:
|
||||||
selector:
|
selector:
|
||||||
app: checkmate-redis
|
app: redis
|
||||||
ports:
|
ports:
|
||||||
- port: {{ .Values.redis.port }}
|
- port: {{ .Values.redis.port }}
|
||||||
{{- end }}
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
{{- if .Values.redis.enabled }}
|
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: StatefulSet
|
|
||||||
metadata:
|
|
||||||
name: checkmate-redis
|
|
||||||
spec:
|
|
||||||
replicas: 1
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
app: checkmate-redis
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
app: checkmate-redis
|
|
||||||
spec:
|
|
||||||
containers:
|
|
||||||
- name: redis
|
|
||||||
image: {{ .Values.redis.image }}
|
|
||||||
ports:
|
|
||||||
- containerPort: {{ .Values.redis.port }}
|
|
||||||
volumeMounts:
|
|
||||||
- name: redis-data
|
|
||||||
mountPath: /data
|
|
||||||
volumeClaimTemplates:
|
|
||||||
- metadata:
|
|
||||||
name: checkmate-redis-persistent-storage
|
|
||||||
spec:
|
|
||||||
storageClassName: {{ .Values.persistence.redis.storageClass | quote }}
|
|
||||||
accessModes: ["ReadWriteOnce"]
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
storage: {{ .Values.persistence.redis.size | default "1Gi" | quote }}
|
|
||||||
{{- end }}
|
|
||||||
@@ -4,6 +4,10 @@
|
|||||||
{{- fail "secrets.JWT_SECRET must be overridden and cannot be 'change_me'" }}
|
{{- fail "secrets.JWT_SECRET must be overridden and cannot be 'change_me'" }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
|
{{- if or (not $secrets.REFRESH_TOKEN_SECRET) (eq $secrets.REFRESH_TOKEN_SECRET "change_me") }}
|
||||||
|
{{- fail "secrets.REFRESH_TOKEN_SECRET must be overridden and cannot be 'change_me'" }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Secret
|
kind: Secret
|
||||||
metadata:
|
metadata:
|
||||||
|
|||||||
@@ -1,25 +1,17 @@
|
|||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: checkmate-server
|
name: server
|
||||||
spec:
|
spec:
|
||||||
replicas: 1
|
replicas: 1
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app: checkmate-server
|
app: server
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
app: checkmate-server
|
app: server
|
||||||
spec:
|
spec:
|
||||||
{{- with .Values.server.affinity }}
|
|
||||||
affinity:
|
|
||||||
{{- tpl ( . | toYaml) $ | nindent 8 }}
|
|
||||||
{{- end }}
|
|
||||||
{{- with .Values.server.tolerations }}
|
|
||||||
tolerations:
|
|
||||||
{{- tpl ( . | toYaml) $ | nindent 8 }}
|
|
||||||
{{- end }}
|
|
||||||
containers:
|
containers:
|
||||||
- name: server
|
- name: server
|
||||||
image: {{ .Values.server.image }}
|
image: {{ .Values.server.image }}
|
||||||
@@ -28,10 +20,3 @@ spec:
|
|||||||
envFrom:
|
envFrom:
|
||||||
- secretRef:
|
- secretRef:
|
||||||
name: checkmate-secrets
|
name: checkmate-secrets
|
||||||
{{- with .Values.server.resources }}
|
|
||||||
resources:
|
|
||||||
{{- tpl ( . | toYaml) $ | nindent 12 }}
|
|
||||||
{{- end }}
|
|
||||||
env:
|
|
||||||
- name: CLIENT_HOST
|
|
||||||
value: "{{ .Values.client.protocol }}://{{ .Values.client.ingress.host }}"
|
|
||||||
@@ -2,37 +2,24 @@
|
|||||||
apiVersion: networking.k8s.io/v1
|
apiVersion: networking.k8s.io/v1
|
||||||
kind: Ingress
|
kind: Ingress
|
||||||
metadata:
|
metadata:
|
||||||
name: checkmate-server-ingress
|
name: server-ingress
|
||||||
{{- if .Values.server.ingress.annotations }}
|
|
||||||
annotations:
|
annotations:
|
||||||
{{- range $key, $value := .Values.server.ingress.annotations }}
|
nginx.ingress.kubernetes.io/rewrite-target: /
|
||||||
{{ $key }}: {{ $value | quote }}
|
nginx.ingress.kubernetes.io/enable-cors: "true"
|
||||||
{{- end }}
|
nginx.ingress.kubernetes.io/cors-allow-origin: "http://{{ .Values.client.ingress.host }},https://{{ .Values.client.ingress.host }}"
|
||||||
{{- end }}
|
nginx.ingress.kubernetes.io/cors-allow-methods: "GET, PUT, POST, DELETE, PATCH, OPTIONS"
|
||||||
{{/*#annotations:
|
nginx.ingress.kubernetes.io/cors-allow-headers: "DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization"
|
||||||
#nginx.ingress.kubernetes.io/rewrite-target: /
|
nginx.ingress.kubernetes.io/cors-allow-credentials: "true"
|
||||||
#nginx.ingress.kubernetes.io/enable-cors: "true"
|
|
||||||
#nginx.ingress.kubernetes.io/cors-allow-origin: "http://{{ .Values.client.ingress.host }},https://{{ .Values.client.ingress.host }}"
|
|
||||||
#nginx.ingress.kubernetes.io/cors-allow-methods: "GET, PUT, POST, DELETE, PATCH, OPTIONS"
|
|
||||||
#nginx.ingress.kubernetes.io/cors-allow-headers: "DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization"
|
|
||||||
#nginx.ingress.kubernetes.io/cors-allow-credentials: "true"*/}}
|
|
||||||
spec:
|
spec:
|
||||||
ingressClassName: {{ .Values.server.ingress.className }}
|
|
||||||
{{- if .Values.server.ingress.tls.enabled }}
|
|
||||||
tls:
|
|
||||||
- hosts:
|
|
||||||
- {{ .Values.server.ingress.host }}
|
|
||||||
secretName: {{ default (printf "%s-server-tls" .Release.Name) .Values.server.ingress.tls.secretName }}
|
|
||||||
{{- end }}
|
|
||||||
rules:
|
rules:
|
||||||
- host: {{ .Values.server.ingress.host }}
|
- host: {{ .Values.server.ingress.host }}
|
||||||
http:
|
http:
|
||||||
paths:
|
paths:
|
||||||
- path: /api/v1
|
- path: /
|
||||||
pathType: Prefix
|
pathType: Prefix
|
||||||
backend:
|
backend:
|
||||||
service:
|
service:
|
||||||
name: checkmate-server
|
name: server
|
||||||
port:
|
port:
|
||||||
number: {{ .Values.server.port }}
|
number: {{ .Values.server.port }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: ConfigMap
|
|
||||||
metadata:
|
|
||||||
name: checkmate-server-nginx-cm
|
|
||||||
data:
|
|
||||||
default.conf: |
|
|
||||||
server {
|
|
||||||
listen 80;
|
|
||||||
listen [::]:80;
|
|
||||||
|
|
||||||
server_name checkmate-demo.bluewavelabs.ca;
|
|
||||||
server_tokens off;
|
|
||||||
|
|
||||||
location /.well-known/acme-challenge/ {
|
|
||||||
root /var/www/certbot;
|
|
||||||
}
|
|
||||||
|
|
||||||
location / {
|
|
||||||
root /usr/share/nginx/html;
|
|
||||||
index index.html index.htm;
|
|
||||||
try_files $uri $uri/ /index.html;
|
|
||||||
}
|
|
||||||
|
|
||||||
# location /api/ {
|
|
||||||
# proxy_pass http://{{ .Values.server.ingress.host }}:5000/api/;
|
|
||||||
# proxy_http_version 1.1;
|
|
||||||
# proxy_set_header Host $host;
|
|
||||||
# proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
# proxy_set_header X-Forwarded-Proto $scheme;
|
|
||||||
# }
|
|
||||||
|
|
||||||
location /api-docs/ {
|
|
||||||
proxy_pass http://{{ .Values.server.ingress.host }}:5000/api-docs/;
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
name: checkmate-server
|
name: server
|
||||||
spec:
|
spec:
|
||||||
selector:
|
selector:
|
||||||
app: checkmate-server
|
app: server
|
||||||
ports:
|
ports:
|
||||||
- port: {{ .Values.server.port }}
|
- port: {{ .Values.server.port }}
|
||||||
@@ -1,70 +1,41 @@
|
|||||||
client:
|
client:
|
||||||
image: ghcr.io/bluewave-labs/checkmate-client:v3.2.0
|
image: ghcr.io/bluewave-labs/checkmate-client:v2.3
|
||||||
port: 80
|
port: 80
|
||||||
protocol: http
|
|
||||||
ingress:
|
ingress:
|
||||||
enabled: true
|
enabled: true
|
||||||
host: change_me
|
host: change_me
|
||||||
className: nginx
|
|
||||||
annotations: {}
|
|
||||||
# Example annotations for cert-manager:
|
|
||||||
# annotations:
|
|
||||||
# cert-manager.io/cluster-issuer: "letsencrypt-prod"
|
|
||||||
tls:
|
|
||||||
enabled: false
|
|
||||||
# secretName: {{ .Release.Name }}-client-tls # Optional; defaults to <release>-client-tls if omitted
|
|
||||||
# Note: when enabling TLS, also set client.protocol: https and add
|
|
||||||
# a cert-manager issuer annotation (e.g. cert-manager.io/cluster-issuer: "letsencrypt-prod").
|
|
||||||
# The secret will be automatically created by cert-manager when using the cert-manager.io/cluster-issuer annotation
|
|
||||||
|
|
||||||
server:
|
server:
|
||||||
image: ghcr.io/bluewave-labs/checkmate-backend:v3.2.0
|
image: ghcr.io/bluewave-labs/checkmate-backend:v2.3
|
||||||
port: 52345
|
port: 52345
|
||||||
protocol: http
|
protocol: change_me
|
||||||
ingress:
|
ingress:
|
||||||
enabled: true
|
enabled: true
|
||||||
host: change_me
|
host: change_me
|
||||||
className: nginx
|
|
||||||
annotations: {}
|
|
||||||
# Example annotations for cert-manager:
|
|
||||||
# annotations:
|
|
||||||
# cert-manager.io/cluster-issuer: "letsencrypt-prod"
|
|
||||||
tls:
|
|
||||||
enabled: false
|
|
||||||
# secretName: {{ .Release.Name }}-server-tls # Optional; defaults to <release>-server-tls if omitted
|
|
||||||
# Note: when enabling TLS, also set server.protocol: https and add
|
|
||||||
# a cert-manager issuer annotation (e.g. cert-manager.io/cluster-issuer: "letsencrypt-prod").
|
|
||||||
# The secret will be automatically created by cert-manager when using the cert-manager.io/cluster-issuer annotation
|
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
enabled: false
|
|
||||||
image: redis:7.2
|
image: redis:7.2
|
||||||
port: 6379
|
port: 6379
|
||||||
|
|
||||||
mongodb:
|
mongodb:
|
||||||
image: ghcr.io/bluewave-labs/checkmate-mongo:v3.2.0
|
image: mongo:7.0
|
||||||
port: 27017
|
port: 27017
|
||||||
|
|
||||||
secrets:
|
secrets:
|
||||||
JWT_SECRET: change_me
|
JWT_SECRET: change_me
|
||||||
# REFRESH_TOKEN_SECRET: change_me
|
REFRESH_TOKEN_SECRET: change_me
|
||||||
# SYSTEM_EMAIL_ADDRESS: test@example.com
|
SYSTEM_EMAIL_ADDRESS: test@example.com
|
||||||
# SYSTEM_EMAIL_PASSWORD: change_me
|
SYSTEM_EMAIL_PASSWORD: change_me
|
||||||
# SYSTEM_EMAIL_HOST: smtp.example.com
|
SYSTEM_EMAIL_HOST: smtp.example.com
|
||||||
# SYSTEM_EMAIL_PORT: "587"
|
SYSTEM_EMAIL_PORT: "587"
|
||||||
# PAGESPEED_API_KEY: change_me
|
PAGESPEED_API_KEY: change_me
|
||||||
DB_CONNECTION_STRING: mongodb://checkmate-mongodb.namespace.svc:27017/uptime_db
|
DB_CONNECTION_STRING: mongodb://mongodb:27017/uptime_db
|
||||||
CLIENT_HOST: change_me
|
REDIS_HOST: redis
|
||||||
# REDIS_HOST: redis
|
REDIS_PORT: "6379"
|
||||||
# REDIS_PORT: "6379"
|
DB_TYPE: MongoDB
|
||||||
# DB_TYPE: MongoDB
|
TOKEN_TTL: 99d
|
||||||
# TOKEN_TTL: 99d
|
REFRESH_TOKEN_TTL: 99d
|
||||||
# REFRESH_TOKEN_TTL: 99d
|
|
||||||
|
|
||||||
persistence:
|
persistence:
|
||||||
mongo:
|
mongodbSize: 5Gi
|
||||||
size: 5Gi
|
redisSize: 1Gi
|
||||||
storageClass: ""
|
|
||||||
redis:
|
|
||||||
size: 1Gi
|
|
||||||
storageClass: ""
|
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
VITE_APP_API_BASE_URL=UPTIME_APP_API_BASE_URL
|
VITE_APP_API_BASE_URL=UPTIME_APP_API_BASE_URL
|
||||||
VITE_APP_API_V2_BASE_URL=UPTIME_APP_API_V2_BASE_URL
|
|
||||||
VITE_APP_CLIENT_HOST=UPTIME_APP_CLIENT_HOST
|
VITE_APP_CLIENT_HOST=UPTIME_APP_CLIENT_HOST
|
||||||
VITE_APP_LOG_LEVEL=UPTIME_APP_LOG_LEVEL
|
VITE_APP_LOG_LEVEL=UPTIME_APP_LOG_LEVEL
|
||||||
+1
-2
@@ -28,5 +28,4 @@ dist-ssr
|
|||||||
|
|
||||||
# Scripts
|
# Scripts
|
||||||
*.sh
|
*.sh
|
||||||
!env.sh
|
!env.sh
|
||||||
.env.development
|
|
||||||
Generated
+21
-765
File diff suppressed because it is too large.
Load diff
+11
-11
@@ -5,8 +5,8 @@
|
|||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build": "tsc -b && vite build",
|
"build": "vite build",
|
||||||
"build-dev": "tsc -b && vite build --mode development",
|
"build-dev": "vite build --mode development",
|
||||||
"lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0",
|
"lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
"format": "prettier --write .",
|
"format": "prettier --write .",
|
||||||
@@ -16,7 +16,6 @@
|
|||||||
"@emotion/react": "^11.13.3",
|
"@emotion/react": "^11.13.3",
|
||||||
"@emotion/styled": "^11.13.0",
|
"@emotion/styled": "^11.13.0",
|
||||||
"@hello-pangea/dnd": "^18.0.0",
|
"@hello-pangea/dnd": "^18.0.0",
|
||||||
"@hookform/resolvers": "5.2.2",
|
|
||||||
"@mui/icons-material": "6.4.11",
|
"@mui/icons-material": "6.4.11",
|
||||||
"@mui/lab": "6.0.0-dev.240424162023-9968b4889d",
|
"@mui/lab": "6.0.0-dev.240424162023-9968b4889d",
|
||||||
"@mui/material": "6.4.11",
|
"@mui/material": "6.4.11",
|
||||||
@@ -27,14 +26,11 @@
|
|||||||
"dayjs": "1.11.13",
|
"dayjs": "1.11.13",
|
||||||
"flag-icons": "7.3.2",
|
"flag-icons": "7.3.2",
|
||||||
"html2canvas": "^1.4.1",
|
"html2canvas": "^1.4.1",
|
||||||
"human-interval": "2.0.1",
|
|
||||||
"i18next": "25.4.2",
|
"i18next": "25.4.2",
|
||||||
"joi": "17.13.3",
|
"joi": "17.13.3",
|
||||||
"mui-color-input": "^6.0.0",
|
"mui-color-input": "^6.0.0",
|
||||||
"pretty-ms": "9.3.0",
|
|
||||||
"react": "18.3.1",
|
"react": "18.3.1",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
"react-hook-form": "7.63.0",
|
|
||||||
"react-i18next": "^15.4.0",
|
"react-i18next": "^15.4.0",
|
||||||
"react-icons": "5.5.0",
|
"react-icons": "5.5.0",
|
||||||
"react-redux": "9.2.0",
|
"react-redux": "9.2.0",
|
||||||
@@ -43,12 +39,17 @@
|
|||||||
"react-toastify": "^10.0.5",
|
"react-toastify": "^10.0.5",
|
||||||
"recharts": "2.15.2",
|
"recharts": "2.15.2",
|
||||||
"redux-persist": "6.0.0",
|
"redux-persist": "6.0.0",
|
||||||
"swr": "2.3.6",
|
"vite-plugin-svgr": "^4.2.0"
|
||||||
"vite-plugin-svgr": "^4.2.0",
|
},
|
||||||
"zod": "4.1.11"
|
"unusedDepencies": {
|
||||||
|
"@solana/wallet-adapter-base": "0.9.25",
|
||||||
|
"@solana/wallet-adapter-material-ui": "0.16.35",
|
||||||
|
"@solana/wallet-adapter-react": "0.15.37",
|
||||||
|
"@solana/wallet-adapter-react-ui": "0.9.37",
|
||||||
|
"@solana/wallet-adapter-wallets": "0.19.34",
|
||||||
|
"@solana/web3.js": "1.98.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "24.5.2",
|
|
||||||
"@types/react": "^18.2.66",
|
"@types/react": "^18.2.66",
|
||||||
"@types/react-dom": "^18.2.22",
|
"@types/react-dom": "^18.2.22",
|
||||||
"@vitejs/plugin-react": "^4.2.1",
|
"@vitejs/plugin-react": "^4.2.1",
|
||||||
@@ -57,7 +58,6 @@
|
|||||||
"eslint-plugin-react-hooks": "^5.0.0",
|
"eslint-plugin-react-hooks": "^5.0.0",
|
||||||
"eslint-plugin-react-refresh": "^0.4.6",
|
"eslint-plugin-react-refresh": "^0.4.6",
|
||||||
"prettier": "^3.3.3",
|
"prettier": "^3.3.3",
|
||||||
"typescript": "5.9.3",
|
|
||||||
"vite": "6.3.6"
|
"vite": "6.3.6"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+11
-6
@@ -9,7 +9,8 @@ import { CssBaseline, GlobalStyles } from "@mui/material";
|
|||||||
import { logger } from "./Utils/Logger"; // Import the logger
|
import { logger } from "./Utils/Logger"; // Import the logger
|
||||||
import { networkService } from "./main";
|
import { networkService } from "./main";
|
||||||
import { Routes } from "./Routes";
|
import { Routes } from "./Routes";
|
||||||
import AppLayout from "@/Components/v1/Layouts/AppLayout";
|
import WalletProvider from "./Components/WalletProvider";
|
||||||
|
import AppLayout from "./Components/Layouts/AppLayout";
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
const mode = useSelector((state) => state.ui.mode);
|
const mode = useSelector((state) => state.ui.mode);
|
||||||
@@ -23,12 +24,16 @@ function App() {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
/* Extract Themeprovider, baseline and global styles to Styles */
|
||||||
<ThemeProvider theme={mode === "light" ? lightTheme : darkTheme}>
|
<ThemeProvider theme={mode === "light" ? lightTheme : darkTheme}>
|
||||||
<CssBaseline />
|
<WalletProvider>
|
||||||
<AppLayout>
|
<CssBaseline />
|
||||||
<Routes />
|
|
||||||
</AppLayout>
|
<AppLayout>
|
||||||
<ToastContainer />
|
<Routes />
|
||||||
|
</AppLayout>
|
||||||
|
<ToastContainer />
|
||||||
|
</WalletProvider>
|
||||||
</ThemeProvider>
|
</ThemeProvider>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
+8
-10
@@ -2,17 +2,17 @@
|
|||||||
import IconButton from "@mui/material/IconButton";
|
import IconButton from "@mui/material/IconButton";
|
||||||
import Menu from "@mui/material/Menu";
|
import Menu from "@mui/material/Menu";
|
||||||
import MenuItem from "@mui/material/MenuItem";
|
import MenuItem from "@mui/material/MenuItem";
|
||||||
import Settings from "../../../assets/icons/settings-bold.svg?react";
|
import Settings from "../../assets/icons/settings-bold.svg?react";
|
||||||
import Dialog from "../Dialog/index.jsx";
|
import Dialog from "../../Components/Dialog";
|
||||||
|
|
||||||
// Utils
|
// Utils
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import { createToast } from "../../../Utils/toastUtils.jsx";
|
import { createToast } from "../../Utils/toastUtils";
|
||||||
|
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
import { usePauseMonitor, useDeleteMonitor } from "../../../Hooks/monitorHooks.js";
|
import { usePauseMonitor, useDeleteMonitor } from "../../Hooks/monitorHooks";
|
||||||
|
|
||||||
const ActionsMenu = ({
|
const ActionsMenu = ({
|
||||||
monitor,
|
monitor,
|
||||||
@@ -31,8 +31,7 @@ const ActionsMenu = ({
|
|||||||
const handleRemove = async (event) => {
|
const handleRemove = async (event) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
let monitor = { id: actions.id };
|
let monitor = { _id: actions.id };
|
||||||
console.log(monitor);
|
|
||||||
await deleteMonitor({ monitor });
|
await deleteMonitor({ monitor });
|
||||||
updateRowCallback();
|
updateRowCallback();
|
||||||
};
|
};
|
||||||
@@ -40,7 +39,7 @@ const ActionsMenu = ({
|
|||||||
const handlePause = async () => {
|
const handlePause = async () => {
|
||||||
try {
|
try {
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
await pauseMonitor({ monitorId: monitor.id });
|
await pauseMonitor({ monitorId: monitor._id });
|
||||||
pauseCallback();
|
pauseCallback();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
createToast({ body: "Failed to pause monitor." });
|
createToast({ body: "Failed to pause monitor." });
|
||||||
@@ -73,7 +72,7 @@ const ActionsMenu = ({
|
|||||||
aria-label="monitor actions"
|
aria-label="monitor actions"
|
||||||
onClick={(event) => {
|
onClick={(event) => {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
openMenu(event, monitor.id, monitor.type === "ping" ? null : monitor.url);
|
openMenu(event, monitor._id, monitor.type === "ping" ? null : monitor.url);
|
||||||
}}
|
}}
|
||||||
sx={{
|
sx={{
|
||||||
"&:focus": {
|
"&:focus": {
|
||||||
@@ -198,7 +197,6 @@ const ActionsMenu = ({
|
|||||||
confirmationButtonLabel="Delete"
|
confirmationButtonLabel="Delete"
|
||||||
/* Do we need stop propagation? */
|
/* Do we need stop propagation? */
|
||||||
onConfirm={(e) => {
|
onConfirm={(e) => {
|
||||||
console.log(e);
|
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
handleRemove(e);
|
handleRemove(e);
|
||||||
}}
|
}}
|
||||||
@@ -212,7 +210,7 @@ const ActionsMenu = ({
|
|||||||
|
|
||||||
ActionsMenu.propTypes = {
|
ActionsMenu.propTypes = {
|
||||||
monitor: PropTypes.shape({
|
monitor: PropTypes.shape({
|
||||||
id: PropTypes.string,
|
_id: PropTypes.string,
|
||||||
url: PropTypes.string,
|
url: PropTypes.string,
|
||||||
type: PropTypes.string,
|
type: PropTypes.string,
|
||||||
isActive: PropTypes.bool,
|
isActive: PropTypes.bool,
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
+3
-3
@@ -1,6 +1,6 @@
|
|||||||
import LeftArrow from "../../../assets/icons/left-arrow.svg?react";
|
import LeftArrow from "../../assets/icons/left-arrow.svg?react";
|
||||||
import LeftArrowDouble from "../../../assets/icons/left-arrow-double.svg?react";
|
import LeftArrowDouble from "../../assets/icons/left-arrow-double.svg?react";
|
||||||
import LeftArrowLong from "../../../assets/icons/left-arrow-long.svg?react";
|
import LeftArrowLong from "../../assets/icons/left-arrow-long.svg?react";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
|
|
||||||
const ArrowLeft = ({ type, color = "#667085", ...props }) => {
|
const ArrowLeft = ({ type, color = "#667085", ...props }) => {
|
||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
import RightArrow from "../../../assets/icons/right-arrow.svg?react";
|
import RightArrow from "../../assets/icons/right-arrow.svg?react";
|
||||||
import RightArrowDouble from "../../../assets/icons/right-arrow-double.svg?react";
|
import RightArrowDouble from "../../assets/icons/right-arrow-double.svg?react";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
|
|
||||||
const ArrowRight = ({ type, color = "#667085", ...props }) => {
|
const ArrowRight = ({ type, color = "#667085", ...props }) => {
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
+1
-1
@@ -2,7 +2,7 @@ import PropTypes from "prop-types";
|
|||||||
import { Box, Breadcrumbs as MUIBreadcrumbs } from "@mui/material";
|
import { Box, Breadcrumbs as MUIBreadcrumbs } from "@mui/material";
|
||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import ArrowRight from "../ArrowRight/index.jsx";
|
import ArrowRight from "../ArrowRight";
|
||||||
import "./index.css";
|
import "./index.css";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
File renamed without changes.
+1
-1
@@ -61,7 +61,7 @@ import {
|
|||||||
Tooltip,
|
Tooltip,
|
||||||
ResponsiveContainer,
|
ResponsiveContainer,
|
||||||
} from "recharts";
|
} from "recharts";
|
||||||
import { createGradient } from "../Utils/gradientUtils.jsx";
|
import { createGradient } from "../Utils/gradientUtils";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
import { useTheme } from "@mui/material";
|
import { useTheme } from "@mui/material";
|
||||||
import { useId } from "react";
|
import { useId } from "react";
|
||||||
File renamed without changes.
+3
-3
@@ -1,6 +1,6 @@
|
|||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import { Box, Stack, Tooltip, Typography } from "@mui/material";
|
import { Box, Stack, Tooltip, Typography } from "@mui/material";
|
||||||
import { formatDateWithTz } from "../../../../Utils/timeUtils.js";
|
import { formatDateWithTz } from "../../../Utils/timeUtils";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import "./index.css";
|
import "./index.css";
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
@@ -103,7 +103,7 @@ const BarChart = ({ checks = [] }) => {
|
|||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
placement="top"
|
placement="top"
|
||||||
key={`check-${check?.id}`}
|
key={`check-${check?._id}`}
|
||||||
slotProps={{
|
slotProps={{
|
||||||
popper: {
|
popper: {
|
||||||
className: "bar-tooltip",
|
className: "bar-tooltip",
|
||||||
@@ -145,7 +145,7 @@ const BarChart = ({ checks = [] }) => {
|
|||||||
position="relative"
|
position="relative"
|
||||||
width="9px"
|
width="9px"
|
||||||
height="100%"
|
height="100%"
|
||||||
backgroundColor={theme.palette.primary.lowContrast}
|
backgroundColor={theme.palette.primary.lowContrast} // CAIO_REVIEW
|
||||||
sx={{
|
sx={{
|
||||||
borderRadius: theme.spacing(1.5),
|
borderRadius: theme.spacing(1.5),
|
||||||
/*
|
/*
|
||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
import { Typography, Stack } from "@mui/material";
|
import { Typography, Stack } from "@mui/material";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import IconBox from "../../IconBox/index.jsx";
|
import IconBox from "../../IconBox";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* `EmptyView` is a functional React component that displays an empty state view with an optional icon, header, and message.
|
* `EmptyView` is a functional React component that displays an empty state view with an optional icon, header, and message.
|
||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
import { Stack, Typography } from "@mui/material";
|
import { Stack, Typography } from "@mui/material";
|
||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import IconBox from "../../IconBox/index.jsx";
|
import IconBox from "../../IconBox";
|
||||||
import EmptyView from "./EmptyView.jsx";
|
import EmptyView from "./EmptyView";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
|
|
||||||
const ChartBox = ({
|
const ChartBox = ({
|
||||||
File renamed without changes.
File renamed without changes.
+1
-1
@@ -5,7 +5,7 @@ import { Stack, Box, Tooltip, Typography } from "@mui/material";
|
|||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import { useState, useEffect } from "react";
|
import { useState, useEffect } from "react";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
import { formatDateWithTz } from "../../../../Utils/timeUtils.js";
|
import { formatDateWithTz } from "../../../Utils/timeUtils";
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
|
|
||||||
const PlaceholderCheck = ({ daysToShow }) => {
|
const PlaceholderCheck = ({ daysToShow }) => {
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
import { Stack, Typography } from "@mui/material";
|
import { Stack, Typography } from "@mui/material";
|
||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import IconBox from "../../IconBox/index.jsx";
|
import IconBox from "../../IconBox";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
|
|
||||||
const LegendBox = ({ children, icon, header, sx }) => {
|
const LegendBox = ({ children, icon, header, sx }) => {
|
||||||
File renamed without changes.
+2
-2
@@ -12,11 +12,11 @@ import { Box, Stack, Typography } from "@mui/material";
|
|||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import { useMemo, useState } from "react";
|
import { useMemo, useState } from "react";
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
import { formatDateWithTz } from "../../../../Utils/timeUtils.js";
|
import { formatDateWithTz } from "../../../Utils/timeUtils";
|
||||||
import {
|
import {
|
||||||
tooltipDateFormatLookup,
|
tooltipDateFormatLookup,
|
||||||
tickDateFormatLookup,
|
tickDateFormatLookup,
|
||||||
} from "../Utils/chartUtilFunctions.js";
|
} from "../Utils/chartUtilFunctions";
|
||||||
|
|
||||||
import "./index.css";
|
import "./index.css";
|
||||||
const CustomToolTip = ({ active, payload, label, dateRange }) => {
|
const CustomToolTip = ({ active, payload, label, dateRange }) => {
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import { Box, Stack, Tooltip, Typography } from "@mui/material";
|
import { Box, Stack, Tooltip, Typography } from "@mui/material";
|
||||||
import { formatDateWithTz } from "../../../../Utils/timeUtils.js";
|
import { formatDateWithTz } from "../../../Utils/timeUtils";
|
||||||
import { useEffect, useState, forwardRef } from "react";
|
import { useEffect, useState, forwardRef } from "react";
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
File renamed without changes.
+2
-2
@@ -2,9 +2,9 @@ import PropTypes from "prop-types";
|
|||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
import { useTheme } from "@mui/material";
|
import { useTheme } from "@mui/material";
|
||||||
import { Text } from "recharts";
|
import { Text } from "recharts";
|
||||||
import { formatDateWithTz } from "../../../../Utils/timeUtils.js";
|
import { formatDateWithTz } from "../../../Utils/timeUtils";
|
||||||
import { Box, Stack, Typography } from "@mui/material";
|
import { Box, Stack, Typography } from "@mui/material";
|
||||||
import { tickDateFormatLookup, tooltipDateFormatLookup } from "./chartUtilFunctions.js";
|
import { tickDateFormatLookup, tooltipDateFormatLookup } from "./chartUtilFunctions";
|
||||||
/**
|
/**
|
||||||
* Custom tick component for rendering time with timezone.
|
* Custom tick component for rendering time with timezone.
|
||||||
*
|
*
|
||||||
File renamed without changes.
@@ -1,7 +1,7 @@
|
|||||||
import "./check.css";
|
import "./check.css";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
import CheckGrey from "../../../assets/icons/check.svg?react";
|
import CheckGrey from "../../assets/icons/check.svg?react";
|
||||||
import CheckOutlined from "../../../assets/icons/check-outlined.svg?react";
|
import CheckOutlined from "../../assets/icons/check-outlined.svg?react";
|
||||||
import { Box, Stack, Typography } from "@mui/material";
|
import { Box, Stack, Typography } from "@mui/material";
|
||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
|
|
||||||
File renamed without changes.
File renamed without changes.
+1
-1
@@ -10,7 +10,7 @@ import MenuItem from "@mui/material/MenuItem";
|
|||||||
import Drawer from "@mui/material/Drawer";
|
import Drawer from "@mui/material/Drawer";
|
||||||
import MenuIcon from "@mui/icons-material/Menu";
|
import MenuIcon from "@mui/icons-material/Menu";
|
||||||
import CloseRoundedIcon from "@mui/icons-material/CloseRounded";
|
import CloseRoundedIcon from "@mui/icons-material/CloseRounded";
|
||||||
import ThemeSwitch from "../ThemeSwitch/index.jsx";
|
import ThemeSwitch from "../ThemeSwitch";
|
||||||
import { useTheme } from "@mui/material/styles";
|
import { useTheme } from "@mui/material/styles";
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
import { useLocation, useNavigate } from "react-router-dom";
|
import { useLocation, useNavigate } from "react-router-dom";
|
||||||
File renamed without changes.
File renamed without changes.
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
import { Box, Stack, Typography } from "@mui/material";
|
import { Box, Stack, Typography } from "@mui/material";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import ConfigBox from "../ConfigBox/index.jsx";
|
import ConfigBox from "../ConfigBox";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ConfigRow is a styled container used to layout content in a row format with specific padding, border, and spacing.
|
* ConfigRow is a styled container used to layout content in a row format with specific padding, border, and spacing.
|
||||||
File renamed without changes.
@@ -1,6 +1,6 @@
|
|||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
import { Button, Stack } from "@mui/material";
|
import { Button, Stack } from "@mui/material";
|
||||||
import { GenericDialog } from "./genericDialog.jsx";
|
import { GenericDialog } from "./genericDialog";
|
||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
File renamed without changes.
File renamed without changes.
+3
-3
@@ -1,8 +1,8 @@
|
|||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import Box from "@mui/material/Box";
|
import Box from "@mui/material/Box";
|
||||||
import Background from "../../../assets/Images/background-grid.svg?react";
|
import Background from "../../assets/Images/background-grid.svg?react";
|
||||||
import OutputAnimation from "../../../assets/Animations/output.gif";
|
import OutputAnimation from "../../assets/Animations/output.gif";
|
||||||
import DarkmodeOutput from "../../../assets/Animations/darkmodeOutput.gif";
|
import DarkmodeOutput from "../../assets/Animations/darkmodeOutput.gif";
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
const FallbackBackground = () => {
|
const FallbackBackground = () => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
+1
-1
@@ -2,7 +2,7 @@ import PropTypes from "prop-types";
|
|||||||
import { useTheme } from "@mui/material/styles";
|
import { useTheme } from "@mui/material/styles";
|
||||||
import Box from "@mui/material/Box";
|
import Box from "@mui/material/Box";
|
||||||
import Stack from "@mui/material/Stack";
|
import Stack from "@mui/material/Stack";
|
||||||
import Check from "../Check/Check.jsx";
|
import Check from "../Check/Check";
|
||||||
const FallbackCheckList = ({ checks, type }) => {
|
const FallbackCheckList = ({ checks, type }) => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
return (
|
return (
|
||||||
File renamed without changes.
+1
-1
@@ -3,7 +3,7 @@ import { useTheme } from "@mui/material/styles";
|
|||||||
import Link from "@mui/material/Link";
|
import Link from "@mui/material/Link";
|
||||||
import { Link as RouterLink } from "react-router-dom";
|
import { Link as RouterLink } from "react-router-dom";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import Alert from "../Alert/index.jsx";
|
import Alert from "../Alert";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
|
|
||||||
const renderWarningMessage = (t) => {
|
const renderWarningMessage = (t) => {
|
||||||
File renamed without changes.
File renamed without changes.
+5
-5
@@ -2,11 +2,11 @@ import PropTypes from "prop-types";
|
|||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import { Box, Stack } from "@mui/material";
|
import { Box, Stack } from "@mui/material";
|
||||||
import "./index.css";
|
import "./index.css";
|
||||||
import FallbackTitle from "./FallbackTitle.jsx";
|
import FallbackTitle from "./FallbackTitle";
|
||||||
import FallbackCheckList from "./FallbackCheckList.jsx";
|
import FallbackCheckList from "./FallbackCheckList";
|
||||||
import FallbackActionButtons from "./FallBackActionButtons.jsx";
|
import FallbackActionButtons from "./FallBackActionButtons";
|
||||||
import FallbackBackground from "./FallbackBackground.jsx";
|
import FallbackBackground from "./FallbackBackground";
|
||||||
import FallbackContainer from "./FallbackContainer.jsx";
|
import FallbackContainer from "./FallbackContainer";
|
||||||
/**
|
/**
|
||||||
* Fallback component to display a fallback UI with a title, a list of checks, and a navigation button.
|
* Fallback component to display a fallback UI with a title, a list of checks, and a navigation button.
|
||||||
*
|
*
|
||||||
File renamed without changes.
File renamed without changes.
+4
-4
@@ -1,8 +1,8 @@
|
|||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import { Box, Stack } from "@mui/material";
|
import { Box, Stack } from "@mui/material";
|
||||||
import OutputAnimation from "../../../assets/Animations/output.gif";
|
import OutputAnimation from "../../assets/Animations/output.gif";
|
||||||
import DarkmodeOutput from "../../../assets/Animations/darkmodeOutput.gif";
|
import DarkmodeOutput from "../../assets/Animations/darkmodeOutput.gif";
|
||||||
import Background from "../../../assets/Images/background-grid.svg?react";
|
import Background from "../../assets/Images/background-grid.svg?react";
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -40,13 +40,13 @@ const GenericFallback = ({ children }) => {
|
|||||||
<Box
|
<Box
|
||||||
component="img"
|
component="img"
|
||||||
src={mode === "light" ? OutputAnimation : DarkmodeOutput}
|
src={mode === "light" ? OutputAnimation : DarkmodeOutput}
|
||||||
|
Background="transparent"
|
||||||
alt="Loading animation"
|
alt="Loading animation"
|
||||||
sx={{
|
sx={{
|
||||||
zIndex: 1,
|
zIndex: 1,
|
||||||
border: "none",
|
border: "none",
|
||||||
borderRadius: theme.spacing(8),
|
borderRadius: theme.spacing(8),
|
||||||
width: "100%",
|
width: "100%",
|
||||||
backgroundColor: "transparent",
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Box
|
<Box
|
||||||
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
|
|
||||||
import { logger } from "../../../Utils/Logger.js";
|
import { logger } from "../../Utils/Logger";
|
||||||
import { networkService } from "../../../main.jsx";
|
import { networkService } from "../../main";
|
||||||
|
|
||||||
const withAdminCheck = (WrappedComponent) => {
|
const withAdminCheck = (WrappedComponent) => {
|
||||||
const WithAdminCheck = (props) => {
|
const WithAdminCheck = (props) => {
|
||||||
File renamed without changes.
@@ -1,8 +1,7 @@
|
|||||||
import { Stack, Typography } from "@mui/material";
|
import { Stack, Typography } from "@mui/material";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import Dot from "../Dot/index.jsx";
|
import Dot from "../Dot";
|
||||||
import { StatusLabel } from "@/Components/v1/Label/index.jsx";
|
|
||||||
/**
|
/**
|
||||||
* Host component.
|
* Host component.
|
||||||
* This subcomponent receives a params object and displays the host details.
|
* This subcomponent receives a params object and displays the host details.
|
||||||
@@ -15,7 +14,7 @@ import { StatusLabel } from "@/Components/v1/Label/index.jsx";
|
|||||||
* @param {number} params.percentage - The percentage to display.
|
* @param {number} params.percentage - The percentage to display.
|
||||||
* @returns {React.ElementType} Returns a div element with the host details.
|
* @returns {React.ElementType} Returns a div element with the host details.
|
||||||
*/
|
*/
|
||||||
const Host = ({ url, title, percentageColor, percentage, showURL, status }) => {
|
const Host = ({ url, title, percentageColor, percentage, showURL }) => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
return (
|
return (
|
||||||
<Stack>
|
<Stack>
|
||||||
@@ -23,36 +22,21 @@ const Host = ({ url, title, percentageColor, percentage, showURL, status }) => {
|
|||||||
direction="row"
|
direction="row"
|
||||||
position="relative"
|
position="relative"
|
||||||
alignItems="center"
|
alignItems="center"
|
||||||
gap={theme.spacing(5)}
|
gap={theme.spacing(4)}
|
||||||
>
|
>
|
||||||
<Typography
|
{title}
|
||||||
variant="h6"
|
|
||||||
sx={{
|
|
||||||
fontWeight: 600,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{title}
|
|
||||||
</Typography>
|
|
||||||
|
|
||||||
{percentageColor && percentage && (
|
{percentageColor && percentage && (
|
||||||
<>
|
<>
|
||||||
<Dot />
|
<Dot />
|
||||||
<Typography
|
<Typography
|
||||||
variant="h6"
|
component="span"
|
||||||
sx={{
|
sx={{
|
||||||
fontWeight: 600,
|
|
||||||
color: percentageColor,
|
color: percentageColor,
|
||||||
|
fontWeight: 500,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{percentage}%
|
{percentage}%
|
||||||
</Typography>
|
</Typography>
|
||||||
{status && (
|
|
||||||
<StatusLabel
|
|
||||||
status={status}
|
|
||||||
text={status}
|
|
||||||
customStyles={{ textTransform: "capitalize" }}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</Stack>
|
</Stack>
|
||||||
@@ -67,7 +51,6 @@ Host.propTypes = {
|
|||||||
percentage: PropTypes.string,
|
percentage: PropTypes.string,
|
||||||
url: PropTypes.string,
|
url: PropTypes.string,
|
||||||
showURL: PropTypes.bool,
|
showURL: PropTypes.bool,
|
||||||
status: PropTypes.string,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default Host;
|
export default Host;
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
import { useTheme } from "@mui/material";
|
import { useTheme } from "@mui/material";
|
||||||
import { BaseLabel } from "../Label/index.jsx";
|
import { BaseLabel } from "../Label";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @component
|
* @component
|
||||||
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
import i18n from "../../../Utils/i18n.js";
|
import i18n from "../../Utils/i18n";
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
const I18nLoader = () => {
|
const I18nLoader = () => {
|
||||||
const language = useSelector((state) => state.ui.language ?? "en");
|
const language = useSelector((state) => state.ui.language);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (language && i18n.language !== language) {
|
if (language && i18n.language !== language) {
|
||||||
File renamed without changes.
File renamed without changes.
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
import { RowContainer } from "../StandardContainer/index.jsx";
|
import { RowContainer } from "../StandardContainer";
|
||||||
import { Stack, Typography } from "@mui/material";
|
import { Stack, Typography } from "@mui/material";
|
||||||
import Image from "../Image/index.jsx";
|
import Image from "../Image";
|
||||||
|
|
||||||
import { useTheme } from "@mui/material/styles";
|
import { useTheme } from "@mui/material/styles";
|
||||||
|
|
||||||
File renamed without changes.
+3
-2
@@ -1,8 +1,9 @@
|
|||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
import { FormControlLabel, Checkbox as MuiCheckbox } from "@mui/material";
|
import { FormControlLabel, Checkbox as MuiCheckbox } from "@mui/material";
|
||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import CheckboxOutline from "../../../../assets/icons/checkbox-outline.svg?react";
|
import CheckboxOutline from "../../../assets/icons/checkbox-outline.svg?react";
|
||||||
import CheckboxFilled from "../../../../assets/icons/checkbox-filled.svg?react";
|
import CheckboxFilled from "../../../assets/icons/checkbox-filled.svg?react";
|
||||||
|
import "./index.css";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checkbox Component
|
* Checkbox Component
|
||||||
File renamed without changes.
File renamed without changes.
+2
-2
@@ -1,10 +1,10 @@
|
|||||||
// Components
|
// Components
|
||||||
import { Box, Stack, Typography } from "@mui/material";
|
import { Box, Stack, Typography } from "@mui/material";
|
||||||
import CloudUploadIcon from "@mui/icons-material/CloudUpload";
|
import CloudUploadIcon from "@mui/icons-material/CloudUpload";
|
||||||
import Image from "../../Image/index.jsx";
|
import Image from "../../../Components/Image";
|
||||||
import TextField from "@mui/material/TextField";
|
import TextField from "@mui/material/TextField";
|
||||||
import IconButton from "@mui/material/IconButton";
|
import IconButton from "@mui/material/IconButton";
|
||||||
import ProgressUpload from "../../ProgressBars/index.jsx";
|
import ProgressUpload from "../../ProgressBars";
|
||||||
import ImageIcon from "@mui/icons-material/Image";
|
import ImageIcon from "@mui/icons-material/Image";
|
||||||
|
|
||||||
// Utils
|
// Utils
|
||||||
File renamed without changes.
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
import { FormControlLabel, Radio as MUIRadio, Typography } from "@mui/material";
|
import { FormControlLabel, Radio as MUIRadio, Typography } from "@mui/material";
|
||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import RadioChecked from "../../../../assets/icons/radio-checked.svg?react";
|
import RadioChecked from "../../../assets/icons/radio-checked.svg?react";
|
||||||
import "./index.css";
|
import "./index.css";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
+6
-13
@@ -8,10 +8,10 @@ import {
|
|||||||
Checkbox,
|
Checkbox,
|
||||||
} from "@mui/material";
|
} from "@mui/material";
|
||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import SearchIcon from "../../../../assets/icons/search.svg?react";
|
import SearchIcon from "../../../assets/icons/search.svg?react";
|
||||||
import React, { useEffect } from "react";
|
import React, { useEffect } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import FieldWrapper from "../FieldWrapper/index.jsx";
|
import FieldWrapper from "../FieldWrapper";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Search component using Material UI's Autocomplete.
|
* Search component using Material UI's Autocomplete.
|
||||||
@@ -85,12 +85,7 @@ const Search = ({
|
|||||||
const enhancedOptions = React.useMemo(() => {
|
const enhancedOptions = React.useMemo(() => {
|
||||||
return multiple && isAdorned
|
return multiple && isAdorned
|
||||||
? [
|
? [
|
||||||
{
|
{ [filteredBy]: t("selectAll"), isSelectAll: true, _id: "select_all" },
|
||||||
[filteredBy]: t("selectAll"),
|
|
||||||
isSelectAll: true,
|
|
||||||
_id: "select_all",
|
|
||||||
id: "select_all",
|
|
||||||
},
|
|
||||||
...options,
|
...options,
|
||||||
]
|
]
|
||||||
: options;
|
: options;
|
||||||
@@ -98,7 +93,7 @@ const Search = ({
|
|||||||
const isOptionSelected = (option) => {
|
const isOptionSelected = (option) => {
|
||||||
if (!multiple && !isAdorned) return false;
|
if (!multiple && !isAdorned) return false;
|
||||||
if (Array.isArray(value)) {
|
if (Array.isArray(value)) {
|
||||||
return value.some((item) => (item._id ?? item.id) === (option._id ?? option.id));
|
return value.some((item) => item._id === option._id);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
@@ -150,9 +145,7 @@ const Search = ({
|
|||||||
disableClearable
|
disableClearable
|
||||||
options={enhancedOptions}
|
options={enhancedOptions}
|
||||||
getOptionLabel={(option) => option[filteredBy]}
|
getOptionLabel={(option) => option[filteredBy]}
|
||||||
isOptionEqualToValue={(option, value) =>
|
isOptionEqualToValue={(option, value) => option._id === value._id} // Compare by unique identifier
|
||||||
(option._id ?? option.id) === (value?._id ?? value?.id)
|
|
||||||
} // Compare by unique identifier
|
|
||||||
renderInput={(params) => (
|
renderInput={(params) => (
|
||||||
<FieldWrapper
|
<FieldWrapper
|
||||||
label={label}
|
label={label}
|
||||||
@@ -213,7 +206,7 @@ const Search = ({
|
|||||||
return filtered;
|
return filtered;
|
||||||
}}
|
}}
|
||||||
getOptionKey={(option) => {
|
getOptionKey={(option) => {
|
||||||
return option._id ?? option.id;
|
return option._id;
|
||||||
}}
|
}}
|
||||||
renderOption={(props, option) => {
|
renderOption={(props, option) => {
|
||||||
const { key, ...optionProps } = props;
|
const { key, ...optionProps } = props;
|
||||||
File renamed without changes.
+15
-24
@@ -2,7 +2,7 @@ import PropTypes from "prop-types";
|
|||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import { MenuItem, Select as MuiSelect, Stack, Typography } from "@mui/material";
|
import { MenuItem, Select as MuiSelect, Stack, Typography } from "@mui/material";
|
||||||
import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown";
|
import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown";
|
||||||
import FieldWrapper from "../FieldWrapper/index.jsx";
|
import FieldWrapper from "../FieldWrapper";
|
||||||
|
|
||||||
import "./index.css";
|
import "./index.css";
|
||||||
|
|
||||||
@@ -62,7 +62,6 @@ const Select = ({
|
|||||||
fieldWrapperSx = {},
|
fieldWrapperSx = {},
|
||||||
}) => {
|
}) => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const getItemValue = (item) => item?._id ?? item?.id;
|
|
||||||
const itemStyles = {
|
const itemStyles = {
|
||||||
fontSize: "var(--env-var-font-size-medium)",
|
fontSize: "var(--env-var-font-size-medium)",
|
||||||
color: theme.palette.primary.contrastTextTertiary,
|
color: theme.palette.primary.contrastTextTertiary,
|
||||||
@@ -124,7 +123,7 @@ const Select = ({
|
|||||||
...sx,
|
...sx,
|
||||||
}}
|
}}
|
||||||
renderValue={(selected) => {
|
renderValue={(selected) => {
|
||||||
const selectedItem = items.find((item) => getItemValue(item) === selected);
|
const selectedItem = items.find((item) => item._id === selected);
|
||||||
const displayName = selectedItem ? selectedItem.name : placeholder;
|
const displayName = selectedItem ? selectedItem.name : placeholder;
|
||||||
return (
|
return (
|
||||||
<Typography
|
<Typography
|
||||||
@@ -153,25 +152,17 @@ const Select = ({
|
|||||||
{placeholder}
|
{placeholder}
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
)}
|
)}
|
||||||
{items
|
{items.map((item) => (
|
||||||
.map((item) => {
|
<MenuItem
|
||||||
const itemValue = getItemValue(item);
|
value={item._id}
|
||||||
if (itemValue === undefined || itemValue === null) {
|
key={`${id}-${item._id}`}
|
||||||
return null;
|
sx={{
|
||||||
}
|
...itemStyles,
|
||||||
return (
|
}}
|
||||||
<MenuItem
|
>
|
||||||
value={itemValue}
|
{item.name}
|
||||||
key={`${id}-${itemValue}`}
|
</MenuItem>
|
||||||
sx={{
|
))}
|
||||||
...itemStyles,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{item.name}
|
|
||||||
</MenuItem>
|
|
||||||
);
|
|
||||||
})
|
|
||||||
.filter(Boolean)}
|
|
||||||
</MuiSelect>
|
</MuiSelect>
|
||||||
</FieldWrapper>
|
</FieldWrapper>
|
||||||
);
|
);
|
||||||
@@ -188,8 +179,8 @@ Select.propTypes = {
|
|||||||
.isRequired,
|
.isRequired,
|
||||||
items: PropTypes.arrayOf(
|
items: PropTypes.arrayOf(
|
||||||
PropTypes.shape({
|
PropTypes.shape({
|
||||||
_id: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.bool]),
|
_id: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.bool])
|
||||||
id: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.bool]),
|
.isRequired,
|
||||||
|
|
||||||
name: PropTypes.string.isRequired,
|
name: PropTypes.string.isRequired,
|
||||||
})
|
})
|
||||||
+1
-1
@@ -4,7 +4,7 @@ import PropTypes from "prop-types";
|
|||||||
import VisibilityOff from "@mui/icons-material/VisibilityOff";
|
import VisibilityOff from "@mui/icons-material/VisibilityOff";
|
||||||
import Visibility from "@mui/icons-material/Visibility";
|
import Visibility from "@mui/icons-material/Visibility";
|
||||||
import ReorderRoundedIcon from "@mui/icons-material/ReorderRounded";
|
import ReorderRoundedIcon from "@mui/icons-material/ReorderRounded";
|
||||||
import DeleteIcon from "../../../../../assets/icons/trash-bin.svg?react";
|
import DeleteIcon from "../../../../assets/icons/trash-bin.svg?react";
|
||||||
|
|
||||||
export const HttpAdornment = ({ https }) => {
|
export const HttpAdornment = ({ https }) => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
+1
-1
@@ -2,7 +2,7 @@ import { Stack, TextField, Typography } from "@mui/material";
|
|||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import { forwardRef, useState, cloneElement } from "react";
|
import { forwardRef, useState, cloneElement } from "react";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
import FieldWrapper from "../FieldWrapper/index.jsx";
|
import FieldWrapper from "../FieldWrapper";
|
||||||
|
|
||||||
const getSx = (theme, type, maxWidth) => {
|
const getSx = (theme, type, maxWidth) => {
|
||||||
const sx = {
|
const sx = {
|
||||||
File renamed without changes.
@@ -147,9 +147,11 @@ const StatusLabel = ({ status, text, customStyles }) => {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Box
|
<Box
|
||||||
|
width={7}
|
||||||
|
height={7}
|
||||||
bgcolor={theme.palette[themeColor].lowContrast}
|
bgcolor={theme.palette[themeColor].lowContrast}
|
||||||
borderRadius="0%"
|
borderRadius="50%"
|
||||||
marginRight="1px"
|
marginRight="5px"
|
||||||
/>
|
/>
|
||||||
</BaseLabel>
|
</BaseLabel>
|
||||||
);
|
);
|
||||||
Loaded 100 of 513 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user