Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toast notification timeout settings #2555

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 1 addition & 17 deletions .github/workflows/auto-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
node: [ 14, 16, 18, 19 ]
node: [ 14, 16, 17, 18 ]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
Expand Down Expand Up @@ -66,19 +66,3 @@ jobs:
- run: npm install
- run: npm run build
- run: npm run cy:test

frontend-unit-tests:
needs: [ check-linters ]
runs-on: ubuntu-latest
steps:
- run: git config --global core.autocrlf false # Mainly for Windows
- uses: actions/checkout@v3

- name: Use Node.js 14
uses: actions/setup-node@v3
with:
node-version: 14
cache: 'npm'
- run: npm install
- run: npm run build
- run: npm run cy:run:unit
16 changes: 8 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Project Info

First of all, I want to thank everyone who made pull requests for Uptime Kuma. I never thought the GitHub Community would be so nice! Because of this, I also never thought that other people would actually read and edit my code. It is not very well structured or commented, sorry about that.
First of all, thank you everyone who made pull requests for Uptime Kuma, I never thought GitHub Community can be that nice! And also because of this, I also never thought other people actually read my code and edit my code. It is not structured and commented so well, lol. Sorry about that.

The project was created with vite.js (vue3). Then I created a subdirectory called "server" for server part. Both frontend and backend share the same package.json.

Expand All @@ -27,7 +27,7 @@ The frontend code build into "dist" directory. The server (express.js) exposes t

## Can I create a pull request for Uptime Kuma?

Yes or no, it depends on what you will try to do. Since I don't want to waste your time, be sure to **create an empty draft pull request or open an issue, so we can have a discussion first**. Especially for a large pull request or you don't know it will be merged or not.
Yes or no, it depends on what you will try to do. Since I don't want to waste your time, be sure to **create an empty draft pull request or open an issue, so we can discuss first**. Especially for a large pull request or you don't know it will be merged or not.

Here are some references:

Expand All @@ -51,10 +51,6 @@ Here are some references:
- Convert existing code into other programming languages
- Unnecessary large code changes (Hard to review, causes code conflicts to other pull requests)

The above cases cannot cover all situations.

I (@louislam) have the final say. If your pull request does not meet my expectations, I will reject it, no matter how much time you spend on it. Therefore, it is essential to have a discussion beforehand.

