-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnetlify-screen-plugin.js
73 lines (68 loc) · 1.56 KB
/
netlify-screen-plugin.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import React, { useEffect, useState } from "react"
export const NetlifyScreenPlugin = {
__type: "screen",
name: "Netlify",
label: "Netlify",
// layout: "fullscreen",
Icon: () => null,
Component: NetlifyScreen,
}
function NetlifyScreen() {
const [site, setSite] = useState({ build_settings: {} })
useEffect(() => {
fetch("/netlify").then(async site => {
setSite(await site.json())
})
}, [])
return (
<div>
<ul>
<li>
<a href={site.admin_url} target="_blank">
Admin
</a>
</li>
<li>
<a href={site.ssl_url} target="_blank">
{site.ssl_url}
</a>
</li>
</ul>
<h2>Build Settings</h2>
<table>
<thead>
<th>
<td>Setting</td>
<td>Value</td>
</th>
</thead>
<tbody>
<tr>
<td>Command</td>
<td>{site.build_settings.cmd}</td>
</tr>
<tr>
<td>Command</td>
<td>{site.build_settings.cmd}</td>
</tr>
<tr>
<td>dir</td>
<td>{site.build_settings.dir}</td>
</tr>
<tr>
<td>Repository</td>
<td>
<a href={site.build_settings.repo_url} target="_blank">
{site.build_settings.repo_path}
</a>
</td>
</tr>
<tr>
<td>Branch</td>
<td>{site.build_settings.repo_branch}</td>
</tr>
</tbody>
</table>
</div>
)
}