From c8e05d2c08fb64d0275d8694a7c768a1be49a977 Mon Sep 17 00:00:00 2001 From: kira1928 Date: Fri, 20 Jan 2023 22:39:35 +0900 Subject: [PATCH] add copy-live-info-to-clipboard button. (#344) --- src/webapp/src/component/live-info/index.tsx | 40 +++++++++++++++++++- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/src/webapp/src/component/live-info/index.tsx b/src/webapp/src/component/live-info/index.tsx index b641ff76..8a1ab785 100644 --- a/src/webapp/src/component/live-info/index.tsx +++ b/src/webapp/src/component/live-info/index.tsx @@ -1,7 +1,10 @@ import React from "react"; import API from '../../utils/api'; -import { PageHeader } from 'antd'; -import { Descriptions } from 'antd'; +import { + PageHeader, + Descriptions, + Button +} from 'antd'; const api = new API(); @@ -52,6 +55,18 @@ class LiveInfo extends React.Component { }) } + getTextForCopy(): string { + return ` +App Name: ${this.state.appVersion} +App Version: ${this.state.appVersion} +Build Time: ${this.state.buildTime} +Pid: ${this.state.pid} +Platform: ${this.state.platform} +Go Version: ${this.state.goVersion} +Git Hash: ${this.state.gitHash} +`; + } + render() { return (
@@ -71,6 +86,27 @@ class LiveInfo extends React.Component { {this.state.goVersion} {this.state.gitHash} +
) }