Просмотр исходного кода

Merge pull request #760 from porter-dev/master

Merge styling fixes
jusrhee 5 лет назад
Родитель
Сommit
d938ffc8d9

+ 13 - 1
dashboard/src/components/CopyToClipboard.tsx

@@ -3,6 +3,7 @@ import ClipboardJS from "clipboard";
 import React, { Component, RefObject } from "react";
 import React, { Component, RefObject } from "react";
 import Tooltip from "@material-ui/core/Tooltip";
 import Tooltip from "@material-ui/core/Tooltip";
 import styled from "styled-components";
 import styled from "styled-components";
+import { styled as materialStyled } from "@material-ui/core/styles";
 
 
 type PropsType = {
 type PropsType = {
   text: string;
   text: string;
@@ -79,7 +80,18 @@ export default class CopyToClipboard extends Component<PropsType, StateType> {
   render() {
   render() {
     return (
     return (
       <Tooltip
       <Tooltip
-        title="Copied to clipboard!"
+        title={
+          <div
+            style={{
+              fontFamily: "Work Sans, sans-serif",
+              fontSize: "12px",
+              fontWeight: "normal",
+              padding: "5px 6px",
+            }}
+          >
+            Copied to clipboard
+          </div>
+        }
         open={this.state.success}
         open={this.state.success}
         placement="bottom"
         placement="bottom"
         arrow
         arrow

+ 3 - 1
dashboard/src/main/home/dashboard/ClusterList.tsx

@@ -268,7 +268,8 @@ const DashboardIcon = styled.div`
 
 
 const TemplateTitle = styled.div`
 const TemplateTitle = styled.div`
   margin-bottom: 0px;
   margin-bottom: 0px;
-  width: 80%;
+  margin-top: 13px;
+  width: 100%;
   text-align: center;
   text-align: center;
   font-size: 14px;
   font-size: 14px;
   white-space: nowrap;
   white-space: nowrap;
@@ -362,6 +363,7 @@ const Url = styled.a`
   width: 100%;
   width: 100%;
   font-size: 13px;
   font-size: 13px;
   user-select: text;
   user-select: text;
+  font-weight: 400;
   display: flex;
   display: flex;
   align-items: center;
   align-items: center;
   justify-content: center;
   justify-content: center;

+ 12 - 2
dashboard/src/main/home/launch/expanded-template/LaunchTemplate.tsx

@@ -181,8 +181,18 @@ class LaunchTemplate extends Component<PropsType, StateType> {
         });
         });
       })
       })
       .catch((err) => {
       .catch((err) => {
-        this.setState({ saveValuesStatus: "error" });
-        setCurrentError(err.response.data.errors[0]);
+        let parsedErr =
+          err?.response?.data?.errors && err.response.data.errors[0];
+        if (parsedErr) {
+          err = parsedErr;
+        }
+
+        this.setState({
+          saveValuesStatus: parsedErr,
+        });
+
+        setCurrentError(err);
+
         window.analytics.track("Failed to Deploy Add-on", {
         window.analytics.track("Failed to Deploy Add-on", {
           name: this.props.currentTemplate.name,
           name: this.props.currentTemplate.name,
           namespace: this.state.selectedNamespace,
           namespace: this.state.selectedNamespace,

+ 2 - 2
dashboard/src/main/home/launch/launch-flow/LaunchFlow.tsx

@@ -188,7 +188,7 @@ class LaunchFlow extends Component<PropsType, StateType> {
         this.setState({
         this.setState({
           saveValuesStatus: parsedErr,
           saveValuesStatus: parsedErr,
         });
         });
-        setCurrentError(err.response.data.errors[0]);
+        setCurrentError(err);
         window.analytics.track("Failed to Deploy Add-on", {
         window.analytics.track("Failed to Deploy Add-on", {
           name: this.props.currentTemplate.name,
           name: this.props.currentTemplate.name,
           namespace: selectedNamespace,
           namespace: selectedNamespace,
@@ -274,7 +274,7 @@ class LaunchFlow extends Component<PropsType, StateType> {
               }
               }
             )
             )
             .then((res) => {
             .then((res) => {
-              resolve(res.data?.external_url);
+              resolve(res?.data?.external_url);
             })
             })
             .catch((err) => {
             .catch((err) => {
               let parsedErr =
               let parsedErr =

+ 2 - 2
dashboard/src/shared/types.tsx

@@ -9,12 +9,12 @@ export interface ClusterType {
 
 
 export interface DetailedClusterType extends ClusterType {
 export interface DetailedClusterType extends ClusterType {
   ingress_ip?: string;
   ingress_ip?: string;
-  ingress_error?: DetailedIngressError
+  ingress_error?: DetailedIngressError;
 }
 }
 
 
 export interface DetailedIngressError {
 export interface DetailedIngressError {
   message: string;
   message: string;
-  error: string
+  error: string;
 }
 }
 
 
 export interface ChartType {
 export interface ChartType {

+ 27 - 0
docs/guides/advanced-nginx-settings.md

@@ -0,0 +1,27 @@
+> 🚧
+>
+> **Note:** these advanced configuration will only work if you've set up a [custom domain](https://docs.getporter.dev/docs/https-and-custom-domains). They will not work on `*.porter.run` domains. 
+
+Every cluster provisioned by Porter by default uses an NGINX [ingress controller](https://kubernetes.github.io/ingress-nginx) to connect your web applications to the internet. There are different options for customizing the NGINX configuration that a specific application uses. 
+
+Most of the time, you can customize the NGINX configuration by adding an "Ingress Annotation" when deploying a web service. This can be found in the "Advanced" tab of the web template:
+
+![Advanced tab ingress](https://files.readme.io/fcfa8a2-Screen_Shot_2021-06-02_at_5.15.26_PM.png "Screen Shot 2021-06-02 at 5.15.26 PM.png")
+
+To add an annotation, simply click "Add row" and add key-value pairs for the annotation. 
+
+> 📘
+>
+> **Note:** this document attempts to cover the most common use-cases. To view the full list of annotations, [go here](https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations).
+
+# NGINX Settings Options
+
+## Client Max Body Size 
+
+If you are getting undesired `413 Request Entity Too Large` errors, you can increase the maximum size of the client request by setting the field [client_max_body_size](http://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size). You can do this by adding the following annotation:
+
+```yaml
+nginx.ingress.kubernetes.io/proxy-body-size: 8m
+```
+
+This will set the maximum client request body size to 8 megabytes. [Read more about NGINX units](http://nginx.org/en/docs/syntax.html).

+ 1 - 1
server/api/oauth_google_handler.go

@@ -145,7 +145,7 @@ func (app *App) upsertGoogleUserFromToken(tok *oauth2.Token) (*models.User, erro
 
 
 	// if the app has a restricted domain, check the `hd` query param
 	// if the app has a restricted domain, check the `hd` query param
 	if app.ServerConf.GoogleRestrictedDomain != "" {
 	if app.ServerConf.GoogleRestrictedDomain != "" {
-		if gInfo.HD != "bloomchat.app" {
+		if gInfo.HD != app.ServerConf.GoogleRestrictedDomain {
 			return nil, fmt.Errorf("Email is not in the restricted domain group.")
 			return nil, fmt.Errorf("Email is not in the restricted domain group.")
 		}
 		}
 	}
 	}