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

Update sevrets #107

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

63 changes: 40 additions & 23 deletions config.yaml
Original file line number Diff line number Diff line change
@@ -1,37 +1,54 @@
settings:
title: 'Status Page'
url: 'https://status-page.eidam.dev' # used for Slack messages
title: 'Cotpear Status Page'
url: 'https://status.cotpear.com' # used for Slack messages
logo: logo-192x192.png # image in ./public/ folder
daysInHistogram: 90 # number of days you want to display in histogram
collectResponseTimes: true # collects avg response times from CRON locations

allmonitorsOperational: 'All Systems Operational'
notAllmonitorsOperational: 'Not All Systems Operational'
monitorLabelOperational: 'Operational'
monitorLabelNotOperational: 'Not Operational'
monitorLabelNoData: 'No data'
dayInHistogramNoData: 'No data'
dayInHistogramOperational: 'All good'
dayInHistogramNotOperational: ' incident(s)' # xx incident(s) recorded
allmonitorsOperational: '所有站點運作良好'
notAllmonitorsOperational: '部分站點運作有異'
monitorLabelOperational: '良好'
monitorLabelNotOperational: '有狀況'
monitorLabelNoData: '無資料'
dayInHistogramNoData: '無資料'
dayInHistogramOperational: '一切良好'
dayInHistogramNotOperational: ' 個事件' # xx incident(s) recorded

monitors:
- id: workers-cloudflare-com # unique identifier
name: workers.cloudflare.com
description: 'You write code. They handle the rest.' # default=empty
url: 'https://workers.cloudflare.com/' # URL to fetch
- id: www-cotpear-com # unique identifier
name: 首頁 - https://www.cotpear.com
description: 'Cotpear 主頁' # default=empty
url: 'https://www.cotpear.com/' # URL to fetch
method: GET # default=GET
expectStatus: 200 # operational status, default=200
followRedirect: false # should fetch follow redirects, default=false

- id: www-cloudflare-com
name: www.cloudflare.com
description: 'Built for anything connected to the Internet.'
url: 'https://www.cloudflare.com'

- id: go-cotpear-com # unique identifier
name: 短連結服務 - go.cotpear.com
description: '短連結服務(非公用服務)' # default=empty
url: 'https://go.cotpear.com/status' # URL to fetch
method: GET # default=GET
expectStatus: 404 # operational status, default=200
followRedirect: false # should fetch follow redirects, default=false

- id: pwd-cotpear-com
name: 密碼管理器 - https://pwd.cotpear.com
description: 'Cotpear 密碼管理器'
url: 'https://pwd.cotpear.com'
method: GET
expectStatus: 200

- id: blog-cloudflare-com
name: The Cloudflare Blog
url: 'https://blog.cloudflare.com/'

- id: policies-cotpear-com
name: Cotpear 隱私權與政策 - https://policies.cotpear.com
description: 'Cotpear 隱私權與政策'
url: 'https://policies.cotpear.com'
method: GET
expectStatus: 200

- id: yi_chi-cotpear-com
name: Yi Chi Profile - https://yi-chi.cotpear.com
description: '關於我 - 齊一個人頁面'
url: 'https://yi-chi.cotpear.com'
method: GET
expectStatus: 200

5 changes: 3 additions & 2 deletions pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,21 +90,22 @@ export default function Index({ config, kvMonitors, kvMonitorsLastUpdate }) {
})}
<div className="flex flex-row justify-between mt-4 text-sm">
<div>
Powered by{' '}
技術是由{' '}
<a href="https://workers.cloudflare.com/" target="_blank">
Cloudflare Workers{' '}
</a>
&{' '}
<a href="https://flareact.com/" target="_blank">
Flareact{' '}
</a>
提供。
</div>
<div>
<a
href="https://github.com/eidam/cf-workers-status-page"
target="_blank"
>
Get Your Status Page
部署一個您自己的狀態頁面
</a>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/components/monitorCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ export default function MonitorCard({ key, monitor, data }) {
<MonitorHistogram monitorId={monitor.id} kvMonitor={data} />

<div className="flex flex-row justify-between items-center text-gray-400 text-sm">
<div>{config.settings.daysInHistogram} days ago</div>
<div>Today</div>
<div>{config.settings.daysInHistogram} 天前</div>
<div>今天</div>
</div>
</div>
)
Expand Down
7 changes: 3 additions & 4 deletions src/components/monitorStatusHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@ export default function MonitorStatusHeader({ kvMonitorsLastUpdate }) {
<div>{text}</div>
{kvMonitorsLastUpdate.time && typeof window !== 'undefined' && (
<div className="text-xs font-light">
checked{' '}
{Math.round((Date.now() - kvMonitorsLastUpdate.time) / 1000)} sec
ago (from{' '}
{locations[kvMonitorsLastUpdate.loc] || kvMonitorsLastUpdate.loc})
於{' '}
{Math.round((Date.now() - kvMonitorsLastUpdate.time) / 1000)} 秒前檢查
(位置: {' '}{locations[kvMonitorsLastUpdate.loc] || kvMonitorsLastUpdate.loc})
</div>
)}
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/monitorStatusLabel.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const classes = {

export default function MonitorStatusLabel({ kvMonitor }) {
let color = 'gray'
let text = 'No data'
let text = '無資料'

if (typeof kvMonitor !== 'undefined') {
if (kvMonitor.lastCheck.operational) {
Expand Down
8 changes: 4 additions & 4 deletions src/functions/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { useEffect, useState } from 'react'
const kvDataKey = 'monitors_data_v1_1'

export const locations = {
WAW: 'Warsaw',
SCL: 'Santiago de Chile',
MEL: 'Melbourne',
SIN: 'Singapore',
WAW: '華沙',
SCL: '聖地牙哥',
MEL: '墨爾本',
SIN: '新加坡',
}

export async function getKVMonitors() {
Expand Down
2 changes: 1 addition & 1 deletion wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ type = "webpack"
webpack_config = "node_modules/flareact/webpack"

[triggers]
crons = ["* * * * *"]
crons = ["*/15 * * * *"]

[site]
bucket = "out"
Expand Down