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

fixed the IABOT status messages clearer #118

Open
wants to merge 1 commit 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
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 23 additions & 9 deletions src/components/Checkbox.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,26 @@
import React from "react";

export default function Checkbox ( { label, value, onChange, className='', tooltipId=null, tooltipContent=null }) {
return <label className={`${className} ${tooltipContent ? "tooltip-active" : ''}`}
data-tooltip-id={tooltipId}
data-tooltip-html={tooltipContent}
><input
type="checkbox"
checked={value}
onChange={onChange}
/>{label}</label>
export default function Checkbox({
label,
value,
onChange,
className = "",
tooltipId = null,
tooltipContent = null,
}) {
// Determine the status message based on the checkbox value
const statusMessage = value ? "Permalive" : "Permadead";

return (
<label
className={`${className} ${tooltipContent ? "tooltip-active" : ""}`}
data-tooltip-id={tooltipId}
data-tooltip-html={tooltipContent}
>
<input type="checkbox" checked={value} onChange={onChange} />
{label}
{/* Display the status message */}
<span className="status-message"> ({statusMessage})</span>
</label>
);
}
75 changes: 46 additions & 29 deletions src/constants/endpoints.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,52 @@

// export const IARI_V2_URL_BASE = 'https://archive.org/services/context/iari-prod/v2';
// export const API_V2_STAGE_URL_BASE = 'https://archive.org/services/context/iari/v2stage';

export const IariSources = {
iari: {
key: 'iari',
caption: 'IARI',
proxy: 'https://archive.org/services/context/iari/v2',
iari: {
key: "iari",
caption: "IARI",
proxy: "https://archive.org/services/context/iari/v2",
statusMessages: {
permalive: "IARI is fully operational and responding to requests.",
permadead:
"IARI is currently unavailable and not responding to requests.",
},
iari_prod: {
key: 'iari_prod',
caption: 'IARI Prod',
// proxy: 'https://archive.org/services/context/iari-prod/v2',
proxy: 'https://iabot-api.archive.org/services/context/iari-prod/v2',
},
iari_prod: {
key: "iari_prod",
caption: "IARI Prod",
proxy: "https://iabot-api.archive.org/services/context/iari-prod/v2",
statusMessages: {
permalive: "IARI Prod is fully operational and responding to requests.",
permadead:
"IARI Prod is currently unavailable and not responding to requests.",
},
iari_stage: {
key: 'iari_stage',
caption: 'IARI Stage',
// proxy: 'https://archive.org/services/context/iari-stage/v2',
proxy: 'https://iabot-api.archive.org/services/context/iari-stage/v2',
},
iari_stage: {
key: "iari_stage",
caption: "IARI Stage",
proxy: "https://iabot-api.archive.org/services/context/iari-stage/v2",
statusMessages: {
permalive: "IARI Stage is fully operational and responding to requests.",
permadead:
"IARI Stage is currently unavailable and not responding to requests.",
},
iari_test: {
key: 'iari_test',
caption: 'IARI Test',
// proxy: 'https://archive.org/services/context/iari-test/v2',
proxy: 'https://iabot-api.archive.org/services/context/iari-test/v2',
},
iari_test: {
key: "iari_test",
caption: "IARI Test",
proxy: "https://iabot-api.archive.org/services/context/iari-test/v2",
statusMessages: {
permalive: "IARI Test is fully operational and responding to requests.",
permadead:
"IARI Test is currently unavailable and not responding to requests.",
},
iari_local: {
key: 'iari_local',
caption: 'IARI Local',
proxy: 'http://localhost:5000/v2',
},
iari_local: {
key: "iari_local",
caption: "IARI Local",
proxy: "http://localhost:5000/v2",
statusMessages: {
permalive: "IARI Local is fully operational and responding to requests.",
permadead:
"IARI Local is currently unavailable and not responding to requests.",
},
}

},
};
Loading