-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #82 from ligangty/2.0-refactor
Re-organize: move pages conponent to dedicated folders
- Loading branch information
Showing
13 changed files
with
254 additions
and
237 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
117 changes: 117 additions & 0 deletions
117
src/main/webui/src/app/components/content/common/StoreBasicSections.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
/** | ||
* Copyright (C) 2023 Red Hat, Inc. (https://github.com/Commonjava/indy-ui-service) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import React from 'react'; | ||
import {PropTypes} from 'prop-types'; | ||
import {DisableTimeoutHint, PrefetchHint, Hint} from './Hints.jsx'; | ||
import {Filters} from '../../../utils/Filters.js'; | ||
import {Utils} from '../../../utils/AppUtils.js'; | ||
import {TimeUtils} from '../../../utils/TimeUtils.js'; | ||
|
||
export const StoreViewBasicSection = ({store})=>{ | ||
let authoritativeIndexHints = "Make the content index authoritative to this repository"; | ||
if(store.type==="hosted"){ | ||
authoritativeIndexHints += " (when readonly, this will be enabled automatically)"; | ||
} | ||
return <div className="fieldset"> | ||
<div className="detail-field"> | ||
<label>Package Type:</label> | ||
<span className="key">{store.packageType}</span> | ||
</div> | ||
<div className="detail-field"> | ||
<label>Name:</label> | ||
<span className="key">{store.name}</span> | ||
</div> | ||
<div className="detail-field"> | ||
<span>{Filters.checkmark(!store.disabled)}</span> | ||
<label>Enabled?</label> | ||
{ | ||
store.disabled && store.disableExpiration && | ||
<span className="hint">Set to automatically re-enable at {TimeUtils.timestampToDateFormat(store.disableExpiration)}</span> | ||
} | ||
</div> | ||
<div className="detail-field"> | ||
<span>{Filters.checkmark(store.authoritative_index)}</span> | ||
<label>Authoritative index enabled?</label> | ||
{ | ||
(store.type==="remote" || store.type==="hosted") && !store.authoritative_index && | ||
<span className="hint">{authoritativeIndexHints}</span> | ||
} | ||
</div> | ||
<div className="sub-fields"> | ||
<div className="detail-field"> | ||
<label>Disable Timeout:</label> | ||
<span>{store.disable_timeout}</span> | ||
<DisableTimeoutHint /> | ||
</div> | ||
</div> | ||
<div className="detail-field"> | ||
<label>Local URL:</label> | ||
{ | ||
// TODO: is this store.demo still available now? | ||
store.demo ? | ||
<span>{Utils.storeHref(store.key)}</span> : | ||
<span><a href={Utils.storeHref(store.key)} target="_new">{Utils.storeHref(store.key)}</a></span> | ||
} | ||
</div> | ||
<div className="detail-field"> | ||
<label>Remote URL:</label> | ||
<span><a href={store.url} target="_new">{store.url}</a></span> | ||
</div> | ||
<div className="sub-fields"> | ||
<div className="detail-field"> | ||
<span>{Filters.checkmark(!store.is_passthrough)}</span> | ||
<label>Allow Content Caching</label> | ||
<span><Hint hintKey="passthrough" /></span> | ||
</div> | ||
{ | ||
!store.is_passthrough && | ||
|
||
<div> | ||
<div className="detail-field"> | ||
<label>Content Cache Timeout:</label> | ||
<span>{TimeUtils.secondsToDuration(store.cache_timeout_seconds)}</span> | ||
</div> | ||
<div className="detail-field"> | ||
<label>Metadata Cache Timeout:</label> | ||
<span>{TimeUtils.secondsToDuration(store.metadata_timeout_seconds, true)}</span> | ||
</div> | ||
</div> | ||
|
||
} | ||
</div> | ||
|
||
<div className="sub-fields"> | ||
<div className="detail-field"> | ||
<label>Pre-fetching Priority:</label> | ||
<span>{store.prefetch_priority}</span> | ||
<PrefetchHint /> | ||
</div> | ||
<div className="detail-field"> | ||
<span>{Filters.checkmark(store.prefetch_rescan)}</span> | ||
<label>Allow Pre-fetching Rescan?</label> | ||
</div> | ||
<div className="detail-field"> | ||
<label>Pre-fetching Listing Type:</label> | ||
<span>{store.prefetch_listing_type}</span> | ||
</div> | ||
</div> | ||
</div>; | ||
}; | ||
|
||
StoreViewBasicSection.propTypes = { | ||
store: PropTypes.object.isRequired | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.