I will mark your pull request in the [milestones](https://github.com/louislam/uptime-kuma/milestones), if I am plan to review and merge it.

Also, please don't rush or ask for ETA, because I have to understand the pull request, make sure it is no breaking changes and stick to my vision of this project, especially for large pull requests.
Expand All @@ -77,9 +73,9 @@ Before deep into coding, discussion first is preferred. Creating an empty pull r

## Project Styles

I personally do not like it when something requires so much learning and configuration before you can finally start the app.
I personally do not like something need to learn so much and need to config so much before you can finally start the app.

- Easy to install for non-Docker users, no native build dependency is needed (at least for x86_64), no extra config, no extra effort required to get it running
- Easy to install for non-Docker users, no native build dependency is needed (at least for x86_64), no extra config, no extra effort to get it run
- Single container for Docker users, no very complex docker-compose file. Just map the volume and expose the port, then good to go
- Settings should be configurable in the frontend. Environment variable is not encouraged, unless it is related to startup such as `DATA_DIR`.
- Easy to use
Expand Down Expand Up @@ -177,11 +173,15 @@ The data and socket logic are in `src/mixins/socket.js`.

## Unit Test

It is an end-to-end testing. It is using Jest and Puppeteer.

```bash
npm run build
npm test
```

By default, the Chromium window will be shown up during the test. Specifying `HEADLESS_TEST=1` for terminal environments.

## Dependencies

Both frontend and backend share the same package.json. However, the frontend dependencies are eventually not used in the production environment, because it is usually also baked into dist files. So:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
<img src="./public/icon.svg" width="128" alt="" />
</div>

Uptime Kuma is an easy-to-use self-hosted monitoring tool.
It is a self-hosted monitoring tool like "Uptime Robot".

<img src="https://user-images.githubusercontent.com/1336778/212262296-e6205815-ad62-488c-83ec-a5b0d0689f7c.jpg" width="700" alt="" />
<img src="https://uptime.kuma.pet/img/dark.jpg" width="700" alt="" />

## 🥔 Live Demo

Expand Down
10 changes: 0 additions & 10 deletions config/cypress.frontend.config.js

This file was deleted.

16 changes: 0 additions & 16 deletions docker/builder-go.dockerfile

This file was deleted.

21 changes: 14 additions & 7 deletions docker/dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
############################################
# Build in Golang
# Run npm run build-healthcheck-armv7 in the host first, another it will be super slow where it is building the armv7 healthcheck
# Check file: builder-go.dockerfile
############################################
FROM louislam/uptime-kuma:builder-go AS build_healthcheck
FROM golang:1.19.4-buster AS build_healthcheck
WORKDIR /app
ARG TARGETPLATFORM
COPY ./extra/ ./extra/

# Compile healthcheck.go
RUN apt update
RUN apt --yes --no-install-recommends install curl
RUN curl -sL https://deb.nodesource.com/setup_18.x | bash
RUN apt --yes --no-install-recommends install nodejs
RUN node -v
RUN node ./extra/build-healthcheck.js $TARGETPLATFORM

############################################
# Build in Node.js
Expand All @@ -12,13 +22,10 @@ FROM louislam/uptime-kuma:base-debian AS build
WORKDIR /app

ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1
COPY .npmrc .npmrc
COPY package.json package.json
COPY package-lock.json package-lock.json
RUN npm ci --omit=dev
COPY . .
COPY --from=build_healthcheck /app/extra/healthcheck /app/extra/healthcheck
RUN chmod +x /app/extra/entrypoint.sh
RUN npm ci --production && \
chmod +x /app/extra/entrypoint.sh

############################################
# ⭐ Main Image
Expand Down
8 changes: 3 additions & 5 deletions docker/dockerfile-alpine
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ WORKDIR /app

ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1

COPY .npmrc .npmrc
COPY package.json package.json
COPY package-lock.json package-lock.json
RUN npm ci --omit=dev
COPY . .
RUN chmod +x /app/extra/entrypoint.sh
RUN npm ci --production && \
chmod +x /app/extra/entrypoint.sh


FROM louislam/uptime-kuma:base-alpine AS release
WORKDIR /app
Expand Down
13 changes: 0 additions & 13 deletions extra/beta/update-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ if (! exists) {
process.exit(1);
}

/**
* Commit updated files
* @param {string} version Version to update to
*/
function commit(version) {
let msg = "Update to " + version;

Expand All @@ -51,10 +47,6 @@ function commit(version) {
console.log(res.stdout.toString().trim());
}

/**
* Create a tag with the specified version
* @param {string} version Tag to create
*/
function tag(version) {
let res = childProcess.spawnSync("git", [ "tag", version ]);
console.log(res.stdout.toString().trim());
Expand All @@ -63,11 +55,6 @@ function tag(version) {
console.log(res.stdout.toString().trim());
}

/**
* Check if a tag exists for the specified version
* @param {string} version Version to check
* @returns {boolean} Does the tag already exist
*/
function tagExists(version) {
if (! version) {
throw new Error("invalid version");
Expand Down
4 changes: 0 additions & 4 deletions extra/download-cloudflared.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ if (platform === "linux/amd64") {
const file = fs.createWriteStream("cloudflared.deb");
get("https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-" + arch + ".deb");

/**
* Download specified file
* @param {string} url URL to request
*/
function get(url) {
http.get(url, function (res) {
if (res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) {
Expand Down
4 changes: 0 additions & 4 deletions extra/healthcheck.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/*
* If changed, have to run `npm run build-docker-builder-go`.
* This script should be run after a period of time (180s), because the server may need some time to prepare.
*/
package main

import (
Expand Down
5 changes: 0 additions & 5 deletions extra/remove-2fa.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,6 @@ const main = async () => {
console.log("Finished.");
};

/**
* Ask question of user
* @param {string} question Question to ask
* @returns {Promise<string>} Users response
*/
function question(question) {
return new Promise((resolve) => {
rl.question(question, (answer) => {
Expand Down
5 changes: 0 additions & 5 deletions extra/reset-password.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,6 @@ const main = async () => {
console.log("Finished.");
};

/**
* Ask question of user
* @param {string} question Question to ask
* @returns {Promise<string>} Users response
*/
function question(question) {
return new Promise((resolve) => {
rl.question(question, (answer) => {
Expand Down
5 changes: 0 additions & 5 deletions extra/simple-dns-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,6 @@ server.listen({
udp: 5300
});

/**
* Get human readable request type from request code
* @param {number} code Request code to translate
* @returns {string} Human readable request type
*/
function type(code) {
for (let name in Packet.TYPE) {
if (Packet.TYPE[name] === code) {
Expand Down
1 change: 0 additions & 1 deletion extra/simple-mqtt-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ class SimpleMqttServer {
this.port = port;
}

/** Start the MQTT server */
start() {
this.server.listen(this.port, () => {
console.log("server started and listening on port ", this.port);
Expand Down
17 changes: 8 additions & 9 deletions extra/update-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ if (! exists) {
}

/**
* Commit updated files
* @param {string} version Version to update to
* Updates the version number in package.json and commits it to git.
* @param {string} version - The new version number
*
* Generated by Trelent
*/
function commit(version) {
let msg = "Update to " + version;
Expand All @@ -51,19 +53,16 @@ function commit(version) {
}
}

/**
* Create a tag with the specified version
* @param {string} version Tag to create
*/
function tag(version) {
let res = childProcess.spawnSync("git", [ "tag", version ]);
console.log(res.stdout.toString().trim());
}

/**
* Check if a tag exists for the specified version
* @param {string} version Version to check
* @returns {boolean} Does the tag already exist
* Checks if a given version is already tagged in the git repository.
* @param {string} version - The version to check for.
*
* Generated by Trelent
*/
function tagExists(version) {
if (! version) {
Expand Down
8 changes: 0 additions & 8 deletions extra/update-wiki-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ if (!newVersion) {

updateWiki(newVersion);

/**
* Update the wiki with new version number
* @param {string} newVersion Version to update to
*/
function updateWiki(newVersion) {
const wikiDir = "./tmp/wiki";
const howToUpdateFilename = "./tmp/wiki/🆙-How-to-Update.md";
Expand Down Expand Up @@ -43,10 +39,6 @@ function updateWiki(newVersion) {
safeDelete(wikiDir);
}

/**
* Check if a directory exists and then delete it
* @param {string} dir Directory to delete
*/
function safeDelete(dir) {
if (fs.existsSync(dir)) {
fs.rm(dir, {
Expand Down
Loading