Skip to content

Commit

Permalink
Merge pull request #227 from Thiht/minor-improvements
Browse files Browse the repository at this point in the history
Minor improvements
  • Loading branch information
Thiht authored Nov 14, 2021
2 parents a0773a8 + aa279bc commit f588c98
Show file tree
Hide file tree
Showing 28 changed files with 29 additions and 6 deletions.
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ check-default-ports:
@lsof -i:8080 > /dev/null && (echo "Port 8080 already in use"; exit 1) || true
@lsof -i:8081 > /dev/null && (echo "Port 8081 already in use"; exit 1) || true

.PHONY: optimize
optimize:
find client/assets/ -iname '*.png' -print0 | xargs -0 -n1 optipng -strip all
find docs/ -iname '*.png' -print0 | xargs -0 -n1 optipng -strip all

# The following targets are only available for CI usage

build/smocker.tar.gz:
Expand Down
Binary file modified client/assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/assets/logo180.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 16 additions & 3 deletions client/components/History.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
Typography,
} from "antd";
import dayjs from "dayjs";
import { getReasonPhrase } from "http-status-codes";
import yaml from "js-yaml";
import orderBy from "lodash/orderBy";
import * as React from "react";
Expand Down Expand Up @@ -65,6 +66,16 @@ const EntryComponent = React.memo(
responseStatusColor = "orange";
}
}

let responseStatusTitle = "Unknown HTTP status code";
try {
responseStatusTitle = getReasonPhrase(value.response.status);
} catch {
if (value.response.status >= 600) {
responseStatusTitle = "Smocker error";
}
}

return (
<div className="entry">
<div className="request">
Expand Down Expand Up @@ -104,8 +115,10 @@ const EntryComponent = React.memo(
<div className="response">
<div className="details">
{value.context.mock_type === "proxy" && <Tag>Proxified</Tag>}
<Tag color={responseStatusColor}>{value.response.status}</Tag>
{value.response.status > 600 && (
<Tag color={responseStatusColor} title={responseStatusTitle}>
{value.response.status}
</Tag>
{value.response.status >= 600 && (
<Typography.Text
className="error"
ellipsis
Expand All @@ -129,7 +142,7 @@ const EntryComponent = React.memo(
<Link to="/pages/mocks" onClick={handleDisplayNewMock}>
<Button block type="dashed">
<PlusCircleOutlined />
{value.response.status > 600
{value.response.status >= 600
? "Create a new mock from request"
: "Create a new mock from entry"}
</Button>
Expand Down
2 changes: 1 addition & 1 deletion client/components/Navbar.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Layout, Menu, Row } from "antd";
import * as React from "react";
import { Link, useLocation } from "react-router-dom";
import Logo from "../assets/logo.png";
import Logo from "../assets/logo180.png";
import { cleanQueryParams } from "../modules/utils";
import "./Navbar.scss";

Expand Down
9 changes: 7 additions & 2 deletions client/index.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="./assets/favicon.ico" />
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<meta
name="description"
content="Smocker is a simple and efficient HTTP mock server"
/>
<link rel="apple-touch-icon" href="./assets/logo180.png" />
<title>Smocker</title>
<base href="{{.basePath}}" />
<link rel="stylesheet" href="npm:antd/dist/antd.css" />
Expand Down
Binary file modified docs/.vuepress/public/logo/cover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/.vuepress/public/logo/favicon/android-chrome-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/.vuepress/public/logo/favicon/android-chrome-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/.vuepress/public/logo/favicon/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/.vuepress/public/logo/favicon/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/.vuepress/public/logo/favicon/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/.vuepress/public/logo/favicon/mstile-150x150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/.vuepress/public/logo/logo-h280.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/.vuepress/public/logo/logo-h50.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/.vuepress/public/logo/logo-horizontal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/.vuepress/public/logo/logo-vertical.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/.vuepress/public/logo/logo-w500.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/.vuepress/public/screenshots/screenshot-add-mocks.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/.vuepress/public/screenshots/screenshot-empty-history.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/.vuepress/public/screenshots/screenshot-empty-mocks.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/.vuepress/public/screenshots/screenshot-history-666.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/.vuepress/public/screenshots/screenshot-history.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/.vuepress/public/screenshots/screenshot-mocks.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/.vuepress/public/screenshots/screenshot-sessions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f588c98

Please sign in to comment.