dstack 0.19.12rc1__py3-none-any.whl → 0.19.13__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of dstack might be problematic. Click here for more details.
- dstack/_internal/cli/services/configurators/run.py +43 -47
- dstack/_internal/cli/utils/run.py +15 -27
- dstack/_internal/core/backends/aws/compute.py +22 -9
- dstack/_internal/core/backends/aws/resources.py +26 -0
- dstack/_internal/core/backends/base/offers.py +0 -1
- dstack/_internal/core/backends/template/configurator.py.jinja +1 -6
- dstack/_internal/core/backends/template/models.py.jinja +4 -0
- dstack/_internal/core/compatibility/__init__.py +0 -0
- dstack/_internal/core/compatibility/fleets.py +72 -0
- dstack/_internal/core/compatibility/gateways.py +34 -0
- dstack/_internal/core/compatibility/runs.py +125 -0
- dstack/_internal/core/compatibility/volumes.py +32 -0
- dstack/_internal/core/models/configurations.py +1 -1
- dstack/_internal/core/models/fleets.py +6 -1
- dstack/_internal/core/models/instances.py +51 -12
- dstack/_internal/core/models/profiles.py +43 -3
- dstack/_internal/core/models/repos/local.py +3 -3
- dstack/_internal/core/models/runs.py +118 -44
- dstack/_internal/server/app.py +1 -1
- dstack/_internal/server/background/tasks/process_running_jobs.py +47 -12
- dstack/_internal/server/background/tasks/process_runs.py +14 -1
- dstack/_internal/server/services/runner/client.py +4 -1
- dstack/_internal/server/services/storage/__init__.py +38 -0
- dstack/_internal/server/services/storage/base.py +27 -0
- dstack/_internal/server/services/storage/gcs.py +44 -0
- dstack/_internal/server/services/{storage.py → storage/s3.py} +4 -27
- dstack/_internal/server/settings.py +7 -3
- dstack/_internal/server/statics/index.html +1 -1
- dstack/_internal/server/statics/{main-5b9786c955b42bf93581.js → main-2066f1f22ddb4557bcde.js} +1677 -46
- dstack/_internal/server/statics/{main-5b9786c955b42bf93581.js.map → main-2066f1f22ddb4557bcde.js.map} +1 -1
- dstack/_internal/server/statics/{main-8f9c66f404e9c7e7e020.css → main-f39c418b05fe14772dd8.css} +1 -1
- dstack/_internal/server/testing/common.py +2 -1
- dstack/_internal/utils/common.py +4 -0
- dstack/api/server/_fleets.py +9 -69
- dstack/api/server/_gateways.py +3 -14
- dstack/api/server/_runs.py +4 -116
- dstack/api/server/_volumes.py +3 -14
- dstack/plugins/builtin/rest_plugin/_plugin.py +24 -5
- dstack/version.py +2 -2
- {dstack-0.19.12rc1.dist-info → dstack-0.19.13.dist-info}/METADATA +1 -1
- {dstack-0.19.12rc1.dist-info → dstack-0.19.13.dist-info}/RECORD +44 -36
- {dstack-0.19.12rc1.dist-info → dstack-0.19.13.dist-info}/WHEEL +0 -0
- {dstack-0.19.12rc1.dist-info → dstack-0.19.13.dist-info}/entry_points.txt +0 -0
- {dstack-0.19.12rc1.dist-info → dstack-0.19.13.dist-info}/licenses/LICENSE.md +0 -0
dstack/_internal/server/statics/{main-5b9786c955b42bf93581.js → main-2066f1f22ddb4557bcde.js}
RENAMED
|
@@ -112839,6 +112839,1590 @@ function src_LineChart(_a) {
|
|
|
112839
112839
|
src_applyDisplayName(src_LineChart, 'LineChart');
|
|
112840
112840
|
/* harmony default export */ const src_line_chart = (src_LineChart);
|
|
112841
112841
|
//# sourceMappingURL=index.js.map
|
|
112842
|
+
;// ./node_modules/@cloudscape-design/components/property-filter/utils.js
|
|
112843
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
112844
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
112845
|
+
// Finds the longest property the filtering text starts from.
|
|
112846
|
+
function src_matchFilteringProperty(filteringProperties, filteringText) {
|
|
112847
|
+
let maxLength = 0;
|
|
112848
|
+
let matchedProperty = null;
|
|
112849
|
+
for (const property of filteringProperties) {
|
|
112850
|
+
if ((property.propertyLabel.length >= maxLength && src_startsWith(filteringText, property.propertyLabel)) ||
|
|
112851
|
+
(property.propertyLabel.length > maxLength &&
|
|
112852
|
+
src_startsWith(filteringText.toLowerCase(), property.propertyLabel.toLowerCase()))) {
|
|
112853
|
+
maxLength = property.propertyLabel.length;
|
|
112854
|
+
matchedProperty = property;
|
|
112855
|
+
}
|
|
112856
|
+
}
|
|
112857
|
+
return matchedProperty;
|
|
112858
|
+
}
|
|
112859
|
+
// Finds the longest operator the filtering text starts from.
|
|
112860
|
+
function src_matchOperator(allowedOperators, filteringText) {
|
|
112861
|
+
filteringText = filteringText.toLowerCase();
|
|
112862
|
+
let maxLength = 0;
|
|
112863
|
+
let matchedOperator = null;
|
|
112864
|
+
for (const operator of allowedOperators) {
|
|
112865
|
+
if (operator.length > maxLength && src_startsWith(filteringText, operator.toLowerCase())) {
|
|
112866
|
+
maxLength = operator.length;
|
|
112867
|
+
matchedOperator = operator;
|
|
112868
|
+
}
|
|
112869
|
+
}
|
|
112870
|
+
return matchedOperator;
|
|
112871
|
+
}
|
|
112872
|
+
// Finds if the filtering text matches any operator prefix.
|
|
112873
|
+
function src_matchOperatorPrefix(allowedOperators, filteringText) {
|
|
112874
|
+
if (filteringText.trim().length === 0) {
|
|
112875
|
+
return '';
|
|
112876
|
+
}
|
|
112877
|
+
for (const operator of allowedOperators) {
|
|
112878
|
+
if (src_startsWith(operator.toLowerCase(), filteringText.toLowerCase())) {
|
|
112879
|
+
return filteringText;
|
|
112880
|
+
}
|
|
112881
|
+
}
|
|
112882
|
+
return null;
|
|
112883
|
+
}
|
|
112884
|
+
function src_matchTokenValue({ property, operator, value }, filteringOptions) {
|
|
112885
|
+
var _a, _b;
|
|
112886
|
+
const tokenType = property === null || property === void 0 ? void 0 : property.getTokenType(operator);
|
|
112887
|
+
const propertyOptions = filteringOptions.filter(option => option.property === property);
|
|
112888
|
+
const castValue = (value) => {
|
|
112889
|
+
if (value === null) {
|
|
112890
|
+
return tokenType === 'enum' ? [] : null;
|
|
112891
|
+
}
|
|
112892
|
+
return tokenType === 'enum' && !Array.isArray(value) ? [value] : value;
|
|
112893
|
+
};
|
|
112894
|
+
const bestMatch = { propertyKey: property === null || property === void 0 ? void 0 : property.propertyKey, operator, value: castValue(value) };
|
|
112895
|
+
for (const option of propertyOptions) {
|
|
112896
|
+
if ((option.label && option.label === value) || (!option.label && option.value === value)) {
|
|
112897
|
+
// exact match found: return it
|
|
112898
|
+
return { propertyKey: property === null || property === void 0 ? void 0 : property.propertyKey, operator, value: castValue(option.value) };
|
|
112899
|
+
}
|
|
112900
|
+
// By default, the token value is a string, but when a custom property is used,
|
|
112901
|
+
// the token value can be any, therefore we need to check for its type before calling toLowerCase()
|
|
112902
|
+
if (typeof value === 'string' && value.toLowerCase() === ((_b = (_a = option.label) !== null && _a !== void 0 ? _a : option.value) !== null && _b !== void 0 ? _b : '').toLowerCase()) {
|
|
112903
|
+
// non-exact match: save and keep running in case exact match found later
|
|
112904
|
+
bestMatch.value = castValue(option.value);
|
|
112905
|
+
}
|
|
112906
|
+
}
|
|
112907
|
+
return bestMatch;
|
|
112908
|
+
}
|
|
112909
|
+
function src_trimStart(source) {
|
|
112910
|
+
let spacesLength = 0;
|
|
112911
|
+
for (let i = 0; i < source.length; i++) {
|
|
112912
|
+
if (source[i] === ' ') {
|
|
112913
|
+
spacesLength++;
|
|
112914
|
+
}
|
|
112915
|
+
else {
|
|
112916
|
+
break;
|
|
112917
|
+
}
|
|
112918
|
+
}
|
|
112919
|
+
return source.slice(spacesLength);
|
|
112920
|
+
}
|
|
112921
|
+
function src_trimFirstSpace(source) {
|
|
112922
|
+
return source[0] === ' ' ? source.slice(1) : source;
|
|
112923
|
+
}
|
|
112924
|
+
function src_removeOperator(source, operator) {
|
|
112925
|
+
const operatorLastIndex = source.indexOf(operator) + operator.length;
|
|
112926
|
+
const textWithoutOperator = source.slice(operatorLastIndex);
|
|
112927
|
+
// We need to remove the first leading space in case the user presses space
|
|
112928
|
+
// after the operator, for example: Owner: admin, will result in value of ` admin`
|
|
112929
|
+
// and we need to remove the first space, if the user added any more spaces only the
|
|
112930
|
+
// first one will be removed.
|
|
112931
|
+
return src_trimFirstSpace(textWithoutOperator);
|
|
112932
|
+
}
|
|
112933
|
+
function src_startsWith(source, target) {
|
|
112934
|
+
return source.indexOf(target) === 0;
|
|
112935
|
+
}
|
|
112936
|
+
/**
|
|
112937
|
+
* Transforms query token groups to tokens (only taking 1 level of nesting).
|
|
112938
|
+
*/
|
|
112939
|
+
function src_tokenGroupToTokens(tokenGroups) {
|
|
112940
|
+
const tokens = [];
|
|
112941
|
+
for (const tokenOrGroup of tokenGroups) {
|
|
112942
|
+
if ('operator' in tokenOrGroup) {
|
|
112943
|
+
tokens.push(tokenOrGroup);
|
|
112944
|
+
}
|
|
112945
|
+
else {
|
|
112946
|
+
for (const nestedTokenOrGroup of tokenOrGroup.tokens) {
|
|
112947
|
+
if ('operator' in nestedTokenOrGroup) {
|
|
112948
|
+
tokens.push(nestedTokenOrGroup);
|
|
112949
|
+
}
|
|
112950
|
+
else {
|
|
112951
|
+
// Ignore deeply nested tokens
|
|
112952
|
+
}
|
|
112953
|
+
}
|
|
112954
|
+
}
|
|
112955
|
+
}
|
|
112956
|
+
return tokens;
|
|
112957
|
+
}
|
|
112958
|
+
//# sourceMappingURL=utils.js.map
|
|
112959
|
+
;// ./node_modules/@cloudscape-design/components/property-filter/i18n-utils.js
|
|
112960
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
112961
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
112962
|
+
|
|
112963
|
+
|
|
112964
|
+
function src_usePropertyFilterI18n(def = {}) {
|
|
112965
|
+
var _a;
|
|
112966
|
+
const i18n = src_useInternalI18n('property-filter');
|
|
112967
|
+
const allPropertiesLabel = i18n('i18nStrings.allPropertiesLabel', def === null || def === void 0 ? void 0 : def.allPropertiesLabel);
|
|
112968
|
+
const operationAndText = i18n('i18nStrings.operationAndText', def === null || def === void 0 ? void 0 : def.operationAndText);
|
|
112969
|
+
const operationOrText = i18n('i18nStrings.operationOrText', def === null || def === void 0 ? void 0 : def.operationOrText);
|
|
112970
|
+
const formatToken = (_a = i18n('i18nStrings.formatToken', def.formatToken, format => token => format({
|
|
112971
|
+
token__propertyLabel: token.propertyLabel,
|
|
112972
|
+
token__operator: src_getOperatorI18nString(token.operator),
|
|
112973
|
+
token__value: token.value,
|
|
112974
|
+
}))) !== null && _a !== void 0 ? _a : (token => `${token.propertyLabel} ${token.operator} ${token.value}`);
|
|
112975
|
+
function toFormatted(token) {
|
|
112976
|
+
var _a, _b, _c;
|
|
112977
|
+
let valueFormatter = (_a = token.property) === null || _a === void 0 ? void 0 : _a.getValueFormatter(token.operator);
|
|
112978
|
+
if (!valueFormatter && ((_b = token.property) === null || _b === void 0 ? void 0 : _b.getTokenType(token.operator)) === 'enum') {
|
|
112979
|
+
valueFormatter = value => (Array.isArray(value) ? value.join(', ') : value);
|
|
112980
|
+
}
|
|
112981
|
+
const propertyLabel = token.property ? token.property.propertyLabel : allPropertiesLabel !== null && allPropertiesLabel !== void 0 ? allPropertiesLabel : '';
|
|
112982
|
+
const tokenValue = valueFormatter ? valueFormatter(token.value) : token.value;
|
|
112983
|
+
return { propertyKey: (_c = token.property) === null || _c === void 0 ? void 0 : _c.propertyKey, propertyLabel, operator: token.operator, value: tokenValue };
|
|
112984
|
+
}
|
|
112985
|
+
return Object.assign(Object.assign({}, def), { allPropertiesLabel,
|
|
112986
|
+
operationAndText,
|
|
112987
|
+
operationOrText, applyActionText: i18n('i18nStrings.applyActionText', def === null || def === void 0 ? void 0 : def.applyActionText), cancelActionText: i18n('i18nStrings.cancelActionText', def === null || def === void 0 ? void 0 : def.cancelActionText), clearFiltersText: i18n('i18nStrings.clearFiltersText', def === null || def === void 0 ? void 0 : def.clearFiltersText), editTokenHeader: i18n('i18nStrings.editTokenHeader', def === null || def === void 0 ? void 0 : def.editTokenHeader), groupPropertiesText: i18n('i18nStrings.groupPropertiesText', def === null || def === void 0 ? void 0 : def.groupPropertiesText), groupValuesText: i18n('i18nStrings.groupValuesText', def === null || def === void 0 ? void 0 : def.groupValuesText), operatorContainsText: i18n('i18nStrings.operatorContainsText', def === null || def === void 0 ? void 0 : def.operatorContainsText), operatorDoesNotContainText: i18n('i18nStrings.operatorDoesNotContainText', def === null || def === void 0 ? void 0 : def.operatorDoesNotContainText), operatorDoesNotEqualText: i18n('i18nStrings.operatorDoesNotEqualText', def === null || def === void 0 ? void 0 : def.operatorDoesNotEqualText), operatorEqualsText: i18n('i18nStrings.operatorEqualsText', def === null || def === void 0 ? void 0 : def.operatorEqualsText), operatorGreaterOrEqualText: i18n('i18nStrings.operatorGreaterOrEqualText', def === null || def === void 0 ? void 0 : def.operatorGreaterOrEqualText), operatorGreaterText: i18n('i18nStrings.operatorGreaterText', def === null || def === void 0 ? void 0 : def.operatorGreaterText), operatorLessOrEqualText: i18n('i18nStrings.operatorLessOrEqualText', def === null || def === void 0 ? void 0 : def.operatorLessOrEqualText), operatorLessText: i18n('i18nStrings.operatorLessText', def === null || def === void 0 ? void 0 : def.operatorLessText), operatorStartsWithText: i18n('i18nStrings.operatorStartsWithText', def === null || def === void 0 ? void 0 : def.operatorStartsWithText), operatorDoesNotStartWithText: i18n('i18nStrings.operatorDoesNotStartWithText', def === null || def === void 0 ? void 0 : def.operatorDoesNotStartWithText), operatorText: i18n('i18nStrings.operatorText', def === null || def === void 0 ? void 0 : def.operatorText), operatorsText: i18n('i18nStrings.operatorsText', def === null || def === void 0 ? void 0 : def.operatorsText), propertyText: i18n('i18nStrings.propertyText', def === null || def === void 0 ? void 0 : def.propertyText), tokenLimitShowFewer: i18n('i18nStrings.tokenLimitShowFewer', def === null || def === void 0 ? void 0 : def.tokenLimitShowFewer), tokenLimitShowMore: i18n('i18nStrings.tokenLimitShowMore', def === null || def === void 0 ? void 0 : def.tokenLimitShowMore), valueText: i18n('i18nStrings.valueText', def === null || def === void 0 ? void 0 : def.valueText), tokenEditorTokenRemoveLabel: i18n('i18nStrings.tokenEditorTokenRemoveLabel', def === null || def === void 0 ? void 0 : def.tokenEditorTokenRemoveLabel), tokenEditorTokenRemoveFromGroupLabel: i18n('i18nStrings.tokenEditorTokenRemoveFromGroupLabel', def === null || def === void 0 ? void 0 : def.tokenEditorTokenRemoveFromGroupLabel), tokenEditorAddNewTokenLabel: i18n('i18nStrings.tokenEditorAddNewTokenLabel', def === null || def === void 0 ? void 0 : def.tokenEditorAddNewTokenLabel), tokenEditorAddTokenActionsAriaLabel: i18n('i18nStrings.tokenEditorAddTokenActionsAriaLabel', def === null || def === void 0 ? void 0 : def.tokenEditorAddTokenActionsAriaLabel), formatToken: token => {
|
|
112988
|
+
const formattedToken = toFormatted(token);
|
|
112989
|
+
return Object.assign(Object.assign({}, formattedToken), { formattedText: formatToken(toFormatted(token)) });
|
|
112990
|
+
}, groupAriaLabel: group => {
|
|
112991
|
+
var _a;
|
|
112992
|
+
const tokens = src_tokenGroupToTokens(group.tokens).map(toFormatted);
|
|
112993
|
+
const groupOperationLabel = (_a = (group.operation === 'and' ? operationAndText : operationOrText)) !== null && _a !== void 0 ? _a : '';
|
|
112994
|
+
return tokens.map(token => formatToken(token)).join(` ${groupOperationLabel} `);
|
|
112995
|
+
}, groupEditAriaLabel: group => {
|
|
112996
|
+
var _a, _b;
|
|
112997
|
+
const tokens = src_tokenGroupToTokens(group.tokens).map(token => toFormatted(token));
|
|
112998
|
+
const operation = group.operation;
|
|
112999
|
+
const operationLabel = (_a = (operation === 'and' ? operationAndText : operationOrText)) !== null && _a !== void 0 ? _a : '';
|
|
113000
|
+
const formatter = i18n('i18nStrings.groupEditAriaLabel', def.groupEditAriaLabel, format => () => format({
|
|
113001
|
+
group__operationLabel: operationLabel,
|
|
113002
|
+
group__formattedTokens__length: tokens.length.toString(),
|
|
113003
|
+
group__formattedTokens0__formattedText: tokens[0] ? formatToken(tokens[0]) : '',
|
|
113004
|
+
group__formattedTokens1__formattedText: tokens[1] ? formatToken(tokens[1]) : '',
|
|
113005
|
+
group__formattedTokens2__formattedText: tokens[2] ? formatToken(tokens[2]) : '',
|
|
113006
|
+
group__formattedTokens3__formattedText: tokens[3] ? formatToken(tokens[3]) : '',
|
|
113007
|
+
}));
|
|
113008
|
+
return (_b = formatter === null || formatter === void 0 ? void 0 : formatter({ operation, operationLabel, tokens })) !== null && _b !== void 0 ? _b : '';
|
|
113009
|
+
}, removeTokenButtonAriaLabel: token => {
|
|
113010
|
+
var _a;
|
|
113011
|
+
const formatter = i18n('i18nStrings.removeTokenButtonAriaLabel', def.removeTokenButtonAriaLabel, format => () => format({ token__formattedText: formatToken(toFormatted(token)) }));
|
|
113012
|
+
return (_a = formatter === null || formatter === void 0 ? void 0 : formatter(toFormatted(token))) !== null && _a !== void 0 ? _a : '';
|
|
113013
|
+
}, tokenEditorTokenActionsAriaLabel: (token) => {
|
|
113014
|
+
var _a;
|
|
113015
|
+
const formatter = i18n('i18nStrings.tokenEditorTokenActionsAriaLabel', def.tokenEditorTokenActionsAriaLabel, format => () => format({ token__formattedText: formatToken(toFormatted(token)) }));
|
|
113016
|
+
return (_a = formatter === null || formatter === void 0 ? void 0 : formatter(toFormatted(token))) !== null && _a !== void 0 ? _a : '';
|
|
113017
|
+
}, tokenEditorTokenRemoveAriaLabel: token => {
|
|
113018
|
+
var _a;
|
|
113019
|
+
const formatter = i18n('i18nStrings.tokenEditorTokenRemoveAriaLabel', def.tokenEditorTokenRemoveAriaLabel, format => () => format({ token__formattedText: formatToken(toFormatted(token)) }));
|
|
113020
|
+
return (_a = formatter === null || formatter === void 0 ? void 0 : formatter(toFormatted(token))) !== null && _a !== void 0 ? _a : '';
|
|
113021
|
+
}, tokenEditorAddExistingTokenAriaLabel: token => {
|
|
113022
|
+
var _a;
|
|
113023
|
+
const formatter = i18n('i18nStrings.tokenEditorAddExistingTokenAriaLabel', def.tokenEditorAddExistingTokenAriaLabel, format => () => format({ token__formattedText: formatToken(toFormatted(token)) }));
|
|
113024
|
+
return (_a = formatter === null || formatter === void 0 ? void 0 : formatter(toFormatted(token))) !== null && _a !== void 0 ? _a : '';
|
|
113025
|
+
}, tokenEditorAddExistingTokenLabel: token => {
|
|
113026
|
+
var _a;
|
|
113027
|
+
const formattedToken = toFormatted(token);
|
|
113028
|
+
const formatter = i18n('i18nStrings.tokenEditorAddExistingTokenLabel', def.tokenEditorAddExistingTokenLabel, format => () => format({
|
|
113029
|
+
token__propertyLabel: formattedToken.propertyLabel,
|
|
113030
|
+
token__operator: formattedToken.operator,
|
|
113031
|
+
token__value: formattedToken.value,
|
|
113032
|
+
}));
|
|
113033
|
+
return (_a = formatter === null || formatter === void 0 ? void 0 : formatter(toFormatted(token))) !== null && _a !== void 0 ? _a : '';
|
|
113034
|
+
} });
|
|
113035
|
+
}
|
|
113036
|
+
function src_operatorToDescription(operator, i18nStrings) {
|
|
113037
|
+
switch (operator) {
|
|
113038
|
+
case '<':
|
|
113039
|
+
return i18nStrings.operatorLessText;
|
|
113040
|
+
case '<=':
|
|
113041
|
+
return i18nStrings.operatorLessOrEqualText;
|
|
113042
|
+
case '>':
|
|
113043
|
+
return i18nStrings.operatorGreaterText;
|
|
113044
|
+
case '>=':
|
|
113045
|
+
return i18nStrings.operatorGreaterOrEqualText;
|
|
113046
|
+
case ':':
|
|
113047
|
+
return i18nStrings.operatorContainsText;
|
|
113048
|
+
case '!:':
|
|
113049
|
+
return i18nStrings.operatorDoesNotContainText;
|
|
113050
|
+
case '=':
|
|
113051
|
+
return i18nStrings.operatorEqualsText;
|
|
113052
|
+
case '!=':
|
|
113053
|
+
return i18nStrings.operatorDoesNotEqualText;
|
|
113054
|
+
case '^':
|
|
113055
|
+
return i18nStrings.operatorStartsWithText;
|
|
113056
|
+
case '!^':
|
|
113057
|
+
return i18nStrings.operatorDoesNotStartWithText;
|
|
113058
|
+
// The line is ignored from coverage because it is not reachable.
|
|
113059
|
+
// The purpose of it is to prevent TS errors if ComparisonOperator type gets extended.
|
|
113060
|
+
/* istanbul ignore next */
|
|
113061
|
+
default:
|
|
113062
|
+
return '';
|
|
113063
|
+
}
|
|
113064
|
+
}
|
|
113065
|
+
function src_getOperatorI18nString(operator) {
|
|
113066
|
+
switch (operator) {
|
|
113067
|
+
case '=':
|
|
113068
|
+
return 'equals';
|
|
113069
|
+
case '!=':
|
|
113070
|
+
return 'not_equals';
|
|
113071
|
+
case '>':
|
|
113072
|
+
return 'greater_than';
|
|
113073
|
+
case '>=':
|
|
113074
|
+
return 'greater_than_equal';
|
|
113075
|
+
case '<':
|
|
113076
|
+
return 'less_than';
|
|
113077
|
+
case '<=':
|
|
113078
|
+
return 'less_than_equal';
|
|
113079
|
+
case ':':
|
|
113080
|
+
return 'contains';
|
|
113081
|
+
case '!:':
|
|
113082
|
+
return 'not_contains';
|
|
113083
|
+
case '^':
|
|
113084
|
+
return 'starts_with';
|
|
113085
|
+
case '!^':
|
|
113086
|
+
return 'not_starts_with';
|
|
113087
|
+
// The line is ignored from coverage because it is not reachable.
|
|
113088
|
+
// The purpose of it is to prevent TS errors if ComparisonOperator type gets extended.
|
|
113089
|
+
/* istanbul ignore next */
|
|
113090
|
+
default:
|
|
113091
|
+
return operator;
|
|
113092
|
+
}
|
|
113093
|
+
}
|
|
113094
|
+
//# sourceMappingURL=i18n-utils.js.map
|
|
113095
|
+
;// ./node_modules/@cloudscape-design/components/property-filter/controller.js
|
|
113096
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
113097
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
113098
|
+
|
|
113099
|
+
|
|
113100
|
+
|
|
113101
|
+
const src_getQueryActions = ({ query, onChange, filteringOptions, enableTokenGroups, }) => {
|
|
113102
|
+
const setQuery = (query) => {
|
|
113103
|
+
function transformToken(token) {
|
|
113104
|
+
if ('operator' in token) {
|
|
113105
|
+
return src_matchTokenValue(token, filteringOptions);
|
|
113106
|
+
}
|
|
113107
|
+
return Object.assign(Object.assign({}, token), { tokens: token.tokens.map(transformToken) });
|
|
113108
|
+
}
|
|
113109
|
+
const tokens = query.tokens.map(transformToken);
|
|
113110
|
+
if (enableTokenGroups) {
|
|
113111
|
+
src_fireNonCancelableEvent(onChange, { tokens: [], operation: query.operation, tokenGroups: tokens });
|
|
113112
|
+
}
|
|
113113
|
+
else {
|
|
113114
|
+
src_fireNonCancelableEvent(onChange, { tokens: src_tokenGroupToTokens(tokens), operation: query.operation });
|
|
113115
|
+
}
|
|
113116
|
+
};
|
|
113117
|
+
const addToken = (token) => {
|
|
113118
|
+
setQuery(Object.assign(Object.assign({}, query), { tokens: [...query.tokens, token] }));
|
|
113119
|
+
};
|
|
113120
|
+
const updateToken = (updateIndex, updatedToken, releasedTokens) => {
|
|
113121
|
+
const nestedTokens = src_tokenGroupToTokens([updatedToken]);
|
|
113122
|
+
const capturedTokenIndices = nestedTokens.map(token => token.standaloneIndex).filter(index => index !== undefined);
|
|
113123
|
+
const tokens = query.tokens
|
|
113124
|
+
.map((token, index) => (index === updateIndex ? updatedToken : token))
|
|
113125
|
+
.filter((_, index) => index === updateIndex || !capturedTokenIndices.includes(index));
|
|
113126
|
+
tokens.push(...releasedTokens);
|
|
113127
|
+
setQuery(Object.assign(Object.assign({}, query), { tokens }));
|
|
113128
|
+
};
|
|
113129
|
+
const removeToken = (removeIndex) => {
|
|
113130
|
+
setQuery(Object.assign(Object.assign({}, query), { tokens: query.tokens.filter((_, index) => index !== removeIndex) }));
|
|
113131
|
+
};
|
|
113132
|
+
const removeAllTokens = () => {
|
|
113133
|
+
setQuery(Object.assign(Object.assign({}, query), { tokens: [] }));
|
|
113134
|
+
};
|
|
113135
|
+
const updateOperation = (operation) => {
|
|
113136
|
+
setQuery(Object.assign(Object.assign({}, query), { operation }));
|
|
113137
|
+
};
|
|
113138
|
+
return { addToken, updateToken, updateOperation, removeToken, removeAllTokens };
|
|
113139
|
+
};
|
|
113140
|
+
const src_getAllowedOperators = (property) => {
|
|
113141
|
+
const { operators = [], defaultOperator } = property;
|
|
113142
|
+
const operatorOrder = ['=', '!=', ':', '!:', '^', '!^', '>=', '<=', '<', '>'];
|
|
113143
|
+
const operatorSet = new Set([defaultOperator, ...operators]);
|
|
113144
|
+
return operatorOrder.filter(op => operatorSet.has(op));
|
|
113145
|
+
};
|
|
113146
|
+
/*
|
|
113147
|
+
* parses the value of the filtering input to figure out the current step of entering the token:
|
|
113148
|
+
* - "property": means that a filter on a particular column is being added, with operator already finalized
|
|
113149
|
+
* - "operator": means that a filter on a particular column is being added, with operator not yet finalized
|
|
113150
|
+
* - "free-text": means that a "free text" token is being added
|
|
113151
|
+
*/
|
|
113152
|
+
const src_parseText = (filteringText, filteringProperties, freeTextFiltering) => {
|
|
113153
|
+
const property = src_matchFilteringProperty(filteringProperties, filteringText);
|
|
113154
|
+
if (!property) {
|
|
113155
|
+
if (!freeTextFiltering.disabled) {
|
|
113156
|
+
// For free text filtering, we allow ! as a shortcut for !:
|
|
113157
|
+
const freeTextOperators = freeTextFiltering.operators.indexOf('!:') >= 0
|
|
113158
|
+
? ['!', ...freeTextFiltering.operators]
|
|
113159
|
+
: freeTextFiltering.operators;
|
|
113160
|
+
const operator = src_matchOperator(freeTextOperators, filteringText);
|
|
113161
|
+
if (operator) {
|
|
113162
|
+
return {
|
|
113163
|
+
step: 'free-text',
|
|
113164
|
+
operator: operator === '!' ? '!:' : operator,
|
|
113165
|
+
value: src_removeOperator(filteringText, operator),
|
|
113166
|
+
};
|
|
113167
|
+
}
|
|
113168
|
+
}
|
|
113169
|
+
return {
|
|
113170
|
+
step: 'free-text',
|
|
113171
|
+
value: filteringText,
|
|
113172
|
+
};
|
|
113173
|
+
}
|
|
113174
|
+
const allowedOps = src_getAllowedOperators(property);
|
|
113175
|
+
const textWithoutProperty = filteringText.substring(property.propertyLabel.length);
|
|
113176
|
+
const operator = src_matchOperator(allowedOps, src_trimStart(textWithoutProperty));
|
|
113177
|
+
if (operator) {
|
|
113178
|
+
return {
|
|
113179
|
+
step: 'property',
|
|
113180
|
+
property,
|
|
113181
|
+
operator,
|
|
113182
|
+
value: src_removeOperator(textWithoutProperty, operator),
|
|
113183
|
+
};
|
|
113184
|
+
}
|
|
113185
|
+
const operatorPrefix = src_matchOperatorPrefix(allowedOps, src_trimStart(textWithoutProperty));
|
|
113186
|
+
if (operatorPrefix !== null) {
|
|
113187
|
+
return { step: 'operator', property, operatorPrefix };
|
|
113188
|
+
}
|
|
113189
|
+
return {
|
|
113190
|
+
step: 'free-text',
|
|
113191
|
+
value: filteringText,
|
|
113192
|
+
};
|
|
113193
|
+
};
|
|
113194
|
+
const src_getAllValueSuggestions = (filteringOptions, operator = '=', i18nStrings, customGroupsText) => {
|
|
113195
|
+
var _a;
|
|
113196
|
+
const defaultGroup = {
|
|
113197
|
+
label: (_a = i18nStrings.groupValuesText) !== null && _a !== void 0 ? _a : '',
|
|
113198
|
+
options: [],
|
|
113199
|
+
};
|
|
113200
|
+
const customGroups = {};
|
|
113201
|
+
filteringOptions.forEach(filteringOption => {
|
|
113202
|
+
const property = filteringOption.property;
|
|
113203
|
+
// given option refers to a non-existent filtering property
|
|
113204
|
+
if (!property) {
|
|
113205
|
+
return;
|
|
113206
|
+
}
|
|
113207
|
+
// this option's filtering property does not support current operator
|
|
113208
|
+
if (src_getAllowedOperators(property).indexOf(operator) === -1) {
|
|
113209
|
+
return;
|
|
113210
|
+
}
|
|
113211
|
+
if (property.propertyGroup && !customGroups[property.propertyGroup]) {
|
|
113212
|
+
const label = customGroupsText.reduce((acc, customGroup) => (customGroup.group === property.propertyGroup ? customGroup.values : acc), '');
|
|
113213
|
+
customGroups[property.propertyGroup] = {
|
|
113214
|
+
label,
|
|
113215
|
+
options: [],
|
|
113216
|
+
};
|
|
113217
|
+
}
|
|
113218
|
+
const propertyGroup = property.propertyGroup ? customGroups[property.propertyGroup] : defaultGroup;
|
|
113219
|
+
propertyGroup.options.push({
|
|
113220
|
+
value: property.propertyLabel + ' ' + (operator || '=') + ' ' + filteringOption.value,
|
|
113221
|
+
label: filteringOption.label,
|
|
113222
|
+
__labelPrefix: property.propertyLabel + ' ' + (operator || '='),
|
|
113223
|
+
});
|
|
113224
|
+
});
|
|
113225
|
+
return [defaultGroup, ...Object.keys(customGroups).map(group => customGroups[group])];
|
|
113226
|
+
};
|
|
113227
|
+
const src_filteringPropertyToAutosuggestOption = (filteringProperty) => ({
|
|
113228
|
+
value: filteringProperty.propertyLabel,
|
|
113229
|
+
label: filteringProperty.propertyLabel,
|
|
113230
|
+
keepOpenOnSelect: true,
|
|
113231
|
+
});
|
|
113232
|
+
function src_getPropertySuggestions(filteringProperties, customGroupsText, i18nStrings, filteringPropertyToOption) {
|
|
113233
|
+
var _a;
|
|
113234
|
+
const defaultGroup = {
|
|
113235
|
+
label: (_a = i18nStrings.groupPropertiesText) !== null && _a !== void 0 ? _a : '',
|
|
113236
|
+
options: [],
|
|
113237
|
+
};
|
|
113238
|
+
const customGroups = {};
|
|
113239
|
+
filteringProperties.forEach(filteringProperty => {
|
|
113240
|
+
const { propertyGroup } = filteringProperty;
|
|
113241
|
+
let optionsGroup = defaultGroup;
|
|
113242
|
+
if (propertyGroup) {
|
|
113243
|
+
if (!customGroups[propertyGroup]) {
|
|
113244
|
+
const label = customGroupsText.reduce((acc, customGroup) => (customGroup.group === propertyGroup ? customGroup.properties : acc), '');
|
|
113245
|
+
customGroups[propertyGroup] = { options: [], label };
|
|
113246
|
+
}
|
|
113247
|
+
optionsGroup = customGroups[propertyGroup];
|
|
113248
|
+
}
|
|
113249
|
+
optionsGroup.options.push(filteringPropertyToOption(filteringProperty));
|
|
113250
|
+
});
|
|
113251
|
+
const defaultGroupArray = defaultGroup.options.length ? [defaultGroup] : [];
|
|
113252
|
+
const customGroupsArray = Object.keys(customGroups).map(groupKey => customGroups[groupKey]);
|
|
113253
|
+
return [...defaultGroupArray, ...customGroupsArray];
|
|
113254
|
+
}
|
|
113255
|
+
const src_getAutosuggestOptions = (parsedText, filteringProperties, filteringOptions, customGroupsText, i18nStrings) => {
|
|
113256
|
+
switch (parsedText.step) {
|
|
113257
|
+
case 'property': {
|
|
113258
|
+
const { propertyLabel, groupValuesLabel } = parsedText.property;
|
|
113259
|
+
const options = filteringOptions.filter(o => o.property === parsedText.property);
|
|
113260
|
+
return {
|
|
113261
|
+
filterText: parsedText.value,
|
|
113262
|
+
options: [
|
|
113263
|
+
{
|
|
113264
|
+
options: options.map(({ label, value }) => ({
|
|
113265
|
+
value: propertyLabel + ' ' + parsedText.operator + ' ' + value,
|
|
113266
|
+
label: label,
|
|
113267
|
+
__labelPrefix: propertyLabel + ' ' + parsedText.operator,
|
|
113268
|
+
})),
|
|
113269
|
+
label: groupValuesLabel,
|
|
113270
|
+
},
|
|
113271
|
+
],
|
|
113272
|
+
};
|
|
113273
|
+
}
|
|
113274
|
+
case 'operator': {
|
|
113275
|
+
return {
|
|
113276
|
+
filterText: parsedText.property.propertyLabel + ' ' + parsedText.operatorPrefix,
|
|
113277
|
+
options: [
|
|
113278
|
+
...src_getPropertySuggestions(filteringProperties, customGroupsText, i18nStrings, src_filteringPropertyToAutosuggestOption),
|
|
113279
|
+
{
|
|
113280
|
+
options: src_getAllowedOperators(parsedText.property).map(value => ({
|
|
113281
|
+
value: parsedText.property.propertyLabel + ' ' + value + ' ',
|
|
113282
|
+
label: parsedText.property.propertyLabel + ' ' + value,
|
|
113283
|
+
description: src_operatorToDescription(value, i18nStrings),
|
|
113284
|
+
keepOpenOnSelect: true,
|
|
113285
|
+
})),
|
|
113286
|
+
label: i18nStrings.operatorsText,
|
|
113287
|
+
},
|
|
113288
|
+
],
|
|
113289
|
+
};
|
|
113290
|
+
}
|
|
113291
|
+
case 'free-text': {
|
|
113292
|
+
const needsValueSuggestions = !!parsedText.value;
|
|
113293
|
+
const needsPropertySuggestions = !(parsedText.step === 'free-text' && parsedText.operator === '!:');
|
|
113294
|
+
return {
|
|
113295
|
+
filterText: parsedText.value,
|
|
113296
|
+
options: [
|
|
113297
|
+
...(needsPropertySuggestions
|
|
113298
|
+
? src_getPropertySuggestions(filteringProperties, customGroupsText, i18nStrings, src_filteringPropertyToAutosuggestOption)
|
|
113299
|
+
: []),
|
|
113300
|
+
...(needsValueSuggestions
|
|
113301
|
+
? src_getAllValueSuggestions(filteringOptions, parsedText.operator, i18nStrings, customGroupsText)
|
|
113302
|
+
: []),
|
|
113303
|
+
],
|
|
113304
|
+
};
|
|
113305
|
+
}
|
|
113306
|
+
}
|
|
113307
|
+
};
|
|
113308
|
+
//# sourceMappingURL=controller.js.map
|
|
113309
|
+
;// ./node_modules/@cloudscape-design/components/multiselect/embedded.js
|
|
113310
|
+
|
|
113311
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
113312
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
113313
|
+
|
|
113314
|
+
|
|
113315
|
+
|
|
113316
|
+
|
|
113317
|
+
|
|
113318
|
+
|
|
113319
|
+
|
|
113320
|
+
|
|
113321
|
+
|
|
113322
|
+
const src_EmbeddedMultiselect = src_react.forwardRef((_a, externalRef) => {
|
|
113323
|
+
var { options, filteringType, ariaLabel, selectedOptions, deselectAriaLabel, virtualScroll, filteringText = '' } = _a, restProps = src_rest(_a, ["options", "filteringType", "ariaLabel", "selectedOptions", "deselectAriaLabel", "virtualScroll", "filteringText"]);
|
|
113324
|
+
const formFieldContext = src_useFormFieldContext(restProps);
|
|
113325
|
+
const ariaLabelId = src_useUniqueId('multiselect-ariaLabel-');
|
|
113326
|
+
const footerId = src_useUniqueId('multiselect-footer-');
|
|
113327
|
+
const multiselectProps = src_useMultiselect(Object.assign({ options,
|
|
113328
|
+
selectedOptions,
|
|
113329
|
+
filteringType, disabled: false, deselectAriaLabel, controlId: formFieldContext.controlId, ariaLabelId,
|
|
113330
|
+
footerId, filteringValue: filteringText, externalRef, keepOpen: true, embedded: true }, restProps));
|
|
113331
|
+
const ListComponent = virtualScroll ? src_virtual_list : src_plain_list;
|
|
113332
|
+
const status = multiselectProps.dropdownStatus;
|
|
113333
|
+
return (src_react.createElement("div", { className: src_multiselect_styles_css.embedded },
|
|
113334
|
+
src_react.createElement(ListComponent, { menuProps: multiselectProps.getMenuProps(), getOptionProps: multiselectProps.getOptionProps, filteredOptions: multiselectProps.filteredOptions, filteringValue: filteringText, ref: multiselectProps.scrollToIndex, hasDropdownStatus: status.content !== null, checkboxes: true, useInteractiveGroups: true, screenReaderContent: multiselectProps.announcement, highlightType: multiselectProps.highlightType }),
|
|
113335
|
+
status.content && src_react.createElement(src_dropdown_footer, { content: status.content, id: footerId }),
|
|
113336
|
+
src_react.createElement(src_ScreenreaderOnly, { id: ariaLabelId }, ariaLabel)));
|
|
113337
|
+
});
|
|
113338
|
+
/* harmony default export */ const src_embedded = (src_EmbeddedMultiselect);
|
|
113339
|
+
//# sourceMappingURL=embedded.js.map
|
|
113340
|
+
;// ./node_modules/@cloudscape-design/components/property-filter/filter-options.js
|
|
113341
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
113342
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
113343
|
+
function src_filter_options_filterOptions(options, searchText = '') {
|
|
113344
|
+
if (!searchText) {
|
|
113345
|
+
return options;
|
|
113346
|
+
}
|
|
113347
|
+
const filtered = [];
|
|
113348
|
+
for (const option of options) {
|
|
113349
|
+
if (src_filter_options_isGroup(option)) {
|
|
113350
|
+
const childOptions = src_filter_options_filterOptions(option.options, searchText);
|
|
113351
|
+
if (childOptions.length > 0) {
|
|
113352
|
+
filtered.push(Object.assign(Object.assign({}, option), { options: childOptions }));
|
|
113353
|
+
}
|
|
113354
|
+
}
|
|
113355
|
+
else if (src_filter_options_matchSingleOption(option, searchText)) {
|
|
113356
|
+
filtered.push(option);
|
|
113357
|
+
}
|
|
113358
|
+
}
|
|
113359
|
+
return filtered;
|
|
113360
|
+
}
|
|
113361
|
+
function src_filter_options_isGroup(optionOrGroup) {
|
|
113362
|
+
return 'options' in optionOrGroup;
|
|
113363
|
+
}
|
|
113364
|
+
function src_filter_options_matchSingleOption(option, searchText) {
|
|
113365
|
+
var _a, _b;
|
|
113366
|
+
searchText = searchText.toLowerCase();
|
|
113367
|
+
const label = ((_a = option.label) !== null && _a !== void 0 ? _a : '').toLowerCase();
|
|
113368
|
+
const labelPrefix = (_b = option.__labelPrefix) !== null && _b !== void 0 ? _b : '';
|
|
113369
|
+
const value = (option.value ? option.value.slice(labelPrefix.length) : '').toLowerCase();
|
|
113370
|
+
return label.indexOf(searchText) !== -1 || value.indexOf(searchText) !== -1;
|
|
113371
|
+
}
|
|
113372
|
+
//# sourceMappingURL=filter-options.js.map
|
|
113373
|
+
;// ./node_modules/@cloudscape-design/components/property-filter/use-load-items.js
|
|
113374
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
113375
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
113376
|
+
|
|
113377
|
+
|
|
113378
|
+
/**
|
|
113379
|
+
* This hook generates `onBlur`, `onFocus` and `onLoadItems` handlers that make sure an `onLoadItems` event
|
|
113380
|
+
* fires exactly once every time control they are used on gets focused.
|
|
113381
|
+
* It is necessary to do this because Autosuggest and Select dedupe their `onLoadItems` events stopping
|
|
113382
|
+
* the same event from firing twice in a row. This means, refocusing the control sometimes results in
|
|
113383
|
+
* `onLoadItems` firing, but sometimes not.
|
|
113384
|
+
*/
|
|
113385
|
+
const src_use_load_items_useLoadItems = (onLoadItems, focusFilteringText, currentFilteringProperty, currentFilteringText, currentFilteringOperator) => {
|
|
113386
|
+
const focusIn = (0,src_react.useRef)(false);
|
|
113387
|
+
const handleBlur = () => {
|
|
113388
|
+
focusIn.current = true;
|
|
113389
|
+
};
|
|
113390
|
+
const fireLoadItems = (detail) => {
|
|
113391
|
+
var _a;
|
|
113392
|
+
src_fireNonCancelableEvent(onLoadItems, Object.assign(Object.assign({}, detail), { filteringText: (_a = currentFilteringText !== null && currentFilteringText !== void 0 ? currentFilteringText : detail.filteringText) !== null && _a !== void 0 ? _a : '', filteringProperty: currentFilteringProperty, filteringOperator: currentFilteringOperator }));
|
|
113393
|
+
focusIn.current = false;
|
|
113394
|
+
};
|
|
113395
|
+
const handleFocus = () => {
|
|
113396
|
+
if (focusIn.current) {
|
|
113397
|
+
fireLoadItems({ firstPage: true, samePage: false, filteringText: focusFilteringText });
|
|
113398
|
+
}
|
|
113399
|
+
};
|
|
113400
|
+
const handleLoadItems = ({ detail }) => fireLoadItems(detail);
|
|
113401
|
+
return {
|
|
113402
|
+
onBlur: handleBlur,
|
|
113403
|
+
onFocus: handleFocus,
|
|
113404
|
+
onLoadItems: handleLoadItems,
|
|
113405
|
+
};
|
|
113406
|
+
};
|
|
113407
|
+
//# sourceMappingURL=use-load-items.js.map
|
|
113408
|
+
;// ./node_modules/@cloudscape-design/components/property-filter/styles.scoped.css
|
|
113409
|
+
// extracted by mini-css-extract-plugin
|
|
113410
|
+
|
|
113411
|
+
;// ./node_modules/@cloudscape-design/components/property-filter/styles.css.js
|
|
113412
|
+
|
|
113413
|
+
|
|
113414
|
+
/* harmony default export */ const src_property_filter_styles_css = ({
|
|
113415
|
+
"root": "awsui_root_1wzqe_piuc8_145",
|
|
113416
|
+
"search-field": "awsui_search-field_1wzqe_piuc8_177",
|
|
113417
|
+
"input-wrapper": "awsui_input-wrapper_1wzqe_piuc8_184",
|
|
113418
|
+
"add-token": "awsui_add-token_1wzqe_piuc8_191",
|
|
113419
|
+
"tokens": "awsui_tokens_1wzqe_piuc8_198",
|
|
113420
|
+
"token-operator": "awsui_token-operator_1wzqe_piuc8_203",
|
|
113421
|
+
"property-editor": "awsui_property-editor_1wzqe_piuc8_207",
|
|
113422
|
+
"property-editor-header": "awsui_property-editor-header_1wzqe_piuc8_210",
|
|
113423
|
+
"property-editor-header-enum": "awsui_property-editor-header-enum_1wzqe_piuc8_223",
|
|
113424
|
+
"property-editor-form": "awsui_property-editor-form_1wzqe_piuc8_238",
|
|
113425
|
+
"property-editor-cancel": "awsui_property-editor-cancel_1wzqe_piuc8_243",
|
|
113426
|
+
"property-editor-actions": "awsui_property-editor-actions_1wzqe_piuc8_246",
|
|
113427
|
+
"property-editor-enum": "awsui_property-editor-enum_1wzqe_piuc8_254",
|
|
113428
|
+
"token-editor": "awsui_token-editor_1wzqe_piuc8_259",
|
|
113429
|
+
"token-editor-form": "awsui_token-editor-form_1wzqe_piuc8_266",
|
|
113430
|
+
"token-editor-field-property": "awsui_token-editor-field-property_1wzqe_piuc8_269",
|
|
113431
|
+
"token-editor-field-operator": "awsui_token-editor-field-operator_1wzqe_piuc8_272",
|
|
113432
|
+
"token-editor-field-value": "awsui_token-editor-field-value_1wzqe_piuc8_275",
|
|
113433
|
+
"token-editor-multiselect-wrapper": "awsui_token-editor-multiselect-wrapper_1wzqe_piuc8_278",
|
|
113434
|
+
"token-editor-multiselect-wrapper-inner": "awsui_token-editor-multiselect-wrapper-inner_1wzqe_piuc8_283",
|
|
113435
|
+
"token-editor-cancel": "awsui_token-editor-cancel_1wzqe_piuc8_287",
|
|
113436
|
+
"token-editor-submit": "awsui_token-editor-submit_1wzqe_piuc8_290",
|
|
113437
|
+
"token-editor-actions": "awsui_token-editor-actions_1wzqe_piuc8_293",
|
|
113438
|
+
"token-editor-grid": "awsui_token-editor-grid_1wzqe_piuc8_302",
|
|
113439
|
+
"token-editor-grid-group": "awsui_token-editor-grid-group_1wzqe_piuc8_336",
|
|
113440
|
+
"token-editor-narrow": "awsui_token-editor-narrow_1wzqe_piuc8_339",
|
|
113441
|
+
"token-editor-supports-groups": "awsui_token-editor-supports-groups_1wzqe_piuc8_348",
|
|
113442
|
+
"token-editor-grid-header": "awsui_token-editor-grid-header_1wzqe_piuc8_352",
|
|
113443
|
+
"token-editor-grid-cell": "awsui_token-editor-grid-cell_1wzqe_piuc8_358",
|
|
113444
|
+
"token-editor-add-token": "awsui_token-editor-add-token_1wzqe_piuc8_367",
|
|
113445
|
+
"custom-content-wrapper": "awsui_custom-content-wrapper_1wzqe_piuc8_371",
|
|
113446
|
+
"custom-control": "awsui_custom-control_1wzqe_piuc8_375",
|
|
113447
|
+
"input": "awsui_input_1wzqe_piuc8_184",
|
|
113448
|
+
"results": "awsui_results_1wzqe_piuc8_383",
|
|
113449
|
+
"token-trigger": "awsui_token-trigger_1wzqe_piuc8_388",
|
|
113450
|
+
"remove-all": "awsui_remove-all_1wzqe_piuc8_393",
|
|
113451
|
+
"join-operation": "awsui_join-operation_1wzqe_piuc8_394",
|
|
113452
|
+
"custom-filter-actions": "awsui_custom-filter-actions_1wzqe_piuc8_395",
|
|
113453
|
+
"constraint": "awsui_constraint_1wzqe_piuc8_399"
|
|
113454
|
+
});
|
|
113455
|
+
|
|
113456
|
+
;// ./node_modules/@cloudscape-design/components/property-filter/test-classes/styles.scoped.css
|
|
113457
|
+
// extracted by mini-css-extract-plugin
|
|
113458
|
+
|
|
113459
|
+
;// ./node_modules/@cloudscape-design/components/property-filter/test-classes/styles.css.js
|
|
113460
|
+
|
|
113461
|
+
|
|
113462
|
+
/* harmony default export */ const src_property_filter_test_classes_styles_css = ({
|
|
113463
|
+
"filtering-token": "awsui_filtering-token_1heb1_1ayd6_5",
|
|
113464
|
+
"filtering-token-dismiss-button": "awsui_filtering-token-dismiss-button_1heb1_1ayd6_9",
|
|
113465
|
+
"filtering-token-select": "awsui_filtering-token-select_1heb1_1ayd6_13",
|
|
113466
|
+
"filtering-token-content": "awsui_filtering-token-content_1heb1_1ayd6_17",
|
|
113467
|
+
"filtering-token-inner": "awsui_filtering-token-inner_1heb1_1ayd6_21",
|
|
113468
|
+
"filtering-token-inner-dismiss-button": "awsui_filtering-token-inner-dismiss-button_1heb1_1ayd6_25",
|
|
113469
|
+
"filtering-token-inner-select": "awsui_filtering-token-inner-select_1heb1_1ayd6_29",
|
|
113470
|
+
"filtering-token-inner-content": "awsui_filtering-token-inner-content_1heb1_1ayd6_33",
|
|
113471
|
+
"filtering-token-edit-button": "awsui_filtering-token-edit-button_1heb1_1ayd6_37",
|
|
113472
|
+
"token-editor-field-property": "awsui_token-editor-field-property_1heb1_1ayd6_41",
|
|
113473
|
+
"token-editor-field-operator": "awsui_token-editor-field-operator_1heb1_1ayd6_45",
|
|
113474
|
+
"token-editor-field-value": "awsui_token-editor-field-value_1heb1_1ayd6_49",
|
|
113475
|
+
"token-editor-token-remove-actions": "awsui_token-editor-token-remove-actions_1heb1_1ayd6_53",
|
|
113476
|
+
"token-editor-token-add-actions": "awsui_token-editor-token-add-actions_1heb1_1ayd6_57",
|
|
113477
|
+
"token-editor-cancel": "awsui_token-editor-cancel_1heb1_1ayd6_61",
|
|
113478
|
+
"token-editor-submit": "awsui_token-editor-submit_1heb1_1ayd6_65",
|
|
113479
|
+
"property-editor-cancel": "awsui_property-editor-cancel_1heb1_1ayd6_69",
|
|
113480
|
+
"property-editor-submit": "awsui_property-editor-submit_1heb1_1ayd6_73"
|
|
113481
|
+
});
|
|
113482
|
+
|
|
113483
|
+
;// ./node_modules/@cloudscape-design/components/property-filter/property-editor.js
|
|
113484
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
113485
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
113486
|
+
|
|
113487
|
+
|
|
113488
|
+
|
|
113489
|
+
|
|
113490
|
+
|
|
113491
|
+
|
|
113492
|
+
|
|
113493
|
+
|
|
113494
|
+
|
|
113495
|
+
|
|
113496
|
+
|
|
113497
|
+
function src_PropertyEditorContentCustom({ property, operator, filter, value, onChange, operatorForm, }) {
|
|
113498
|
+
const labelId = src_useUniqueId();
|
|
113499
|
+
return (src_react.createElement("div", { className: src_property_filter_styles_css['property-editor'] },
|
|
113500
|
+
src_react.createElement("div", { className: src_property_filter_styles_css['property-editor-header'], id: labelId }, property.groupValuesLabel),
|
|
113501
|
+
src_react.createElement("div", { className: src_property_filter_styles_css['property-editor-form'] },
|
|
113502
|
+
src_react.createElement(src_FormFieldContext.Provider, { value: { ariaLabelledby: labelId } }, operatorForm({ value, onChange, operator, filter })))));
|
|
113503
|
+
}
|
|
113504
|
+
function src_PropertyEditorContentEnum({ property, filter, value: unknownValue, onChange, asyncProps, filteringOptions, onLoadItems, }) {
|
|
113505
|
+
const valueOptions = filteringOptions
|
|
113506
|
+
.filter(option => { var _a; return ((_a = option.property) === null || _a === void 0 ? void 0 : _a.propertyKey) === property.propertyKey; })
|
|
113507
|
+
.map(({ label, value }) => ({ label, value }));
|
|
113508
|
+
const valueHandlers = src_use_load_items_useLoadItems(onLoadItems, '', property.externalProperty);
|
|
113509
|
+
const value = !unknownValue ? [] : Array.isArray(unknownValue) ? unknownValue : [unknownValue];
|
|
113510
|
+
const selectedOptions = valueOptions.filter(option => value.includes(option.value));
|
|
113511
|
+
const filteredOptions = src_filter_options_filterOptions(valueOptions, filter);
|
|
113512
|
+
return (src_react.createElement("div", { className: src_clsx_m(src_property_filter_styles_css['property-editor'], src_property_filter_styles_css['property-editor-enum']) },
|
|
113513
|
+
filteredOptions.length === 0 && (src_react.createElement("div", { className: src_property_filter_styles_css['property-editor-header-enum'] },
|
|
113514
|
+
src_react.createElement(src_checkbox_internal, { checked: false, readOnly: true }),
|
|
113515
|
+
property.groupValuesLabel)),
|
|
113516
|
+
src_react.createElement(src_embedded, Object.assign({ filteringType: "manual", selectedOptions: selectedOptions, onChange: e => onChange(e.detail.selectedOptions.map(o => o.value)), options: filteredOptions.length > 0 ? [{ options: filteredOptions, label: property.groupValuesLabel }] : [], filteringText: filter, ariaLabel: property.groupValuesLabel, statusType: "finished", noMatch: asyncProps.empty }, valueHandlers, asyncProps))));
|
|
113517
|
+
}
|
|
113518
|
+
function src_PropertyEditorFooter({ property, operator, value, onCancel, onSubmit, i18nStrings, }) {
|
|
113519
|
+
const submitToken = () => onSubmit({ property, operator, value });
|
|
113520
|
+
return (src_react.createElement("div", { className: src_property_filter_styles_css['property-editor-actions'] },
|
|
113521
|
+
src_react.createElement(src_button_internal, { variant: "link", className: src_clsx_m(src_property_filter_styles_css['property-editor-cancel'], src_property_filter_test_classes_styles_css['property-editor-cancel']), onClick: onCancel }, i18nStrings.cancelActionText),
|
|
113522
|
+
src_react.createElement(src_button_internal, { className: src_property_filter_test_classes_styles_css['property-editor-submit'], onClick: submitToken }, i18nStrings.applyActionText)));
|
|
113523
|
+
}
|
|
113524
|
+
//# sourceMappingURL=property-editor.js.map
|
|
113525
|
+
;// ./node_modules/@cloudscape-design/components/property-filter/property-filter-autosuggest.js
|
|
113526
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
113527
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
113528
|
+
|
|
113529
|
+
|
|
113530
|
+
|
|
113531
|
+
|
|
113532
|
+
|
|
113533
|
+
|
|
113534
|
+
|
|
113535
|
+
|
|
113536
|
+
|
|
113537
|
+
|
|
113538
|
+
|
|
113539
|
+
|
|
113540
|
+
|
|
113541
|
+
|
|
113542
|
+
|
|
113543
|
+
|
|
113544
|
+
|
|
113545
|
+
|
|
113546
|
+
const src_DROPDOWN_WIDTH_OPTIONS_LIST = 300;
|
|
113547
|
+
const src_DROPDOWN_WIDTH_CUSTOM_FORM = 200;
|
|
113548
|
+
const src_PropertyFilterAutosuggest = src_react.forwardRef((props, ref) => {
|
|
113549
|
+
var _a;
|
|
113550
|
+
const { value, onChange, onFocus, onBlur, onLoadItems, options, statusType = 'finished', placeholder, disabled, ariaLabel, enteredTextLabel, onKeyDown, virtualScroll, expandToViewport, customForm, filterText, onOptionClick, hideEnteredTextOption, searchResultsId, onCloseDropdown } = props, rest = src_rest(props, ["value", "onChange", "onFocus", "onBlur", "onLoadItems", "options", "statusType", "placeholder", "disabled", "ariaLabel", "enteredTextLabel", "onKeyDown", "virtualScroll", "expandToViewport", "customForm", "filterText", "onOptionClick", "hideEnteredTextOption", "searchResultsId", "onCloseDropdown"]);
|
|
113551
|
+
const highlightText = filterText === undefined ? value : filterText;
|
|
113552
|
+
const customFormRef = (0,src_react.useRef)(null);
|
|
113553
|
+
const autosuggestInputRef = (0,src_react.useRef)(null);
|
|
113554
|
+
const mergedRef = src_useMergeRefs(autosuggestInputRef, ref);
|
|
113555
|
+
const filteredOptions = (0,src_react.useMemo)(() => src_filter_options_filterOptions(options || [], highlightText), [options, highlightText]);
|
|
113556
|
+
const [autosuggestItemsState, autosuggestItemsHandlers] = src_useAutosuggestItems({
|
|
113557
|
+
options: filteredOptions,
|
|
113558
|
+
filterValue: value,
|
|
113559
|
+
filterText: highlightText,
|
|
113560
|
+
filteringType: 'manual',
|
|
113561
|
+
enteredTextLabel,
|
|
113562
|
+
hideEnteredTextLabel: hideEnteredTextOption,
|
|
113563
|
+
onSelectItem: (option) => {
|
|
113564
|
+
var _a;
|
|
113565
|
+
const value = option.value || '';
|
|
113566
|
+
src_fireNonCancelableEvent(onChange, { value });
|
|
113567
|
+
const selectedCancelled = src_fireCancelableEvent(onOptionClick, option);
|
|
113568
|
+
if (!selectedCancelled) {
|
|
113569
|
+
(_a = autosuggestInputRef.current) === null || _a === void 0 ? void 0 : _a.close();
|
|
113570
|
+
}
|
|
113571
|
+
else {
|
|
113572
|
+
autosuggestItemsHandlers.resetHighlightWithKeyboard();
|
|
113573
|
+
}
|
|
113574
|
+
},
|
|
113575
|
+
});
|
|
113576
|
+
const autosuggestLoadMoreHandlers = src_useAutosuggestLoadMore({
|
|
113577
|
+
options,
|
|
113578
|
+
statusType,
|
|
113579
|
+
onLoadItems: (detail) => src_fireNonCancelableEvent(onLoadItems, detail),
|
|
113580
|
+
});
|
|
113581
|
+
const handleChange = (event) => {
|
|
113582
|
+
autosuggestItemsHandlers.resetHighlightWithKeyboard();
|
|
113583
|
+
src_fireNonCancelableEvent(onChange, event.detail);
|
|
113584
|
+
};
|
|
113585
|
+
const handleDelayedInput = (event) => {
|
|
113586
|
+
autosuggestLoadMoreHandlers.fireLoadMoreOnInputChange(event.detail.value);
|
|
113587
|
+
};
|
|
113588
|
+
const handleFocus = () => {
|
|
113589
|
+
autosuggestLoadMoreHandlers.fireLoadMoreOnInputFocus();
|
|
113590
|
+
src_fireCancelableEvent(onFocus, null);
|
|
113591
|
+
};
|
|
113592
|
+
const handleBlur = () => {
|
|
113593
|
+
src_fireCancelableEvent(onBlur, null);
|
|
113594
|
+
};
|
|
113595
|
+
const handleKeyDown = (e) => {
|
|
113596
|
+
src_fireCancelableEvent(onKeyDown, e.detail);
|
|
113597
|
+
};
|
|
113598
|
+
const handlePressArrowDown = () => {
|
|
113599
|
+
var _a;
|
|
113600
|
+
autosuggestItemsHandlers.moveHighlightWithKeyboard(1);
|
|
113601
|
+
if (customFormRef.current) {
|
|
113602
|
+
(_a = src_getFirstFocusable(customFormRef.current)) === null || _a === void 0 ? void 0 : _a.focus();
|
|
113603
|
+
}
|
|
113604
|
+
};
|
|
113605
|
+
const handlePressArrowUp = () => {
|
|
113606
|
+
autosuggestItemsHandlers.moveHighlightWithKeyboard(-1);
|
|
113607
|
+
};
|
|
113608
|
+
const handlePressEnter = () => {
|
|
113609
|
+
return autosuggestItemsHandlers.selectHighlightedOptionWithKeyboard();
|
|
113610
|
+
};
|
|
113611
|
+
const handleCloseDropdown = () => {
|
|
113612
|
+
autosuggestItemsHandlers.resetHighlightWithKeyboard();
|
|
113613
|
+
onCloseDropdown === null || onCloseDropdown === void 0 ? void 0 : onCloseDropdown();
|
|
113614
|
+
};
|
|
113615
|
+
const handleRecoveryClick = () => {
|
|
113616
|
+
var _a;
|
|
113617
|
+
autosuggestLoadMoreHandlers.fireLoadMoreOnRecoveryClick();
|
|
113618
|
+
(_a = autosuggestInputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
113619
|
+
};
|
|
113620
|
+
const selfControlId = src_useUniqueId('input');
|
|
113621
|
+
const controlId = (_a = rest.controlId) !== null && _a !== void 0 ? _a : selfControlId;
|
|
113622
|
+
const listId = src_useUniqueId('list');
|
|
113623
|
+
const footerId = src_useUniqueId('footer');
|
|
113624
|
+
const highlightedOptionIdSource = src_useUniqueId();
|
|
113625
|
+
const highlightedOptionId = autosuggestItemsState.highlightedOption ? highlightedOptionIdSource : undefined;
|
|
113626
|
+
const isEmpty = !value && !autosuggestItemsState.items.length;
|
|
113627
|
+
const dropdownStatus = src_useDropdownStatus(Object.assign(Object.assign({}, props), { isEmpty, onRecoveryClick: handleRecoveryClick, hasRecoveryCallback: !!onLoadItems }));
|
|
113628
|
+
let content = null;
|
|
113629
|
+
if (customForm) {
|
|
113630
|
+
content = (src_react.createElement("div", { ref: customFormRef, className: src_property_filter_styles_css['custom-content-wrapper'] }, customForm.content));
|
|
113631
|
+
}
|
|
113632
|
+
else if (autosuggestItemsState.items.length > 0) {
|
|
113633
|
+
content = (src_react.createElement(src_AutosuggestOptionsList, { statusType: statusType, autosuggestItemsState: autosuggestItemsState, autosuggestItemsHandlers: autosuggestItemsHandlers, highlightedOptionId: highlightedOptionId, highlightText: highlightText, listId: listId, controlId: controlId, handleLoadMore: autosuggestLoadMoreHandlers.fireLoadMoreOnScroll, hasDropdownStatus: dropdownStatus.content !== null, virtualScroll: virtualScroll, listBottom: !dropdownStatus.isSticky ? src_react.createElement(src_dropdown_footer, { content: dropdownStatus.content, id: footerId }) : null, ariaDescribedby: dropdownStatus.content ? footerId : undefined }));
|
|
113634
|
+
}
|
|
113635
|
+
return (src_react.createElement(src_autosuggest_input, Object.assign({ ref: mergedRef }, rest, { className: src_clsx_m(src_autosuggest_styles_css.root, src_property_filter_styles_css.input), value: value, onChange: handleChange, onFocus: handleFocus, onBlur: handleBlur, onKeyDown: handleKeyDown, controlId: controlId, placeholder: placeholder, disabled: disabled, ariaLabel: ariaLabel, expandToViewport: expandToViewport, ariaControls: listId, ariaActivedescendant: highlightedOptionId, ariaDescribedby: src_joinStrings(searchResultsId, rest.ariaDescribedby), dropdownExpanded: autosuggestItemsState.items.length > 1 || dropdownStatus.content !== null || !!customForm, dropdownContentKey: customForm ? 'custom' : 'options', dropdownContent: content, dropdownFooter: dropdownStatus.isSticky && dropdownStatus.content && !customForm ? (src_react.createElement(src_dropdown_footer, { content: dropdownStatus.content, hasItems: autosuggestItemsState.items.length >= 1, id: footerId })) : customForm ? (customForm.footer) : null, dropdownWidth: customForm ? src_DROPDOWN_WIDTH_CUSTOM_FORM : src_DROPDOWN_WIDTH_OPTIONS_LIST, dropdownContentFocusable: !!customForm, onCloseDropdown: handleCloseDropdown, onDelayedInput: handleDelayedInput, onPressArrowDown: handlePressArrowDown, onPressArrowUp: handlePressArrowUp, onPressEnter: handlePressEnter, loopFocus: !!customForm || dropdownStatus.hasRecoveryButton })));
|
|
113636
|
+
});
|
|
113637
|
+
/* harmony default export */ const src_property_filter_autosuggest = (src_PropertyFilterAutosuggest);
|
|
113638
|
+
//# sourceMappingURL=property-filter-autosuggest.js.map
|
|
113639
|
+
;// ./node_modules/@cloudscape-design/components/property-filter/filtering-token/styles.scoped.css
|
|
113640
|
+
// extracted by mini-css-extract-plugin
|
|
113641
|
+
|
|
113642
|
+
;// ./node_modules/@cloudscape-design/components/property-filter/filtering-token/styles.css.js
|
|
113643
|
+
|
|
113644
|
+
|
|
113645
|
+
/* harmony default export */ const src_filtering_token_styles_css = ({
|
|
113646
|
+
"root": "awsui_root_19bso_1vgkt_153",
|
|
113647
|
+
"inner-root": "awsui_inner-root_19bso_1vgkt_154",
|
|
113648
|
+
"has-groups": "awsui_has-groups_19bso_1vgkt_187",
|
|
113649
|
+
"compact-mode": "awsui_compact-mode_19bso_1vgkt_191",
|
|
113650
|
+
"token": "awsui_token_19bso_1vgkt_200",
|
|
113651
|
+
"inner-token": "awsui_inner-token_19bso_1vgkt_201",
|
|
113652
|
+
"grouped": "awsui_grouped_19bso_1vgkt_214",
|
|
113653
|
+
"list": "awsui_list_19bso_1vgkt_226",
|
|
113654
|
+
"show-operation": "awsui_show-operation_19bso_1vgkt_237",
|
|
113655
|
+
"select": "awsui_select_19bso_1vgkt_243",
|
|
113656
|
+
"inner-select": "awsui_inner-select_19bso_1vgkt_244",
|
|
113657
|
+
"token-content": "awsui_token-content_19bso_1vgkt_248",
|
|
113658
|
+
"token-content-grouped": "awsui_token-content-grouped_19bso_1vgkt_254",
|
|
113659
|
+
"inner-token-content": "awsui_inner-token-content_19bso_1vgkt_259",
|
|
113660
|
+
"edit-button": "awsui_edit-button_19bso_1vgkt_264",
|
|
113661
|
+
"dismiss-button": "awsui_dismiss-button_19bso_1vgkt_265",
|
|
113662
|
+
"inner-dismiss-button": "awsui_inner-dismiss-button_19bso_1vgkt_266",
|
|
113663
|
+
"token-disabled": "awsui_token-disabled_19bso_1vgkt_324"
|
|
113664
|
+
});
|
|
113665
|
+
|
|
113666
|
+
;// ./node_modules/@cloudscape-design/components/property-filter/filtering-token/index.js
|
|
113667
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
113668
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
113669
|
+
|
|
113670
|
+
|
|
113671
|
+
|
|
113672
|
+
|
|
113673
|
+
|
|
113674
|
+
|
|
113675
|
+
|
|
113676
|
+
|
|
113677
|
+
|
|
113678
|
+
|
|
113679
|
+
|
|
113680
|
+
|
|
113681
|
+
const src_FilteringToken = (0,src_react.forwardRef)((_a, ref) => {
|
|
113682
|
+
var { tokens, showOperation, operation, groupOperation, andText, orText, groupAriaLabel, operationAriaLabel, groupEditAriaLabel, disabled = false, onChangeOperation, onChangeGroupOperation, onDismissToken, editorContent, editorHeader, editorDismissAriaLabel, editorExpandToViewport, onEditorOpen, hasGroups, popoverSize } = _a, rest = src_rest(_a, ["tokens", "showOperation", "operation", "groupOperation", "andText", "orText", "groupAriaLabel", "operationAriaLabel", "groupEditAriaLabel", "disabled", "onChangeOperation", "onChangeGroupOperation", "onDismissToken", "editorContent", "editorHeader", "editorDismissAriaLabel", "editorExpandToViewport", "onEditorOpen", "hasGroups", "popoverSize"]);
|
|
113683
|
+
const [nextFocusIndex, setNextFocusIndex] = (0,src_react.useState)(null);
|
|
113684
|
+
const tokenListRef = src_useListFocusController({
|
|
113685
|
+
nextFocusIndex,
|
|
113686
|
+
onFocusMoved: target => {
|
|
113687
|
+
target.focus();
|
|
113688
|
+
setNextFocusIndex(null);
|
|
113689
|
+
},
|
|
113690
|
+
listItemSelector: `.${src_filtering_token_styles_css['inner-root']}`,
|
|
113691
|
+
fallbackSelector: `.${src_filtering_token_styles_css.root}`,
|
|
113692
|
+
});
|
|
113693
|
+
const popoverRef = (0,src_react.useRef)(null);
|
|
113694
|
+
const popoverProps = {
|
|
113695
|
+
content: editorContent,
|
|
113696
|
+
triggerType: 'text',
|
|
113697
|
+
header: editorHeader,
|
|
113698
|
+
size: popoverSize,
|
|
113699
|
+
position: 'bottom',
|
|
113700
|
+
dismissAriaLabel: editorDismissAriaLabel,
|
|
113701
|
+
renderWithPortal: editorExpandToViewport,
|
|
113702
|
+
__onOpen: onEditorOpen,
|
|
113703
|
+
__closeAnalyticsAction: 'editClose',
|
|
113704
|
+
};
|
|
113705
|
+
(0,src_react.useImperativeHandle)(ref, () => ({ closeEditor: () => { var _a; return (_a = popoverRef.current) === null || _a === void 0 ? void 0 : _a.dismissPopover(); } }));
|
|
113706
|
+
return (src_react.createElement(src_TokenGroup, Object.assign({ ref: tokenListRef, ariaLabel: tokens.length === 1 ? tokens[0].ariaLabel : groupAriaLabel, operation: showOperation && (src_react.createElement(src_OperationSelector, { operation: operation, onChange: onChangeOperation, ariaLabel: operationAriaLabel, andText: andText, orText: orText, parent: true, disabled: disabled })), tokenAction: tokens.length === 1 ? (src_react.createElement(src_TokenDismissButton, { ariaLabel: tokens[0].dismissAriaLabel, onClick: () => onDismissToken(0), parent: true, disabled: disabled })) : (src_react.createElement(src_popover_internal, Object.assign({ ref: popoverRef }, popoverProps, { triggerType: "filtering-token" }),
|
|
113707
|
+
src_react.createElement(src_TokenEditButton, { ariaLabel: groupEditAriaLabel, disabled: disabled }))), parent: true, grouped: tokens.length > 1, disabled: disabled, hasGroups: hasGroups }, src_copyAnalyticsMetadataAttribute(rest)), tokens.length === 1 ? (src_react.createElement(src_popover_internal, Object.assign({ ref: popoverRef }, popoverProps),
|
|
113708
|
+
src_react.createElement("span", Object.assign({}, src_getAnalyticsMetadataAttribute({
|
|
113709
|
+
action: 'editStart',
|
|
113710
|
+
})), tokens[0].content))) : (src_react.createElement("ul", { className: src_filtering_token_styles_css.list }, tokens.map((token, index) => (src_react.createElement("li", { key: index },
|
|
113711
|
+
src_react.createElement(src_TokenGroup, { ariaLabel: token.ariaLabel, operation: index !== 0 && (src_react.createElement(src_OperationSelector, { operation: groupOperation, onChange: onChangeGroupOperation, ariaLabel: operationAriaLabel, andText: andText, orText: orText, parent: false, disabled: disabled })), tokenAction: src_react.createElement(src_TokenDismissButton, { ariaLabel: token.dismissAriaLabel, onClick: () => {
|
|
113712
|
+
onDismissToken(index);
|
|
113713
|
+
setNextFocusIndex(index);
|
|
113714
|
+
}, parent: false, disabled: disabled }), parent: false, grouped: false, disabled: disabled, hasGroups: false }, token.content))))))));
|
|
113715
|
+
});
|
|
113716
|
+
/* harmony default export */ const src_filtering_token = (src_FilteringToken);
|
|
113717
|
+
const src_TokenGroup = (0,src_react.forwardRef)((_a, ref) => {
|
|
113718
|
+
var { ariaLabel, children, operation, tokenAction, parent, grouped, disabled, hasGroups } = _a, rest = src_rest(_a, ["ariaLabel", "children", "operation", "tokenAction", "parent", "grouped", "disabled", "hasGroups"]);
|
|
113719
|
+
const groupRef = (0,src_react.useRef)(null);
|
|
113720
|
+
const mergedRef = src_useMergeRefs(ref, groupRef);
|
|
113721
|
+
const isCompactMode = src_useDensityMode(groupRef) === 'compact';
|
|
113722
|
+
return (src_react.createElement("div", Object.assign({ ref: mergedRef, className: src_clsx_m(parent
|
|
113723
|
+
? src_clsx_m(src_filtering_token_styles_css.root, src_property_filter_test_classes_styles_css['filtering-token'])
|
|
113724
|
+
: src_clsx_m(src_filtering_token_styles_css['inner-root'], src_property_filter_test_classes_styles_css['filtering-token-inner']), hasGroups && src_filtering_token_styles_css['has-groups'], isCompactMode && src_filtering_token_styles_css['compact-mode']), role: "group", "aria-label": ariaLabel }, src_copyAnalyticsMetadataAttribute(rest)),
|
|
113725
|
+
operation,
|
|
113726
|
+
src_react.createElement("div", { className: src_clsx_m(parent ? src_filtering_token_styles_css.token : src_filtering_token_styles_css['inner-token'], !!operation && src_filtering_token_styles_css['show-operation'], grouped && src_filtering_token_styles_css.grouped, disabled && src_filtering_token_styles_css['token-disabled']), "aria-disabled": disabled },
|
|
113727
|
+
src_react.createElement("div", { className: src_clsx_m(parent
|
|
113728
|
+
? src_clsx_m(src_filtering_token_styles_css['token-content'], src_property_filter_test_classes_styles_css['filtering-token-content'])
|
|
113729
|
+
: src_clsx_m(src_filtering_token_styles_css['inner-token-content'], src_property_filter_test_classes_styles_css['filtering-token-inner-content']), grouped && src_filtering_token_styles_css['token-content-grouped']) }, children),
|
|
113730
|
+
tokenAction)));
|
|
113731
|
+
});
|
|
113732
|
+
function src_OperationSelector({ operation, onChange, ariaLabel, andText, orText, parent, disabled, }) {
|
|
113733
|
+
return (src_react.createElement(src_select_internal, { __inFilteringToken: parent ? 'root' : 'nested', className: src_clsx_m(parent
|
|
113734
|
+
? src_clsx_m(src_filtering_token_styles_css.select, src_property_filter_test_classes_styles_css['filtering-token-select'])
|
|
113735
|
+
: src_clsx_m(src_filtering_token_styles_css['inner-select'], src_property_filter_test_classes_styles_css['filtering-token-inner-select'])), options: [
|
|
113736
|
+
{ value: 'and', label: andText },
|
|
113737
|
+
{ value: 'or', label: orText },
|
|
113738
|
+
], selectedOption: { value: operation, label: operation === 'and' ? andText : orText }, onChange: e => onChange(e.detail.selectedOption.value), disabled: disabled, ariaLabel: ariaLabel }));
|
|
113739
|
+
}
|
|
113740
|
+
function src_TokenDismissButton({ ariaLabel, onClick, parent, disabled, }) {
|
|
113741
|
+
return (src_react.createElement("button", Object.assign({ type: "button", className: src_clsx_m(parent
|
|
113742
|
+
? src_clsx_m(src_filtering_token_styles_css['dismiss-button'], src_property_filter_test_classes_styles_css['filtering-token-dismiss-button'])
|
|
113743
|
+
: src_clsx_m(src_filtering_token_styles_css['inner-dismiss-button'], src_property_filter_test_classes_styles_css['filtering-token-inner-dismiss-button'])), "aria-label": ariaLabel, onClick: onClick, disabled: disabled }, src_getAnalyticsMetadataAttribute({ action: 'dismiss' })),
|
|
113744
|
+
src_react.createElement(src_internal, { name: "close" })));
|
|
113745
|
+
}
|
|
113746
|
+
function src_TokenEditButton({ ariaLabel, disabled }) {
|
|
113747
|
+
return (src_react.createElement("button", { type: "button", className: src_clsx_m(src_filtering_token_styles_css['edit-button'], src_property_filter_test_classes_styles_css['filtering-token-edit-button']), "aria-label": ariaLabel, disabled: disabled },
|
|
113748
|
+
src_react.createElement(src_internal, { name: "edit" })));
|
|
113749
|
+
}
|
|
113750
|
+
//# sourceMappingURL=index.js.map
|
|
113751
|
+
;// ./node_modules/@cloudscape-design/components/property-filter/token-editor-inputs.js
|
|
113752
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
113753
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
113754
|
+
|
|
113755
|
+
|
|
113756
|
+
|
|
113757
|
+
|
|
113758
|
+
|
|
113759
|
+
|
|
113760
|
+
|
|
113761
|
+
|
|
113762
|
+
function src_PropertyInput({ property, onChangePropertyKey, asyncProps, filteringProperties, onLoadItems, customGroupsText, i18nStrings, freeTextFiltering, }) {
|
|
113763
|
+
var _a;
|
|
113764
|
+
const propertySelectHandlers = src_use_load_items_useLoadItems(onLoadItems);
|
|
113765
|
+
const asyncPropertySelectProps = asyncProps ? Object.assign(Object.assign({}, asyncProps), propertySelectHandlers) : {};
|
|
113766
|
+
const propertyOptions = src_getPropertySuggestions(filteringProperties, customGroupsText, i18nStrings, ({ propertyKey, propertyLabel }) => ({
|
|
113767
|
+
value: propertyKey,
|
|
113768
|
+
label: propertyLabel,
|
|
113769
|
+
dontCloseOnSelect: true,
|
|
113770
|
+
}));
|
|
113771
|
+
const allPropertiesOption = {
|
|
113772
|
+
label: i18nStrings.allPropertiesLabel,
|
|
113773
|
+
value: undefined,
|
|
113774
|
+
};
|
|
113775
|
+
if (!freeTextFiltering.disabled) {
|
|
113776
|
+
propertyOptions.unshift(allPropertiesOption);
|
|
113777
|
+
}
|
|
113778
|
+
return (src_react.createElement(src_select_internal, Object.assign({ options: propertyOptions, selectedOption: property
|
|
113779
|
+
? {
|
|
113780
|
+
value: (_a = property.propertyKey) !== null && _a !== void 0 ? _a : undefined,
|
|
113781
|
+
label: property.propertyLabel,
|
|
113782
|
+
}
|
|
113783
|
+
: allPropertiesOption, onChange: e => onChangePropertyKey(e.detail.selectedOption.value) }, asyncPropertySelectProps)));
|
|
113784
|
+
}
|
|
113785
|
+
function src_OperatorInput({ property, operator, onChangeOperator, i18nStrings, freeTextFiltering, triggerVariant, }) {
|
|
113786
|
+
const operatorOptions = (property ? src_getAllowedOperators(property) : freeTextFiltering.operators).map(operator => ({
|
|
113787
|
+
value: operator,
|
|
113788
|
+
label: operator,
|
|
113789
|
+
description: src_operatorToDescription(operator, i18nStrings),
|
|
113790
|
+
}));
|
|
113791
|
+
return (src_react.createElement(src_select_internal, { options: operatorOptions, triggerVariant: triggerVariant, selectedOption: operator
|
|
113792
|
+
? {
|
|
113793
|
+
value: operator,
|
|
113794
|
+
label: operator,
|
|
113795
|
+
description: src_operatorToDescription(operator, i18nStrings),
|
|
113796
|
+
}
|
|
113797
|
+
: null, onChange: e => onChangeOperator(e.detail.selectedOption.value) }));
|
|
113798
|
+
}
|
|
113799
|
+
function src_ValueInput(props) {
|
|
113800
|
+
const { property, operator, value, onChangeValue } = props;
|
|
113801
|
+
const OperatorForm = (property === null || property === void 0 ? void 0 : property.propertyKey) && operator && (property === null || property === void 0 ? void 0 : property.getValueFormRenderer(operator));
|
|
113802
|
+
if (OperatorForm) {
|
|
113803
|
+
return src_react.createElement(OperatorForm, { value: value, onChange: onChangeValue, operator: operator });
|
|
113804
|
+
}
|
|
113805
|
+
if (property && operator && property.getTokenType(operator) === 'enum') {
|
|
113806
|
+
return src_react.createElement(src_ValueInputEnum, Object.assign({}, props, { property: property, operator: operator }));
|
|
113807
|
+
}
|
|
113808
|
+
return src_react.createElement(src_ValueInputAuto, Object.assign({}, props));
|
|
113809
|
+
}
|
|
113810
|
+
function src_ValueInputAuto({ property, operator, value: unknownValue, onChangeValue, asyncProps, filteringOptions, onLoadItems, i18nStrings, }) {
|
|
113811
|
+
var _a;
|
|
113812
|
+
const value = (unknownValue !== null && unknownValue !== void 0 ? unknownValue : '') + '';
|
|
113813
|
+
const valueOptions = property
|
|
113814
|
+
? filteringOptions
|
|
113815
|
+
.filter(option => { var _a; return ((_a = option.property) === null || _a === void 0 ? void 0 : _a.propertyKey) === property.propertyKey; })
|
|
113816
|
+
.map(({ label, value }) => ({ label, value }))
|
|
113817
|
+
: [];
|
|
113818
|
+
const valueAutosuggestHandlers = src_use_load_items_useLoadItems(onLoadItems, '', property === null || property === void 0 ? void 0 : property.externalProperty, value, operator);
|
|
113819
|
+
const asyncValueAutosuggestProps = (property === null || property === void 0 ? void 0 : property.propertyKey)
|
|
113820
|
+
? Object.assign(Object.assign({}, valueAutosuggestHandlers), asyncProps) : { empty: asyncProps.empty };
|
|
113821
|
+
const [matchedOption] = valueOptions.filter(option => option.value === value);
|
|
113822
|
+
return (src_react.createElement(src_autosuggest_internal, Object.assign({ enteredTextLabel: i18nStrings.enteredTextLabel, value: (_a = matchedOption === null || matchedOption === void 0 ? void 0 : matchedOption.label) !== null && _a !== void 0 ? _a : value, clearAriaLabel: i18nStrings.clearAriaLabel, onChange: e => onChangeValue(e.detail.value), disabled: !operator, options: valueOptions }, asyncValueAutosuggestProps, { virtualScroll: true })));
|
|
113823
|
+
}
|
|
113824
|
+
function src_ValueInputEnum({ property, operator, value: unknownValue, onChangeValue, asyncProps, filteringOptions, onLoadItems, }) {
|
|
113825
|
+
const valueOptions = filteringOptions
|
|
113826
|
+
.filter(option => { var _a; return ((_a = option.property) === null || _a === void 0 ? void 0 : _a.propertyKey) === property.propertyKey; })
|
|
113827
|
+
.map(({ label, value }) => ({ label, value }));
|
|
113828
|
+
const valueAutosuggestHandlers = src_use_load_items_useLoadItems(onLoadItems, '', property.externalProperty, undefined, operator);
|
|
113829
|
+
const asyncValueAutosuggestProps = Object.assign(Object.assign({ statusType: 'finished' }, valueAutosuggestHandlers), asyncProps);
|
|
113830
|
+
const value = !unknownValue ? [] : Array.isArray(unknownValue) ? unknownValue : [unknownValue];
|
|
113831
|
+
const selectedOptions = valueOptions.filter(option => value.includes(option.value));
|
|
113832
|
+
return (src_react.createElement("div", { className: src_property_filter_styles_css['token-editor-multiselect-wrapper'] },
|
|
113833
|
+
src_react.createElement("div", { className: src_property_filter_styles_css['token-editor-multiselect-wrapper-inner'] },
|
|
113834
|
+
src_react.createElement(src_multiselect_internal, Object.assign({ filteringType: "auto", selectedOptions: selectedOptions, onChange: e => onChangeValue(e.detail.selectedOptions.map(o => o.value)), options: valueOptions.length > 0 ? [{ options: valueOptions, label: property.groupValuesLabel }] : [] }, asyncValueAutosuggestProps, { inlineTokens: true, hideTokens: true, keepOpen: true })))));
|
|
113835
|
+
}
|
|
113836
|
+
//# sourceMappingURL=token-editor-inputs.js.map
|
|
113837
|
+
;// ./node_modules/@cloudscape-design/components/property-filter/token-editor.js
|
|
113838
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
113839
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
113840
|
+
|
|
113841
|
+
|
|
113842
|
+
|
|
113843
|
+
|
|
113844
|
+
|
|
113845
|
+
|
|
113846
|
+
|
|
113847
|
+
|
|
113848
|
+
|
|
113849
|
+
|
|
113850
|
+
|
|
113851
|
+
|
|
113852
|
+
|
|
113853
|
+
|
|
113854
|
+
function src_TokenEditor({ supportsGroups, asyncProperties, asyncProps, customGroupsText, freeTextFiltering, filteringProperties, filteringOptions, i18nStrings, onLoadItems, onSubmit, onDismiss, tokensToCapture, onTokenCapture, onTokenRelease, tempGroup, onChangeTempGroup, }) {
|
|
113855
|
+
var _a;
|
|
113856
|
+
const [nextFocusIndex, setNextFocusIndex] = (0,src_react.useState)(null);
|
|
113857
|
+
const tokenListRef = src_useListFocusController({
|
|
113858
|
+
nextFocusIndex,
|
|
113859
|
+
onFocusMoved: target => {
|
|
113860
|
+
target.focus();
|
|
113861
|
+
setNextFocusIndex(null);
|
|
113862
|
+
},
|
|
113863
|
+
listItemSelector: `.${src_property_filter_styles_css['token-editor-field-property']}`,
|
|
113864
|
+
fallbackSelector: `.${src_property_filter_styles_css['token-editor-add-token']}`,
|
|
113865
|
+
});
|
|
113866
|
+
const groups = tempGroup.map((temporaryToken, index) => {
|
|
113867
|
+
const setTemporaryToken = (newToken) => {
|
|
113868
|
+
var _a;
|
|
113869
|
+
const copy = [...tempGroup];
|
|
113870
|
+
copy[index] = newToken;
|
|
113871
|
+
if (((_a = newToken.property) === null || _a === void 0 ? void 0 : _a.getTokenType(newToken.operator)) === 'enum' && newToken.value === null) {
|
|
113872
|
+
newToken.value = [];
|
|
113873
|
+
}
|
|
113874
|
+
onChangeTempGroup(copy);
|
|
113875
|
+
};
|
|
113876
|
+
const property = temporaryToken.property;
|
|
113877
|
+
const onChangePropertyKey = (newPropertyKey) => {
|
|
113878
|
+
var _a;
|
|
113879
|
+
const filteringProperty = filteringProperties.reduce((acc, property) => (property.propertyKey === newPropertyKey ? property : acc), undefined);
|
|
113880
|
+
const allowedOperators = filteringProperty ? src_getAllowedOperators(filteringProperty) : freeTextFiltering.operators;
|
|
113881
|
+
const operator = temporaryToken.operator && allowedOperators.indexOf(temporaryToken.operator) !== -1
|
|
113882
|
+
? temporaryToken.operator
|
|
113883
|
+
: allowedOperators[0];
|
|
113884
|
+
const matchedProperty = (_a = filteringProperties.find(property => property.propertyKey === newPropertyKey)) !== null && _a !== void 0 ? _a : null;
|
|
113885
|
+
setTemporaryToken(Object.assign(Object.assign({}, temporaryToken), { property: matchedProperty, operator, value: null }));
|
|
113886
|
+
};
|
|
113887
|
+
const operator = temporaryToken.operator;
|
|
113888
|
+
const onChangeOperator = (newOperator) => {
|
|
113889
|
+
const currentOperatorTokenType = property === null || property === void 0 ? void 0 : property.getTokenType(operator);
|
|
113890
|
+
const newOperatorTokenType = property === null || property === void 0 ? void 0 : property.getTokenType(newOperator);
|
|
113891
|
+
const shouldClearValue = currentOperatorTokenType !== newOperatorTokenType;
|
|
113892
|
+
const value = shouldClearValue ? null : temporaryToken.value;
|
|
113893
|
+
setTemporaryToken(Object.assign(Object.assign({}, temporaryToken), { operator: newOperator, value }));
|
|
113894
|
+
};
|
|
113895
|
+
const value = temporaryToken.value;
|
|
113896
|
+
const onChangeValue = (newValue) => {
|
|
113897
|
+
setTemporaryToken(Object.assign(Object.assign({}, temporaryToken), { value: newValue }));
|
|
113898
|
+
};
|
|
113899
|
+
return { token: temporaryToken, property, onChangePropertyKey, operator, onChangeOperator, value, onChangeValue };
|
|
113900
|
+
});
|
|
113901
|
+
return (src_react.createElement("div", { className: src_property_filter_styles_css['token-editor'], ref: tokenListRef },
|
|
113902
|
+
src_react.createElement(src_TokenEditorFields, { supportsGroups: supportsGroups, tokens: groups.map(group => group.token), onRemove: index => {
|
|
113903
|
+
const updated = tempGroup.filter((_, existingIndex) => existingIndex !== index);
|
|
113904
|
+
onChangeTempGroup(updated);
|
|
113905
|
+
setNextFocusIndex(index);
|
|
113906
|
+
}, onRemoveFromGroup: index => {
|
|
113907
|
+
const releasedToken = tempGroup[index];
|
|
113908
|
+
const updated = tempGroup.filter((_, existingIndex) => existingIndex !== index);
|
|
113909
|
+
onChangeTempGroup(updated);
|
|
113910
|
+
onTokenRelease(releasedToken);
|
|
113911
|
+
setNextFocusIndex(index);
|
|
113912
|
+
}, onSubmit: onSubmit, renderProperty: index => (src_react.createElement(src_PropertyInput, { property: groups[index].property, onChangePropertyKey: groups[index].onChangePropertyKey, asyncProps: asyncProperties ? asyncProps : null, filteringProperties: filteringProperties, onLoadItems: onLoadItems, customGroupsText: customGroupsText, i18nStrings: i18nStrings, freeTextFiltering: freeTextFiltering })), renderOperator: index => (src_react.createElement(src_OperatorInput, { property: groups[index].property, operator: groups[index].operator, onChangeOperator: groups[index].onChangeOperator, i18nStrings: i18nStrings, freeTextFiltering: freeTextFiltering, triggerVariant: supportsGroups ? 'label' : 'option' })), renderValue: index => (src_react.createElement(src_ValueInput, { property: groups[index].property, operator: groups[index].operator, value: groups[index].value, onChangeValue: groups[index].onChangeValue, asyncProps: asyncProps, filteringOptions: filteringOptions, onLoadItems: onLoadItems, i18nStrings: i18nStrings })), i18nStrings: i18nStrings }),
|
|
113913
|
+
supportsGroups && (src_react.createElement("div", { className: src_clsx_m(src_property_filter_styles_css['token-editor-add-token'], src_property_filter_test_classes_styles_css['token-editor-token-add-actions']) },
|
|
113914
|
+
src_react.createElement(src_button_dropdown_internal, { variant: "normal", ariaLabel: i18nStrings.tokenEditorAddTokenActionsAriaLabel, items: tokensToCapture.map((token, index) => {
|
|
113915
|
+
var _a, _b, _c, _d;
|
|
113916
|
+
return {
|
|
113917
|
+
id: index.toString(),
|
|
113918
|
+
text: (_b = (_a = i18nStrings.tokenEditorAddExistingTokenLabel) === null || _a === void 0 ? void 0 : _a.call(i18nStrings, token)) !== null && _b !== void 0 ? _b : '',
|
|
113919
|
+
ariaLabel: (_d = (_c = i18nStrings.tokenEditorAddExistingTokenAriaLabel) === null || _c === void 0 ? void 0 : _c.call(i18nStrings, token)) !== null && _d !== void 0 ? _d : '',
|
|
113920
|
+
};
|
|
113921
|
+
}), onItemClick: ({ detail }) => {
|
|
113922
|
+
const index = parseInt(detail.id);
|
|
113923
|
+
if (!isNaN(index) && tokensToCapture[index]) {
|
|
113924
|
+
onChangeTempGroup([...tempGroup, Object.assign({}, tokensToCapture[index])]);
|
|
113925
|
+
setNextFocusIndex(groups.length);
|
|
113926
|
+
onTokenCapture(tokensToCapture[index]);
|
|
113927
|
+
}
|
|
113928
|
+
}, disabled: tokensToCapture.length === 0, showMainActionOnly: tokensToCapture.length === 0, mainAction: {
|
|
113929
|
+
text: (_a = i18nStrings.tokenEditorAddNewTokenLabel) !== null && _a !== void 0 ? _a : '',
|
|
113930
|
+
onClick: () => {
|
|
113931
|
+
var _a;
|
|
113932
|
+
const lastTokenInGroup = tempGroup[tempGroup.length - 1];
|
|
113933
|
+
const property = lastTokenInGroup ? lastTokenInGroup.property : null;
|
|
113934
|
+
const operator = (_a = property === null || property === void 0 ? void 0 : property.defaultOperator) !== null && _a !== void 0 ? _a : ':';
|
|
113935
|
+
onChangeTempGroup([...tempGroup, { property, operator, value: null }]);
|
|
113936
|
+
setNextFocusIndex(groups.length);
|
|
113937
|
+
},
|
|
113938
|
+
} }))),
|
|
113939
|
+
src_react.createElement("div", { className: src_property_filter_styles_css['token-editor-actions'] },
|
|
113940
|
+
src_react.createElement("span", Object.assign({}, src_getAnalyticsMetadataAttribute({
|
|
113941
|
+
action: 'editCancel',
|
|
113942
|
+
})),
|
|
113943
|
+
src_react.createElement(src_button_internal, { formAction: "none", variant: "link", className: src_clsx_m(src_property_filter_styles_css['token-editor-cancel'], src_property_filter_test_classes_styles_css['token-editor-cancel']), onClick: onDismiss }, i18nStrings.cancelActionText)),
|
|
113944
|
+
src_react.createElement("span", Object.assign({}, src_getAnalyticsMetadataAttribute({
|
|
113945
|
+
action: 'editConfirm',
|
|
113946
|
+
})),
|
|
113947
|
+
src_react.createElement(src_button_internal, { className: src_clsx_m(src_property_filter_styles_css['token-editor-submit'], src_property_filter_test_classes_styles_css['token-editor-submit']), formAction: "none", onClick: onSubmit }, i18nStrings.applyActionText)))));
|
|
113948
|
+
}
|
|
113949
|
+
function src_TokenEditorFields({ tokens, supportsGroups, onRemove, onRemoveFromGroup, onSubmit, renderProperty, renderOperator, renderValue, i18nStrings, }) {
|
|
113950
|
+
const isMobile = src_useMobile();
|
|
113951
|
+
const isNarrow = isMobile || !supportsGroups;
|
|
113952
|
+
const propertyLabelId = src_useUniqueId();
|
|
113953
|
+
const operatorLabelId = src_useUniqueId();
|
|
113954
|
+
const valueLabelId = src_useUniqueId();
|
|
113955
|
+
const headers = (src_react.createElement("div", { className: src_property_filter_styles_css['token-editor-grid-group'] },
|
|
113956
|
+
src_react.createElement("div", { id: propertyLabelId, className: src_property_filter_styles_css['token-editor-grid-header'] }, i18nStrings.propertyText),
|
|
113957
|
+
src_react.createElement("div", { id: operatorLabelId, className: src_property_filter_styles_css['token-editor-grid-header'] }, i18nStrings.operatorText),
|
|
113958
|
+
src_react.createElement("div", { id: valueLabelId, className: src_property_filter_styles_css['token-editor-grid-header'] }, i18nStrings.valueText),
|
|
113959
|
+
src_react.createElement("div", { className: src_property_filter_styles_css['token-editor-grid-header'] })));
|
|
113960
|
+
return (src_react.createElement("form", { className: src_clsx_m(src_property_filter_styles_css['token-editor-grid'], isNarrow && src_property_filter_styles_css['token-editor-narrow'], src_property_filter_styles_css['token-editor-form']), onSubmit: event => {
|
|
113961
|
+
event.preventDefault();
|
|
113962
|
+
onSubmit();
|
|
113963
|
+
} },
|
|
113964
|
+
!isNarrow && headers,
|
|
113965
|
+
tokens.map((token, index) => {
|
|
113966
|
+
var _a, _b, _c, _d, _e, _f;
|
|
113967
|
+
return (src_react.createElement("div", { key: index, role: "group", "aria-label": i18nStrings.formatToken(token).formattedText, className: src_clsx_m(src_property_filter_styles_css['token-editor-grid-group'], supportsGroups && src_property_filter_styles_css['token-editor-supports-groups']) },
|
|
113968
|
+
src_react.createElement("div", { className: src_clsx_m(src_property_filter_styles_css['token-editor-grid-cell'], isNarrow && src_property_filter_styles_css['token-editor-narrow']) },
|
|
113969
|
+
src_react.createElement(src_TokenEditorField, { isNarrow: isNarrow, label: i18nStrings.propertyText, labelId: propertyLabelId, className: src_clsx_m(src_property_filter_styles_css['token-editor-field-property'], src_property_filter_test_classes_styles_css['token-editor-field-property']), index: index }, renderProperty(index))),
|
|
113970
|
+
src_react.createElement("div", { className: src_clsx_m(src_property_filter_styles_css['token-editor-grid-cell'], isNarrow && src_property_filter_styles_css['token-editor-narrow']) },
|
|
113971
|
+
src_react.createElement(src_TokenEditorField, { isNarrow: isNarrow, label: i18nStrings.operatorText, labelId: operatorLabelId, className: src_clsx_m(src_property_filter_styles_css['token-editor-field-operator'], src_property_filter_test_classes_styles_css['token-editor-field-operator']), index: index }, renderOperator(index))),
|
|
113972
|
+
src_react.createElement("div", { className: src_clsx_m(src_property_filter_styles_css['token-editor-grid-cell'], isNarrow && src_property_filter_styles_css['token-editor-narrow']) },
|
|
113973
|
+
src_react.createElement(src_TokenEditorField, { isNarrow: isNarrow, label: i18nStrings.valueText, labelId: valueLabelId, className: src_clsx_m(src_property_filter_styles_css['token-editor-field-value'], src_property_filter_test_classes_styles_css['token-editor-field-value']), index: index }, renderValue(index))),
|
|
113974
|
+
supportsGroups && (src_react.createElement("div", { className: src_clsx_m(src_property_filter_styles_css['token-editor-grid-cell'], isNarrow && src_property_filter_styles_css['token-editor-narrow']) },
|
|
113975
|
+
src_react.createElement("div", { className: src_property_filter_styles_css['token-editor-remove-token'] },
|
|
113976
|
+
src_react.createElement(src_TokenEditorRemoveActions, { isNarrow: isNarrow, ariaLabel: (_b = (_a = i18nStrings.tokenEditorTokenActionsAriaLabel) === null || _a === void 0 ? void 0 : _a.call(i18nStrings, token)) !== null && _b !== void 0 ? _b : '', mainActionAriaLabel: (_d = (_c = i18nStrings.tokenEditorTokenRemoveAriaLabel) === null || _c === void 0 ? void 0 : _c.call(i18nStrings, token)) !== null && _d !== void 0 ? _d : '', disabled: tokens.length === 1, items: [
|
|
113977
|
+
{
|
|
113978
|
+
id: 'remove',
|
|
113979
|
+
text: (_e = i18nStrings.tokenEditorTokenRemoveLabel) !== null && _e !== void 0 ? _e : '',
|
|
113980
|
+
disabled: token.standaloneIndex !== undefined,
|
|
113981
|
+
},
|
|
113982
|
+
{ id: 'remove-from-group', text: (_f = i18nStrings.tokenEditorTokenRemoveFromGroupLabel) !== null && _f !== void 0 ? _f : '' },
|
|
113983
|
+
], onItemClick: itemId => {
|
|
113984
|
+
switch (itemId) {
|
|
113985
|
+
case 'remove':
|
|
113986
|
+
return onRemove(index);
|
|
113987
|
+
case 'remove-from-group':
|
|
113988
|
+
return onRemoveFromGroup(index);
|
|
113989
|
+
}
|
|
113990
|
+
}, index: index }))))));
|
|
113991
|
+
})));
|
|
113992
|
+
}
|
|
113993
|
+
function src_TokenEditorField({ isNarrow, label, labelId, children, className, index, }) {
|
|
113994
|
+
return isNarrow ? (src_react.createElement(src_InternalFormField, { label: label, className: className, stretch: true, "data-testindex": index }, children)) : (src_react.createElement(src_FormFieldContext.Provider, { value: { ariaLabelledby: labelId } },
|
|
113995
|
+
src_react.createElement(src_InternalFormField, { className: className, "data-testindex": index }, children)));
|
|
113996
|
+
}
|
|
113997
|
+
function src_TokenEditorRemoveActions({ isNarrow, ariaLabel, mainActionAriaLabel, disabled, items, onItemClick, index, }) {
|
|
113998
|
+
return isNarrow ? (src_react.createElement(src_button_dropdown_internal, { variant: "normal", ariaLabel: ariaLabel, items: items.slice(1), onItemClick: ({ detail }) => onItemClick(detail.id), disabled: disabled, mainAction: {
|
|
113999
|
+
text: items[0].text,
|
|
114000
|
+
onClick: () => onItemClick(items[0].id),
|
|
114001
|
+
disabled,
|
|
114002
|
+
ariaLabel: mainActionAriaLabel,
|
|
114003
|
+
}, className: src_property_filter_test_classes_styles_css['token-editor-token-remove-actions'], "data-testindex": index })) : (src_react.createElement(src_button_dropdown_internal, { variant: "icon", ariaLabel: ariaLabel, items: items, onItemClick: ({ detail }) => onItemClick(detail.id), disabled: disabled, className: src_property_filter_test_classes_styles_css['token-editor-token-remove-actions'], "data-testindex": index }));
|
|
114004
|
+
}
|
|
114005
|
+
//# sourceMappingURL=token-editor.js.map
|
|
114006
|
+
;// ./node_modules/@cloudscape-design/components/property-filter/analytics-metadata/styles.scoped.css
|
|
114007
|
+
// extracted by mini-css-extract-plugin
|
|
114008
|
+
|
|
114009
|
+
;// ./node_modules/@cloudscape-design/components/property-filter/analytics-metadata/styles.css.js
|
|
114010
|
+
|
|
114011
|
+
|
|
114012
|
+
/* harmony default export */ const src_property_filter_analytics_metadata_styles_css = ({
|
|
114013
|
+
"token-trigger": "awsui_token-trigger_1b6uy_xiape_5",
|
|
114014
|
+
"search-field": "awsui_search-field_1b6uy_xiape_6"
|
|
114015
|
+
});
|
|
114016
|
+
|
|
114017
|
+
;// ./node_modules/@cloudscape-design/components/property-filter/token.js
|
|
114018
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
114019
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
114020
|
+
|
|
114021
|
+
|
|
114022
|
+
|
|
114023
|
+
|
|
114024
|
+
|
|
114025
|
+
|
|
114026
|
+
|
|
114027
|
+
|
|
114028
|
+
const src_TokenButton = ({ query, onUpdateToken, onUpdateOperation, onRemoveToken, tokenIndex, filteringProperties, filteringOptions, asyncProps, onLoadItems, i18nStrings, asyncProperties, hideOperations, customGroupsText, disabled, freeTextFiltering, expandToViewport, enableTokenGroups, }) => {
|
|
114029
|
+
var _a, _b, _c, _d;
|
|
114030
|
+
const tokenRef = (0,src_react.useRef)(null);
|
|
114031
|
+
const hasGroups = query.tokens.some(tokenOrGroup => 'operation' in tokenOrGroup);
|
|
114032
|
+
const first = tokenIndex === 0;
|
|
114033
|
+
const tokenOrGroup = query.tokens[tokenIndex];
|
|
114034
|
+
const tokens = src_tokenGroupToTokens([tokenOrGroup]).map(t => (Object.assign(Object.assign({}, t), { standaloneIndex: undefined })));
|
|
114035
|
+
const operation = query.operation;
|
|
114036
|
+
const groupOperation = 'operation' in tokenOrGroup ? tokenOrGroup.operation : operation === 'and' ? 'or' : 'and';
|
|
114037
|
+
const [tempTokens, setTempTokens] = (0,src_react.useState)(tokens);
|
|
114038
|
+
const capturedTokenIndices = tempTokens.map(token => token.standaloneIndex).filter(index => index !== undefined);
|
|
114039
|
+
const tokensToCapture = [];
|
|
114040
|
+
for (let index = 0; index < query.tokens.length; index++) {
|
|
114041
|
+
const token = query.tokens[index];
|
|
114042
|
+
if ('operator' in token && token !== tokenOrGroup && !capturedTokenIndices.includes(index)) {
|
|
114043
|
+
tokensToCapture.push(token);
|
|
114044
|
+
}
|
|
114045
|
+
}
|
|
114046
|
+
const [tempReleasedTokens, setTempReleasedTokens] = (0,src_react.useState)([]);
|
|
114047
|
+
tokensToCapture.push(...tempReleasedTokens);
|
|
114048
|
+
return (src_react.createElement(src_filtering_token, Object.assign({ ref: tokenRef, tokens: tokens.map(token => {
|
|
114049
|
+
const formattedToken = i18nStrings.formatToken(token);
|
|
114050
|
+
return {
|
|
114051
|
+
content: (src_react.createElement("span", { className: src_clsx_m(src_property_filter_styles_css['token-trigger'], src_property_filter_analytics_metadata_styles_css['token-trigger']) },
|
|
114052
|
+
src_react.createElement(src_TokenTrigger, { token: formattedToken, allProperties: token.property === null }))),
|
|
114053
|
+
ariaLabel: formattedToken.formattedText,
|
|
114054
|
+
dismissAriaLabel: i18nStrings.removeTokenButtonAriaLabel(token),
|
|
114055
|
+
};
|
|
114056
|
+
}), showOperation: !first && !hideOperations, operation: operation, andText: (_a = i18nStrings.operationAndText) !== null && _a !== void 0 ? _a : '', orText: (_b = i18nStrings.operationOrText) !== null && _b !== void 0 ? _b : '', operationAriaLabel: (_c = i18nStrings.tokenOperatorAriaLabel) !== null && _c !== void 0 ? _c : '', onChangeOperation: onUpdateOperation, onDismissToken: (removeIndex) => {
|
|
114057
|
+
if (tokens.length === 1) {
|
|
114058
|
+
onRemoveToken();
|
|
114059
|
+
}
|
|
114060
|
+
else {
|
|
114061
|
+
const newTokens = tokens.filter((_, index) => index !== removeIndex);
|
|
114062
|
+
const updatedToken = newTokens.length === 1 ? newTokens[0] : { operation: groupOperation, tokens: newTokens };
|
|
114063
|
+
onUpdateToken(updatedToken, []);
|
|
114064
|
+
}
|
|
114065
|
+
}, disabled: disabled, editorContent: src_react.createElement(src_TokenEditor, { supportsGroups: enableTokenGroups, filteringProperties: filteringProperties, filteringOptions: filteringOptions, tempGroup: tempTokens, onChangeTempGroup: setTempTokens, tokensToCapture: tokensToCapture, onTokenCapture: capturedToken => setTempReleasedTokens(prev => prev.filter(token => token !== capturedToken)), onTokenRelease: releasedToken => {
|
|
114066
|
+
if (releasedToken.standaloneIndex === undefined) {
|
|
114067
|
+
setTempReleasedTokens(prev => [...prev, releasedToken]);
|
|
114068
|
+
}
|
|
114069
|
+
}, asyncProps: asyncProps, onLoadItems: onLoadItems, i18nStrings: i18nStrings, asyncProperties: asyncProperties, customGroupsText: customGroupsText, freeTextFiltering: freeTextFiltering, onDismiss: () => {
|
|
114070
|
+
var _a;
|
|
114071
|
+
(_a = tokenRef.current) === null || _a === void 0 ? void 0 : _a.closeEditor();
|
|
114072
|
+
}, onSubmit: () => {
|
|
114073
|
+
var _a;
|
|
114074
|
+
const updatedToken = tempTokens.length === 1 ? tempTokens[0] : { operation: groupOperation, tokens: tempTokens };
|
|
114075
|
+
onUpdateToken(updatedToken, tempReleasedTokens);
|
|
114076
|
+
(_a = tokenRef.current) === null || _a === void 0 ? void 0 : _a.closeEditor();
|
|
114077
|
+
} }), editorHeader: (_d = i18nStrings.editTokenHeader) !== null && _d !== void 0 ? _d : '', editorDismissAriaLabel: i18nStrings.dismissAriaLabel, editorExpandToViewport: !!expandToViewport, onEditorOpen: () => {
|
|
114078
|
+
setTempTokens(tokens);
|
|
114079
|
+
setTempReleasedTokens([]);
|
|
114080
|
+
}, groupOperation: groupOperation, onChangeGroupOperation: operation => onUpdateToken({ operation, tokens }, []), groupAriaLabel: i18nStrings.groupAriaLabel({ operation: groupOperation, tokens }), groupEditAriaLabel: i18nStrings.groupEditAriaLabel({ operation: groupOperation, tokens }), hasGroups: hasGroups, popoverSize: enableTokenGroups ? 'content' : 'large' }, src_getAnalyticsMetadataAttribute({
|
|
114081
|
+
detail: {
|
|
114082
|
+
tokenPosition: `${tokenIndex + 1}`,
|
|
114083
|
+
tokenLabel: `.${src_property_filter_analytics_metadata_styles_css['token-trigger']}`,
|
|
114084
|
+
},
|
|
114085
|
+
}))));
|
|
114086
|
+
};
|
|
114087
|
+
const src_TokenTrigger = ({ token: { propertyLabel, operator, value }, allProperties, }) => {
|
|
114088
|
+
if (propertyLabel) {
|
|
114089
|
+
propertyLabel += ' ';
|
|
114090
|
+
}
|
|
114091
|
+
const freeTextContainsToken = operator === ':' && allProperties;
|
|
114092
|
+
const operatorText = freeTextContainsToken ? '' : operator + ' ';
|
|
114093
|
+
return (src_react.createElement(src_react.Fragment, null,
|
|
114094
|
+
allProperties ? '' : propertyLabel,
|
|
114095
|
+
src_react.createElement("span", { className: src_property_filter_styles_css['token-operator'] }, operatorText),
|
|
114096
|
+
value));
|
|
114097
|
+
};
|
|
114098
|
+
//# sourceMappingURL=token.js.map
|
|
114099
|
+
;// ./node_modules/@cloudscape-design/components/property-filter/internal.js
|
|
114100
|
+
|
|
114101
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
114102
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
114103
|
+
|
|
114104
|
+
|
|
114105
|
+
|
|
114106
|
+
|
|
114107
|
+
|
|
114108
|
+
|
|
114109
|
+
|
|
114110
|
+
|
|
114111
|
+
|
|
114112
|
+
|
|
114113
|
+
|
|
114114
|
+
|
|
114115
|
+
|
|
114116
|
+
|
|
114117
|
+
|
|
114118
|
+
|
|
114119
|
+
|
|
114120
|
+
|
|
114121
|
+
|
|
114122
|
+
|
|
114123
|
+
|
|
114124
|
+
|
|
114125
|
+
|
|
114126
|
+
const src_PropertyFilterInternal = src_react.forwardRef((_a, ref) => {
|
|
114127
|
+
var _b;
|
|
114128
|
+
var { disabled, countText, query, hideOperations, onChange, filteringProperties, filteringOptions, customGroupsText, disableFreeTextFiltering, freeTextFiltering, onLoadItems, virtualScroll, customControl, customFilterActions, filteringPlaceholder, filteringAriaLabel, filteringEmpty, filteringLoadingText, filteringFinishedText, filteringErrorText, filteringRecoveryText, filteringConstraintText, filteringStatusType, asyncProperties, tokenLimit, expandToViewport, tokenLimitShowFewerAriaLabel, tokenLimitShowMoreAriaLabel, enableTokenGroups, loading = false, __internalRootRef } = _a, rest = src_rest(_a, ["disabled", "countText", "query", "hideOperations", "onChange", "filteringProperties", "filteringOptions", "customGroupsText", "disableFreeTextFiltering", "freeTextFiltering", "onLoadItems", "virtualScroll", "customControl", "customFilterActions", "filteringPlaceholder", "filteringAriaLabel", "filteringEmpty", "filteringLoadingText", "filteringFinishedText", "filteringErrorText", "filteringRecoveryText", "filteringConstraintText", "filteringStatusType", "asyncProperties", "tokenLimit", "expandToViewport", "tokenLimitShowFewerAriaLabel", "tokenLimitShowMoreAriaLabel", "enableTokenGroups", "loading", "__internalRootRef"]);
|
|
114129
|
+
const [nextFocusIndex, setNextFocusIndex] = (0,src_react.useState)(null);
|
|
114130
|
+
const tokenListRef = src_useListFocusController({
|
|
114131
|
+
nextFocusIndex,
|
|
114132
|
+
onFocusMoved: (target, targetType) => {
|
|
114133
|
+
var _a;
|
|
114134
|
+
if (targetType === 'fallback') {
|
|
114135
|
+
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus({ preventDropdown: true });
|
|
114136
|
+
}
|
|
114137
|
+
else {
|
|
114138
|
+
target.focus();
|
|
114139
|
+
}
|
|
114140
|
+
setNextFocusIndex(null);
|
|
114141
|
+
},
|
|
114142
|
+
listItemSelector: `.${src_token_list_styles_css['list-item']}`,
|
|
114143
|
+
showMoreSelector: `.${src_token_list_styles_css.toggle}`,
|
|
114144
|
+
fallbackSelector: `.${src_property_filter_styles_css.input}`,
|
|
114145
|
+
});
|
|
114146
|
+
const mergedRef = src_useMergeRefs(tokenListRef, __internalRootRef);
|
|
114147
|
+
const inputRef = (0,src_react.useRef)(null);
|
|
114148
|
+
const searchResultsRef = (0,src_react.useRef)(null);
|
|
114149
|
+
const baseProps = src_getBaseProps(rest);
|
|
114150
|
+
const i18nStrings = src_usePropertyFilterI18n(rest.i18nStrings);
|
|
114151
|
+
(0,src_react.useImperativeHandle)(ref, () => ({ focus: () => { var _a; return (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus(); } }), []);
|
|
114152
|
+
const [filteringText, setFilteringText] = (0,src_react.useState)('');
|
|
114153
|
+
const { internalProperties, internalOptions, internalQuery, internalFreeText } = (() => {
|
|
114154
|
+
var _a, _b;
|
|
114155
|
+
const propertyByKey = filteringProperties.reduce((acc, property) => {
|
|
114156
|
+
var _a, _b, _c, _d, _e;
|
|
114157
|
+
const extendedOperators = ((_a = property === null || property === void 0 ? void 0 : property.operators) !== null && _a !== void 0 ? _a : []).reduce((acc, operator) => (typeof operator === 'object' ? acc.set(operator.operator, operator) : acc), new Map());
|
|
114158
|
+
acc.set(property.key, {
|
|
114159
|
+
propertyKey: property.key,
|
|
114160
|
+
propertyLabel: (_b = property === null || property === void 0 ? void 0 : property.propertyLabel) !== null && _b !== void 0 ? _b : '',
|
|
114161
|
+
groupValuesLabel: (_c = property === null || property === void 0 ? void 0 : property.groupValuesLabel) !== null && _c !== void 0 ? _c : '',
|
|
114162
|
+
propertyGroup: property === null || property === void 0 ? void 0 : property.group,
|
|
114163
|
+
operators: ((_d = property === null || property === void 0 ? void 0 : property.operators) !== null && _d !== void 0 ? _d : []).map(op => (typeof op === 'string' ? op : op.operator)),
|
|
114164
|
+
defaultOperator: (_e = property === null || property === void 0 ? void 0 : property.defaultOperator) !== null && _e !== void 0 ? _e : '=',
|
|
114165
|
+
getTokenType: operator => { var _a, _b; return (operator ? (_b = (_a = extendedOperators.get(operator)) === null || _a === void 0 ? void 0 : _a.tokenType) !== null && _b !== void 0 ? _b : 'value' : 'value'); },
|
|
114166
|
+
getValueFormatter: operator => { var _a, _b; return (operator ? (_b = (_a = extendedOperators.get(operator)) === null || _a === void 0 ? void 0 : _a.format) !== null && _b !== void 0 ? _b : null : null); },
|
|
114167
|
+
getValueFormRenderer: operator => { var _a, _b; return (operator ? (_b = (_a = extendedOperators.get(operator)) === null || _a === void 0 ? void 0 : _a.form) !== null && _b !== void 0 ? _b : null : null); },
|
|
114168
|
+
externalProperty: property,
|
|
114169
|
+
});
|
|
114170
|
+
return acc;
|
|
114171
|
+
}, new Map());
|
|
114172
|
+
const getProperty = (propertyKey) => { var _a; return (_a = propertyByKey.get(propertyKey)) !== null && _a !== void 0 ? _a : null; };
|
|
114173
|
+
const internalOptions = filteringOptions.map(option => {
|
|
114174
|
+
var _a, _b;
|
|
114175
|
+
return ({
|
|
114176
|
+
property: getProperty(option.propertyKey),
|
|
114177
|
+
value: option.value,
|
|
114178
|
+
label: (_b = (_a = option.label) !== null && _a !== void 0 ? _a : option.value) !== null && _b !== void 0 ? _b : '',
|
|
114179
|
+
});
|
|
114180
|
+
});
|
|
114181
|
+
function transformToken(tokenOrGroup, standaloneIndex) {
|
|
114182
|
+
return 'operation' in tokenOrGroup
|
|
114183
|
+
? {
|
|
114184
|
+
operation: tokenOrGroup.operation,
|
|
114185
|
+
tokens: tokenOrGroup.tokens.map(token => transformToken(token)),
|
|
114186
|
+
}
|
|
114187
|
+
: {
|
|
114188
|
+
standaloneIndex,
|
|
114189
|
+
property: tokenOrGroup.propertyKey ? getProperty(tokenOrGroup.propertyKey) : null,
|
|
114190
|
+
operator: tokenOrGroup.operator,
|
|
114191
|
+
value: tokenOrGroup.value,
|
|
114192
|
+
};
|
|
114193
|
+
}
|
|
114194
|
+
const internalQuery = {
|
|
114195
|
+
operation: query.operation,
|
|
114196
|
+
tokens: (enableTokenGroups && query.tokenGroups ? query.tokenGroups : query.tokens).map(transformToken),
|
|
114197
|
+
};
|
|
114198
|
+
const internalFreeText = {
|
|
114199
|
+
disabled: disableFreeTextFiltering,
|
|
114200
|
+
operators: (_a = freeTextFiltering === null || freeTextFiltering === void 0 ? void 0 : freeTextFiltering.operators) !== null && _a !== void 0 ? _a : [':', '!:'],
|
|
114201
|
+
defaultOperator: (_b = freeTextFiltering === null || freeTextFiltering === void 0 ? void 0 : freeTextFiltering.defaultOperator) !== null && _b !== void 0 ? _b : ':',
|
|
114202
|
+
};
|
|
114203
|
+
return { internalProperties: [...propertyByKey.values()], internalOptions, internalQuery, internalFreeText };
|
|
114204
|
+
})();
|
|
114205
|
+
const { addToken, updateToken, updateOperation, removeToken, removeAllTokens } = src_getQueryActions({
|
|
114206
|
+
query: internalQuery,
|
|
114207
|
+
filteringOptions: internalOptions,
|
|
114208
|
+
onChange,
|
|
114209
|
+
enableTokenGroups,
|
|
114210
|
+
});
|
|
114211
|
+
const parsedText = src_parseText(filteringText, internalProperties, internalFreeText);
|
|
114212
|
+
const autosuggestOptions = src_getAutosuggestOptions(parsedText, internalProperties, internalOptions, customGroupsText, i18nStrings);
|
|
114213
|
+
const createToken = (currentText) => {
|
|
114214
|
+
const parsedText = src_parseText(currentText, internalProperties, internalFreeText);
|
|
114215
|
+
let newToken;
|
|
114216
|
+
switch (parsedText.step) {
|
|
114217
|
+
case 'property': {
|
|
114218
|
+
newToken = {
|
|
114219
|
+
property: parsedText.property,
|
|
114220
|
+
operator: parsedText.operator,
|
|
114221
|
+
value: parsedText.value,
|
|
114222
|
+
};
|
|
114223
|
+
break;
|
|
114224
|
+
}
|
|
114225
|
+
case 'free-text': {
|
|
114226
|
+
newToken = {
|
|
114227
|
+
property: null,
|
|
114228
|
+
operator: parsedText.operator || internalFreeText.defaultOperator,
|
|
114229
|
+
value: parsedText.value,
|
|
114230
|
+
};
|
|
114231
|
+
break;
|
|
114232
|
+
}
|
|
114233
|
+
case 'operator': {
|
|
114234
|
+
newToken = {
|
|
114235
|
+
property: null,
|
|
114236
|
+
operator: internalFreeText.defaultOperator,
|
|
114237
|
+
value: currentText,
|
|
114238
|
+
};
|
|
114239
|
+
break;
|
|
114240
|
+
}
|
|
114241
|
+
}
|
|
114242
|
+
if (internalFreeText.disabled && !newToken.property) {
|
|
114243
|
+
return;
|
|
114244
|
+
}
|
|
114245
|
+
addToken(newToken);
|
|
114246
|
+
setFilteringText('');
|
|
114247
|
+
};
|
|
114248
|
+
const getLoadMoreDetail = (parsedText, filteringText) => {
|
|
114249
|
+
const loadMoreDetail = {
|
|
114250
|
+
filteringProperty: undefined,
|
|
114251
|
+
filteringText,
|
|
114252
|
+
filteringOperator: undefined,
|
|
114253
|
+
};
|
|
114254
|
+
if (parsedText.step === 'property') {
|
|
114255
|
+
loadMoreDetail.filteringProperty = parsedText.property.externalProperty;
|
|
114256
|
+
loadMoreDetail.filteringText = parsedText.value;
|
|
114257
|
+
loadMoreDetail.filteringOperator = parsedText.operator;
|
|
114258
|
+
}
|
|
114259
|
+
return loadMoreDetail;
|
|
114260
|
+
};
|
|
114261
|
+
const loadMoreDetail = getLoadMoreDetail(parsedText, filteringText);
|
|
114262
|
+
const inputLoadItemsHandlers = src_use_load_items_useLoadItems(onLoadItems, loadMoreDetail.filteringText, loadMoreDetail.filteringProperty, loadMoreDetail.filteringText, loadMoreDetail.filteringOperator);
|
|
114263
|
+
const asyncProps = {
|
|
114264
|
+
empty: filteringEmpty,
|
|
114265
|
+
loadingText: filteringLoadingText,
|
|
114266
|
+
finishedText: filteringFinishedText,
|
|
114267
|
+
errorText: filteringErrorText,
|
|
114268
|
+
recoveryText: filteringRecoveryText,
|
|
114269
|
+
statusType: filteringStatusType,
|
|
114270
|
+
};
|
|
114271
|
+
const asyncAutosuggestProps = !!filteringText.length || asyncProperties
|
|
114272
|
+
? Object.assign(Object.assign({}, inputLoadItemsHandlers), asyncProps) : {};
|
|
114273
|
+
const handleSelected = event => {
|
|
114274
|
+
var _a;
|
|
114275
|
+
const { detail: option } = event;
|
|
114276
|
+
const value = option.value || '';
|
|
114277
|
+
if (!value) {
|
|
114278
|
+
return;
|
|
114279
|
+
}
|
|
114280
|
+
if (!('keepOpenOnSelect' in option)) {
|
|
114281
|
+
createToken(value);
|
|
114282
|
+
return;
|
|
114283
|
+
}
|
|
114284
|
+
// stop dropdown from closing
|
|
114285
|
+
event.preventDefault();
|
|
114286
|
+
const parsedText = src_parseText(value, internalProperties, internalFreeText);
|
|
114287
|
+
const loadMoreDetail = getLoadMoreDetail(parsedText, value);
|
|
114288
|
+
// Insert operator automatically if only one operator is defined for the given property.
|
|
114289
|
+
if (parsedText.step === 'operator') {
|
|
114290
|
+
const operators = src_getAllowedOperators(parsedText.property);
|
|
114291
|
+
if (value.trim() === parsedText.property.propertyLabel && operators.length === 1) {
|
|
114292
|
+
loadMoreDetail.filteringProperty = (_a = parsedText.property.externalProperty) !== null && _a !== void 0 ? _a : undefined;
|
|
114293
|
+
loadMoreDetail.filteringOperator = operators[0];
|
|
114294
|
+
loadMoreDetail.filteringText = '';
|
|
114295
|
+
setFilteringText(parsedText.property.propertyLabel + ' ' + operators[0] + ' ');
|
|
114296
|
+
}
|
|
114297
|
+
}
|
|
114298
|
+
src_fireNonCancelableEvent(onLoadItems, Object.assign(Object.assign({}, loadMoreDetail), { firstPage: true, samePage: false }));
|
|
114299
|
+
};
|
|
114300
|
+
src_useDebounceSearchResultCallback({
|
|
114301
|
+
searchQuery: query,
|
|
114302
|
+
countText,
|
|
114303
|
+
loading,
|
|
114304
|
+
announceCallback: () => {
|
|
114305
|
+
var _a;
|
|
114306
|
+
(_a = searchResultsRef.current) === null || _a === void 0 ? void 0 : _a.reannounce();
|
|
114307
|
+
},
|
|
114308
|
+
});
|
|
114309
|
+
const propertyStep = parsedText.step === 'property' ? parsedText : null;
|
|
114310
|
+
const customValueKey = propertyStep ? propertyStep.property.propertyKey + ':' + propertyStep.operator : '';
|
|
114311
|
+
const [customFormValueRecord, setCustomFormValueRecord] = (0,src_react.useState)({});
|
|
114312
|
+
const customFormValue = customValueKey in customFormValueRecord ? customFormValueRecord[customValueKey] : null;
|
|
114313
|
+
const setCustomFormValue = (value) => setCustomFormValueRecord({ [customValueKey]: value });
|
|
114314
|
+
const operatorForm = propertyStep && propertyStep.property.getValueFormRenderer(propertyStep.operator);
|
|
114315
|
+
const isEnumValue = (propertyStep === null || propertyStep === void 0 ? void 0 : propertyStep.property.getTokenType(propertyStep.operator)) === 'enum';
|
|
114316
|
+
const searchResultsId = src_useUniqueId('property-filter-search-results');
|
|
114317
|
+
const constraintTextId = src_useUniqueId('property-filter-constraint');
|
|
114318
|
+
const textboxAriaDescribedBy = filteringConstraintText
|
|
114319
|
+
? src_joinStrings(rest.ariaDescribedby, constraintTextId)
|
|
114320
|
+
: rest.ariaDescribedby;
|
|
114321
|
+
const showResults = !!((_b = internalQuery.tokens) === null || _b === void 0 ? void 0 : _b.length) && !disabled && !!countText;
|
|
114322
|
+
return (src_react.createElement("div", Object.assign({}, baseProps, { className: src_clsx_m(baseProps.className, src_property_filter_styles_css.root), ref: mergedRef }),
|
|
114323
|
+
src_react.createElement("div", { className: src_clsx_m(src_property_filter_styles_css['search-field'], src_property_filter_analytics_metadata_styles_css['search-field']) },
|
|
114324
|
+
customControl && src_react.createElement("div", { className: src_property_filter_styles_css['custom-control'] }, customControl),
|
|
114325
|
+
src_react.createElement("div", { className: src_property_filter_styles_css['input-wrapper'] },
|
|
114326
|
+
src_react.createElement(src_property_filter_autosuggest, Object.assign({ ref: inputRef, virtualScroll: virtualScroll, enteredTextLabel: i18nStrings.enteredTextLabel, ariaLabel: filteringAriaLabel !== null && filteringAriaLabel !== void 0 ? filteringAriaLabel : i18nStrings.filteringAriaLabel, placeholder: filteringPlaceholder !== null && filteringPlaceholder !== void 0 ? filteringPlaceholder : i18nStrings.filteringPlaceholder, ariaLabelledby: rest.ariaLabelledby, ariaDescribedby: textboxAriaDescribedBy, controlId: rest.controlId, value: filteringText, disabled: disabled }, autosuggestOptions, { onChange: event => setFilteringText(event.detail.value), empty: filteringEmpty }, asyncAutosuggestProps, { expandToViewport: expandToViewport, onOptionClick: handleSelected, customForm: operatorForm || isEnumValue
|
|
114327
|
+
? {
|
|
114328
|
+
content: operatorForm ? (src_react.createElement(src_PropertyEditorContentCustom, { key: customValueKey, property: propertyStep.property, operator: propertyStep.operator, filter: propertyStep.value, operatorForm: operatorForm, value: customFormValue, onChange: setCustomFormValue })) : (src_react.createElement(src_PropertyEditorContentEnum, { key: customValueKey, property: propertyStep.property, filter: propertyStep.value, value: customFormValue, onChange: setCustomFormValue, asyncProps: asyncProps, filteringOptions: internalOptions, onLoadItems: inputLoadItemsHandlers.onLoadItems })),
|
|
114329
|
+
footer: (src_react.createElement(src_PropertyEditorFooter, { key: customValueKey, property: propertyStep.property, operator: propertyStep.operator, value: customFormValue, i18nStrings: i18nStrings, onCancel: () => {
|
|
114330
|
+
var _a, _b;
|
|
114331
|
+
setFilteringText('');
|
|
114332
|
+
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.close();
|
|
114333
|
+
(_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.focus({ preventDropdown: true });
|
|
114334
|
+
}, onSubmit: token => {
|
|
114335
|
+
var _a, _b;
|
|
114336
|
+
addToken(token);
|
|
114337
|
+
setFilteringText('');
|
|
114338
|
+
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus({ preventDropdown: true });
|
|
114339
|
+
(_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.close();
|
|
114340
|
+
} })),
|
|
114341
|
+
}
|
|
114342
|
+
: undefined, onCloseDropdown: () => setCustomFormValueRecord({}), hideEnteredTextOption: internalFreeText.disabled && parsedText.step !== 'property', clearAriaLabel: i18nStrings.clearAriaLabel, searchResultsId: showResults ? searchResultsId : undefined })),
|
|
114343
|
+
showResults ? (src_react.createElement("div", { className: src_property_filter_styles_css.results },
|
|
114344
|
+
src_react.createElement(src_SearchResults, { id: searchResultsId, renderLiveRegion: !loading, ref: searchResultsRef }, countText))) : null)),
|
|
114345
|
+
filteringConstraintText && (src_react.createElement("div", { id: constraintTextId, className: src_property_filter_styles_css.constraint }, filteringConstraintText)),
|
|
114346
|
+
internalQuery.tokens && internalQuery.tokens.length > 0 && (src_react.createElement("div", { className: src_property_filter_styles_css.tokens },
|
|
114347
|
+
src_react.createElement(src_space_between_internal, { size: "xs", direction: "horizontal" },
|
|
114348
|
+
src_react.createElement(src_TokenList, { alignment: "inline", limit: tokenLimit, items: internalQuery.tokens, limitShowFewerAriaLabel: tokenLimitShowFewerAriaLabel, limitShowMoreAriaLabel: tokenLimitShowMoreAriaLabel, renderItem: (_, tokenIndex) => (src_react.createElement(src_TokenButton, { query: internalQuery, tokenIndex: tokenIndex, onUpdateToken: (token, releasedTokens) => {
|
|
114349
|
+
updateToken(tokenIndex, token, releasedTokens);
|
|
114350
|
+
}, onUpdateOperation: updateOperation, onRemoveToken: () => {
|
|
114351
|
+
removeToken(tokenIndex);
|
|
114352
|
+
setNextFocusIndex(tokenIndex);
|
|
114353
|
+
}, filteringProperties: internalProperties, filteringOptions: internalOptions, asyncProps: asyncProps, onLoadItems: onLoadItems, i18nStrings: i18nStrings, asyncProperties: asyncProperties, hideOperations: hideOperations, customGroupsText: customGroupsText, freeTextFiltering: internalFreeText, disabled: disabled, expandToViewport: expandToViewport, enableTokenGroups: enableTokenGroups })), i18nStrings: {
|
|
114354
|
+
limitShowFewer: i18nStrings.tokenLimitShowFewer,
|
|
114355
|
+
limitShowMore: i18nStrings.tokenLimitShowMore,
|
|
114356
|
+
}, after: customFilterActions ? (src_react.createElement("div", { className: src_property_filter_styles_css['custom-filter-actions'] }, customFilterActions)) : (src_react.createElement("span", Object.assign({}, src_getAnalyticsMetadataAttribute({
|
|
114357
|
+
action: 'clearFilters',
|
|
114358
|
+
})),
|
|
114359
|
+
src_react.createElement(src_InternalButton, { formAction: "none", onClick: () => {
|
|
114360
|
+
var _a;
|
|
114361
|
+
removeAllTokens();
|
|
114362
|
+
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus({ preventDropdown: true });
|
|
114363
|
+
}, className: src_property_filter_styles_css['remove-all'], disabled: disabled }, i18nStrings.clearFiltersText))) }))))));
|
|
114364
|
+
});
|
|
114365
|
+
/* harmony default export */ const src_property_filter_internal = (src_PropertyFilterInternal);
|
|
114366
|
+
//# sourceMappingURL=internal.js.map
|
|
114367
|
+
;// ./node_modules/@cloudscape-design/components/property-filter/index.js
|
|
114368
|
+
|
|
114369
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
114370
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
114371
|
+
|
|
114372
|
+
|
|
114373
|
+
|
|
114374
|
+
|
|
114375
|
+
|
|
114376
|
+
|
|
114377
|
+
|
|
114378
|
+
const src_PropertyFilter = src_react.forwardRef((_a, ref) => {
|
|
114379
|
+
var _b;
|
|
114380
|
+
var { filteringProperties, filteringOptions = [], customGroupsText = [], enableTokenGroups = false, disableFreeTextFiltering = false, asyncProperties, expandToViewport, hideOperations = false, tokenLimit, virtualScroll } = _a, rest = src_rest(_a, ["filteringProperties", "filteringOptions", "customGroupsText", "enableTokenGroups", "disableFreeTextFiltering", "asyncProperties", "expandToViewport", "hideOperations", "tokenLimit", "virtualScroll"]);
|
|
114381
|
+
let hasCustomForms = false;
|
|
114382
|
+
let hasEnumTokens = false;
|
|
114383
|
+
let hasCustomFormatters = false;
|
|
114384
|
+
for (const property of filteringProperties) {
|
|
114385
|
+
for (const operator of (_b = property.operators) !== null && _b !== void 0 ? _b : []) {
|
|
114386
|
+
if (typeof operator === 'object') {
|
|
114387
|
+
hasCustomForms = hasCustomForms || !!operator.form;
|
|
114388
|
+
hasEnumTokens = hasEnumTokens || operator.tokenType === 'enum';
|
|
114389
|
+
hasCustomFormatters = hasCustomFormatters || !!operator.format;
|
|
114390
|
+
}
|
|
114391
|
+
}
|
|
114392
|
+
}
|
|
114393
|
+
const baseComponentProps = src_useBaseComponent('PropertyFilter', {
|
|
114394
|
+
props: {
|
|
114395
|
+
asyncProperties,
|
|
114396
|
+
disableFreeTextFiltering,
|
|
114397
|
+
enableTokenGroups,
|
|
114398
|
+
expandToViewport,
|
|
114399
|
+
hideOperations,
|
|
114400
|
+
tokenLimit,
|
|
114401
|
+
virtualScroll,
|
|
114402
|
+
},
|
|
114403
|
+
metadata: {
|
|
114404
|
+
hasCustomForms,
|
|
114405
|
+
hasEnumTokens,
|
|
114406
|
+
hasCustomFormatters,
|
|
114407
|
+
},
|
|
114408
|
+
});
|
|
114409
|
+
const componentAnalyticsMetadata = {
|
|
114410
|
+
name: 'awsui.PropertyFilter',
|
|
114411
|
+
label: `.${src_property_filter_analytics_metadata_styles_css['search-field']} input`,
|
|
114412
|
+
properties: {
|
|
114413
|
+
disabled: `${!!rest.disabled}`,
|
|
114414
|
+
queryTokensCount: `${rest.query && rest.query.tokens ? rest.query.tokens.length : 0}`,
|
|
114415
|
+
},
|
|
114416
|
+
};
|
|
114417
|
+
if (hideOperations && enableTokenGroups) {
|
|
114418
|
+
src_logging_warnOnce('PropertyFilter', 'Operations cannot be hidden when token groups are enabled.');
|
|
114419
|
+
hideOperations = false;
|
|
114420
|
+
}
|
|
114421
|
+
return (src_react.createElement(src_property_filter_internal, Object.assign({ ref: ref }, baseComponentProps, { filteringProperties: filteringProperties, filteringOptions: filteringOptions, customGroupsText: customGroupsText, enableTokenGroups: enableTokenGroups, disableFreeTextFiltering: disableFreeTextFiltering, asyncProperties: asyncProperties, expandToViewport: expandToViewport, hideOperations: hideOperations, tokenLimit: tokenLimit, virtualScroll: virtualScroll }, src_getAnalyticsMetadataAttribute({ component: componentAnalyticsMetadata }), rest)));
|
|
114422
|
+
});
|
|
114423
|
+
src_applyDisplayName(src_PropertyFilter, 'PropertyFilter');
|
|
114424
|
+
/* harmony default export */ const src_property_filter = (src_PropertyFilter);
|
|
114425
|
+
//# sourceMappingURL=index.js.map
|
|
112842
114426
|
;// ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js
|
|
112843
114427
|
|
|
112844
114428
|
function src_objectWithoutProperties_objectWithoutProperties(e, t) {
|
|
@@ -119417,11 +121001,12 @@ var src_slice_initialState={items:[]};var src_notificationsSlice=src_createSlice
|
|
|
119417
121001
|
var src_lodash = __webpack_require__(2543);
|
|
119418
121002
|
;// ./src/libs/serverErrors.ts
|
|
119419
121003
|
function src_serverErrors(error){var _data;return"object"===_typeof(error)&&null!==error&&"data"in error&&// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
119420
|
-
"string"==typeof(null===(_data=error.data)||void 0===_data?void 0:_data.message)}function src_isResponseServerFormFieldError(fieldError){return"object"===src_typeof_typeof(fieldError)&&null!==fieldError&&fieldError!==void 0&&"loc"in fieldError&&"msg"in fieldError&&(0,src_lodash.isArray)(null===fieldError||void 0===fieldError?void 0:fieldError.loc)&&"string"==typeof(null===fieldError||void 0===fieldError?void 0:fieldError.msg)}function src_isResponseServerError(formErrors){return"object"===src_typeof_typeof(formErrors)&&null!==formErrors&&formErrors!==void 0&&"detail"in formErrors&&(0,src_lodash.isArray)(null===formErrors||void 0===formErrors?void 0:formErrors.detail)&&!!formErrors.detail.length&&"msg"in formErrors.detail[0]}
|
|
121004
|
+
"string"==typeof(null===(_data=error.data)||void 0===_data?void 0:_data.message)}function src_isResponseServerFormFieldError(fieldError){return"object"===src_typeof_typeof(fieldError)&&null!==fieldError&&fieldError!==void 0&&"loc"in fieldError&&"msg"in fieldError&&(0,src_lodash.isArray)(null===fieldError||void 0===fieldError?void 0:fieldError.loc)&&"string"==typeof(null===fieldError||void 0===fieldError?void 0:fieldError.msg)}function src_isResponseServerError(formErrors){return"object"===src_typeof_typeof(formErrors)&&null!==formErrors&&formErrors!==void 0&&"detail"in formErrors&&(0,src_lodash.isArray)(null===formErrors||void 0===formErrors?void 0:formErrors.detail)&&!!formErrors.detail.length&&"msg"in formErrors.detail[0]}// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
121005
|
+
function src_serverErrors_getServerError(error){var errorText=null===error||void 0===error?void 0:error.error,errorData=error.data;if(src_isResponseServerError(errorData)){var errorDetail=errorData.detail;errorText=errorDetail.flatMap(function(_ref){var msg=_ref.msg;return msg}).join(", ")}return errorText}
|
|
119421
121006
|
;// ./src/libs/index.ts
|
|
119422
121007
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
119423
121008
|
function src_arrayToRecordByKeyName(array,selector){return array.reduce(function(acc,item){return acc[item[selector]]=item,acc},{})}function src_wait(delayInMS){return new Promise(function(resolve){return setTimeout(resolve,delayInMS)})}function src_libs_goToUrl(url,blank){var link=document.createElement("a");link.style.opacity="0",link.style.position="absolute",link.style.top="-2000px",blank&&(link.target="_blank"),link.href=url,document.body.append(link),link.click(),link.remove()}var src_copyToClipboard=function(copyText,success,failed){navigator.clipboard.writeText(copyText).then(success,failed)};var src_MINUTE=6e4;var src_getDateAgoSting=function(time){try{return Date.now()-time<src_MINUTE?"Just now":Date.now()-time<24*(60*src_MINUTE)?formatDistanceToNowStrict(new Date(time),{addSuffix:!0}):format(new Date(time),"dd/MM/yyyy")}catch(err){return""}};var src_getUid=function(a){return a?(0|16*Math.random()).toString(16):(""+1e11+1e11).replace(/1|0/g,src_getUid)};var src_buildRoute=function(route,params){return Object.keys(params).reduce(function(acc,key){var regExp=new RegExp(":".concat(key));return acc.replace(regExp,params[key])},route)};var src_libs_formatBytes=function(bytes){var decimals=1<arguments.length&&arguments[1]!==void 0?arguments[1]:2;if(0===bytes)return"0Bytes";var k=1024,dm=0>=decimals?0:decimals,i=Math.floor(Math.log(bytes)/Math.log(k));return parseFloat((bytes/Math.pow(k,i)).toFixed(dm))+["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][i]};var src_libs_centsToFormattedString=function(cents,currency){var floatValue=cents/100;return"".concat(0>floatValue?"-":"").concat(currency).concat(Math.abs(floatValue).toFixed(2))};var src_riseRouterException=function(){var status=0<arguments.length&&arguments[0]!==void 0?arguments[0]:404,json=1<arguments.length&&arguments[1]!==void 0?arguments[1]:"Not Found";// eslint-disable-next-line @typescript-eslint/no-throw-literal
|
|
119424
|
-
throw new Response(json,{status:status})};var src_base64ToArrayBuffer=function(base64){for(var binaryString=atob(base64),bytes=new Uint8Array(binaryString.length),i=0;i<binaryString.length;i++)bytes[i]=binaryString.charCodeAt(i);return bytes};var src_isValidUrl=function(urlString){try{return!!new URL(urlString)}catch(e){return!1}};var src_includeSubString=function(value,query){return value.toLowerCase().includes(query.trim().toLowerCase())};
|
|
121009
|
+
throw new Response(json,{status:status})};var src_base64ToArrayBuffer=function(base64){for(var binaryString=atob(base64),bytes=new Uint8Array(binaryString.length),i=0;i<binaryString.length;i++)bytes[i]=binaryString.charCodeAt(i);return bytes};var src_isValidUrl=function(urlString){try{return!!new URL(urlString)}catch(e){return!1}};var src_includeSubString=function(value,query){return value.toLowerCase().includes(query.trim().toLowerCase())};var src_capitalize=function(str){return str.charAt(0).toUpperCase()+str.slice(1)};
|
|
119425
121010
|
;// ./src/hooks/useNotifications.ts
|
|
119426
121011
|
function src_useNotifications_ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function src_useNotifications_objectSpread(e){for(var t,r=1;r<arguments.length;r++)t=null==arguments[r]?{}:arguments[r],r%2?src_useNotifications_ownKeys(Object(t),!0).forEach(function(r){src_defineProperty_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):src_useNotifications_ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))});return e}var src_NOTIFICATION_LIFE_TIME=6e3,src_defaultArgs={temporary:!0,liveTime:src_NOTIFICATION_LIFE_TIME};var src_useNotifications_useNotifications=function(){var args=0<arguments.length&&void 0!==arguments[0]?arguments[0]:src_defaultArgs,dispatch=src_hooks_useAppDispatch(),notificationIdsSet=(0,src_react.useRef)(new Set),_defaultArgs$args=src_useNotifications_objectSpread(src_useNotifications_objectSpread({},src_defaultArgs),args),temporary=_defaultArgs$args.temporary,liveTime=_defaultArgs$args.liveTime,removeNotification=function(id){dispatch(src_remove(id)),notificationIdsSet.current.has(id)&¬ificationIdsSet.current.delete(id)};return (0,src_react.useEffect)(function(){return function(){notificationIdsSet.current.forEach(function(notificationId){removeNotification(notificationId)})}},[]),[function(notification){var id=src_getUid();dispatch(src_push(src_useNotifications_objectSpread(src_useNotifications_objectSpread({id:id},notification),{},{dismissible:!0,onDismiss:function(){removeNotification(id)}}))),temporary?setTimeout(function(){removeNotification(id)},liveTime):notificationIdsSet.current.add(id)}]};
|
|
119427
121012
|
;// ./src/hooks/useHelpPanel.ts
|
|
@@ -119459,7 +121044,7 @@ function src_asyncToGenerator_asyncToGenerator(n) {
|
|
|
119459
121044
|
var src_regenerator = __webpack_require__(4756);
|
|
119460
121045
|
var src_regenerator_default = /*#__PURE__*/__webpack_require__.n(src_regenerator);
|
|
119461
121046
|
;// ./src/hooks/useInfiniteScroll.ts
|
|
119462
|
-
var src_useInfiniteScroll_excluded=["limit"];function src_useInfiniteScroll_ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function src_useInfiniteScroll_objectSpread(e){for(var t,r=1;r<arguments.length;r++)t=null==arguments[r]?{}:arguments[r],r%2?src_useInfiniteScroll_ownKeys(Object(t),!0).forEach(function(r){src_defineProperty_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):src_useInfiniteScroll_ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))});return e}/* eslint-disable @typescript-eslint/no-explicit-any */var src_SCROLL_POSITION_GAP=400;var src_useInfiniteScroll=function(_ref){var useLazyQuery=_ref.useLazyQuery,getPaginationParams=_ref.getPaginationParams,args=_ref.args,_useState=(0,src_react.useState)([]),_useState2=src_slicedToArray_slicedToArray(_useState,2),data=_useState2[0],setData=_useState2[1],scrollElement=(0,src_react.useRef)(document.documentElement),isLoadingRef=(0,src_react.useRef)(!1),lastRequestParams=(0,src_react.useRef)(void 0),_useState3=(0,src_react.useState)(!1),_useState4=src_slicedToArray_slicedToArray(_useState3,2),disabledMore=_useState4[0],setDisabledMore=_useState4[1],limit=args.limit,argsProp=src_objectWithoutProperties_objectWithoutProperties(args,src_useInfiniteScroll_excluded),_useLazyQuery=useLazyQuery(src_useInfiniteScroll_objectSpread({},args)),_useLazyQuery2=src_slicedToArray_slicedToArray(_useLazyQuery,2),getItems=_useLazyQuery2[0],_useLazyQuery2$=_useLazyQuery2[1],isLoading=_useLazyQuery2$.isLoading,isFetching=_useLazyQuery2$.isFetching,getDataRequest=function(params){return lastRequestParams.current=params,getItems(src_useInfiniteScroll_objectSpread({limit:limit},params)).unwrap()},getEmptyList=function(){isLoadingRef.current=!0,setData([]),getDataRequest(argsProp).then(function(result){setDisabledMore(!1),setData(result),isLoadingRef.current=!1})};(0,src_react.useEffect)(function(){getEmptyList()
|
|
121047
|
+
var src_useInfiniteScroll_excluded=["limit"];function src_useInfiniteScroll_ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function src_useInfiniteScroll_objectSpread(e){for(var t,r=1;r<arguments.length;r++)t=null==arguments[r]?{}:arguments[r],r%2?src_useInfiniteScroll_ownKeys(Object(t),!0).forEach(function(r){src_defineProperty_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):src_useInfiniteScroll_ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))});return e}/* eslint-disable @typescript-eslint/no-explicit-any */var src_SCROLL_POSITION_GAP=400;var src_useInfiniteScroll=function(_ref){var useLazyQuery=_ref.useLazyQuery,getPaginationParams=_ref.getPaginationParams,args=_ref.args,_useState=(0,src_react.useState)([]),_useState2=src_slicedToArray_slicedToArray(_useState,2),data=_useState2[0],setData=_useState2[1],scrollElement=(0,src_react.useRef)(document.documentElement),isLoadingRef=(0,src_react.useRef)(!1),lastRequestParams=(0,src_react.useRef)(void 0),_useState3=(0,src_react.useState)(!1),_useState4=src_slicedToArray_slicedToArray(_useState3,2),disabledMore=_useState4[0],setDisabledMore=_useState4[1],limit=args.limit,argsProp=src_objectWithoutProperties_objectWithoutProperties(args,src_useInfiniteScroll_excluded),lastArgsProps=(0,src_react.useRef)(null),_useLazyQuery=useLazyQuery(src_useInfiniteScroll_objectSpread({},args)),_useLazyQuery2=src_slicedToArray_slicedToArray(_useLazyQuery,2),getItems=_useLazyQuery2[0],_useLazyQuery2$=_useLazyQuery2[1],isLoading=_useLazyQuery2$.isLoading,isFetching=_useLazyQuery2$.isFetching,getDataRequest=function(params){return lastRequestParams.current=params,getItems(src_useInfiniteScroll_objectSpread({limit:limit},params)).unwrap()},getEmptyList=function(){isLoadingRef.current=!0,setData([]),getDataRequest(argsProp).then(function(result){setDisabledMore(!1),setData(result),isLoadingRef.current=!1})};(0,src_react.useEffect)(function(){(0,src_lodash.isEqual)(argsProp,lastArgsProps.current)||(getEmptyList(),lastArgsProps.current=argsProp)},[argsProp,lastArgsProps]);var getMore=/*#__PURE__*/function(){var _ref2=src_asyncToGenerator_asyncToGenerator(/*#__PURE__*/src_regenerator_default().mark(function _callee(){var result;return src_regenerator_default().wrap(function(_context){for(;;)switch(_context.prev=_context.next){case 0:if(!(isLoadingRef.current||disabledMore)){_context.next=2;break}return _context.abrupt("return");case 2:return _context.prev=2,isLoadingRef.current=!0,_context.next=6,getDataRequest(src_useInfiniteScroll_objectSpread(src_useInfiniteScroll_objectSpread({},argsProp),getPaginationParams(data[data.length-1])));case 6:result=_context.sent,0<result.length?setData(function(prev){return[].concat(src_toConsumableArray_toConsumableArray(prev),src_toConsumableArray_toConsumableArray(result))}):setDisabledMore(!0),_context.next=13;break;case 10:_context.prev=10,_context.t0=_context["catch"](2),console.log(_context.t0);case 13:isLoadingRef.current=!1;case 14:case"end":return _context.stop()}},_callee,null,[[2,10]])}));return function(){return _ref2.apply(this,arguments)}}();(0,src_react.useLayoutEffect)(function(){var element=scrollElement.current;isLoadingRef.current||!data.length||0>=element.scrollHeight-element.clientHeight&&getMore().catch(console.log)},[data]);var onScroll=(0,src_react.useCallback)(function(){if(!(disabledMore||isLoadingRef.current)){var element=scrollElement.current,scrollPositionFromBottom=element.scrollHeight-(element.clientHeight+element.scrollTop);scrollPositionFromBottom<src_SCROLL_POSITION_GAP&&getMore().catch(console.log)}},[disabledMore,getMore]);(0,src_react.useEffect)(function(){return document.addEventListener("scroll",onScroll),function(){document.removeEventListener("scroll",onScroll)}},[onScroll]);var isLoadingMore=0<data.length&&isFetching;return{data:data,isLoading:isLoading||0===data.length&&isFetching,isLoadingMore:isLoadingMore,refreshList:getEmptyList}};
|
|
119463
121048
|
;// ./node_modules/@cloudscape-design/collection-hooks/mjs/operations/filter.js
|
|
119464
121049
|
function src_defaultFilteringFunction(item, filteringText, filteringFields) {
|
|
119465
121050
|
if (filteringText.length === 0) {
|
|
@@ -121448,7 +123033,8 @@ var src_Notifications_Notifications=function(){var notifications=src_hooks_useAp
|
|
|
121448
123033
|
;// ./src/components/ConfirmationDialog/index.tsx
|
|
121449
123034
|
var src_ConfirmationDialog=function(_ref){var titleProp=_ref.title,contentProp=_ref.content,_ref$visible=_ref.visible,onDiscard=_ref.onDiscard,onConfirm=_ref.onConfirm,cancelButtonLabelProp=_ref.cancelButtonLabel,confirmButtonLabelProp=_ref.confirmButtonLabel,_useTranslation=src_useTranslation_useTranslation(),t=_useTranslation.t,title=null!==titleProp&&void 0!==titleProp?titleProp:t("confirm_dialog.title"),content=null!==contentProp&&void 0!==contentProp?contentProp:/*#__PURE__*/src_react.createElement(src_box_Box,{variant:"span"},t("confirm_dialog.message")),cancelButtonLabel=null!==cancelButtonLabelProp&&void 0!==cancelButtonLabelProp?cancelButtonLabelProp:t("common.cancel"),confirmButtonLabel=null!==confirmButtonLabelProp&&void 0!==confirmButtonLabelProp?confirmButtonLabelProp:t("common.delete");return/*#__PURE__*/src_react.createElement(src_modal_Modal,{visible:void 0!==_ref$visible&&_ref$visible,onDismiss:onDiscard,header:title,footer:/*#__PURE__*/src_react.createElement(src_box_Box,{float:"right"},/*#__PURE__*/src_react.createElement(src_space_between_SpaceBetween,{direction:"horizontal",size:"xs"},/*#__PURE__*/src_react.createElement(src_components_button,{variant:"link",onClick:onDiscard},cancelButtonLabel),/*#__PURE__*/src_react.createElement(src_components_button,{variant:"primary",onClick:onConfirm},confirmButtonLabel)))},content)};
|
|
121450
123035
|
;// ./src/components/FileUploader/FileEntry/index.tsx
|
|
121451
|
-
var src_FileEntry_FileEntry=function(_ref){var file=_ref.file,_ref$showImage=_ref.showImage,_ref$truncateLength=_ref.truncateLength,truncateLength=void 0===_ref$truncateLength?20:_ref$truncateLength,i18nStrings=_ref.i18nStrings,_useState=useState(),_useState2=_slicedToArray(_useState,2),imageData=_useState2[0],setImageData=_useState2[1],reader=new FileReader;reader.onload=function(event){setImageData(event.target.result)},reader.readAsDataURL(file)
|
|
123036
|
+
var src_FileEntry_FileEntry=function(_ref){var file=_ref.file,_ref$showImage=_ref.showImage,_ref$truncateLength=_ref.truncateLength,truncateLength=void 0===_ref$truncateLength?20:_ref$truncateLength,i18nStrings=_ref.i18nStrings,_useState=useState(),_useState2=_slicedToArray(_useState,2),imageData=_useState2[0],setImageData=_useState2[1],reader=new FileReader;reader.onload=function(event){setImageData(event.target.result)},reader.readAsDataURL(file);// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
123037
|
+
var ext=file.name.split(".").pop(),displayFileName=file.name.length-ext.length-1>truncateLength?"".concat(file.name.slice(0,truncateLength),"... .").concat(ext):file.name,lastModifiedDate=new Date(file.lastModified),fileSize=file.size;return/*#__PURE__*/React.createElement(SpaceBetween,{size:"s",direction:"horizontal"},/*#__PURE__*/React.createElement(StatusIndicator,{type:"success"}),void 0!==_ref$showImage&&_ref$showImage&&/*#__PURE__*/React.createElement("img",{alt:file.name,style:{width:"5em",height:"5em",objectFit:"cover"},src:imageData}),/*#__PURE__*/React.createElement(SpaceBetween,{size:"xxxs"},/*#__PURE__*/React.createElement(Box,null,displayFileName),!1))};
|
|
121452
123038
|
;// ./src/components/FileUploader/Token/styles.module.scss
|
|
121453
123039
|
// extracted by mini-css-extract-plugin
|
|
121454
123040
|
/* harmony default export */ const src_Token_styles_module = ({"tokenPanel":"qExbS"});
|
|
@@ -122124,6 +123710,8 @@ var src_Hotspot_excluded=["renderHotspot","children"];var src_Hotspot_Hotspot=fu
|
|
|
122124
123710
|
;// ./src/components/index.ts
|
|
122125
123711
|
// custom components
|
|
122126
123712
|
|
|
123713
|
+
;// ./src/consts.ts
|
|
123714
|
+
var src_consts_DATE_TIME_FORMAT="MM/dd/yyyy HH:mm";var src_DISCORD_URL="https://discord.gg/u8SmfwPpMd";var src_QUICK_START_URL="https://dstack.ai/docs/quickstart/";var src_TALLY_FORM_ID="3xYlYG";var src_DOCS_URL="https://dstack.ai/docs/";var src_DEFAULT_TABLE_PAGE_SIZE=20;
|
|
122127
123715
|
;// ./src/routes.ts
|
|
122128
123716
|
var src_routes_ROUTES={BASE:"/",LOGOUT:"/logout",AUTH:{GITHUB_CALLBACK:"/auth/github/callback",OKTA_CALLBACK:"/auth/okta/callback",ENTRA_CALLBACK:"/auth/entra/callback",TOKEN:"/auth/token"},PROJECT:{LIST:"/projects",ADD:"/projects/add",DETAILS:{TEMPLATE:"/projects/:projectName",FORMAT:function(projectName){return src_buildRoute(src_routes_ROUTES.PROJECT.DETAILS.TEMPLATE,{projectName:projectName})},SETTINGS:{TEMPLATE:"/projects/:projectName",FORMAT:function(projectName){return src_buildRoute(src_routes_ROUTES.PROJECT.DETAILS.SETTINGS.TEMPLATE,{projectName:projectName})}},RUNS:{DETAILS:{TEMPLATE:"/projects/:projectName/runs/:runId",FORMAT:function(projectName,runId){return src_buildRoute(src_routes_ROUTES.PROJECT.DETAILS.RUNS.DETAILS.TEMPLATE,{projectName:projectName,runId:runId})},METRICS:{TEMPLATE:"/projects/:projectName/runs/:runId/metrics",FORMAT:function(projectName,runId){return src_buildRoute(src_routes_ROUTES.PROJECT.DETAILS.RUNS.DETAILS.METRICS.TEMPLATE,{projectName:projectName,runId:runId})}},JOBS:{DETAILS:{TEMPLATE:"/projects/:projectName/runs/:runId/jobs/:jobName",FORMAT:function(projectName,runId,jobName){return src_buildRoute(src_routes_ROUTES.PROJECT.DETAILS.RUNS.DETAILS.JOBS.DETAILS.TEMPLATE,{projectName:projectName,runId:runId,jobName:jobName})},METRICS:{TEMPLATE:"/projects/:projectName/runs/:runId/jobs/:jobName/metrics",FORMAT:function(projectName,runId,jobName){return src_buildRoute(src_routes_ROUTES.PROJECT.DETAILS.RUNS.DETAILS.JOBS.DETAILS.METRICS.TEMPLATE,{projectName:projectName,runId:runId,jobName:jobName})}}}}}}},BACKEND:{ADD:{TEMPLATE:"/projects/:projectName/backends/add",FORMAT:function(projectName){return src_buildRoute(src_routes_ROUTES.PROJECT.BACKEND.ADD.TEMPLATE,{projectName:projectName})}},EDIT:{TEMPLATE:"/projects/:projectName/backends/:backend",FORMAT:function(projectName,backendName){return src_buildRoute(src_routes_ROUTES.PROJECT.BACKEND.EDIT.TEMPLATE,{projectName:projectName,backend:backendName})}}},GATEWAY:{ADD:{TEMPLATE:"/projects/:projectName/gateways/add",FORMAT:function(projectName){return src_buildRoute(src_routes_ROUTES.PROJECT.GATEWAY.ADD.TEMPLATE,{projectName:projectName})}},EDIT:{TEMPLATE:"/projects/:projectName/gateways/:instance",FORMAT:function(projectName,instanceName){return src_buildRoute(src_routes_ROUTES.PROJECT.GATEWAY.EDIT.TEMPLATE,{projectName:projectName,instance:instanceName})}}}},RUNS:{LIST:"/runs"},MODELS:{LIST:"/models",DETAILS:{TEMPLATE:"/projects/:projectName/models/:runName",FORMAT:function(projectName,runName){return src_buildRoute(src_routes_ROUTES.MODELS.DETAILS.TEMPLATE,{projectName:projectName,runName:runName})}}},FLEETS:{LIST:"/fleets",DETAILS:{TEMPLATE:"/projects/:projectName/fleets/:fleetId",FORMAT:function(projectName,fleetId){return src_buildRoute(src_routes_ROUTES.FLEETS.DETAILS.TEMPLATE,{projectName:projectName,fleetId:fleetId})}}},INSTANCES:{LIST:"/instances"},VOLUMES:{LIST:"/volumes"},USER:{LIST:"/users",ADD:"/users/add",DETAILS:{TEMPLATE:"/users/:userName",FORMAT:function(userName){return src_buildRoute(src_routes_ROUTES.USER.DETAILS.TEMPLATE,{userName:userName})}},EDIT:{TEMPLATE:"/users/:userName/edit",FORMAT:function(userName){return src_buildRoute(src_routes_ROUTES.USER.EDIT.TEMPLATE,{userName:userName})}},PROJECTS:{TEMPLATE:"/users/:userName/projects",FORMAT:function(userName){return src_buildRoute(src_routes_ROUTES.USER.PROJECTS.TEMPLATE,{userName:userName})}},BILLING:{LIST:{TEMPLATE:"/users/:userName/billing",FORMAT:function(userName){return src_buildRoute(src_routes_ROUTES.USER.BILLING.LIST.TEMPLATE,{userName:userName})}},ADD_PAYMENT:{TEMPLATE:"/users/:userName/billing/payments/add",FORMAT:function(userName){return src_buildRoute(src_routes_ROUTES.USER.BILLING.ADD_PAYMENT.TEMPLATE,{userName:userName})}}}},BILLING:{BALANCE:"/billing"}};
|
|
122129
123717
|
;// ./src/api.ts
|
|
@@ -124936,7 +126524,7 @@ function src_rtk_query_react_esm_isMutationDefinition(e) {
|
|
|
124936
126524
|
return e.type === src_rtk_query_react_esm_DefinitionType.mutation;
|
|
124937
126525
|
}
|
|
124938
126526
|
// src/query/utils/capitalize.ts
|
|
124939
|
-
function
|
|
126527
|
+
function src_rtk_query_react_esm_capitalize(str) {
|
|
124940
126528
|
return str.replace(str[0], str[0].toUpperCase());
|
|
124941
126529
|
}
|
|
124942
126530
|
// src/query/tsHelpers.ts
|
|
@@ -124982,15 +126570,15 @@ var src_reactHooksModule = function (_c) {
|
|
|
124982
126570
|
useQueryState: useQueryState,
|
|
124983
126571
|
useQuerySubscription: useQuerySubscription
|
|
124984
126572
|
});
|
|
124985
|
-
api["use" +
|
|
124986
|
-
api["useLazy" +
|
|
126573
|
+
api["use" + src_rtk_query_react_esm_capitalize(endpointName) + "Query"] = useQuery;
|
|
126574
|
+
api["useLazy" + src_rtk_query_react_esm_capitalize(endpointName) + "Query"] = useLazyQuery;
|
|
124987
126575
|
}
|
|
124988
126576
|
else if (src_rtk_query_react_esm_isMutationDefinition(definition)) {
|
|
124989
126577
|
var useMutation = buildMutationHook(endpointName);
|
|
124990
126578
|
src_rtk_query_react_esm_safeAssign(anyApi.endpoints[endpointName], {
|
|
124991
126579
|
useMutation: useMutation
|
|
124992
126580
|
});
|
|
124993
|
-
api["use" +
|
|
126581
|
+
api["use" + src_rtk_query_react_esm_capitalize(endpointName) + "Mutation"] = useMutation;
|
|
124994
126582
|
}
|
|
124995
126583
|
}
|
|
124996
126584
|
};
|
|
@@ -125026,19 +126614,18 @@ var src_rtk_query_react_esm_createApi = /* @__PURE__ */ src_buildCreateApi(src_c
|
|
|
125026
126614
|
|
|
125027
126615
|
//# sourceMappingURL=rtk-query-react.esm.js.map
|
|
125028
126616
|
;// ./src/libs/fetchBaseQueryHeaders.ts
|
|
125029
|
-
function src_baseQueryHeaders(headers,_ref){var _app$authData,getState=_ref.getState,token=null===(_app$authData=getState().app.authData)||void 0===_app$authData?void 0:_app$authData.token,authorizationHeader=headers.get("Authorization");return token&&!authorizationHeader&&headers.set("Authorization","Bearer ".concat(token)),headers.set("X-API-VERSION","latest"),headers}
|
|
126617
|
+
function src_baseQueryHeaders(headers,_ref){var _app$authData,getState=_ref.getState,token=null===(_app$authData=getState().app.authData)||void 0===_app$authData?void 0:_app$authData.token,authorizationHeader=headers.get("Authorization");return token&&!authorizationHeader&&headers.set("Authorization","Bearer ".concat(token)),headers.set("X-API-VERSION","latest"),headers}/* harmony default export */ const src_fetchBaseQueryHeaders = (src_baseQueryHeaders);
|
|
125030
126618
|
;// ./src/services/server.ts
|
|
125031
126619
|
var src_serverApi=src_rtk_query_react_esm_createApi({reducerPath:"serverApi",baseQuery:src_fetchBaseQuery({prepareHeaders:src_fetchBaseQueryHeaders}),endpoints:function(builder){return{getServerInfo:builder.query({query:function(){return{url:src_API.SERVER.INFO(),method:"POST"}}})}}});var src_useGetServerInfoQuery=src_serverApi.useGetServerInfoQuery;
|
|
125032
126620
|
;// ./src/layouts/AppLayout/TutorialPanel/constants.tsx
|
|
125033
126621
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
125034
126622
|
// SPDX-License-Identifier: MIT-0
|
|
125035
126623
|
var src_constants_tutorialPanelI18nStrings={labelsTaskStatus:{pending:"Pending","in-progress":"In progress",success:"Success"},loadingText:"Loading",tutorialListTitle:"Take a tour",tutorialListDescription:"Follow the tutorials below to get up to speed with dstack Sky.",tutorialListDownloadLinkText:"Download PDF version",tutorialCompletedText:"Completed",labelExitTutorial:"dismiss tutorial",learnMoreLinkText:"Learn more",startTutorialButtonText:"Start",restartTutorialButtonText:"Restart",completionScreenTitle:"Congratulations! You completed it.",feedbackLinkText:"Feedback",dismissTutorialButtonText:"Dismiss",taskTitle:function(taskIndex,_taskTitle){return"Task ".concat(taskIndex+1,": ").concat(_taskTitle)},stepTitle:function(stepIndex,_stepTitle){return"Step ".concat(stepIndex+1,": ").concat(_stepTitle)},labelTotalSteps:function(totalStepCount){return"Total steps: ".concat(totalStepCount)},labelLearnMoreExternalIcon:"Opens in a new tab",labelTutorialListDownloadLink:"Download PDF version of this tutorial",labelLearnMoreLink:"Learn more about transcribe audio (opens new tab)"};var src_overlayI18nStrings={stepCounterText:function(stepIndex,totalStepCount){return"Step ".concat(stepIndex+1,"/").concat(totalStepCount)},taskTitle:function(taskIndex,_taskTitle2){return"Task ".concat(taskIndex+1,": ").concat(_taskTitle2)},labelHotspot:function(openState,stepIndex,totalStepCount){return openState?"close annotation for step ".concat(stepIndex+1," of ").concat(totalStepCount):"open annotation for step ".concat(stepIndex+1," of ").concat(totalStepCount)},nextButtonText:"Next",previousButtonText:"Previous",finishButtonText:"Finish",labelDismissAnnotation:"hide annotation"};var src_constants_HotspotIds=/*#__PURE__*/function(HotspotIds){return HotspotIds.ADD_TOP_UP_BALANCE="billing-top-up-balance",HotspotIds.PAYMENT_CONTINUE_BUTTON="billing-payment-continue-button",HotspotIds.CONFIGURE_CLI_COMMAND="configure-cli-command",HotspotIds}({});var src_BILLING_TUTORIAL={completed:!1,title:"Set up billing",description:/*#__PURE__*/src_react.createElement(src_react.Fragment,null,/*#__PURE__*/src_react.createElement(src_box_Box,{variant:"p",color:"text-body-secondary",padding:{top:"n"}},"Top up your balance via a credit card to use GPU by dstack Sky.")),completedScreenDescription:"TBA",tasks:[{title:"Add payment method",steps:[{title:"Click Top up balance button",content:"Click Top up balance button",hotspotId:src_constants_HotspotIds.ADD_TOP_UP_BALANCE},{title:"Click continue",content:"Please, click continue",hotspotId:src_constants_HotspotIds.PAYMENT_CONTINUE_BUTTON}]}]};var src_CONFIGURE_CLI_TUTORIAL={completed:!1,title:"Set up the CLI",description:/*#__PURE__*/src_react.createElement(src_react.Fragment,null,/*#__PURE__*/src_react.createElement(src_box_Box,{variant:"p",color:"text-body-secondary",padding:{top:"n"}},"Configure the CLI on your local machine to submit workload to dstack Sky.")),completedScreenDescription:"TBA",tasks:[{title:"Configure the CLI",steps:[{title:"Run the dstack project add command",content:"Run this command on your local machine to configure the dstack CLI.",hotspotId:src_constants_HotspotIds.CONFIGURE_CLI_COMMAND}]}]};var src_JOIN_DISCORD_TUTORIAL={completed:!1,title:"Community",description:/*#__PURE__*/src_react.createElement(src_react.Fragment,null,/*#__PURE__*/src_react.createElement(src_box_Box,{variant:"p",color:"text-body-secondary",padding:{top:"n"}},"Need help or want to chat with other users of dstack? Join our Discord server!")),completedScreenDescription:"TBA",tasks:[]};var src_QUICKSTART_TUTORIAL={completed:!1,title:"Quickstart",description:/*#__PURE__*/src_react.createElement(src_react.Fragment,null,/*#__PURE__*/src_react.createElement(src_box_Box,{variant:"p",color:"text-body-secondary",padding:{top:"n"}},"Check out the quickstart guide to get started with dstack")),completedScreenDescription:"TBA",tasks:[]};var src_CREDITS_TUTORIAL={completed:!1,title:"Get free credits",description:/*#__PURE__*/src_react.createElement(src_react.Fragment,null,/*#__PURE__*/src_react.createElement(src_box_Box,{variant:"p",color:"text-body-secondary",padding:{top:"n"}},"Tell us about your project and get some free credits to try dstack Sky!")),completedScreenDescription:"TBA",tasks:[]};
|
|
125036
|
-
;// ./src/consts.ts
|
|
125037
|
-
var src_consts_DATE_TIME_FORMAT="MM/dd/yyyy HH:mm";var src_DISCORD_URL="https://discord.gg/u8SmfwPpMd";var src_QUICK_START_URL="https://dstack.ai/docs/quickstart/";var src_TALLY_FORM_ID="3xYlYG";var src_DOCS_URL="https://dstack.ai/docs/";var src_DEFAULT_TABLE_PAGE_SIZE=20;
|
|
125038
|
-
;// ./src/libs/run.ts
|
|
125039
|
-
function src_run_ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function src_run_objectSpread(e){for(var t,r=1;r<arguments.length;r++)t=null==arguments[r]?{}:arguments[r],r%2?src_run_ownKeys(Object(t),!0).forEach(function(r){src_defineProperty_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):src_run_ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))});return e}var src_getStatusIconType=function(status){switch(status){case"failed":return"error";case"aborted":case"terminated":case"done":return"stopped";case"running":return"success";case"terminating":case"pulling":case"provisioning":return"in-progress";case"submitted":case"pending":return"pending";default:console.error(new Error("Undefined run status"))}};var src_getExtendedModelFromRun=function(run){var _run$service,_run$service$model,_run$service2,_run$run_spec$run_nam,_run$latest_job_submi,_run$latest_job_submi2,_run$latest_job_submi3,_run$latest_job_submi4,_run$latest_job_submi5,_run$latest_job_submi6,_run$latest_job_submi7,_run$latest_job_submi8;return null!==run&&void 0!==run&&null!==(_run$service=run.service)&&void 0!==_run$service&&_run$service.model?src_run_objectSpread(src_run_objectSpread({},null!==(_run$service$model=null===(_run$service2=run.service)||void 0===_run$service2?void 0:_run$service2.model)&&void 0!==_run$service$model?_run$service$model:{}),{},{id:run.id,project_name:run.project_name,run_name:null!==(_run$run_spec$run_nam=null===run||void 0===run?void 0:run.run_spec.run_name)&&void 0!==_run$run_spec$run_nam?_run$run_spec$run_nam:"No run name",user:run.user,resources:null!==(_run$latest_job_submi=null===(_run$latest_job_submi2=run.latest_job_submission)||void 0===_run$latest_job_submi2||null===(_run$latest_job_submi2=_run$latest_job_submi2.job_provisioning_data)||void 0===_run$latest_job_submi2||null===(_run$latest_job_submi2=_run$latest_job_submi2.instance_type)||void 0===_run$latest_job_submi2||null===(_run$latest_job_submi2=_run$latest_job_submi2.resources)||void 0===_run$latest_job_submi2?void 0:_run$latest_job_submi2.description)&&void 0!==_run$latest_job_submi?_run$latest_job_submi:null,price:null!==(_run$latest_job_submi3=null===(_run$latest_job_submi4=run.latest_job_submission)||void 0===_run$latest_job_submi4||null===(_run$latest_job_submi4=_run$latest_job_submi4.job_provisioning_data)||void 0===_run$latest_job_submi4?void 0:_run$latest_job_submi4.price)&&void 0!==_run$latest_job_submi3?_run$latest_job_submi3:null,submitted_at:run.submitted_at,repository:src_getRepoNameFromRun(run),backend:null!==(_run$latest_job_submi5=null===(_run$latest_job_submi6=run.latest_job_submission)||void 0===_run$latest_job_submi6||null===(_run$latest_job_submi6=_run$latest_job_submi6.job_provisioning_data)||void 0===_run$latest_job_submi6?void 0:_run$latest_job_submi6.backend)&&void 0!==_run$latest_job_submi5?_run$latest_job_submi5:null,region:null!==(_run$latest_job_submi7=null===(_run$latest_job_submi8=run.latest_job_submission)||void 0===_run$latest_job_submi8||null===(_run$latest_job_submi8=_run$latest_job_submi8.job_provisioning_data)||void 0===_run$latest_job_submi8?void 0:_run$latest_job_submi8.region)&&void 0!==_run$latest_job_submi7?_run$latest_job_submi7:null}):null};var src_getRepoNameFromRun=function(run){return (0,src_lodash.get)(run.run_spec.repo_data,"repo_name",(0,src_lodash.get)(run.run_spec.repo_data,"repo_dir","-"))};
|
|
125040
126624
|
;// ./src/pages/Runs/constants.ts
|
|
125041
|
-
var src_runStatusForDeleting=["failed","aborted","done","terminated"];var src_inActiveRunStatuses=["failed","aborted","done","terminated"];var src_runStatusForStopping=["submitted","provisioning","pulling","pending","running"];var src_runStatusForAborting=["submitted","provisioning","pulling","pending","running"];var src_unfinishedRuns=["running","terminating","pending"];var src_finishedJobs=["terminated","aborted","failed","done"]
|
|
126625
|
+
var src_runStatusForDeleting=["failed","aborted","done","terminated"];var src_inActiveRunStatuses=["failed","aborted","done","terminated"];var src_runStatusForStopping=["submitted","provisioning","pulling","pending","running"];var src_runStatusForAborting=["submitted","provisioning","pulling","pending","running"];var src_unfinishedRuns=["running","terminating","pending"];var src_finishedJobs=["terminated","aborted","failed","done"];// TODO: Replace TJobStatus with TRunStatus and remove all consts above
|
|
126626
|
+
var src_finishedRunStatuses=["done","failed","terminated"];
|
|
126627
|
+
;// ./src/libs/run.ts
|
|
126628
|
+
function src_run_ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function src_run_objectSpread(e){for(var t,r=1;r<arguments.length;r++)t=null==arguments[r]?{}:arguments[r],r%2?src_run_ownKeys(Object(t),!0).forEach(function(r){src_defineProperty_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):src_run_ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))});return e}var src_getStatusIconType=function(status,terminationReason){if(src_finishedRunStatuses.includes(status)&&"interrupted_by_no_capacity"===terminationReason)return"stopped";switch(status){case"failed":return"error";case"done":return"success";case"aborted":case"terminated":return"stopped";case"running":return"success";case"terminating":case"pulling":case"provisioning":return"in-progress";case"submitted":case"pending":return"pending";default:console.error(new Error("Undefined run status"))}};var src_getStatusIconColor=function(status,terminationReason){if("failed_to_start_due_to_no_capacity"===terminationReason||"interrupted_by_no_capacity"===terminationReason)return"yellow";return"submitted"===status||"pending"===status?"blue":"pulling"===status?"green":"aborted"===status?"yellow":"done"===status?"grey":void 0};var src_getRunStatusMessage=function(run){var _run$latest_job_submi;return src_finishedRunStatuses.includes(run.status)&&null!==(_run$latest_job_submi=run.latest_job_submission)&&void 0!==_run$latest_job_submi&&_run$latest_job_submi.status_message?src_capitalize(run.latest_job_submission.status_message):src_capitalize(run.status_message||run.status)};var src_getRunError=function(run){var _ref,_run$error,_run$latest_job_submi2,error=null!==(_ref=null!==(_run$error=run.error)&&void 0!==_run$error?_run$error:null===(_run$latest_job_submi2=run.latest_job_submission)||void 0===_run$latest_job_submi2?void 0:_run$latest_job_submi2.error)&&void 0!==_ref?_ref:null;return error?src_capitalize(error):null};var src_getRunPriority=function(run){var _run$run_spec$configu,_run$run_spec$configu2;return null!==(_run$run_spec$configu=null===(_run$run_spec$configu2=run.run_spec.configuration)||void 0===_run$run_spec$configu2?void 0:_run$run_spec$configu2.priority)&&void 0!==_run$run_spec$configu?_run$run_spec$configu:null};var src_getExtendedModelFromRun=function(run){var _run$service,_run$service$model,_run$service2,_run$run_spec$run_nam,_run$latest_job_submi3,_run$latest_job_submi4,_run$latest_job_submi5,_run$latest_job_submi6,_run$latest_job_submi7,_run$latest_job_submi8,_run$latest_job_submi9,_run$latest_job_submi10;return null!==run&&void 0!==run&&null!==(_run$service=run.service)&&void 0!==_run$service&&_run$service.model?src_run_objectSpread(src_run_objectSpread({},null!==(_run$service$model=null===(_run$service2=run.service)||void 0===_run$service2?void 0:_run$service2.model)&&void 0!==_run$service$model?_run$service$model:{}),{},{id:run.id,project_name:run.project_name,run_name:null!==(_run$run_spec$run_nam=null===run||void 0===run?void 0:run.run_spec.run_name)&&void 0!==_run$run_spec$run_nam?_run$run_spec$run_nam:"No run name",user:run.user,resources:null!==(_run$latest_job_submi3=null===(_run$latest_job_submi4=run.latest_job_submission)||void 0===_run$latest_job_submi4||null===(_run$latest_job_submi4=_run$latest_job_submi4.job_provisioning_data)||void 0===_run$latest_job_submi4||null===(_run$latest_job_submi4=_run$latest_job_submi4.instance_type)||void 0===_run$latest_job_submi4||null===(_run$latest_job_submi4=_run$latest_job_submi4.resources)||void 0===_run$latest_job_submi4?void 0:_run$latest_job_submi4.description)&&void 0!==_run$latest_job_submi3?_run$latest_job_submi3:null,price:null!==(_run$latest_job_submi5=null===(_run$latest_job_submi6=run.latest_job_submission)||void 0===_run$latest_job_submi6||null===(_run$latest_job_submi6=_run$latest_job_submi6.job_provisioning_data)||void 0===_run$latest_job_submi6?void 0:_run$latest_job_submi6.price)&&void 0!==_run$latest_job_submi5?_run$latest_job_submi5:null,submitted_at:run.submitted_at,repository:src_getRepoNameFromRun(run),backend:null!==(_run$latest_job_submi7=null===(_run$latest_job_submi8=run.latest_job_submission)||void 0===_run$latest_job_submi8||null===(_run$latest_job_submi8=_run$latest_job_submi8.job_provisioning_data)||void 0===_run$latest_job_submi8?void 0:_run$latest_job_submi8.backend)&&void 0!==_run$latest_job_submi7?_run$latest_job_submi7:null,region:null!==(_run$latest_job_submi9=null===(_run$latest_job_submi10=run.latest_job_submission)||void 0===_run$latest_job_submi10||null===(_run$latest_job_submi10=_run$latest_job_submi10.job_provisioning_data)||void 0===_run$latest_job_submi10?void 0:_run$latest_job_submi10.region)&&void 0!==_run$latest_job_submi9?_run$latest_job_submi9:null}):null};var src_getRepoNameFromRun=function(run){return (0,src_lodash.get)(run.run_spec.repo_data,"repo_name",(0,src_lodash.get)(run.run_spec.repo_data,"repo_dir","-"))};
|
|
125042
126629
|
;// ./src/services/run.ts
|
|
125043
126630
|
var src_run_excluded=["project_name"],src_run_excluded2=["project_name"],src_run_excluded3=["project_name"],src_excluded4=["project_name","run_name"],src_excluded5=["timestamps","values"];function src_services_run_ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function src_services_run_objectSpread(e){for(var t,r=1;r<arguments.length;r++)t=null==arguments[r]?{}:arguments[r],r%2?src_services_run_ownKeys(Object(t),!0).forEach(function(r){src_defineProperty_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):src_services_run_ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))});return e}var src_reduceInvalidateTagsFromRunNames=function(names){return names.reduce(function(accumulator,runName){return accumulator.push({type:"Runs",id:runName}),accumulator.push({type:"AllRuns",id:runName}),accumulator},[])};var src_runApi=src_rtk_query_react_esm_createApi({reducerPath:"runApi",refetchOnMountOrArgChange:!0,baseQuery:src_fetchBaseQuery({prepareHeaders:src_fetchBaseQueryHeaders}),tagTypes:["Runs","Models","Metrics"],endpoints:function(builder){return{getRuns:builder.query({query:function(){var body=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{};return{url:src_API.RUNS.LIST(),method:"POST",body:body}},providesTags:function(result){return result?[].concat(src_toConsumableArray_toConsumableArray(result.map(function(_ref){var id=_ref.id;return{type:"Runs",id:id}})),["Runs"]):["Runs"]}}),getRun:builder.query({query:function(_ref2){var project_name=_ref2.project_name,body=src_objectWithoutProperties_objectWithoutProperties(_ref2,src_run_excluded);return{url:src_API.PROJECTS.RUN_DETAILS(null!==project_name&&void 0!==project_name?project_name:""),method:"POST",body:body}},providesTags:function(result){return result?[{type:"Runs",id:null===result||void 0===result?void 0:result.id}]:[]}}),stopRuns:builder.mutation({query:function(_ref3){var project_name=_ref3.project_name,body=src_objectWithoutProperties_objectWithoutProperties(_ref3,src_run_excluded2);return{url:src_API.PROJECTS.RUNS_STOP(project_name),method:"POST",body:body}},invalidatesTags:function(result,error,params){return src_reduceInvalidateTagsFromRunNames(params.runs_names)}}),deleteRuns:builder.mutation({query:function(_ref4){var project_name=_ref4.project_name,body=src_objectWithoutProperties_objectWithoutProperties(_ref4,src_run_excluded3);return{url:src_API.PROJECTS.RUNS_DELETE(project_name),method:"POST",body:body}},invalidatesTags:function(result,error,params){return src_reduceInvalidateTagsFromRunNames(params.runs_names)},onQueryStarted:function(_ref5,_ref6){return src_asyncToGenerator_asyncToGenerator(/*#__PURE__*/src_regenerator_default().mark(function _callee(){var runs_names,project_name,dispatch,queryFulfilled,patchGetRunResult,patchGetAllRunResult;return src_regenerator_default().wrap(function(_context){for(;;)switch(_context.prev=_context.next){case 0:return runs_names=_ref5.runs_names,project_name=_ref5.project_name,dispatch=_ref6.dispatch,queryFulfilled=_ref6.queryFulfilled,patchGetRunResult=dispatch(src_runApi.util.updateQueryData("getRuns",{project_name:project_name},function(draftRuns){runs_names.forEach(function(runName){var index=draftRuns.findIndex(function(run){return run.run_spec.run_name===runName&&run.project_name===project_name});0<=index&&draftRuns.splice(index,1)})})),patchGetAllRunResult=dispatch(src_runApi.util.updateQueryData("getRuns",{},function(draftRuns){runs_names.forEach(function(runName){var _draftRuns$findIndex,index=null!==(_draftRuns$findIndex=null===draftRuns||void 0===draftRuns?void 0:draftRuns.findIndex(function(run){return run.run_spec.run_name===runName&&run.project_name===project_name}))&&void 0!==_draftRuns$findIndex?_draftRuns$findIndex:-1;0<=index&&(null===draftRuns||void 0===draftRuns||draftRuns.splice(index,1))})})),_context.prev=4,_context.next=7,queryFulfilled;case 7:_context.next=13;break;case 9:_context.prev=9,_context.t0=_context["catch"](4),patchGetRunResult.undo(),patchGetAllRunResult.undo();case 13:case"end":return _context.stop()}},_callee,null,[[4,9]])}))()}}),getModels:builder.query({query:function(){var body=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{};return{url:src_API.RUNS.LIST(),method:"POST",body:body}},transformResponse:function(runs){return (0,src_lodash.sortBy)(runs,[function(i){return-i.submitted_at}])// Should show models of active runs only
|
|
125044
126631
|
.filter(function(run){var _run$service;return src_unfinishedRuns.includes(run.status)&&(null===(_run$service=run.service)||void 0===_run$service?void 0:_run$service.model)}).reduce(function(acc,run){var model=src_getExtendedModelFromRun(run);return model&&acc.push(model),acc},[])},providesTags:function(result){return result?[].concat(src_toConsumableArray_toConsumableArray(result.map(function(_ref7){var id=_ref7.id;return{type:"Models",id:id}})),["Models"]):["Models"]}}),getMetrics:builder.query({query:function(_ref8){var project_name=_ref8.project_name,run_name=_ref8.run_name,params=src_objectWithoutProperties_objectWithoutProperties(_ref8,src_excluded4);return{url:src_API.PROJECTS.JOB_METRICS(project_name,run_name),method:"GET",params:params}},providesTags:["Metrics"],transformResponse:function(_ref9){var metrics=_ref9.metrics;return metrics.map(function(_ref10){var timestamps=_ref10.timestamps,values=_ref10.values,metric=src_objectWithoutProperties_objectWithoutProperties(_ref10,src_excluded5);return src_services_run_objectSpread(src_services_run_objectSpread({},metric),{},{timestamps:timestamps.reverse(),values:values.reverse()})})}})}}});var src_useGetRunsQuery=src_runApi.useGetRunsQuery,src_useLazyGetRunsQuery=src_runApi.useLazyGetRunsQuery,src_useGetRunQuery=src_runApi.useGetRunQuery,src_useStopRunsMutation=src_runApi.useStopRunsMutation,src_useDeleteRunsMutation=src_runApi.useDeleteRunsMutation,src_useLazyGetModelsQuery=src_runApi.useLazyGetModelsQuery,src_useGetMetricsQuery=src_runApi.useGetMetricsQuery;
|
|
@@ -125046,10 +126633,9 @@ var src_run_excluded=["project_name"],src_run_excluded2=["project_name"],src_run
|
|
|
125046
126633
|
var src_AWSCredentialTypeEnum=/*#__PURE__*/function(AWSCredentialTypeEnum){return AWSCredentialTypeEnum.DEFAULT="default",AWSCredentialTypeEnum.ACCESS_KEY="access_key",AWSCredentialTypeEnum}({});var src_AzureCredentialTypeEnum=/*#__PURE__*/function(AzureCredentialTypeEnum){return AzureCredentialTypeEnum.DEFAULT="default",AzureCredentialTypeEnum.CLIENT="client",AzureCredentialTypeEnum}({});var src_GCPCredentialTypeEnum=/*#__PURE__*/function(GCPCredentialTypeEnum){return GCPCredentialTypeEnum.DEFAULT="default",GCPCredentialTypeEnum.SERVICE_ACCOUNT="service_account",GCPCredentialTypeEnum}({});var src_types_GlobalUserRole=/*#__PURE__*/function(GlobalUserRole){return GlobalUserRole.ADMIN="admin",GlobalUserRole.USER="user",GlobalUserRole}({});var src_ProjectUserRole=/*#__PURE__*/function(ProjectUserRole){return ProjectUserRole.ADMIN="admin",ProjectUserRole.USER="user",ProjectUserRole.MANAGER="manager",ProjectUserRole}({});var src_UserPermission=/*#__PURE__*/function(UserPermission){return UserPermission.CAN_CREATE_PROJECTS="CAN_CREATE_PROJECTS",UserPermission}({});var src_userPermissionMap={can_create_projects:src_UserPermission.CAN_CREATE_PROJECTS};
|
|
125047
126634
|
;// ./src/services/user.ts
|
|
125048
126635
|
var src_user_excluded=["username"],src_user_excluded2=["username"];function src_user_ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function src_user_objectSpread(e){for(var t,r=1;r<arguments.length;r++)t=null==arguments[r]?{}:arguments[r],r%2?src_user_ownKeys(Object(t),!0).forEach(function(r){src_defineProperty_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):src_user_ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))});return e}var src_userApi=src_rtk_query_react_esm_createApi({reducerPath:"userApi",refetchOnMountOrArgChange:!0,baseQuery:src_fetchBaseQuery({prepareHeaders:src_fetchBaseQueryHeaders}),tagTypes:["User","Payments","Billing"],endpoints:function(builder){return{getUserData:builder.query({query:function(){return{url:src_API.USERS.CURRENT_USER(),method:"POST"}},transformResponse:function(userData){return src_user_objectSpread(src_user_objectSpread({},userData),{},{permissions:Object.keys(src_userPermissionMap).reduce(function(acc,key){var _userData$permissions;return null!==userData&&void 0!==userData&&null!==(_userData$permissions=userData.permissions)&&void 0!==_userData$permissions&&_userData$permissions[key]&&acc.push(src_UserPermission[src_userPermissionMap[key]]),acc},[])})}}),getUserList:builder.query({query:function(){return{url:src_API.USERS.LIST(),method:"POST"}},providesTags:function(result){return result?[].concat(src_toConsumableArray_toConsumableArray(result.map(function(_ref){var username=_ref.username;return{type:"User",id:username}})),["User"]):["User"]}}),getUser:builder.query({query:function(_ref2){var name=_ref2.name;return{url:src_API.USERS.DETAILS(),method:"POST",body:{username:name}}},providesTags:function(result){return result?[{type:"User",id:result.username}]:[]}}),checkAuthToken:builder.mutation({query:function(_ref3){var token=_ref3.token;return{url:src_API.USERS.CURRENT_USER(),method:"POST",headers:{Authorization:"Bearer ".concat(token)}}}}),createUser:builder.mutation({query:function(user){return{url:src_API.USERS.CREATE(),method:"POST",body:user}},invalidatesTags:function(result){return[{type:"User",id:null===result||void 0===result?void 0:result.username},"User"]}}),updateUser:builder.mutation({query:function(user){return{url:src_API.USERS.UPDATE(),method:"POST",body:user}},invalidatesTags:function(result){return[{type:"User",id:null===result||void 0===result?void 0:result.username}]}}),refreshToken:builder.mutation({query:function(_ref4){var username=_ref4.username;return{url:src_API.USERS.REFRESH_TOKEN(),method:"POST",body:{username:username}}},// invalidatesTags: (result, error, { username }) => [{ type: 'User' as const, id: username }],
|
|
125049
|
-
onQueryStarted:function(_ref5,_ref6){return src_asyncToGenerator_asyncToGenerator(/*#__PURE__*/src_regenerator_default().mark(function _callee(){var username,dispatch,queryFulfilled,_yield$queryFulfilled,data;return src_regenerator_default().wrap(function(_context){for(;;)switch(_context.prev=_context.next){case 0:return username=_ref5.username,dispatch=_ref6.dispatch,queryFulfilled=_ref6.queryFulfilled,_context.prev=2,_context.next=5,queryFulfilled;case 5:_yield$queryFulfilled=_context.sent,data=_yield$queryFulfilled.data,dispatch(src_userApi.util.updateQueryData("getUser",{name:username},function(draft){Object.assign(draft,data)})),_context.next=13;break;case 10:_context.prev=10,_context.t0=_context["catch"](2),console.log(_context.t0);case 13:case"end":return _context.stop()}},_callee,null,[[2,10]])}))()}}),deleteUsers:builder.mutation({query:function(userNames){return{url:src_API.USERS.DELETE(),method:"POST",body:{users:userNames}}},invalidatesTags:["User"]}),getUserPayments:builder.query({query:function(_ref7){var username=_ref7.username;return{url:src_API.USER_PAYMENTS.LIST(username),method:"POST"}},providesTags:function(result){return result?[].concat(src_toConsumableArray_toConsumableArray(result.map(function(_ref8){var id=_ref8.id;return{type:"Payments",id:id}})),["Payments"]):["Payments"]}}),addUserPayment:builder.mutation({query:function(_ref9){var username=_ref9.username,body=src_objectWithoutProperties_objectWithoutProperties(_ref9,src_user_excluded);return{url:src_API.USER_PAYMENTS.ADD(username),method:"POST",body:body}},invalidatesTags:["Payments"]}),getUserBillingInfo:builder.query({query:function(_ref10){var username=_ref10.username;return{url:src_API.USER_BILLING.INFO(username),method:"POST"}},transformResponse:function(response){return src_user_objectSpread({},response)},providesTags:["Billing"]}),userBillingCheckoutSession:builder.mutation({query:function(_ref11){var username=_ref11.username,body=src_objectWithoutProperties_objectWithoutProperties(_ref11,src_user_excluded2);return{url:src_API.USER_BILLING.CHECKOUT_SESSION(username),method:"POST",body:body}},invalidatesTags:["Billing"]}),userBillingPortalSession:builder.mutation({query:function(_ref12){var username=_ref12.username;return{url:src_API.USER_BILLING.PORTAL_SESSION(username),method:"POST"}},invalidatesTags:["Billing"]})}}});var src_useGetUserDataQuery=src_userApi.useGetUserDataQuery,src_useGetUserListQuery=src_userApi.useGetUserListQuery,src_useGetUserQuery=src_userApi.useGetUserQuery,src_useCheckAuthTokenMutation=src_userApi.useCheckAuthTokenMutation,src_useCreateUserMutation=src_userApi.useCreateUserMutation,src_useDeleteUsersMutation=src_userApi.useDeleteUsersMutation,src_useUpdateUserMutation=src_userApi.useUpdateUserMutation,src_useRefreshTokenMutation=src_userApi.useRefreshTokenMutation,src_user_useGetUserPaymentsQuery=src_userApi.useGetUserPaymentsQuery,src_useAddUserPaymentMutation=src_userApi.useAddUserPaymentMutation,src_user_useGetUserBillingInfoQuery=src_userApi.useGetUserBillingInfoQuery,src_user_useUserBillingCheckoutSessionMutation=src_userApi.useUserBillingCheckoutSessionMutation,
|
|
126636
|
+
onQueryStarted:function(_ref5,_ref6){return src_asyncToGenerator_asyncToGenerator(/*#__PURE__*/src_regenerator_default().mark(function _callee(){var username,dispatch,queryFulfilled,_yield$queryFulfilled,data;return src_regenerator_default().wrap(function(_context){for(;;)switch(_context.prev=_context.next){case 0:return username=_ref5.username,dispatch=_ref6.dispatch,queryFulfilled=_ref6.queryFulfilled,_context.prev=2,_context.next=5,queryFulfilled;case 5:_yield$queryFulfilled=_context.sent,data=_yield$queryFulfilled.data,dispatch(src_userApi.util.updateQueryData("getUser",{name:username},function(draft){Object.assign(draft,data)})),_context.next=13;break;case 10:_context.prev=10,_context.t0=_context["catch"](2),console.log(_context.t0);case 13:case"end":return _context.stop()}},_callee,null,[[2,10]])}))()}}),deleteUsers:builder.mutation({query:function(userNames){return{url:src_API.USERS.DELETE(),method:"POST",body:{users:userNames}}},invalidatesTags:["User"]}),getUserPayments:builder.query({query:function(_ref7){var username=_ref7.username;return{url:src_API.USER_PAYMENTS.LIST(username),method:"POST"}},providesTags:function(result){return result?[].concat(src_toConsumableArray_toConsumableArray(result.map(function(_ref8){var id=_ref8.id;return{type:"Payments",id:id}})),["Payments"]):["Payments"]}}),addUserPayment:builder.mutation({query:function(_ref9){var username=_ref9.username,body=src_objectWithoutProperties_objectWithoutProperties(_ref9,src_user_excluded);return{url:src_API.USER_PAYMENTS.ADD(username),method:"POST",body:body}},invalidatesTags:["Payments"]}),getUserBillingInfo:builder.query({query:function(_ref10){var username=_ref10.username;return{url:src_API.USER_BILLING.INFO(username),method:"POST"}},transformResponse:function(response){return src_user_objectSpread({},response)},providesTags:["Billing"]}),userBillingCheckoutSession:builder.mutation({query:function(_ref11){var username=_ref11.username,body=src_objectWithoutProperties_objectWithoutProperties(_ref11,src_user_excluded2);return{url:src_API.USER_BILLING.CHECKOUT_SESSION(username),method:"POST",body:body}},invalidatesTags:["Billing"]}),userBillingPortalSession:builder.mutation({query:function(_ref12){var username=_ref12.username;return{url:src_API.USER_BILLING.PORTAL_SESSION(username),method:"POST"}},invalidatesTags:["Billing"]})}}});var src_useGetUserDataQuery=src_userApi.useGetUserDataQuery,src_useGetUserListQuery=src_userApi.useGetUserListQuery,src_useGetUserQuery=src_userApi.useGetUserQuery,src_useCheckAuthTokenMutation=src_userApi.useCheckAuthTokenMutation,src_useCreateUserMutation=src_userApi.useCreateUserMutation,src_useDeleteUsersMutation=src_userApi.useDeleteUsersMutation,src_useUpdateUserMutation=src_userApi.useUpdateUserMutation,src_useRefreshTokenMutation=src_userApi.useRefreshTokenMutation,src_user_useGetUserPaymentsQuery=src_userApi.useGetUserPaymentsQuery,src_useAddUserPaymentMutation=src_userApi.useAddUserPaymentMutation,src_user_useGetUserBillingInfoQuery=src_userApi.useGetUserBillingInfoQuery,src_user_useUserBillingCheckoutSessionMutation=src_userApi.useUserBillingCheckoutSessionMutation,src_useUserBillingPortalSessionMutation=src_userApi.useUserBillingPortalSessionMutation;
|
|
125050
126637
|
;// ./src/layouts/AppLayout/hooks.ts
|
|
125051
|
-
var src_useSideNavigation=function(){var _useAppSelector,_serverInfoData$serve,_useTranslation=src_useTranslation_useTranslation(),t=_useTranslation.t,userName=null!==(_useAppSelector=src_hooks_useAppSelector(src_slice_selectUserName))&&void 0!==_useAppSelector?_useAppSelector:"",_useLocation=src_dist_useLocation(),pathname=_useLocation.pathname,_usePermissionGuard=src_usePermissionGuard({allowedGlobalRoles:[src_types_GlobalUserRole.ADMIN]}),_usePermissionGuard2=src_slicedToArray_slicedToArray(_usePermissionGuard,1),isGlobalAdmin=_usePermissionGuard2[0],_useGetServerInfoQuer=src_useGetServerInfoQuery(),serverInfoData=_useGetServerInfoQuer.data,isPoolDetails=!!src_useMatch(src_routes_ROUTES.FLEETS.DETAILS.TEMPLATE),billingUrl=src_routes_ROUTES.USER.BILLING.LIST.FORMAT(userName),userProjectsUrl=src_routes_ROUTES.USER.PROJECTS.FORMAT(userName),generalLinks=[{type:"link",text:t("navigation.runs"),href:src_routes_ROUTES.RUNS.LIST},{type:"link",text:t("navigation.models"),href:src_routes_ROUTES.MODELS.LIST},{type:"link",text:t("navigation.fleets"),href:src_routes_ROUTES.FLEETS.LIST},{type:"link",text:t("navigation.instances"),href:src_routes_ROUTES.INSTANCES.LIST},{type:"link",text:t("navigation.volumes"),href:src_routes_ROUTES.VOLUMES.LIST},{type:"link",text:t("navigation.project_other"),href:src_routes_ROUTES.PROJECT.LIST},isGlobalAdmin&&{type:"link",text:t("navigation.users"),href:src_routes_ROUTES.USER.LIST}].filter(Boolean),userSettingsLinks=[{type:"link",text:t("navigation.settings"),href:src_routes_ROUTES.USER.DETAILS.FORMAT(userName)}, false&&0,{type:"link",text:t("users.projects"),href:userProjectsUrl}].filter(Boolean),navLinks=[{type:"section-group",title:t("navigation.general"),items:generalLinks},{type:"divider"},{type:"section-group",title:t("navigation.account"),items:userSettingsLinks},{type:"divider"},{type:"
|
|
125052
|
-
},{type:"link",text:t("common.discord"),external:!0,href:src_DISCORD_URL,onClick:function(){return src_libs_goToUrl(src_DISCORD_URL,!0)}}]},{type:"divider"},{type:"link",href:"#version",text:"dstack version: ".concat(null!==(_serverInfoData$serve=null===serverInfoData||void 0===serverInfoData?void 0:serverInfoData.server_version)&&void 0!==_serverInfoData$serve?_serverInfoData$serve:"No version")}].filter(Boolean),activeHref=(0,src_react.useMemo)(function(){if(isPoolDetails)return src_routes_ROUTES.FLEETS.LIST;var generalActiveLink=generalLinks.find(function(linkItem){return 0===pathname.indexOf(linkItem.href)});if(generalActiveLink)return pathname;var settingsActiveLink=userSettingsLinks.find(function(linkItem){return linkItem.href===pathname});return settingsActiveLink?pathname:"/"+pathname.split("/")[1]},[pathname,userName]);return{navLinks:navLinks,activeHref:activeHref,billingUrl:billingUrl}};
|
|
126638
|
+
var src_useSideNavigation=function(){var _useAppSelector,_serverInfoData$serve,_useTranslation=src_useTranslation_useTranslation(),t=_useTranslation.t,userName=null!==(_useAppSelector=src_hooks_useAppSelector(src_slice_selectUserName))&&void 0!==_useAppSelector?_useAppSelector:"",_useLocation=src_dist_useLocation(),pathname=_useLocation.pathname,_usePermissionGuard=src_usePermissionGuard({allowedGlobalRoles:[src_types_GlobalUserRole.ADMIN]}),_usePermissionGuard2=src_slicedToArray_slicedToArray(_usePermissionGuard,1),isGlobalAdmin=_usePermissionGuard2[0],_useGetServerInfoQuer=src_useGetServerInfoQuery(),serverInfoData=_useGetServerInfoQuer.data,isPoolDetails=!!src_useMatch(src_routes_ROUTES.FLEETS.DETAILS.TEMPLATE),billingUrl=src_routes_ROUTES.USER.BILLING.LIST.FORMAT(userName),userProjectsUrl=src_routes_ROUTES.USER.PROJECTS.FORMAT(userName),generalLinks=[{type:"link",text:t("navigation.runs"),href:src_routes_ROUTES.RUNS.LIST},{type:"link",text:t("navigation.models"),href:src_routes_ROUTES.MODELS.LIST},{type:"link",text:t("navigation.fleets"),href:src_routes_ROUTES.FLEETS.LIST},{type:"link",text:t("navigation.instances"),href:src_routes_ROUTES.INSTANCES.LIST},{type:"link",text:t("navigation.volumes"),href:src_routes_ROUTES.VOLUMES.LIST},{type:"link",text:t("navigation.project_other"),href:src_routes_ROUTES.PROJECT.LIST},isGlobalAdmin&&{type:"link",text:t("navigation.users"),href:src_routes_ROUTES.USER.LIST}].filter(Boolean),userSettingsLinks=[{type:"link",text:t("navigation.settings"),href:src_routes_ROUTES.USER.DETAILS.FORMAT(userName)}, false&&0,{type:"link",text:t("users.projects"),href:userProjectsUrl}].filter(Boolean),navLinks=[{type:"section-group",title:t("navigation.general"),items:generalLinks},{type:"divider"},{type:"section-group",title:t("navigation.account"),items:userSettingsLinks},{type:"divider"},{type:"link",href:"#version",text:"dstack version: ".concat(null!==(_serverInfoData$serve=null===serverInfoData||void 0===serverInfoData?void 0:serverInfoData.server_version)&&void 0!==_serverInfoData$serve?_serverInfoData$serve:"No version")}].filter(Boolean),activeHref=(0,src_react.useMemo)(function(){if(isPoolDetails)return src_routes_ROUTES.FLEETS.LIST;var generalActiveLink=generalLinks.find(function(linkItem){return 0===pathname.indexOf(linkItem.href)});if(generalActiveLink)return pathname;var settingsActiveLink=userSettingsLinks.find(function(linkItem){return linkItem.href===pathname});return settingsActiveLink?pathname:"/"+pathname.split("/")[1]},[pathname,userName]);return{navLinks:navLinks,activeHref:activeHref,billingUrl:billingUrl}};
|
|
125053
126639
|
;// ./src/layouts/AppLayout/TutorialPanel/hooks.ts
|
|
125054
126640
|
function src_hooks_ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function src_hooks_objectSpread(e){for(var t,r=1;r<arguments.length;r++)t=null==arguments[r]?{}:arguments[r],r%2?src_hooks_ownKeys(Object(t),!0).forEach(function(r){src_defineProperty_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):src_hooks_ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))});return e}var src_hooks_useTutorials=function(){var navigate=src_dist_useNavigate(),dispatch=src_hooks_useAppDispatch(),_useSideNavigation=src_useSideNavigation(),billingUrl=_useSideNavigation.billingUrl,useName=src_hooks_useAppSelector(src_slice_selectUserName),_useAppSelector=src_hooks_useAppSelector(src_selectTutorialPanel),billingCompleted=_useAppSelector.billingCompleted,configureCLICompleted=_useAppSelector.configureCLICompleted,discordCompleted=_useAppSelector.discordCompleted,tallyCompleted=_useAppSelector.tallyCompleted,quickStartCompleted=_useAppSelector.quickStartCompleted,_useGetUserBillingInf=src_user_useGetUserBillingInfoQuery({username:null!==useName&&void 0!==useName?useName:""},{skip:!useName}),userBillingData=_useGetUserBillingInf.data,_useGetRunsQuery=src_useGetRunsQuery({limit:1}),runsData=_useGetRunsQuery.data,completeIsChecked=(0,src_react.useRef)(!1);(0,src_react.useEffect)(function(){userBillingData&&runsData&&!completeIsChecked.current&&(dispatch(src_updateTutorialPanelState({billingCompleted:0<userBillingData.balance,configureCLICompleted:0<runsData.length})),(0>=userBillingData.balance||0===runsData.length)&&"sky"==="enterprise"&&0,completeIsChecked.current=!0)},[userBillingData,runsData]);var startBillingTutorial=(0,src_react.useCallback)(function(){navigate(billingUrl)},[billingUrl]),finishBillingTutorial=(0,src_react.useCallback)(function(){dispatch(src_updateTutorialPanelState({billingCompleted:!0}))},[]),startConfigCliTutorial=(0,src_react.useCallback)(function(){},[billingUrl]),finishConfigCliTutorial=(0,src_react.useCallback)(function(){dispatch(src_updateTutorialPanelState({configureCLICompleted:!0}))},[]),startDiscordTutorial=(0,src_react.useCallback)(function(){src_libs_goToUrl(src_DISCORD_URL,!0),dispatch(src_updateTutorialPanelState({discordCompleted:!0}))},[]),startQuickStartTutorial=(0,src_react.useCallback)(function(){src_libs_goToUrl(src_QUICK_START_URL,!0),dispatch(src_updateTutorialPanelState({quickStartCompleted:!0}))},[]),tutorials=(0,src_react.useMemo)(function(){return[// {
|
|
125055
126641
|
// ...CREDITS_TUTORIAL,
|
|
@@ -125058,7 +126644,8 @@ function src_hooks_ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySym
|
|
|
125058
126644
|
// completed: tallyCompleted,
|
|
125059
126645
|
// startCallback: startCreditsTutorial,
|
|
125060
126646
|
// },
|
|
125061
|
-
src_hooks_objectSpread(src_hooks_objectSpread({},src_CONFIGURE_CLI_TUTORIAL),{},{id:2,completed:configureCLICompleted,startCallback:startConfigCliTutorial,finishCallback:finishConfigCliTutorial}),src_hooks_objectSpread(src_hooks_objectSpread({},src_BILLING_TUTORIAL),{},{id:3,completed:billingCompleted,startCallback:startBillingTutorial,finishCallback:finishBillingTutorial}),src_hooks_objectSpread(src_hooks_objectSpread({},src_QUICKSTART_TUTORIAL),{},{id:4,startWithoutActivation:!0,completed:quickStartCompleted,startCallback:startQuickStartTutorial}),src_hooks_objectSpread(src_hooks_objectSpread({},src_JOIN_DISCORD_TUTORIAL),{},{id:5,startWithoutActivation:!0,completed:discordCompleted,startCallback:startDiscordTutorial})]},[billingUrl,quickStartCompleted,discordCompleted,tallyCompleted,billingCompleted,configureCLICompleted,finishBillingTutorial,finishConfigCliTutorial]);//
|
|
126647
|
+
src_hooks_objectSpread(src_hooks_objectSpread({},src_CONFIGURE_CLI_TUTORIAL),{},{id:2,completed:configureCLICompleted,startCallback:startConfigCliTutorial,finishCallback:finishConfigCliTutorial}),src_hooks_objectSpread(src_hooks_objectSpread({},src_BILLING_TUTORIAL),{},{id:3,completed:billingCompleted,startCallback:startBillingTutorial,finishCallback:finishBillingTutorial}),src_hooks_objectSpread(src_hooks_objectSpread({},src_QUICKSTART_TUTORIAL),{},{id:4,startWithoutActivation:!0,completed:quickStartCompleted,startCallback:startQuickStartTutorial}),src_hooks_objectSpread(src_hooks_objectSpread({},src_JOIN_DISCORD_TUTORIAL),{},{id:5,startWithoutActivation:!0,completed:discordCompleted,startCallback:startDiscordTutorial})]},[billingUrl,quickStartCompleted,discordCompleted,tallyCompleted,billingCompleted,configureCLICompleted,finishBillingTutorial,finishConfigCliTutorial]);// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
126648
|
+
// const startCreditsTutorial = useCallback(() => {
|
|
125062
126649
|
// if (typeof Tally !== 'undefined') {
|
|
125063
126650
|
// Tally.openPopup(TALLY_FORM_ID);
|
|
125064
126651
|
// dispatch(updateTutorialPanelState({ tallyCompleted: true }));
|
|
@@ -125511,7 +127098,7 @@ var src_logo_ForwardRef = /*#__PURE__*/(/* unused pure expression or super */ nu
|
|
|
125511
127098
|
|
|
125512
127099
|
/* harmony default export */ const src_logo = (__webpack_require__.p + "static/media/logo.f602feeb138844eda97c8cb641461448.svg");
|
|
125513
127100
|
;// ./src/layouts/AppLayout/index.tsx
|
|
125514
|
-
var src_HeaderPortal=function(_ref){var children=_ref.children,domNode=document.querySelector("#header");return domNode?/*#__PURE__*/(0,src_react_dom.createPortal)(children,domNode):null},src_THEME_ICON_MAP=src_defineProperty_defineProperty(src_defineProperty_defineProperty({},src_Mode.Dark,src_DarkThemeIcon),src_Mode.Light,src_LightThemeIcon),src_AppLayout_AppLayout=function(_ref2){var _useAppSelector,_useAppSelector2,children=_ref2.children,_useTranslation=src_useTranslation_useTranslation(),t=_useTranslation.t,navigate=src_dist_useNavigate();src_useGetServerInfoQuery();var userName=null!==(_useAppSelector=src_hooks_useAppSelector(src_slice_selectUserName))&&void 0!==_useAppSelector?_useAppSelector:"",systemMode=null!==(_useAppSelector2=src_hooks_useAppSelector(src_selectSystemMode))&&void 0!==_useAppSelector2?_useAppSelector2:"",breadcrumbs=src_hooks_useAppSelector(src_selectBreadcrumbs),_useAppSelector3=src_hooks_useAppSelector(src_selectToolsPanelState),toolsIsOpen=_useAppSelector3.isOpen,toolsActiveTab=_useAppSelector3.tab,helpPanelContent=src_hooks_useAppSelector(src_selectHelpPanelContent),dispatch=src_hooks_useAppDispatch(),_useSideNavigation=src_useSideNavigation(),navLinks=_useSideNavigation.navLinks,activeHref=_useSideNavigation.activeHref,onFollowHandler=function(event){event.preventDefault(),event.detail.external?src_libs_goToUrl(event.detail.href,!0):navigate(event.detail.href)},profileActions=[{type:"button",href:src_routes_ROUTES.USER.DETAILS.FORMAT(userName),id:"settings",text:t("common.settings")},{type:"button",href:src_routes_ROUTES.LOGOUT,id:"signout",text:t("common.sign_out")}],onChangeToolsTab=function(tabName){dispatch(src_setToolsTab(tabName))},isVisibleInfoTab=helpPanelContent.header||helpPanelContent.footer||helpPanelContent.body,avatarProps= true?{name:userName}:0,ThemeIcon=src_THEME_ICON_MAP[systemMode];return/*#__PURE__*/src_react.createElement(src_AnnotationContext_AnnotationContext,null,/*#__PURE__*/src_react.createElement(src_HeaderPortal,null,/*#__PURE__*/src_react.createElement("div",{className:src_index_module.appHeader},/*#__PURE__*/src_react.createElement(src_TopNavigation,{i18nStrings:{overflowMenuTriggerText:"",overflowMenuTitleText:"",overflowMenuBackIconAriaLabel:"",overflowMenuDismissIconAriaLabel:""},identity:{href:"/",logo:{src:src_logo,alt:"Dstack logo"}},utilities:[ false&&0,{href:"theme-button",type:"button",iconSvg:/*#__PURE__*/src_react.createElement(ThemeIcon,null),onClick:function(event){switch(event.preventDefault(),systemMode){case src_Mode.Light:return void dispatch(src_setSystemMode(src_Mode.Dark));default:dispatch(src_setSystemMode(src_Mode.Light))}}},{"data-class":"user-menu",type:"menu-dropdown",text:/*#__PURE__*/src_react.createElement("div",{className:src_index_module.userAvatar},/*#__PURE__*/src_react.createElement(src_es,src_extends_extends({},avatarProps,{size:"40px"}))),items:profileActions,// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
127101
|
+
var src_HeaderPortal=function(_ref){var children=_ref.children,domNode=document.querySelector("#header");return domNode?/*#__PURE__*/(0,src_react_dom.createPortal)(children,domNode):null},src_THEME_ICON_MAP=src_defineProperty_defineProperty(src_defineProperty_defineProperty({},src_Mode.Dark,src_DarkThemeIcon),src_Mode.Light,src_LightThemeIcon),src_AppLayout_AppLayout=function(_ref2){var _useAppSelector,_useAppSelector2,children=_ref2.children,_useTranslation=src_useTranslation_useTranslation(),t=_useTranslation.t,navigate=src_dist_useNavigate();src_useGetServerInfoQuery();var userName=null!==(_useAppSelector=src_hooks_useAppSelector(src_slice_selectUserName))&&void 0!==_useAppSelector?_useAppSelector:"",systemMode=null!==(_useAppSelector2=src_hooks_useAppSelector(src_selectSystemMode))&&void 0!==_useAppSelector2?_useAppSelector2:"",breadcrumbs=src_hooks_useAppSelector(src_selectBreadcrumbs),_useAppSelector3=src_hooks_useAppSelector(src_selectToolsPanelState),toolsIsOpen=_useAppSelector3.isOpen,toolsActiveTab=_useAppSelector3.tab,helpPanelContent=src_hooks_useAppSelector(src_selectHelpPanelContent),dispatch=src_hooks_useAppDispatch(),_useSideNavigation=src_useSideNavigation(),navLinks=_useSideNavigation.navLinks,activeHref=_useSideNavigation.activeHref,onFollowHandler=function(event){event.preventDefault(),event.detail.external?src_libs_goToUrl(event.detail.href,!0):navigate(event.detail.href)},profileActions=[{type:"button",href:src_routes_ROUTES.USER.DETAILS.FORMAT(userName),id:"settings",text:t("common.settings")},{type:"button",href:src_routes_ROUTES.LOGOUT,id:"signout",text:t("common.sign_out")}],onChangeToolsTab=function(tabName){dispatch(src_setToolsTab(tabName))},isVisibleInfoTab=helpPanelContent.header||helpPanelContent.footer||helpPanelContent.body,avatarProps= true?{name:userName}:0,ThemeIcon=src_THEME_ICON_MAP[systemMode];return/*#__PURE__*/src_react.createElement(src_AnnotationContext_AnnotationContext,null,/*#__PURE__*/src_react.createElement(src_HeaderPortal,null,/*#__PURE__*/src_react.createElement("div",{className:src_index_module.appHeader},/*#__PURE__*/src_react.createElement(src_TopNavigation,{i18nStrings:{overflowMenuTriggerText:"",overflowMenuTitleText:"",overflowMenuBackIconAriaLabel:"",overflowMenuDismissIconAriaLabel:""},identity:{href:"/",logo:{src:src_logo,alt:"Dstack logo"}},utilities:[ false&&0,{type:"button",text:t("common.docs"),external:!0,onClick:function(){return src_libs_goToUrl(src_DOCS_URL,!0)}},{type:"button",text:t("common.discord"),external:!0,onClick:function(){return src_libs_goToUrl(src_DISCORD_URL,!0)}},{href:"theme-button",type:"button",iconSvg:/*#__PURE__*/src_react.createElement(ThemeIcon,null),onClick:function(event){switch(event.preventDefault(),systemMode){case src_Mode.Light:return void dispatch(src_setSystemMode(src_Mode.Dark));default:dispatch(src_setSystemMode(src_Mode.Light))}}},{"data-class":"user-menu",type:"menu-dropdown",text:/*#__PURE__*/src_react.createElement("div",{className:src_index_module.userAvatar},/*#__PURE__*/src_react.createElement(src_es,src_extends_extends({},avatarProps,{size:"40px"}))),items:profileActions,// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
125515
127102
|
// @ts-ignore
|
|
125516
127103
|
onItemFollow:onFollowHandler}].filter(Boolean)}))),/*#__PURE__*/src_react.createElement(src_app_layout,{headerSelector:"#header",contentType:"default",content:children,splitPanelOpen:!0,breadcrumbs:function(){if(breadcrumbs)return/*#__PURE__*/src_react.createElement(src_breadcrumb_group_BreadcrumbGroup,{items:breadcrumbs,onFollow:onFollowHandler})}(),notifications:/*#__PURE__*/src_react.createElement(src_Notifications_Notifications,null),navigation:/*#__PURE__*/src_react.createElement(src_SideNavigation,{header:{href:"#",text:t("common.control_plane")},activeHref:activeHref,items:navLinks,onFollow:onFollowHandler}),tools:/*#__PURE__*/src_react.createElement(src_react.Fragment,null,/*#__PURE__*/src_react.createElement(src_Tabs_Tabs,{activeTabId:toolsActiveTab,onChange:function(event){return onChangeToolsTab(event.detail.activeTabId)},tabs:[isVisibleInfoTab&&{id:src_ToolsTabs.INFO,label:t("common.info"),content:/*#__PURE__*/src_react.createElement(src_HelpPanel,{header:helpPanelContent.header,footer:helpPanelContent.footer},helpPanelContent.body)}, false&&0].filter(Boolean)})),toolsHide:!toolsIsOpen,toolsOpen:toolsIsOpen,toolsWidth:330,onToolsChange:function(_ref3){var open=_ref3.detail.open;open||dispatch(src_closeToolsPanel())}}),/*#__PURE__*/src_react.createElement(src_TallyComponent,null))};/* harmony default export */ const src_layouts_AppLayout = (src_AppLayout_AppLayout);
|
|
125517
127104
|
;// ./src/layouts/UnauthorizedLayout/styles.module.scss
|
|
@@ -133943,7 +135530,7 @@ var src_getPythonModelCode=function(_ref){var _model$base_url,_model$name,model=
|
|
|
133943
135530
|
// extracted by mini-css-extract-plugin
|
|
133944
135531
|
/* harmony default export */ const src_Details_styles_module = ({"modelDetailsLayout":"saLOO","general":"G6gkh","modelForm":"Yybyq","side":"fTQI9","buttons":"RQFU_","chat":"OSeY8","message":"o9AkU","messageForm":"SaEus","viewCodeControls":"PQJls","copyButton":"fLak8"});
|
|
133945
135532
|
;// ./src/pages/Models/Details/index.tsx
|
|
133946
|
-
function src_asyncIterator(r){var n,t,o,e=2;for("undefined"!=typeof Symbol&&(t=Symbol.asyncIterator,o=Symbol.iterator);e--;){if(t&&null!=(n=r[t]))return n.call(r);if(o&&null!=(n=r[o]))return new src_AsyncFromSyncIterator(n.call(r));t="@@asyncIterator",o="@@iterator"}throw new TypeError("Object is not async iterable")}function src_AsyncFromSyncIterator(r){function AsyncFromSyncIteratorContinuation(r){if(Object(r)!==r)return Promise.reject(new TypeError(r+" is not an object."));var n=r.done;return Promise.resolve(r.value).then(function(r){return{value:r,done:n}})}return src_AsyncFromSyncIterator=function(r){this.s=r,this.n=r.next},src_AsyncFromSyncIterator.prototype={s:null,n:null,next:function(){return AsyncFromSyncIteratorContinuation(this.n.apply(this.s,arguments))},return:function(r){var n=this.s.return;return void 0===n?Promise.resolve({value:r,done:!0}):AsyncFromSyncIteratorContinuation(n.apply(this.s,arguments))},throw:function(r){var n=this.s.return;return void 0===n?Promise.reject(r):AsyncFromSyncIteratorContinuation(n.apply(this.s,arguments))}},new src_AsyncFromSyncIterator(r)}var src_MESSAGE_ROLE_MAP={tool:"Tool",system:"System",user:"User",assistant:"Assistant"},src_CodeTab=/*#__PURE__*/function(CodeTab){return CodeTab.Python="python",CodeTab.Curl="curl",CodeTab}(src_CodeTab||{});var src_ModelDetails=function(){var _params$projectName,_params$runName,_useTranslation=src_useTranslation_useTranslation(),t=_useTranslation.t,token=src_hooks_useAppSelector(src_selectAuthToken),_useState=(0,src_react.useState)([]),_useState2=src_slicedToArray_slicedToArray(_useState,2),messages=_useState2[0],setMessages=_useState2[1],_useState3=(0,src_react.useState)(!1),_useState4=src_slicedToArray_slicedToArray(_useState3,2),viewCodeVisible=_useState4[0],setViewCodeVisible=_useState4[1],_useState5=(0,src_react.useState)(src_CodeTab.Python),_useState6=src_slicedToArray_slicedToArray(_useState5,2),codeTab=_useState6[0],setCodeTab=_useState6[1],_useState7=(0,src_react.useState)(!1),_useState8=src_slicedToArray_slicedToArray(_useState7,2),loading=_useState8[0],setLoading=_useState8[1],params=src_dist_useParams(),paramProjectName=null!==(_params$projectName=params.projectName)&&void 0!==_params$projectName?_params$projectName:"",paramRunName=null!==(_params$runName=params.runName)&&void 0!==_params$runName?_params$runName:"",openai=(0,src_react.useRef)(),textAreaRef=(0,src_react.useRef)(null),chatList=(0,src_react.useRef)(),_useNotifications=src_useNotifications_useNotifications(),_useNotifications2=src_slicedToArray_slicedToArray(_useNotifications,1),pushNotification=_useNotifications2[0],messageForShowing=(0,src_react.useMemo)(function(){return messages.filter(function(m){return"system"!==m.role})},[messages]);src_useBreadcrumbs_useBreadcrumbs([{text:t("navigation.project_other"),href:src_routes_ROUTES.PROJECT.LIST},{text:paramProjectName,href:src_routes_ROUTES.PROJECT.DETAILS.FORMAT(paramProjectName)},{text:t("navigation.models"),href:src_routes_ROUTES.MODELS.LIST},{text:paramRunName,href:src_routes_ROUTES.MODELS.DETAILS.FORMAT(paramProjectName,paramRunName)}]);var scrollChatToBottom=function(){if(chatList.current){var _chatList$current=chatList.current,clientHeight=_chatList$current.clientHeight,scrollHeight=_chatList$current.scrollHeight;chatList.current.scrollTo(0,scrollHeight-clientHeight)}},_useGetRunQuery=src_useGetRunQuery({project_name:paramProjectName,run_name:paramRunName}),runData=_useGetRunQuery.data,isLoadingRun=_useGetRunQuery.isLoading;(0,src_react.useEffect)(function(){runData&&src_runIsStopped(runData.status)&&src_riseRouterException()},[runData]);var modelData=(0,src_react.useMemo)(function(){return runData?src_getExtendedModelFromRun(runData):void 0},[runData]);(0,src_react.useEffect)(function(){modelData&&(openai.current=new src_node_modules_openai({baseURL:src_getModelGateway(modelData.base_url),apiKey:token,dangerouslyAllowBrowser:!0}))},[modelData,token]),(0,src_react.useEffect)(function(){scrollChatToBottom()},[messageForShowing]);var _useForm=src_index_esm_useForm(),handleSubmit=_useForm.handleSubmit,control=_useForm.control,setValue=_useForm.setValue,watch=_useForm.watch,messageText=watch("message"),sendRequest=/*#__PURE__*/function(){var _ref=src_asyncToGenerator_asyncToGenerator(/*#__PURE__*/src_regenerator_default().mark(function _callee(messages){var _modelData$name;return src_regenerator_default().wrap(function(_context){for(;;)switch(_context.prev=_context.next){case 0:if(openai.current){_context.next=2;break}return _context.abrupt("return",Promise.reject("Model not found"));case 2:return _context.abrupt("return",openai.current.chat.completions.create({model:null!==(_modelData$name=null===modelData||void 0===modelData?void 0:modelData.name)&&void 0!==_modelData$name?_modelData$name:"",messages:messages,stream:!0,max_tokens:512}));case 3:case"end":return _context.stop()}},_callee)}));return function(){return _ref.apply(this,arguments)}}(),onSubmit=/*#__PURE__*/function(){var _ref2=src_asyncToGenerator_asyncToGenerator(/*#__PURE__*/src_regenerator_default().mark(function _callee2(data){var _data$instructions,newMessages,newMessage,messagesWithoutSystemMessage,stream,_iteratorAbruptCompletion,_didIteratorError,_iteratorError,_loop,_iterator,_step;return src_regenerator_default().wrap(function(_context3){for(;;)switch(_context3.prev=_context3.next){case 0:if(data.message){_context3.next=2;break}return _context3.abrupt("return");case 2:return newMessage={role:"user",content:data.message},messagesWithoutSystemMessage=messages.filter(function(m){return"system"!==m.role}),newMessages=null!==(_data$instructions=data.instructions)&&void 0!==_data$instructions&&_data$instructions.length?[{role:"system",content:data.instructions}].concat(src_toConsumableArray_toConsumableArray(messagesWithoutSystemMessage),[newMessage]):[].concat(src_toConsumableArray_toConsumableArray(messagesWithoutSystemMessage),[newMessage]),setMessages(newMessages),setLoading(!0),_context3.prev=7,_context3.next=10,sendRequest(newMessages);case 10:stream=_context3.sent,setMessages(function(oldMessages){return[].concat(src_toConsumableArray_toConsumableArray(oldMessages),[{role:"assistant",content:""}])}),setValue("message",""),setTimeout(onChangeMessage,0),_iteratorAbruptCompletion=!1,_didIteratorError=!1,_context3.prev=16,_loop=/*#__PURE__*/src_regenerator_default().mark(function _loop(){var chunk;return src_regenerator_default().wrap(function(_context2){for(;;)switch(_context2.prev=_context2.next){case 0:chunk=_step.value,setMessages(function(oldMessages){var _chunk$choices$0$delt,_chunk$choices$,_lastMessage$content,_chunk$choices$0$delt2,_chunk$choices$2,newMessages=src_toConsumableArray_toConsumableArray(oldMessages),lastMessage=newMessages.pop();return lastMessage?[].concat(src_toConsumableArray_toConsumableArray(newMessages),[{role:null!==(_chunk$choices$0$delt=null===(_chunk$choices$=chunk.choices[0])||void 0===_chunk$choices$||null===(_chunk$choices$=_chunk$choices$.delta)||void 0===_chunk$choices$?void 0:_chunk$choices$.role)&&void 0!==_chunk$choices$0$delt?_chunk$choices$0$delt:null===lastMessage||void 0===lastMessage?void 0:lastMessage.role,content:(null!==(_lastMessage$content=null===lastMessage||void 0===lastMessage?void 0:lastMessage.content)&&void 0!==_lastMessage$content?_lastMessage$content:"")+(null!==(_chunk$choices$0$delt2=null===(_chunk$choices$2=chunk.choices[0])||void 0===_chunk$choices$2||null===(_chunk$choices$2=_chunk$choices$2.delta)||void 0===_chunk$choices$2?void 0:_chunk$choices$2.content)&&void 0!==_chunk$choices$0$delt2?_chunk$choices$0$delt2:"")}]):oldMessages});case 2:case"end":return _context2.stop()}},_loop)}),_iterator=src_asyncIterator(stream);case 19:return _context3.next=21,_iterator.next();case 21:if(!(_iteratorAbruptCompletion=!(_step=_context3.sent).done)){_context3.next=26;break}return _context3.delegateYield(_loop(),"t0",23);case 23:_iteratorAbruptCompletion=!1,_context3.next=19;break;case 26:_context3.next=32;break;case 28:_context3.prev=28,_context3.t1=_context3["catch"](16),_didIteratorError=!0,_iteratorError=_context3.t1;case 32:if(_context3.prev=32,_context3.prev=33,!(_iteratorAbruptCompletion&&null!=_iterator.return)){_context3.next=37;break}return _context3.next=37,_iterator.return();case 37:if(_context3.prev=37,!_didIteratorError){_context3.next=40;break}throw _iteratorError;case 40:return _context3.finish(37);case 41:return _context3.finish(32);case 42:_context3.next=48;break;case 44:_context3.prev=44,_context3.t2=_context3["catch"](7),pushNotification({type:"error",content:t("common.server_error",{error:_context3.t2})}),clearChat();case 48:setLoading(!1),setTimeout(function(){var _textAreaRef$current;null===(_textAreaRef$current=textAreaRef.current)||void 0===_textAreaRef$current||null===(_textAreaRef$current=_textAreaRef$current.querySelector("textarea"))||void 0===_textAreaRef$current||_textAreaRef$current.focus()},10);case 50:case"end":return _context3.stop()}},_callee2,null,[[7,44],[16,28,32,42],[33,,37,41]])}));return function(){return _ref2.apply(this,arguments)}}(),clearChat=function(){setValue("message",""),setValue("instructions",""),setMessages([]),setTimeout(onChangeMessage,10)},renderMessageBody=function(content){var languages=[],matches=content.match(/^(```[A-Za-z]*)/m);matches&&src_toConsumableArray_toConsumableArray(matches).forEach(function(l){return l&&languages.push(l.replace(/^```/,""))});var replacedStrings=src_react_string_replace_default()(content,/^([A-Za-z \t]*)```([A-Za-z]*)?\n([\s\S]*?)```([A-Za-z \t]*)*$/gm,function(match){return match?/*#__PURE__*/src_react.createElement(src_Code,null,match):""});return/*#__PURE__*/src_react.createElement(src_box_Box,{variant:"p"},replacedStrings.filter(function(line,index){return!(languages.includes(line)&&"string"!=typeof replacedStrings[index+1]&&void 0!==src_typeof_typeof(replacedStrings[index+1]))}))},onChangeMessage=function(){if(textAreaRef.current){var textAreaElement=textAreaRef.current.querySelector("textarea");textAreaElement&&(textAreaElement.style.height="auto",textAreaElement.style.height=textAreaElement.scrollHeight+"px")}},pythonCode=src_getPythonModelCode({model:modelData,token:token}),curlCode=src_getCurlModelCode({model:modelData,token:token});return console.log({modelData:modelData}),/*#__PURE__*/src_react.createElement(src_ContentLayout,{header:/*#__PURE__*/src_react.createElement(src_DetailsHeader,{title:/*#__PURE__*/src_react.createElement(src_NavigateLink_NavigateLink,{href:src_routes_ROUTES.PROJECT.DETAILS.RUNS.DETAILS.FORMAT(paramProjectName,paramRunName)},/*#__PURE__*/src_react.createElement(src_box_Box,{variant:"h1"},paramRunName)),actionButtons:/*#__PURE__*/src_react.createElement(src_Button_Button,{disabled:loading,onClick:function(){return setViewCodeVisible(!0)}},t("models.code"))})},isLoadingRun&&/*#__PURE__*/src_react.createElement(src_container_Container,null,/*#__PURE__*/src_react.createElement(src_Loader_Loader,null)),modelData&&/*#__PURE__*/src_react.createElement(src_react.Fragment,null,/*#__PURE__*/src_react.createElement("div",{className:src_Details_styles_module.modelDetailsLayout},/*#__PURE__*/src_react.createElement("div",{className:src_Details_styles_module.general},/*#__PURE__*/src_react.createElement(src_container_Container,{header:/*#__PURE__*/src_react.createElement(src_components_header_Header,{variant:"h2"},t("common.general"))},/*#__PURE__*/src_react.createElement(src_column_layout_ColumnLayout,{columns:4,variant:"text-grid"},/*#__PURE__*/src_react.createElement("div",null,/*#__PURE__*/src_react.createElement(src_box_Box,{variant:"awsui-key-label"},t("models.details.run_name")),/*#__PURE__*/src_react.createElement("div",null,modelData.run_name)),/*#__PURE__*/src_react.createElement("div",null,/*#__PURE__*/src_react.createElement(src_box_Box,{variant:"awsui-key-label"},t("models.model_name")),/*#__PURE__*/src_react.createElement("div",null,modelData.name)),/*#__PURE__*/src_react.createElement("div",null,/*#__PURE__*/src_react.createElement(src_box_Box,{variant:"awsui-key-label"},t("models.type")),/*#__PURE__*/src_react.createElement("div",null,modelData.type))))),/*#__PURE__*/src_react.createElement("form",{className:src_Details_styles_module.modelForm,onSubmit:handleSubmit(onSubmit)},/*#__PURE__*/src_react.createElement("div",{className:src_Details_styles_module.buttons},/*#__PURE__*/src_react.createElement(src_Button_Button,{iconName:"remove",disabled:loading||!messages.length,onClick:clearChat})),/*#__PURE__*/src_react.createElement("aside",{className:src_Details_styles_module.side},/*#__PURE__*/src_react.createElement(src_FormTextarea,{rows:4,disabled:loading,label:t("models.details.instructions"),constraintText:t("models.details.instructions_description"),control:control,name:"instructions"})),/*#__PURE__*/src_react.createElement("div",{className:src_Details_styles_module.chat,ref:chatList},!messageForShowing.length&&/*#__PURE__*/src_react.createElement(src_ListEmptyMessage_ListEmptyMessage,{title:t("models.details.chat_empty_title"),message:t("models.details.chat_empty_message")}),messageForShowing.map(function(message,index){return/*#__PURE__*/src_react.createElement("div",{key:index,className:src_Details_styles_module.message},/*#__PURE__*/src_react.createElement(src_ChatBubble,{ariaLabel:"",type:"user"===message.role?"outgoing":"incoming",avatar:/*#__PURE__*/src_react.createElement(src_Avatar,{ariaLabel:src_MESSAGE_ROLE_MAP[message.role],color:"user"===message.role?"default":"gen-ai",iconName:"user"===message.role?"user-profile":"gen-ai"})},renderMessageBody(message.content||"...")))})),/*#__PURE__*/src_react.createElement("div",{ref:textAreaRef,className:src_Details_styles_module.messageForm},/*#__PURE__*/src_react.createElement(src_FormTextarea,{stretch:!0,placeholder:t("models.details.message_placeholder"),control:control,disabled:loading,name:"message",onKeyDown:function(event){var _event$detail,_event$detail2,_event$detail3,_event$detail4,isCtrlOrShiftKey=(null===event||void 0===event||null===(_event$detail=event.detail)||void 0===_event$detail?void 0:_event$detail.ctrlKey)||(null===event||void 0===event||null===(_event$detail2=event.detail)||void 0===_event$detail2?void 0:_event$detail2.shiftKey);13!==(null===event||void 0===event||null===(_event$detail3=event.detail)||void 0===_event$detail3?void 0:_event$detail3.keyCode)||isCtrlOrShiftKey?13===(null===event||void 0===event||null===(_event$detail4=event.detail)||void 0===_event$detail4?void 0:_event$detail4.keyCode)&&isCtrlOrShiftKey&&(event.preventDefault(),setValue("message",messageText+"\n"),setTimeout(onChangeMessage,0)):handleSubmit(onSubmit)()},onChange:onChangeMessage}),/*#__PURE__*/src_react.createElement("div",{className:src_Details_styles_module.buttons},/*#__PURE__*/src_react.createElement(src_Button_Button,{variant:"primary",disabled:loading},t("common.send")))))),/*#__PURE__*/src_react.createElement(src_modal_Modal,{visible:viewCodeVisible,header:t("models.details.view_code"),size:"large",footer:/*#__PURE__*/src_react.createElement(src_box_Box,{float:"right"},/*#__PURE__*/src_react.createElement(src_Button_Button,{variant:"normal",onClick:function(){return setViewCodeVisible(!1)}},t("common.close"))),onDismiss:function(){return setViewCodeVisible(!1)}},/*#__PURE__*/src_react.createElement(src_space_between_SpaceBetween,{size:"m",direction:"vertical"},/*#__PURE__*/src_react.createElement(src_box_Box,null,t("models.details.view_code_description")),/*#__PURE__*/src_react.createElement("div",{className:src_Details_styles_module.viewCodeControls},/*#__PURE__*/src_react.createElement("div",{className:src_Details_styles_module.copyButton},/*#__PURE__*/src_react.createElement(src_Button_Button,{iconName:"copy",onClick:function(){return codeTab===src_CodeTab.Python?src_copyToClipboard(pythonCode):codeTab===src_CodeTab.Curl?src_copyToClipboard(curlCode):void 0}})),/*#__PURE__*/src_react.createElement(src_Tabs_Tabs,{onChange:function(_ref3){var detail=_ref3.detail;return setCodeTab(detail.activeTabId)},activeTabId:codeTab,tabs:[{label:"python",id:src_CodeTab.Python,content:/*#__PURE__*/src_react.createElement(src_Code,null,pythonCode)},{label:"curl",id:src_CodeTab.Curl,content:/*#__PURE__*/src_react.createElement(src_Code,null,curlCode)}]}))))))};
|
|
135533
|
+
function src_asyncIterator(r){var n,t,o,e=2;for("undefined"!=typeof Symbol&&(t=Symbol.asyncIterator,o=Symbol.iterator);e--;){if(t&&null!=(n=r[t]))return n.call(r);if(o&&null!=(n=r[o]))return new src_AsyncFromSyncIterator(n.call(r));t="@@asyncIterator",o="@@iterator"}throw new TypeError("Object is not async iterable")}function src_AsyncFromSyncIterator(r){function AsyncFromSyncIteratorContinuation(r){if(Object(r)!==r)return Promise.reject(new TypeError(r+" is not an object."));var n=r.done;return Promise.resolve(r.value).then(function(r){return{value:r,done:n}})}return src_AsyncFromSyncIterator=function(r){this.s=r,this.n=r.next},src_AsyncFromSyncIterator.prototype={s:null,n:null,next:function(){return AsyncFromSyncIteratorContinuation(this.n.apply(this.s,arguments))},return:function(r){var n=this.s.return;return void 0===n?Promise.resolve({value:r,done:!0}):AsyncFromSyncIteratorContinuation(n.apply(this.s,arguments))},throw:function(r){var n=this.s.return;return void 0===n?Promise.reject(r):AsyncFromSyncIteratorContinuation(n.apply(this.s,arguments))}},new src_AsyncFromSyncIterator(r)}var src_MESSAGE_ROLE_MAP={tool:"Tool",system:"System",user:"User",assistant:"Assistant"},src_CodeTab=/*#__PURE__*/function(CodeTab){return CodeTab.Python="python",CodeTab.Curl="curl",CodeTab}(src_CodeTab||{});var src_ModelDetails=function(){var _params$projectName,_params$runName,_modelData$run_name,_useTranslation=src_useTranslation_useTranslation(),t=_useTranslation.t,token=src_hooks_useAppSelector(src_selectAuthToken),_useState=(0,src_react.useState)([]),_useState2=src_slicedToArray_slicedToArray(_useState,2),messages=_useState2[0],setMessages=_useState2[1],_useState3=(0,src_react.useState)(!1),_useState4=src_slicedToArray_slicedToArray(_useState3,2),viewCodeVisible=_useState4[0],setViewCodeVisible=_useState4[1],_useState5=(0,src_react.useState)(src_CodeTab.Python),_useState6=src_slicedToArray_slicedToArray(_useState5,2),codeTab=_useState6[0],setCodeTab=_useState6[1],_useState7=(0,src_react.useState)(!1),_useState8=src_slicedToArray_slicedToArray(_useState7,2),loading=_useState8[0],setLoading=_useState8[1],params=src_dist_useParams(),paramProjectName=null!==(_params$projectName=params.projectName)&&void 0!==_params$projectName?_params$projectName:"",paramRunName=null!==(_params$runName=params.runName)&&void 0!==_params$runName?_params$runName:"",openai=(0,src_react.useRef)(),textAreaRef=(0,src_react.useRef)(null),chatList=(0,src_react.useRef)(),_useNotifications=src_useNotifications_useNotifications(),_useNotifications2=src_slicedToArray_slicedToArray(_useNotifications,1),pushNotification=_useNotifications2[0],messageForShowing=(0,src_react.useMemo)(function(){return messages.filter(function(m){return"system"!==m.role})},[messages]);src_useBreadcrumbs_useBreadcrumbs([{text:t("navigation.project_other"),href:src_routes_ROUTES.PROJECT.LIST},{text:paramProjectName,href:src_routes_ROUTES.PROJECT.DETAILS.FORMAT(paramProjectName)},{text:t("navigation.models"),href:src_routes_ROUTES.MODELS.LIST},{text:paramRunName,href:src_routes_ROUTES.MODELS.DETAILS.FORMAT(paramProjectName,paramRunName)}]);var scrollChatToBottom=function(){if(chatList.current){var _chatList$current=chatList.current,clientHeight=_chatList$current.clientHeight,scrollHeight=_chatList$current.scrollHeight;chatList.current.scrollTo(0,scrollHeight-clientHeight)}},_useGetRunQuery=src_useGetRunQuery({project_name:paramProjectName,run_name:paramRunName}),runData=_useGetRunQuery.data,isLoadingRun=_useGetRunQuery.isLoading;(0,src_react.useEffect)(function(){runData&&src_runIsStopped(runData.status)&&src_riseRouterException()},[runData]);var modelData=(0,src_react.useMemo)(function(){return runData?src_getExtendedModelFromRun(runData):void 0},[runData]);(0,src_react.useEffect)(function(){modelData&&(openai.current=new src_node_modules_openai({baseURL:src_getModelGateway(modelData.base_url),apiKey:token,dangerouslyAllowBrowser:!0}))},[modelData,token]),(0,src_react.useEffect)(function(){scrollChatToBottom()},[messageForShowing]);var _useForm=src_index_esm_useForm(),handleSubmit=_useForm.handleSubmit,control=_useForm.control,setValue=_useForm.setValue,watch=_useForm.watch,messageText=watch("message"),sendRequest=/*#__PURE__*/function(){var _ref=src_asyncToGenerator_asyncToGenerator(/*#__PURE__*/src_regenerator_default().mark(function _callee(messages){var _modelData$name;return src_regenerator_default().wrap(function(_context){for(;;)switch(_context.prev=_context.next){case 0:if(openai.current){_context.next=2;break}return _context.abrupt("return",Promise.reject("Model not found"));case 2:return _context.abrupt("return",openai.current.chat.completions.create({model:null!==(_modelData$name=null===modelData||void 0===modelData?void 0:modelData.name)&&void 0!==_modelData$name?_modelData$name:"",messages:messages,stream:!0,max_tokens:512}));case 3:case"end":return _context.stop()}},_callee)}));return function(){return _ref.apply(this,arguments)}}(),onSubmit=/*#__PURE__*/function(){var _ref2=src_asyncToGenerator_asyncToGenerator(/*#__PURE__*/src_regenerator_default().mark(function _callee2(data){var _data$instructions,newMessages,newMessage,messagesWithoutSystemMessage,stream,_iteratorAbruptCompletion,_didIteratorError,_iteratorError,_loop,_iterator,_step;return src_regenerator_default().wrap(function(_context3){for(;;)switch(_context3.prev=_context3.next){case 0:if(data.message){_context3.next=2;break}return _context3.abrupt("return");case 2:return newMessage={role:"user",content:data.message},messagesWithoutSystemMessage=messages.filter(function(m){return"system"!==m.role}),newMessages=null!==(_data$instructions=data.instructions)&&void 0!==_data$instructions&&_data$instructions.length?[{role:"system",content:data.instructions}].concat(src_toConsumableArray_toConsumableArray(messagesWithoutSystemMessage),[newMessage]):[].concat(src_toConsumableArray_toConsumableArray(messagesWithoutSystemMessage),[newMessage]),setMessages(newMessages),setLoading(!0),_context3.prev=7,_context3.next=10,sendRequest(newMessages);case 10:stream=_context3.sent,setMessages(function(oldMessages){return[].concat(src_toConsumableArray_toConsumableArray(oldMessages),[{role:"assistant",content:""}])}),setValue("message",""),setTimeout(onChangeMessage,0),_iteratorAbruptCompletion=!1,_didIteratorError=!1,_context3.prev=16,_loop=/*#__PURE__*/src_regenerator_default().mark(function _loop(){var chunk;return src_regenerator_default().wrap(function(_context2){for(;;)switch(_context2.prev=_context2.next){case 0:chunk=_step.value,setMessages(function(oldMessages){var _chunk$choices$0$delt,_chunk$choices$,_lastMessage$content,_chunk$choices$0$delt2,_chunk$choices$2,newMessages=src_toConsumableArray_toConsumableArray(oldMessages),lastMessage=newMessages.pop();return lastMessage?[].concat(src_toConsumableArray_toConsumableArray(newMessages),[{role:null!==(_chunk$choices$0$delt=null===(_chunk$choices$=chunk.choices[0])||void 0===_chunk$choices$||null===(_chunk$choices$=_chunk$choices$.delta)||void 0===_chunk$choices$?void 0:_chunk$choices$.role)&&void 0!==_chunk$choices$0$delt?_chunk$choices$0$delt:null===lastMessage||void 0===lastMessage?void 0:lastMessage.role,content:(null!==(_lastMessage$content=null===lastMessage||void 0===lastMessage?void 0:lastMessage.content)&&void 0!==_lastMessage$content?_lastMessage$content:"")+(null!==(_chunk$choices$0$delt2=null===(_chunk$choices$2=chunk.choices[0])||void 0===_chunk$choices$2||null===(_chunk$choices$2=_chunk$choices$2.delta)||void 0===_chunk$choices$2?void 0:_chunk$choices$2.content)&&void 0!==_chunk$choices$0$delt2?_chunk$choices$0$delt2:"")}]):oldMessages});case 2:case"end":return _context2.stop()}},_loop)}),_iterator=src_asyncIterator(stream);case 19:return _context3.next=21,_iterator.next();case 21:if(!(_iteratorAbruptCompletion=!(_step=_context3.sent).done)){_context3.next=26;break}return _context3.delegateYield(_loop(),"t0",23);case 23:_iteratorAbruptCompletion=!1,_context3.next=19;break;case 26:_context3.next=32;break;case 28:_context3.prev=28,_context3.t1=_context3["catch"](16),_didIteratorError=!0,_iteratorError=_context3.t1;case 32:if(_context3.prev=32,_context3.prev=33,!(_iteratorAbruptCompletion&&null!=_iterator.return)){_context3.next=37;break}return _context3.next=37,_iterator.return();case 37:if(_context3.prev=37,!_didIteratorError){_context3.next=40;break}throw _iteratorError;case 40:return _context3.finish(37);case 41:return _context3.finish(32);case 42:_context3.next=48;break;case 44:_context3.prev=44,_context3.t2=_context3["catch"](7),pushNotification({type:"error",content:t("common.server_error",{error:_context3.t2})}),clearChat();case 48:setLoading(!1),setTimeout(function(){var _textAreaRef$current;null===(_textAreaRef$current=textAreaRef.current)||void 0===_textAreaRef$current||null===(_textAreaRef$current=_textAreaRef$current.querySelector("textarea"))||void 0===_textAreaRef$current||_textAreaRef$current.focus()},10);case 50:case"end":return _context3.stop()}},_callee2,null,[[7,44],[16,28,32,42],[33,,37,41]])}));return function(){return _ref2.apply(this,arguments)}}(),clearChat=function(){setValue("message",""),setValue("instructions",""),setMessages([]),setTimeout(onChangeMessage,10)},renderMessageBody=function(content){var languages=[],matches=content.match(/^(```[A-Za-z]*)/m);matches&&src_toConsumableArray_toConsumableArray(matches).forEach(function(l){return l&&languages.push(l.replace(/^```/,""))});var replacedStrings=src_react_string_replace_default()(content,/^([A-Za-z \t]*)```([A-Za-z]*)?\n([\s\S]*?)```([A-Za-z \t]*)*$/gm,function(match){return match?/*#__PURE__*/src_react.createElement(src_Code,null,match):""});return/*#__PURE__*/src_react.createElement(src_box_Box,{variant:"p"},replacedStrings.filter(function(line,index){return!(languages.includes(line)&&"string"!=typeof replacedStrings[index+1]&&void 0!==src_typeof_typeof(replacedStrings[index+1]))}))},onChangeMessage=function(){if(textAreaRef.current){var textAreaElement=textAreaRef.current.querySelector("textarea");textAreaElement&&(textAreaElement.style.height="auto",textAreaElement.style.height=textAreaElement.scrollHeight+"px")}},pythonCode=src_getPythonModelCode({model:modelData,token:token}),curlCode=src_getCurlModelCode({model:modelData,token:token});return console.log({modelData:modelData}),/*#__PURE__*/src_react.createElement(src_ContentLayout,{header:/*#__PURE__*/src_react.createElement(src_DetailsHeader,{title:/*#__PURE__*/src_react.createElement(src_NavigateLink_NavigateLink,{href:src_routes_ROUTES.PROJECT.DETAILS.RUNS.DETAILS.FORMAT(paramProjectName,paramRunName)},/*#__PURE__*/src_react.createElement(src_box_Box,{variant:"h1"},paramRunName)),actionButtons:/*#__PURE__*/src_react.createElement(src_Button_Button,{disabled:loading,onClick:function(){return setViewCodeVisible(!0)}},t("models.code"))})},isLoadingRun&&/*#__PURE__*/src_react.createElement(src_container_Container,null,/*#__PURE__*/src_react.createElement(src_Loader_Loader,null)),modelData&&/*#__PURE__*/src_react.createElement(src_react.Fragment,null,/*#__PURE__*/src_react.createElement("div",{className:src_Details_styles_module.modelDetailsLayout},/*#__PURE__*/src_react.createElement("div",{className:src_Details_styles_module.general},/*#__PURE__*/src_react.createElement(src_container_Container,{header:/*#__PURE__*/src_react.createElement(src_components_header_Header,{variant:"h2"},t("common.general"))},/*#__PURE__*/src_react.createElement(src_column_layout_ColumnLayout,{columns:4,variant:"text-grid"},/*#__PURE__*/src_react.createElement("div",null,/*#__PURE__*/src_react.createElement(src_box_Box,{variant:"awsui-key-label"},t("models.details.run_name")),/*#__PURE__*/src_react.createElement("div",null,/*#__PURE__*/src_react.createElement(src_NavigateLink_NavigateLink,{href:src_routes_ROUTES.PROJECT.DETAILS.RUNS.DETAILS.FORMAT(modelData.project_name,null!==(_modelData$run_name=modelData.run_name)&&void 0!==_modelData$run_name?_modelData$run_name:"No run name")},modelData.run_name))),/*#__PURE__*/src_react.createElement("div",null,/*#__PURE__*/src_react.createElement(src_box_Box,{variant:"awsui-key-label"},t("models.model_name")),/*#__PURE__*/src_react.createElement("div",null,modelData.name)),/*#__PURE__*/src_react.createElement("div",null,/*#__PURE__*/src_react.createElement(src_box_Box,{variant:"awsui-key-label"},t("models.type")),/*#__PURE__*/src_react.createElement("div",null,modelData.type))))),/*#__PURE__*/src_react.createElement("form",{className:src_Details_styles_module.modelForm,onSubmit:handleSubmit(onSubmit)},/*#__PURE__*/src_react.createElement("div",{className:src_Details_styles_module.buttons},/*#__PURE__*/src_react.createElement(src_Button_Button,{iconName:"remove",disabled:loading||!messages.length,onClick:clearChat})),/*#__PURE__*/src_react.createElement("aside",{className:src_Details_styles_module.side},/*#__PURE__*/src_react.createElement(src_FormTextarea,{rows:4,disabled:loading,label:t("models.details.instructions"),constraintText:t("models.details.instructions_description"),control:control,name:"instructions"})),/*#__PURE__*/src_react.createElement("div",{className:src_Details_styles_module.chat,ref:chatList},!messageForShowing.length&&/*#__PURE__*/src_react.createElement(src_ListEmptyMessage_ListEmptyMessage,{title:t("models.details.chat_empty_title"),message:t("models.details.chat_empty_message")}),messageForShowing.map(function(message,index){return/*#__PURE__*/src_react.createElement("div",{key:index,className:src_Details_styles_module.message},/*#__PURE__*/src_react.createElement(src_ChatBubble,{ariaLabel:"",type:"user"===message.role?"outgoing":"incoming",avatar:/*#__PURE__*/src_react.createElement(src_Avatar,{ariaLabel:src_MESSAGE_ROLE_MAP[message.role],color:"user"===message.role?"default":"gen-ai",iconName:"user"===message.role?"user-profile":"gen-ai"})},renderMessageBody(message.content||"...")))})),/*#__PURE__*/src_react.createElement("div",{ref:textAreaRef,className:src_Details_styles_module.messageForm},/*#__PURE__*/src_react.createElement(src_FormTextarea,{stretch:!0,placeholder:t("models.details.message_placeholder"),control:control,disabled:loading,name:"message",onKeyDown:function(event){var _event$detail,_event$detail2,_event$detail3,_event$detail4,isCtrlOrShiftKey=(null===event||void 0===event||null===(_event$detail=event.detail)||void 0===_event$detail?void 0:_event$detail.ctrlKey)||(null===event||void 0===event||null===(_event$detail2=event.detail)||void 0===_event$detail2?void 0:_event$detail2.shiftKey);13!==(null===event||void 0===event||null===(_event$detail3=event.detail)||void 0===_event$detail3?void 0:_event$detail3.keyCode)||isCtrlOrShiftKey?13===(null===event||void 0===event||null===(_event$detail4=event.detail)||void 0===_event$detail4?void 0:_event$detail4.keyCode)&&isCtrlOrShiftKey&&(event.preventDefault(),setValue("message",messageText+"\n"),setTimeout(onChangeMessage,0)):handleSubmit(onSubmit)()},onChange:onChangeMessage}),/*#__PURE__*/src_react.createElement("div",{className:src_Details_styles_module.buttons},/*#__PURE__*/src_react.createElement(src_Button_Button,{variant:"primary",disabled:loading},t("common.send")))))),/*#__PURE__*/src_react.createElement(src_modal_Modal,{visible:viewCodeVisible,header:t("models.details.view_code"),size:"large",footer:/*#__PURE__*/src_react.createElement(src_box_Box,{float:"right"},/*#__PURE__*/src_react.createElement(src_Button_Button,{variant:"normal",onClick:function(){return setViewCodeVisible(!1)}},t("common.close"))),onDismiss:function(){return setViewCodeVisible(!1)}},/*#__PURE__*/src_react.createElement(src_space_between_SpaceBetween,{size:"m",direction:"vertical"},/*#__PURE__*/src_react.createElement(src_box_Box,null,t("models.details.view_code_description")),/*#__PURE__*/src_react.createElement("div",{className:src_Details_styles_module.viewCodeControls},/*#__PURE__*/src_react.createElement("div",{className:src_Details_styles_module.copyButton},/*#__PURE__*/src_react.createElement(src_Button_Button,{iconName:"copy",onClick:function(){return codeTab===src_CodeTab.Python?src_copyToClipboard(pythonCode):codeTab===src_CodeTab.Curl?src_copyToClipboard(curlCode):void 0}})),/*#__PURE__*/src_react.createElement(src_Tabs_Tabs,{onChange:function(_ref3){var detail=_ref3.detail;return setCodeTab(detail.activeTabId)},activeTabId:codeTab,tabs:[{label:"python",id:src_CodeTab.Python,content:/*#__PURE__*/src_react.createElement(src_Code,null,pythonCode)},{label:"curl",id:src_CodeTab.Curl,content:/*#__PURE__*/src_react.createElement(src_Code,null,curlCode)}]}))))))};
|
|
133947
135534
|
;// ./src/pages/Project/utils.ts
|
|
133948
135535
|
var src_getProjectRoleByUserName=function(project,userName){var _project$members$find,_project$members$find2;return null!==(_project$members$find=null===(_project$members$find2=project.members.find(function(m){return m.user.username===userName}))||void 0===_project$members$find2?void 0:_project$members$find2.project_role)&&void 0!==_project$members$find?_project$members$find:null};
|
|
133949
135536
|
;// ./src/pages/Project/hooks/useCheckAvailableProjectPermission.ts
|
|
@@ -133990,7 +135577,7 @@ var src_useBackendsTable=function(projectName,backends){var _useTranslation=src_
|
|
|
133990
135577
|
;// ./src/pages/Project/Backends/hooks/index.ts
|
|
133991
135578
|
|
|
133992
135579
|
;// ./src/pages/Project/Backends/Table/constants.tsx
|
|
133993
|
-
var src_BACKENDS_HELP_SKY={header:/*#__PURE__*/src_react.createElement("h2",null,"Backends"),body:/*#__PURE__*/src_react.createElement(src_react.Fragment,null,/*#__PURE__*/src_react.createElement("p",null,"To use ",/*#__PURE__*/src_react.createElement("code",null,"dstack")," with cloud providers, you have to configure backends."),/*#__PURE__*/src_react.createElement("h4",null,"Marketplace"),/*#__PURE__*/src_react.createElement("p",null,"By default, ",/*#__PURE__*/src_react.createElement("code",null,"dstack Sky")," includes a preset of backends that let you access compute from the
|
|
135580
|
+
var src_BACKENDS_HELP_SKY={header:/*#__PURE__*/src_react.createElement("h2",null,"Backends"),body:/*#__PURE__*/src_react.createElement(src_react.Fragment,null,/*#__PURE__*/src_react.createElement("p",null,"To use ",/*#__PURE__*/src_react.createElement("code",null,"dstack")," with cloud providers, you have to configure backends."),/*#__PURE__*/src_react.createElement("h4",null,"Marketplace"),/*#__PURE__*/src_react.createElement("p",null,"By default, ",/*#__PURE__*/src_react.createElement("code",null,"dstack Sky")," includes a preset of backends that let you access compute from the"," ",/*#__PURE__*/src_react.createElement("code",null,"dstack")," marketplace and pay through your ",/*#__PURE__*/src_react.createElement("code",null,"dstack Sky")," user billing."),/*#__PURE__*/src_react.createElement("h4",null,"Your own cloud accounts"),/*#__PURE__*/src_react.createElement("p",null,"You can also configure custom backends to use your own cloud providers, either instead of or in addition to the default ones."),/*#__PURE__*/src_react.createElement("p",null,"See the"," ",/*#__PURE__*/src_react.createElement("a",{href:"https://dstack.ai/docs/concepts/backends",target:"_blank"},"documentation")," ","for the list of supported backends."))};var src_BACKENDS_HELP_ENTERPRISE={header:/*#__PURE__*/src_react.createElement("h2",null,"Backends"),body:/*#__PURE__*/src_react.createElement(src_react.Fragment,null,/*#__PURE__*/src_react.createElement("p",null,"To use ",/*#__PURE__*/src_react.createElement("code",null,"dstack")," with cloud providers, you have to configure backends."),/*#__PURE__*/src_react.createElement("p",null,"See the"," ",/*#__PURE__*/src_react.createElement("a",{href:"https://dstack.ai/docs/concepts/backends",target:"_blank"},"documentation")," ","for the list of supported backends."))};
|
|
133994
135581
|
;// ./src/pages/Project/Backends/Table/styles.module.scss
|
|
133995
135582
|
// extracted by mini-css-extract-plugin
|
|
133996
135583
|
/* harmony default export */ const src_Table_styles_module = ({"cell":"biUJI","contextMenu":"A3asV","ellipsisCell":"kUgHm"});
|
|
@@ -134001,7 +135588,7 @@ var src_hooks_useColumnsDefinitions_useColumnsDefinitions=function(_ref){var loa
|
|
|
134001
135588
|
;// ./src/pages/Project/Backends/Table/index.tsx
|
|
134002
135589
|
function src_Table_ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function src_Table_objectSpread(e){for(var t,r=1;r<arguments.length;r++)t=null==arguments[r]?{}:arguments[r],r%2?src_Table_ownKeys(Object(t),!0).forEach(function(r){src_defineProperty_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):src_Table_ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))});return e}var src_INFO= true?src_BACKENDS_HELP_ENTERPRISE:0;var src_BackendsTable=function(_ref){var backends=_ref.backends,editBackend=_ref.editBackend,deleteBackends=_ref.deleteBackends,onClickAddBackend=_ref.onClickAddBackend,isDisabledDelete=_ref.isDisabledDelete,_useTranslation=src_useTranslation_useTranslation(),t=_useTranslation.t,_useHelpPanel=src_useHelpPanel_useHelpPanel(),_useHelpPanel2=src_slicedToArray_slicedToArray(_useHelpPanel,1),openHelpPanel=_useHelpPanel2[0],renderEmptyMessage=function(){return/*#__PURE__*/src_react.createElement(src_ListEmptyMessage_ListEmptyMessage,{title:t("backend.empty_message_title"),message:t("backend.empty_message_text")},onClickAddBackend&&/*#__PURE__*/src_react.createElement(src_Button_Button,{onClick:onClickAddBackend},t("common.add")))},_useCollection=src_use_collection_useCollection(null!==backends&&void 0!==backends?backends:[],{filtering:{empty:renderEmptyMessage(),noMatch:renderEmptyMessage()},selection:{}}),items=_useCollection.items,collectionProps=_useCollection.collectionProps,selectedItems=collectionProps.selectedItems,isDisabledDeleteSelected=!(null!==selectedItems&&void 0!==selectedItems&&selectedItems.length)||isDisabledDelete,_useColumnsDefinition=src_hooks_useColumnsDefinitions_useColumnsDefinitions(src_Table_objectSpread({},editBackend?{onEditClick:function(backend){return editBackend(backend)}}:{})),columns=_useColumnsDefinition.columns;return/*#__PURE__*/src_react.createElement(src_table,src_extends_extends({},collectionProps,{columnDefinitions:columns,items:items,loadingText:t("common.loading"),selectionType:deleteBackends||editBackend?"multi":void 0,stickyHeader:!0,header:/*#__PURE__*/src_react.createElement(src_components_header_Header,{counter:function(){return null!==backends&&void 0!==backends&&backends.length?"(".concat(backends.length,")"):""}(),info:/*#__PURE__*/src_react.createElement(src_InfoLink_InfoLink,{onFollow:function(){return openHelpPanel(src_INFO)}}),actions:/*#__PURE__*/src_react.createElement(src_space_between_SpaceBetween,{size:"xs",direction:"horizontal"},deleteBackends&&/*#__PURE__*/src_react.createElement(src_ButtonWithConfirmation,{disabled:isDisabledDeleteSelected,formAction:"none",onClick:function(){null!==selectedItems&&void 0!==selectedItems&&selectedItems.length&&deleteBackends&&deleteBackends(selectedItems)},confirmTitle:t("backend.edit.delete_backends_confirm_title"),confirmContent:t("backend.edit.delete_backends_confirm_message")},t("common.delete")),onClickAddBackend&&/*#__PURE__*/src_react.createElement(src_Button_Button,{onClick:onClickAddBackend/*disabled={isDisabledAddBackendButton}*/},t("common.add")))},t("backend.page_title_other"))}))};
|
|
134003
135590
|
;// ./src/pages/Project/Gateways/Table/constants.tsx
|
|
134004
|
-
var src_GATEWAYS_INFO={header:/*#__PURE__*/src_react.createElement("h2",null,"Gateways"),body:/*#__PURE__*/src_react.createElement(src_react.Fragment,null,/*#__PURE__*/src_react.createElement("p",null,"Gateways manage the ingress traffic for running services."),/*#__PURE__*/src_react.createElement("p",null,"To learn more about gateways, see the ",/*#__PURE__*/src_react.createElement("a",{href:"https://dstack.ai/docs/concepts/gateways",target:"_blank"},"documentation"),"."))};
|
|
135591
|
+
var src_GATEWAYS_INFO={header:/*#__PURE__*/src_react.createElement("h2",null,"Gateways"),body:/*#__PURE__*/src_react.createElement(src_react.Fragment,null,/*#__PURE__*/src_react.createElement("p",null,"Gateways manage the ingress traffic for running services."),/*#__PURE__*/src_react.createElement("p",null,"To learn more about gateways, see the"," ",/*#__PURE__*/src_react.createElement("a",{href:"https://dstack.ai/docs/concepts/gateways",target:"_blank"},"documentation"),"."))};
|
|
134005
135592
|
;// ./src/pages/Project/Gateways/Table/styles.module.scss
|
|
134006
135593
|
// extracted by mini-css-extract-plugin
|
|
134007
135594
|
/* harmony default export */ const src_Gateways_Table_styles_module = ({"cell":"naCdG","contextMenu":"_TtVL","ellipsisCell":"FLA_c"});
|
|
@@ -134032,7 +135619,7 @@ var src_useGatewaysTable=function(projectName){var navigate=src_dist_useNavigate
|
|
|
134032
135619
|
;// ./src/pages/Project/Gateways/hooks/index.ts
|
|
134033
135620
|
|
|
134034
135621
|
;// ./src/pages/Project/Details/Settings/constants.tsx
|
|
134035
|
-
var src_CLI_INFO={header:/*#__PURE__*/src_react.createElement("h2",null,"CLI"),body:/*#__PURE__*/src_react.createElement(src_react.Fragment,null,/*#__PURE__*/src_react.createElement("p",null,"To use this project with your CLI, add it using the",/*#__PURE__*/src_react.createElement("a",{href:"https://dstack.ai/docs/reference/cli/dstack/project/",target:"_blank"},/*#__PURE__*/src_react.createElement("code",null,"dstack project add"))," command."),/*#__PURE__*/src_react.createElement("p",null,"To learn how to install the CLI, refer to the"," ",/*#__PURE__*/src_react.createElement("a",{href:"https://dstack.ai/docs/cli/installation",target:"_blank"},"installation")," guide."))};
|
|
135622
|
+
var src_CLI_INFO={header:/*#__PURE__*/src_react.createElement("h2",null,"CLI"),body:/*#__PURE__*/src_react.createElement(src_react.Fragment,null,/*#__PURE__*/src_react.createElement("p",null,"To use this project with your CLI, add it using the",/*#__PURE__*/src_react.createElement("a",{href:"https://dstack.ai/docs/reference/cli/dstack/project/",target:"_blank"},/*#__PURE__*/src_react.createElement("code",null,"dstack project add"))," ","command."),/*#__PURE__*/src_react.createElement("p",null,"To learn how to install the CLI, refer to the"," ",/*#__PURE__*/src_react.createElement("a",{href:"https://dstack.ai/docs/cli/installation",target:"_blank"},"installation")," ","guide."))};
|
|
134036
135623
|
;// ./src/pages/Project/Details/Settings/styles.module.scss
|
|
134037
135624
|
// extracted by mini-css-extract-plugin
|
|
134038
135625
|
/* harmony default export */ const src_Settings_styles_module = ({"dangerSectionGrid":"U24Qs","dangerSectionField":"AKyqV","codeWrapper":"LmVNG","code":"Vntdh","copy":"Wtjre"});
|
|
@@ -134045,7 +135632,7 @@ var src_ProjectAdd=function(){var _useTranslation=src_useTranslation_useTranslat
|
|
|
134045
135632
|
;// ./src/pages/Project/index.tsx
|
|
134046
135633
|
var src_Project=function(){return null};
|
|
134047
135634
|
;// ./src/pages/Project/Backends/YAMLForm/constants.tsx
|
|
134048
|
-
var src_CONFIG_YAML_HELP_SKY={header:/*#__PURE__*/src_react.createElement("h2",null,"Backend config"),body:/*#__PURE__*/src_react.createElement(src_react.Fragment,null,/*#__PURE__*/src_react.createElement("p",null,"The backend config is defined in the YAML format. It specifies the backend's ",/*#__PURE__*/src_react.createElement("code",null,"type")," and settings,"," ","such as ",/*#__PURE__*/src_react.createElement("code",null,"creds"),", ",/*#__PURE__*/src_react.createElement("code",null,"regions"),", and so on."),/*#__PURE__*/src_react.createElement("h4",null,"Marketplace"),/*#__PURE__*/src_react.createElement("p",null,"If you set ",/*#__PURE__*/src_react.createElement("code",null,"creds"),"'s ",/*#__PURE__*/src_react.createElement("code",null,"type")," to ",/*#__PURE__*/src_react.createElement("code",null,"dstack"),", you'll get compute from"," ",/*#__PURE__*/src_react.createElement("code",null,"dstack"),"'s marketplace and will pay for it via your ",/*#__PURE__*/src_react.createElement("code",null,"dstack Sky")," user billing. Example:"),/*#__PURE__*/src_react.createElement("p",null,/*#__PURE__*/src_react.createElement("pre",null,"type: aws","\n","creds:","\n"," ","type: dstack","\n")),/*#__PURE__*/src_react.createElement("p",null,"You can see all supported backend types at the"," ",/*#__PURE__*/src_react.createElement("a",{href:"https://dstack.ai/docs/concepts/backends",target:"_blank"},"documentation"),"."),/*#__PURE__*/src_react.createElement("h4",null,"Your own cloud account"),/*#__PURE__*/src_react.createElement("p",null,"If you want to use your own cloud account, configure ",/*#__PURE__*/src_react.createElement("code",null,"creds")," and other settings according to the"," ",/*#__PURE__*/src_react.createElement("a",{href:"https://dstack.ai/docs/concepts/backends",target:"_blank"},"documentation"),". Example:"),/*#__PURE__*/src_react.createElement("p",null,/*#__PURE__*/src_react.createElement("pre",null,"type: aws","\n","creds:","\n"," ","type: access_key","\n"," ","access_key: AIZKISCVKUK","\n"," ","secret_key: QSbmpqJIUBn1")))};var src_CONFIG_YAML_HELP_ENTERPRISE={header:/*#__PURE__*/src_react.createElement("h2",null,"Backend config"),body:/*#__PURE__*/src_react.createElement(src_react.Fragment,null,/*#__PURE__*/src_react.createElement("p",null,"The backend config is defined in the YAML format. It specifies the backend's ",/*#__PURE__*/src_react.createElement("code",null,"type")," and settings, such as ",/*#__PURE__*/src_react.createElement("code",null,"creds"),", ",/*#__PURE__*/src_react.createElement("code",null,"regions"),", and so on."),/*#__PURE__*/src_react.createElement("p",null,"Example:"),/*#__PURE__*/src_react.createElement("p",null,/*#__PURE__*/src_react.createElement("pre",null,"type: aws","\n","creds:","\n"," ","type: access_key","\n"," ","access_key: AIZKISCVKUK","\n"," ","secret_key: QSbmpqJIUBn1")),/*#__PURE__*/src_react.createElement("p",null,"Each backend type may support different properties. See the"," ",/*#__PURE__*/src_react.createElement("a",{href:"https://dstack.ai/docs/concepts/backends",target:"_blank"},"documentaiton")," for more examples."))};
|
|
135635
|
+
var src_CONFIG_YAML_HELP_SKY={header:/*#__PURE__*/src_react.createElement("h2",null,"Backend config"),body:/*#__PURE__*/src_react.createElement(src_react.Fragment,null,/*#__PURE__*/src_react.createElement("p",null,"The backend config is defined in the YAML format. It specifies the backend's ",/*#__PURE__*/src_react.createElement("code",null,"type")," and settings,"," ","such as ",/*#__PURE__*/src_react.createElement("code",null,"creds"),", ",/*#__PURE__*/src_react.createElement("code",null,"regions"),", and so on."),/*#__PURE__*/src_react.createElement("h4",null,"Marketplace"),/*#__PURE__*/src_react.createElement("p",null,"If you set ",/*#__PURE__*/src_react.createElement("code",null,"creds"),"'s ",/*#__PURE__*/src_react.createElement("code",null,"type")," to ",/*#__PURE__*/src_react.createElement("code",null,"dstack"),", you'll get compute from"," ",/*#__PURE__*/src_react.createElement("code",null,"dstack"),"'s marketplace and will pay for it via your ",/*#__PURE__*/src_react.createElement("code",null,"dstack Sky")," user billing. Example:"),/*#__PURE__*/src_react.createElement("p",null,/*#__PURE__*/src_react.createElement("pre",null,"type: aws","\n","creds:","\n"," ","type: dstack","\n")),/*#__PURE__*/src_react.createElement("p",null,"You can see all supported backend types at the"," ",/*#__PURE__*/src_react.createElement("a",{href:"https://dstack.ai/docs/concepts/backends",target:"_blank"},"documentation"),"."),/*#__PURE__*/src_react.createElement("h4",null,"Your own cloud account"),/*#__PURE__*/src_react.createElement("p",null,"If you want to use your own cloud account, configure ",/*#__PURE__*/src_react.createElement("code",null,"creds")," and other settings according to the"," ",/*#__PURE__*/src_react.createElement("a",{href:"https://dstack.ai/docs/concepts/backends",target:"_blank"},"documentation"),". Example:"),/*#__PURE__*/src_react.createElement("p",null,/*#__PURE__*/src_react.createElement("pre",null,"type: aws","\n","creds:","\n"," ","type: access_key","\n"," ","access_key: AIZKISCVKUK","\n"," ","secret_key: QSbmpqJIUBn1")))};var src_CONFIG_YAML_HELP_ENTERPRISE={header:/*#__PURE__*/src_react.createElement("h2",null,"Backend config"),body:/*#__PURE__*/src_react.createElement(src_react.Fragment,null,/*#__PURE__*/src_react.createElement("p",null,"The backend config is defined in the YAML format. It specifies the backend's ",/*#__PURE__*/src_react.createElement("code",null,"type")," and settings, such as ",/*#__PURE__*/src_react.createElement("code",null,"creds"),", ",/*#__PURE__*/src_react.createElement("code",null,"regions"),", and so on."),/*#__PURE__*/src_react.createElement("p",null,"Example:"),/*#__PURE__*/src_react.createElement("p",null,/*#__PURE__*/src_react.createElement("pre",null,"type: aws","\n","creds:","\n"," ","type: access_key","\n"," ","access_key: AIZKISCVKUK","\n"," ","secret_key: QSbmpqJIUBn1")),/*#__PURE__*/src_react.createElement("p",null,"Each backend type may support different properties. See the"," ",/*#__PURE__*/src_react.createElement("a",{href:"https://dstack.ai/docs/concepts/backends",target:"_blank"},"documentaiton")," ","for more examples."))};
|
|
134049
135636
|
;// ./src/pages/Project/Backends/YAMLForm/index.tsx
|
|
134050
135637
|
var src_YAMLForm_INFO= true?src_CONFIG_YAML_HELP_ENTERPRISE:0;var src_YAMLForm=function(_ref){var initialValues=_ref.initialValues,onCancel=_ref.onCancel,loading=_ref.loading,onSubmitProp=_ref.onSubmit,onApplyProp=_ref.onApply,_useTranslation=src_useTranslation_useTranslation(),t=_useTranslation.t,_useHelpPanel=src_useHelpPanel_useHelpPanel(),_useHelpPanel2=src_slicedToArray_slicedToArray(_useHelpPanel,1),openHelpPanel=_useHelpPanel2[0],_useNotifications=src_useNotifications_useNotifications(),_useNotifications2=src_slicedToArray_slicedToArray(_useNotifications,1),pushNotification=_useNotifications2[0],_useState=(0,src_react.useState)(!1),_useState2=src_slicedToArray_slicedToArray(_useState,2),isApplying=_useState2[0],setIsApplying=_useState2[1],_useForm=src_index_esm_useForm({defaultValues:initialValues}),handleSubmit=_useForm.handleSubmit,control=_useForm.control,setError=_useForm.setError,clearErrors=_useForm.clearErrors;return/*#__PURE__*/src_react.createElement("form",{onSubmit:handleSubmit(function(data){clearErrors();var submitCallback=isApplying&&onApplyProp?onApplyProp:onSubmitProp;submitCallback(data).finally(function(){return setIsApplying(!1)}).catch(function(errorResponse){var errorRequestData=null===errorResponse||void 0===errorResponse?void 0:errorResponse.data;if(src_isResponseServerError(errorRequestData))errorRequestData.detail.forEach(function(error){src_isResponseServerFormFieldError(error)?setError(error.loc.join("."),{type:"custom",message:error.msg}):pushNotification({type:"error",content:t("common.server_error",{error:error.msg})})});else{var _errorResponse$error;pushNotification({type:"error",content:t("common.server_error",{error:null!==(_errorResponse$error=null===errorResponse||void 0===errorResponse?void 0:errorResponse.error)&&void 0!==_errorResponse$error?_errorResponse$error:errorResponse})})}})})},/*#__PURE__*/src_react.createElement(src_form_Form,{actions:/*#__PURE__*/src_react.createElement(src_space_between_SpaceBetween,{direction:"horizontal",size:"xs"},/*#__PURE__*/src_react.createElement(src_Button_Button,{formAction:"none",disabled:loading,variant:"link",onClick:onCancel},t("common.cancel")),onApplyProp&&/*#__PURE__*/src_react.createElement(src_Button_Button,{loading:loading,disabled:loading,onClick:function(){return setIsApplying(!0)}},t("common.apply")),/*#__PURE__*/src_react.createElement(src_Button_Button,{loading:loading,disabled:loading,variant:"primary"},t("common.save")))},/*#__PURE__*/src_react.createElement(src_FormCodeEditor,{info:/*#__PURE__*/src_react.createElement(src_InfoLink_InfoLink,{onFollow:function(){return openHelpPanel(src_YAMLForm_INFO)}}),control:control,label:t("projects.edit.backend_config"),description:t("projects.edit.backend_config_description"),name:"config_yaml",language:"yaml",loading:loading,editorContentHeight:600})))};
|
|
134051
135638
|
;// ./src/pages/Project/Backends/Add/index.tsx
|
|
@@ -134102,16 +135689,16 @@ return isLoadingYaml||isFetchingYaml?/*#__PURE__*/src_react.createElement(src_co
|
|
|
134102
135689
|
;// ./src/pages/Project/Backends/index.tsx
|
|
134103
135690
|
var src_Backends=function(){return null};
|
|
134104
135691
|
;// ./src/pages/Runs/List/Preferences/consts.ts
|
|
134105
|
-
var src_consts_DEFAULT_PREFERENCES={pageSize:30,contentDisplay:[{id:"run_name",visible:!0},{id:"resources",visible:!0},{id:"spot",visible:!0},{id:"price",visible:!0},{id:"submitted_at",visible:!0},{id:"status",visible:!0},{id:"error",visible:!0},{id:"cost",visible:!0},// hidden by default
|
|
134106
|
-
{id:"
|
|
135692
|
+
var src_consts_DEFAULT_PREFERENCES={pageSize:30,contentDisplay:[{id:"run_name",visible:!0},{id:"resources",visible:!0},{id:"spot",visible:!0},{id:"hub_user_name",visible:!0},{id:"price",visible:!0},{id:"submitted_at",visible:!0},{id:"status",visible:!0},{id:"error",visible:!0},{id:"cost",visible:!0},// hidden by default
|
|
135693
|
+
{id:"priority",visible:!1},{id:"finished_at",visible:!1},{id:"project",visible:!1},{id:"repo",visible:!1},{id:"instance",visible:!1},{id:"region",visible:!1},{id:"backend",visible:!1}],wrapLines:!1,stripedRows:!1,contentDensity:"comfortable"};
|
|
134107
135694
|
;// ./src/pages/Runs/List/Preferences/useRunListPreferences.ts
|
|
134108
135695
|
var src_useRunListPreferences=function(){var _useLocalStorageState=src_useLocalStorageState("run-list-preferences",src_consts_DEFAULT_PREFERENCES),_useLocalStorageState2=src_slicedToArray_slicedToArray(_useLocalStorageState,2),preferences=_useLocalStorageState2[0],setPreferences=_useLocalStorageState2[1];return[preferences,setPreferences]};
|
|
134109
135696
|
;// ./src/pages/Runs/Details/Jobs/List/helpers.ts
|
|
134110
|
-
var src_getJobListItemResources=function(job){var _job$job_submissions;return null===(_job$job_submissions=job.job_submissions)||void 0===_job$job_submissions||null===(_job$job_submissions=_job$job_submissions[job.job_submissions.length-1])||void 0===_job$job_submissions||null===(_job$job_submissions=_job$job_submissions.job_provisioning_data)||void 0===_job$job_submissions||null===(_job$job_submissions=_job$job_submissions.instance_type)||void 0===_job$job_submissions||null===(_job$job_submissions=_job$job_submissions.resources)||void 0===_job$job_submissions?void 0:_job$job_submissions.description};var src_getJobListItemSpot=function(job){var _job$job_submissions$,_job$job_submissions2;return null!==(_job$job_submissions$=null===(_job$job_submissions2=job.job_submissions)||void 0===_job$job_submissions2||null===(_job$job_submissions2=_job$job_submissions2[job.job_submissions.length-1])||void 0===_job$job_submissions2||null===(_job$job_submissions2=_job$job_submissions2.job_provisioning_data)||void 0===_job$job_submissions2||null===(_job$job_submissions2=_job$job_submissions2.instance_type)||void 0===_job$job_submissions2||null===(_job$job_submissions2=_job$job_submissions2.resources)||void 0===_job$job_submissions2||null===(_job$job_submissions2=_job$job_submissions2.spot)||void 0===_job$job_submissions2?void 0:_job$job_submissions2.toString())&&void 0!==_job$job_submissions$?_job$job_submissions$:"-"};var src_getJobListItemPrice=function(job){var _job$job_submissions3,_job$job_submissions4;return null!==(_job$job_submissions3=job.job_submissions)&&void 0!==_job$job_submissions3&&null!==(_job$job_submissions3=_job$job_submissions3[job.job_submissions.length-1])&&void 0!==_job$job_submissions3&&null!==(_job$job_submissions3=_job$job_submissions3.job_provisioning_data)&&void 0!==_job$job_submissions3&&_job$job_submissions3.price?"$".concat(null===(_job$job_submissions4=job.job_submissions)||void 0===_job$job_submissions4||null===(_job$job_submissions4=_job$job_submissions4[job.job_submissions.length-1])||void 0===_job$job_submissions4||null===(_job$job_submissions4=_job$job_submissions4.job_provisioning_data)||void 0===_job$job_submissions4?void 0:_job$job_submissions4.price):null};var src_getJobListItemInstance=function(job){var _job$job_submissions5;return null===(_job$job_submissions5=job.job_submissions)||void 0===_job$job_submissions5||null===(_job$job_submissions5=_job$job_submissions5[job.job_submissions.length-1])||void 0===_job$job_submissions5||null===(_job$job_submissions5=_job$job_submissions5.job_provisioning_data)||void 0===_job$job_submissions5||null===(_job$job_submissions5=_job$job_submissions5.instance_type)||void 0===_job$job_submissions5?void 0:_job$job_submissions5.name};var src_getJobListItemRegion=function(job){var _job$job_submissions$2,_job$job_submissions6;return null!==(_job$job_submissions$2=null===(_job$job_submissions6=job.job_submissions)||void 0===_job$job_submissions6||null===(_job$job_submissions6=_job$job_submissions6[job.job_submissions.length-1])||void 0===_job$job_submissions6||null===(_job$job_submissions6=_job$job_submissions6.job_provisioning_data)||void 0===_job$job_submissions6?void 0:_job$job_submissions6.region)&&void 0!==_job$job_submissions$2?_job$job_submissions$2:"-"};var src_getJobListItemBackend=function(job){var _job$job_submissions$3,_job$job_submissions7;return null!==(_job$job_submissions$3=null===(_job$job_submissions7=job.job_submissions)||void 0===_job$job_submissions7||null===(_job$job_submissions7=_job$job_submissions7[job.job_submissions.length-1])||void 0===_job$job_submissions7||null===(_job$job_submissions7=_job$job_submissions7.job_provisioning_data)||void 0===_job$job_submissions7?void 0:_job$job_submissions7.backend)&&void 0!==_job$job_submissions$3?_job$job_submissions$3:"-"};var src_getJobSubmittedAt=function(job){var _job$job_submissions8,_job$job_submissions9;return null!==(_job$job_submissions8=job.job_submissions)&&void 0!==_job$job_submissions8&&_job$job_submissions8[job.job_submissions.length-1].submitted_at?src_format_format(new Date(null===(_job$job_submissions9=job.job_submissions)||void 0===_job$job_submissions9?void 0:_job$job_submissions9[job.job_submissions.length-1].submitted_at),src_consts_DATE_TIME_FORMAT):""};var src_getJobStatus=function(job){var _job$job_submissions10;return null===(_job$job_submissions10=job.job_submissions)||void 0===_job$job_submissions10?void 0:_job$job_submissions10[job.job_submissions.length-1].status};var src_getJobTerminationReason=function(job){var _job$job_submissions$4,_job$job_submissions11;return null!==(_job$job_submissions$4=null===(_job$job_submissions11=job.job_submissions)||void 0===_job$job_submissions11?void 0:_job$job_submissions11[job.job_submissions.length-1].termination_reason)&&void 0!==_job$job_submissions$4?_job$job_submissions$4:"-"};
|
|
135697
|
+
var src_getJobListItemResources=function(job){var _job$job_submissions;return null===(_job$job_submissions=job.job_submissions)||void 0===_job$job_submissions||null===(_job$job_submissions=_job$job_submissions[job.job_submissions.length-1])||void 0===_job$job_submissions||null===(_job$job_submissions=_job$job_submissions.job_provisioning_data)||void 0===_job$job_submissions||null===(_job$job_submissions=_job$job_submissions.instance_type)||void 0===_job$job_submissions||null===(_job$job_submissions=_job$job_submissions.resources)||void 0===_job$job_submissions?void 0:_job$job_submissions.description};var src_getJobListItemSpot=function(job){var _job$job_submissions$,_job$job_submissions2;return null!==(_job$job_submissions$=null===(_job$job_submissions2=job.job_submissions)||void 0===_job$job_submissions2||null===(_job$job_submissions2=_job$job_submissions2[job.job_submissions.length-1])||void 0===_job$job_submissions2||null===(_job$job_submissions2=_job$job_submissions2.job_provisioning_data)||void 0===_job$job_submissions2||null===(_job$job_submissions2=_job$job_submissions2.instance_type)||void 0===_job$job_submissions2||null===(_job$job_submissions2=_job$job_submissions2.resources)||void 0===_job$job_submissions2||null===(_job$job_submissions2=_job$job_submissions2.spot)||void 0===_job$job_submissions2?void 0:_job$job_submissions2.toString())&&void 0!==_job$job_submissions$?_job$job_submissions$:"-"};var src_getJobListItemPrice=function(job){var _job$job_submissions3,_job$job_submissions4;return null!==(_job$job_submissions3=job.job_submissions)&&void 0!==_job$job_submissions3&&null!==(_job$job_submissions3=_job$job_submissions3[job.job_submissions.length-1])&&void 0!==_job$job_submissions3&&null!==(_job$job_submissions3=_job$job_submissions3.job_provisioning_data)&&void 0!==_job$job_submissions3&&_job$job_submissions3.price?"$".concat(null===(_job$job_submissions4=job.job_submissions)||void 0===_job$job_submissions4||null===(_job$job_submissions4=_job$job_submissions4[job.job_submissions.length-1])||void 0===_job$job_submissions4||null===(_job$job_submissions4=_job$job_submissions4.job_provisioning_data)||void 0===_job$job_submissions4?void 0:_job$job_submissions4.price):null};var src_getJobListItemInstance=function(job){var _job$job_submissions5;return null===(_job$job_submissions5=job.job_submissions)||void 0===_job$job_submissions5||null===(_job$job_submissions5=_job$job_submissions5[job.job_submissions.length-1])||void 0===_job$job_submissions5||null===(_job$job_submissions5=_job$job_submissions5.job_provisioning_data)||void 0===_job$job_submissions5||null===(_job$job_submissions5=_job$job_submissions5.instance_type)||void 0===_job$job_submissions5?void 0:_job$job_submissions5.name};var src_getJobListItemRegion=function(job){var _job$job_submissions$2,_job$job_submissions6;return null!==(_job$job_submissions$2=null===(_job$job_submissions6=job.job_submissions)||void 0===_job$job_submissions6||null===(_job$job_submissions6=_job$job_submissions6[job.job_submissions.length-1])||void 0===_job$job_submissions6||null===(_job$job_submissions6=_job$job_submissions6.job_provisioning_data)||void 0===_job$job_submissions6?void 0:_job$job_submissions6.region)&&void 0!==_job$job_submissions$2?_job$job_submissions$2:"-"};var src_getJobListItemBackend=function(job){var _job$job_submissions$3,_job$job_submissions7;return null!==(_job$job_submissions$3=null===(_job$job_submissions7=job.job_submissions)||void 0===_job$job_submissions7||null===(_job$job_submissions7=_job$job_submissions7[job.job_submissions.length-1])||void 0===_job$job_submissions7||null===(_job$job_submissions7=_job$job_submissions7.job_provisioning_data)||void 0===_job$job_submissions7?void 0:_job$job_submissions7.backend)&&void 0!==_job$job_submissions$3?_job$job_submissions$3:"-"};var src_getJobSubmittedAt=function(job){var _job$job_submissions8,_job$job_submissions9;return null!==(_job$job_submissions8=job.job_submissions)&&void 0!==_job$job_submissions8&&_job$job_submissions8[job.job_submissions.length-1].submitted_at?src_format_format(new Date(null===(_job$job_submissions9=job.job_submissions)||void 0===_job$job_submissions9?void 0:_job$job_submissions9[job.job_submissions.length-1].submitted_at),src_consts_DATE_TIME_FORMAT):""};var src_getJobStatus=function(job){var _job$job_submissions10;return null===(_job$job_submissions10=job.job_submissions)||void 0===_job$job_submissions10?void 0:_job$job_submissions10[job.job_submissions.length-1].status};var src_getJobTerminationReason=function(job){var _job$job_submissions$4,_job$job_submissions11;return null!==(_job$job_submissions$4=null===(_job$job_submissions11=job.job_submissions)||void 0===_job$job_submissions11?void 0:_job$job_submissions11[job.job_submissions.length-1].termination_reason)&&void 0!==_job$job_submissions$4?_job$job_submissions$4:"-"};var src_getJobStatusMessage=function(job){var _job$job_submissions12,latest_submission=null===(_job$job_submissions12=job.job_submissions)||void 0===_job$job_submissions12?void 0:_job$job_submissions12[job.job_submissions.length-1];return null!==latest_submission&&void 0!==latest_submission&&latest_submission.status_message?src_capitalize(latest_submission.status_message):src_capitalize(latest_submission.status)};var src_getJobError=function(job){var _job$job_submissions$5,_job$job_submissions13;return null!==(_job$job_submissions$5=null===(_job$job_submissions13=job.job_submissions)||void 0===_job$job_submissions13||null===(_job$job_submissions13=_job$job_submissions13[job.job_submissions.length-1])||void 0===_job$job_submissions13?void 0:_job$job_submissions13.error)&&void 0!==_job$job_submissions$5?_job$job_submissions$5:null};
|
|
134111
135698
|
;// ./src/pages/Runs/List/helpers.ts
|
|
134112
135699
|
var src_getGroupedRunsByProjectAndRepoID=function(runs){return (0,src_lodash.groupBy)(runs,function(_ref){var project_name=_ref.project_name;return project_name})};var src_getRunListItemResources=function(run){var _run$latest_job_submi;return 1<run.jobs.length?"-":null===(_run$latest_job_submi=run.latest_job_submission)||void 0===_run$latest_job_submi||null===(_run$latest_job_submi=_run$latest_job_submi.job_provisioning_data)||void 0===_run$latest_job_submi||null===(_run$latest_job_submi=_run$latest_job_submi.instance_type)||void 0===_run$latest_job_submi||null===(_run$latest_job_submi=_run$latest_job_submi.resources)||void 0===_run$latest_job_submi?void 0:_run$latest_job_submi.description};var src_getRunListItemSpotLabelKey=function(run){var _run$latest_job_submi2;return 1<run.jobs.length?"-":null!==(_run$latest_job_submi2=run.latest_job_submission)&&void 0!==_run$latest_job_submi2&&null!==(_run$latest_job_submi2=_run$latest_job_submi2.job_provisioning_data)&&void 0!==_run$latest_job_submi2&&null!==(_run$latest_job_submi2=_run$latest_job_submi2.instance_type)&&void 0!==_run$latest_job_submi2&&null!==(_run$latest_job_submi2=_run$latest_job_submi2.resources)&&void 0!==_run$latest_job_submi2&&_run$latest_job_submi2.spot?"common.yes":"common.no"};var src_getRunListItemSpot=function(run){var _run$latest_job_submi3,_run$latest_job_submi4;return 1<run.jobs.length?"":null!==(_run$latest_job_submi3=null===(_run$latest_job_submi4=run.latest_job_submission)||void 0===_run$latest_job_submi4||null===(_run$latest_job_submi4=_run$latest_job_submi4.job_provisioning_data)||void 0===_run$latest_job_submi4||null===(_run$latest_job_submi4=_run$latest_job_submi4.instance_type)||void 0===_run$latest_job_submi4||null===(_run$latest_job_submi4=_run$latest_job_submi4.resources)||void 0===_run$latest_job_submi4||null===(_run$latest_job_submi4=_run$latest_job_submi4.spot)||void 0===_run$latest_job_submi4?void 0:_run$latest_job_submi4.toString())&&void 0!==_run$latest_job_submi3?_run$latest_job_submi3:"-"};var src_getRunListItemPrice=function(run){var _run$latest_job_submi5,_run$latest_job_submi6,unFinishedJobs=run.jobs.filter(function(job){return!src_finishedJobs.includes(src_getJobStatus(job))});return 1<run.jobs.length?"$".concat(unFinishedJobs.reduce(function(acc,job){var _job$job_submissions,price=null===(_job$job_submissions=job.job_submissions)||void 0===_job$job_submissions||null===(_job$job_submissions=_job$job_submissions[job.job_submissions.length-1])||void 0===_job$job_submissions||null===(_job$job_submissions=_job$job_submissions.job_provisioning_data)||void 0===_job$job_submissions?void 0:_job$job_submissions.price;return price&&(acc+=price),acc},0)):null!==(_run$latest_job_submi5=run.latest_job_submission)&&void 0!==_run$latest_job_submi5&&null!==(_run$latest_job_submi5=_run$latest_job_submi5.job_provisioning_data)&&void 0!==_run$latest_job_submi5&&_run$latest_job_submi5.price?"$".concat(null===(_run$latest_job_submi6=run.latest_job_submission)||void 0===_run$latest_job_submi6||null===(_run$latest_job_submi6=_run$latest_job_submi6.job_provisioning_data)||void 0===_run$latest_job_submi6?void 0:_run$latest_job_submi6.price):null};var src_getRunListItemInstance=function(run){var _run$latest_job_submi7;return 1<run.jobs.length?"":null===(_run$latest_job_submi7=run.latest_job_submission)||void 0===_run$latest_job_submi7||null===(_run$latest_job_submi7=_run$latest_job_submi7.job_provisioning_data)||void 0===_run$latest_job_submi7||null===(_run$latest_job_submi7=_run$latest_job_submi7.instance_type)||void 0===_run$latest_job_submi7?void 0:_run$latest_job_submi7.name};var src_getRunListItemInstanceId=function(run){var _run$latest_job_submi8,_run$latest_job_submi9;return 1<run.jobs.length?"":null!==(_run$latest_job_submi8=null===(_run$latest_job_submi9=run.latest_job_submission)||void 0===_run$latest_job_submi9||null===(_run$latest_job_submi9=_run$latest_job_submi9.job_provisioning_data)||void 0===_run$latest_job_submi9?void 0:_run$latest_job_submi9.instance_id)&&void 0!==_run$latest_job_submi8?_run$latest_job_submi8:"-"};var src_getRunListItemRegion=function(run){var _run$latest_job_submi10,_run$latest_job_submi11;return 1<run.jobs.length?"":null!==(_run$latest_job_submi10=null===(_run$latest_job_submi11=run.latest_job_submission)||void 0===_run$latest_job_submi11||null===(_run$latest_job_submi11=_run$latest_job_submi11.job_provisioning_data)||void 0===_run$latest_job_submi11?void 0:_run$latest_job_submi11.region)&&void 0!==_run$latest_job_submi10?_run$latest_job_submi10:"-"};var src_getRunListItemBackend=function(run){var _run$latest_job_submi12,_run$latest_job_submi13;return 1<run.jobs.length?"":null!==(_run$latest_job_submi12=null===(_run$latest_job_submi13=run.latest_job_submission)||void 0===_run$latest_job_submi13||null===(_run$latest_job_submi13=_run$latest_job_submi13.job_provisioning_data)||void 0===_run$latest_job_submi13?void 0:_run$latest_job_submi13.backend)&&void 0!==_run$latest_job_submi12?_run$latest_job_submi12:"-"};var src_getRunListItemServiceUrl=function(run){var _run$service,url=null===(_run$service=run.service)||void 0===_run$service?void 0:_run$service.url;return url?url.startsWith("/")?"".concat(src_getBaseUrl()).concat(url):url:null};
|
|
134113
135700
|
;// ./src/pages/Runs/List/hooks/useColumnsDefinitions.tsx
|
|
134114
|
-
var src_List_hooks_useColumnsDefinitions_useColumnsDefinitions=function(){var _useTranslation=src_useTranslation_useTranslation(),t=_useTranslation.t,columns=[{id:"run_name",header:t("projects.run.run_name"),cell:function(item){return null===item.id?item.run_spec.run_name:/*#__PURE__*/src_react.createElement(src_NavigateLink_NavigateLink,{href:src_routes_ROUTES.PROJECT.DETAILS.RUNS.DETAILS.FORMAT(item.project_name,item.id)},item.run_spec.run_name)}},{id:"project",header:"".concat(t("projects.run.project")),cell:function(item){return/*#__PURE__*/src_react.createElement(src_NavigateLink_NavigateLink,{href:src_routes_ROUTES.PROJECT.DETAILS.FORMAT(item.project_name)},item.project_name)}},{id:"repo",header:"".concat(t("projects.run.repo")),cell:function(item){return src_getRepoNameFromRun(item)}},{id:"hub_user_name",header:"".concat(t("projects.run.hub_user_name")),cell:function(item){return/*#__PURE__*/src_react.createElement(src_NavigateLink_NavigateLink,{href:src_routes_ROUTES.USER.DETAILS.FORMAT(item.user)},item.user)}},{id:"submitted_at",header:t("projects.run.submitted_at"),cell:function(item){return src_format_format(new Date(item.submitted_at),src_consts_DATE_TIME_FORMAT)}},{id:"finished_at",header:t("projects.run.finished_at"),cell:function(item){return item.terminated_at?src_format_format(new Date(item.terminated_at),src_consts_DATE_TIME_FORMAT):null}},{id:"status",header:t("projects.run.status"),cell:function(item){return/*#__PURE__*/src_react.createElement(src_status_indicator_StatusIndicator,{type:src_getStatusIconType(
|
|
135701
|
+
var src_List_hooks_useColumnsDefinitions_useColumnsDefinitions=function(){var _useTranslation=src_useTranslation_useTranslation(),t=_useTranslation.t,columns=[{id:"run_name",header:t("projects.run.run_name"),cell:function(item){return null===item.id?item.run_spec.run_name:/*#__PURE__*/src_react.createElement(src_NavigateLink_NavigateLink,{href:src_routes_ROUTES.PROJECT.DETAILS.RUNS.DETAILS.FORMAT(item.project_name,item.id)},item.run_spec.run_name)}},{id:"project",header:"".concat(t("projects.run.project")),cell:function(item){return/*#__PURE__*/src_react.createElement(src_NavigateLink_NavigateLink,{href:src_routes_ROUTES.PROJECT.DETAILS.FORMAT(item.project_name)},item.project_name)}},{id:"repo",header:"".concat(t("projects.run.repo")),cell:function(item){return src_getRepoNameFromRun(item)}},{id:"hub_user_name",header:"".concat(t("projects.run.hub_user_name")),cell:function(item){return/*#__PURE__*/src_react.createElement(src_NavigateLink_NavigateLink,{href:src_routes_ROUTES.USER.DETAILS.FORMAT(item.user)},item.user)}},{id:"submitted_at",header:t("projects.run.submitted_at"),cell:function(item){return src_format_format(new Date(item.submitted_at),src_consts_DATE_TIME_FORMAT)}},{id:"finished_at",header:t("projects.run.finished_at"),cell:function(item){return item.terminated_at?src_format_format(new Date(item.terminated_at),src_consts_DATE_TIME_FORMAT):null}},{id:"status",header:t("projects.run.status"),cell:function(item){var _item$latest_job_subm,_item$latest_job_subm2,_item$latest_job_subm3,status=src_finishedRunStatuses.includes(item.status)?null!==(_item$latest_job_subm=null===(_item$latest_job_subm2=item.latest_job_submission)||void 0===_item$latest_job_subm2?void 0:_item$latest_job_subm2.status)&&void 0!==_item$latest_job_subm?_item$latest_job_subm:item.status:item.status,terminationReason=src_finishedRunStatuses.includes(item.status)?null===(_item$latest_job_subm3=item.latest_job_submission)||void 0===_item$latest_job_subm3?void 0:_item$latest_job_subm3.termination_reason:null;return/*#__PURE__*/src_react.createElement(src_status_indicator_StatusIndicator,{type:src_getStatusIconType(status,terminationReason),colorOverride:src_getStatusIconColor(status,terminationReason)},src_getRunStatusMessage(item))}},{id:"error",header:t("projects.run.error"),cell:function(item){return src_getRunError(item)}},{id:"priority",header:t("projects.run.priority"),cell:function(item){return src_getRunPriority(item)}},{id:"cost",header:"".concat(t("projects.run.cost")),cell:function(item){return"$".concat(item.cost)}},{id:"resources",header:"".concat(t("projects.run.resources")),cell:src_getRunListItemResources},{id:"spot",header:"".concat(t("projects.run.spot")),cell:function(item){return t(src_getRunListItemSpotLabelKey(item))}},{id:"price",header:"".concat(t("projects.run.price")),cell:src_getRunListItemPrice},{id:"instance",header:"".concat(t("projects.run.instance")),cell:src_getRunListItemInstance},{id:"region",header:"".concat(t("projects.run.region")),cell:src_getRunListItemRegion},{id:"backend",header:"".concat(t("projects.run.backend")),cell:src_getRunListItemBackend}];return{columns:columns}};
|
|
134115
135702
|
;// ./src/pages/Runs/List/hooks/useStopRuns.ts
|
|
134116
135703
|
var src_useStopRuns=function(isAborting){var _useTranslation=src_useTranslation_useTranslation(),t=_useTranslation.t,_useStopRunsMutation=src_useStopRunsMutation(),_useStopRunsMutation2=src_slicedToArray_slicedToArray(_useStopRunsMutation,2),stopRun=_useStopRunsMutation2[0],isStopping=_useStopRunsMutation2[1].isLoading,_useNotifications=src_useNotifications_useNotifications(),_useNotifications2=src_slicedToArray_slicedToArray(_useNotifications,1),pushNotification=_useNotifications2[0],stopRuns=(0,src_react.useCallback)(function(runs){var groupedRuns=src_getGroupedRunsByProjectAndRepoID(runs),request=Promise.all(Object.keys(groupedRuns).map(function(key){var runsGroup=groupedRuns[key];return stopRun({project_name:runsGroup[0].project_name,runs_names:runsGroup.map(function(item){return item.run_spec.run_name}),abort:!!isAborting}).unwrap()}));return request.catch(function(error){pushNotification({type:"error",content:t("common.server_error",{error:src_serverErrors_getServerError(error)})})}),request},[isAborting]);return{stopRuns:stopRuns,isStopping:isStopping}};var src_useAbortRuns=function(){var _useStopRuns=src_useStopRuns(!0),abortRuns=_useStopRuns.stopRuns,isAborting=_useStopRuns.isStopping;return{abortRuns:abortRuns,isAborting:isAborting}};
|
|
134117
135704
|
;// ./src/pages/Runs/List/hooks/useDeleteRuns.ts
|
|
@@ -134119,30 +135706,57 @@ var src_useDeleteRuns=function(){var _useTranslation=src_useTranslation_useTrans
|
|
|
134119
135706
|
;// ./src/pages/Runs/List/hooks/useDisabledStatesForButtons.ts
|
|
134120
135707
|
var src_useDisabledStatesForButtons=function(_ref){var selectedRuns=_ref.selectedRuns,isStopping=_ref.isStopping,isAborting=_ref.isAborting,isDeleting=_ref.isDeleting,isRunningOperation=!!(isStopping||isAborting||isDeleting),isDisabledAbortButton=(0,src_react.useMemo)(function(){return!(null!==selectedRuns&&void 0!==selectedRuns&&selectedRuns.length)||selectedRuns.some(function(item){return!src_isAvailableAbortingForRun(item.status)})||isRunningOperation},[selectedRuns,isRunningOperation]),isDisabledStopButton=(0,src_react.useMemo)(function(){return!(null!==selectedRuns&&void 0!==selectedRuns&&selectedRuns.length)||selectedRuns.some(function(item){return!src_isAvailableStoppingForRun(item.status)})||isRunningOperation},[selectedRuns,isRunningOperation]),isDisabledDeleteButton=(0,src_react.useMemo)(function(){return!(null!==selectedRuns&&void 0!==selectedRuns&&selectedRuns.length)||selectedRuns.some(function(item){return!src_isAvailableDeletingForRun(item.status)})||isRunningOperation},[selectedRuns,isRunningOperation]);return{isDisabledAbortButton:isDisabledAbortButton,isDisabledStopButton:isDisabledStopButton,isDisabledDeleteButton:isDisabledDeleteButton}};
|
|
134121
135708
|
;// ./src/pages/Runs/List/hooks/useEmptyMessages.tsx
|
|
134122
|
-
var src_useEmptyMessages_useEmptyMessages=function(_ref){var clearFilter=_ref.clearFilter,isDisabledClearFilter=_ref.isDisabledClearFilter,_useTranslation=src_useTranslation_useTranslation(),t=_useTranslation.t,renderEmptyMessage=(0,src_react.useCallback)(function(){return
|
|
135709
|
+
var src_useEmptyMessages_useEmptyMessages=function(_ref){var clearFilter=_ref.clearFilter,noData=_ref.noData,isDisabledClearFilter=_ref.isDisabledClearFilter,_useTranslation=src_useTranslation_useTranslation(),t=_useTranslation.t,renderEmptyMessage=(0,src_react.useCallback)(function(){return noData&&isDisabledClearFilter?/*#__PURE__*/src_react.createElement(src_ListEmptyMessage_ListEmptyMessage,{title:t("projects.run.empty_message_title"),message:t("projects.run.quickstart_message_text")},/*#__PURE__*/src_react.createElement(src_Button_Button,{variant:"primary",external:!0,onClick:function(){return src_libs_goToUrl(src_QUICK_START_URL,!0)}},t("common.quickstart"))):/*#__PURE__*/src_react.createElement(src_ListEmptyMessage_ListEmptyMessage,{title:t("projects.run.nomatch_message_title"),message:t("projects.run.nomatch_message_text")},/*#__PURE__*/src_react.createElement(src_Button_Button,{disabled:isDisabledClearFilter,onClick:clearFilter},t("common.clearFilter")))},[isDisabledClearFilter,clearFilter]),renderNoMatchMessage=(0,src_react.useCallback)(function(){return/*#__PURE__*/src_react.createElement(src_ListEmptyMessage_ListEmptyMessage,{title:t("projects.run.nomatch_message_title"),message:t("projects.run.nomatch_message_text")},/*#__PURE__*/src_react.createElement(src_Button_Button,{disabled:isDisabledClearFilter,onClick:clearFilter},t("common.clearFilter")))},[isDisabledClearFilter,clearFilter]);return{renderEmptyMessage:renderEmptyMessage,renderNoMatchMessage:renderNoMatchMessage}};
|
|
134123
135710
|
;// ./src/pages/Runs/List/hooks/useFilters.ts
|
|
134124
|
-
var
|
|
135711
|
+
function src_useFilters_ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function src_useFilters_objectSpread(e){for(var t,r=1;r<arguments.length;r++)t=null==arguments[r]?{}:arguments[r],r%2?src_useFilters_ownKeys(Object(t),!0).forEach(function(r){src_defineProperty_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):src_useFilters_ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))});return e}function src_createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=src_useFilters_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function(){};return{s:F,n:function(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function(r){throw r},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){t=t.call(r)},n:function(){var r=t.next();return a=r.done,r},e:function(r){u=!0,o=r},f:function(){try{a||null==t.return||t.return()}finally{if(u)throw o}}}}function src_useFilters_unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return src_useFilters_arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?src_useFilters_arrayLikeToArray(r,a):void 0}}function src_useFilters_arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}var src_FilterKeys={PROJECT_NAME:"project_name",USER_NAME:"username"},src_EMPTY_QUERY={tokens:[],operation:"and"},src_tokensToRequestParams=function(tokens,onlyActive){var params=tokens.reduce(function(acc,token){return token.propertyKey&&(acc[token.propertyKey]=token.value),acc},{});return onlyActive&&(params.only_active="true"),params};var src_hooks_useFilters_useFilters=function(_ref){var localStorePrefix=_ref.localStorePrefix,_useSearchParams=src_dist_useSearchParams(),_useSearchParams2=src_slicedToArray_slicedToArray(_useSearchParams,2),searchParams=_useSearchParams2[0],setSearchParams=_useSearchParams2[1],_useState=(0,src_react.useState)(function(){return"true"===searchParams.get("only_active")}),_useState2=src_slicedToArray_slicedToArray(_useState,2),onlyActive=_useState2[0],setOnlyActive=_useState2[1],_useProjectFilter=src_useProjectFilter({localStorePrefix:localStorePrefix}),projectOptions=_useProjectFilter.projectOptions,_useGetUserListQuery=src_useGetUserListQuery(),usersData=_useGetUserListQuery.data,_useState3=(0,src_react.useState)(function(){var _step,tokens=[],_iterator=src_createForOfIteratorHelper(searchParams.entries());// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
134125
135712
|
// @ts-ignore
|
|
134126
|
-
var
|
|
135713
|
+
try{for(_iterator.s();!(_step=_iterator.n()).done;){var _step$value=src_slicedToArray_slicedToArray(_step.value,2),paramKey=_step$value[0],paramValue=_step$value[1];Object.values(src_FilterKeys).includes(paramKey)&&tokens.push({propertyKey:paramKey,operator:"=",value:paramValue})}}catch(err){_iterator.e(err)}finally{_iterator.f()}return tokens.length?src_useFilters_objectSpread(src_useFilters_objectSpread({},src_EMPTY_QUERY),{},{tokens:tokens}):src_EMPTY_QUERY}),_useState4=src_slicedToArray_slicedToArray(_useState3,2),propertyFilterQuery=_useState4[0],setPropertyFilterQuery=_useState4[1],filteringOptions=(0,src_react.useMemo)(function(){var options=[];return projectOptions.forEach(function(_ref2){var value=_ref2.value;value&&options.push({propertyKey:src_FilterKeys.PROJECT_NAME,value:value})}),null===usersData||void 0===usersData||usersData.forEach(function(_ref3){var username=_ref3.username;options.push({propertyKey:src_FilterKeys.USER_NAME,value:username})}),options},[projectOptions,usersData]),filteringProperties=[{key:src_FilterKeys.PROJECT_NAME,operators:["="],propertyLabel:"Project",groupValuesLabel:"Project values"},{key:src_FilterKeys.USER_NAME,operators:["="],propertyLabel:"User"}],filteringRequestParams=(0,src_react.useMemo)(function(){var params=src_tokensToRequestParams(propertyFilterQuery.tokens);return src_useFilters_objectSpread(src_useFilters_objectSpread({},params),{},{only_active:onlyActive})},[propertyFilterQuery,onlyActive]);return{filteringRequestParams:filteringRequestParams,clearFilter:function(){setSearchParams({}),setOnlyActive(!1),setPropertyFilterQuery(src_EMPTY_QUERY)},propertyFilterQuery:propertyFilterQuery,onChangePropertyFilter:function(_ref4){var detail=_ref4.detail,tokens=detail.tokens,operation=detail.operation,filteredTokens=tokens.filter(function(token,tokenIndex){return!tokens.some(function(item,index){return token.propertyKey===item.propertyKey&&index>tokenIndex})});setSearchParams(src_tokensToRequestParams(filteredTokens,onlyActive)),setPropertyFilterQuery({operation:operation,tokens:filteredTokens})},filteringOptions:filteringOptions,filteringProperties:filteringProperties,onlyActive:onlyActive,onChangeOnlyActive:function(_ref5){var detail=_ref5.detail;setOnlyActive(detail.checked),setSearchParams(src_tokensToRequestParams(propertyFilterQuery.tokens,detail.checked))}}};
|
|
134127
135714
|
;// ./src/pages/Runs/List/hooks/index.ts
|
|
134128
135715
|
|
|
134129
135716
|
;// ./src/pages/Runs/List/Preferences/index.tsx
|
|
134130
135717
|
var src_Preferences_Preferences=function(){var _useTranslation=src_useTranslation_useTranslation(),t=_useTranslation.t,_useRunListPreference=src_useRunListPreferences(),_useRunListPreference2=src_slicedToArray_slicedToArray(_useRunListPreference,2),preferences=_useRunListPreference2[0],setPreferences=_useRunListPreference2[1];return/*#__PURE__*/src_react.createElement(src_CollectionPreferences,{preferences:preferences,onConfirm:function(_ref){var detail=_ref.detail;return setPreferences(detail)},cancelLabel:t("common.cancel"),confirmLabel:t("common.save"),contentDisplayPreference:{title:t("common.select_visible_columns"),options:[{id:"run_name",label:t("projects.run.run_name"),alwaysVisible:!0},{id:"resources",label:t("projects.run.resources")},{id:"spot",label:t("projects.run.spot")},{id:"price",label:t("projects.run.price")},{id:"submitted_at",label:t("projects.run.submitted_at")},{id:"status",label:t("projects.run.status")},{id:"error",label:t("projects.run.error")},{id:"cost",label:t("projects.run.cost")},// hidden by default
|
|
134131
|
-
{id:"finished_at",label:t("projects.run.finished_at")},{id:"project",label:t("projects.run.project")},{id:"hub_user_name",label:t("projects.run.hub_user_name")},{id:"repo",label:t("projects.run.repo")},{id:"instance",label:t("projects.run.instance")},{id:"region",label:t("projects.run.region")},{id:"backend",label:t("projects.run.backend")}]}})};
|
|
135718
|
+
{id:"priority",label:t("projects.run.priority")},{id:"finished_at",label:t("projects.run.finished_at")},{id:"project",label:t("projects.run.project")},{id:"hub_user_name",label:t("projects.run.hub_user_name")},{id:"repo",label:t("projects.run.repo")},{id:"instance",label:t("projects.run.instance")},{id:"region",label:t("projects.run.region")},{id:"backend",label:t("projects.run.backend")}]}})};
|
|
134132
135719
|
;// ./src/pages/Runs/List/styles.module.scss
|
|
134133
135720
|
// extracted by mini-css-extract-plugin
|
|
134134
|
-
/* harmony default export */ const src_Runs_List_styles_module = ({"selectFilters":"sYCvq","
|
|
135721
|
+
/* harmony default export */ const src_Runs_List_styles_module = ({"selectFilters":"sYCvq","propertyFilter":"gMUIr","activeOnly":"PbvNs","emptyMessage":"JPkrf","emptyMessageHelp":"Urnse","cliCommand":"o_Gf_"});
|
|
134135
135722
|
;// ./src/pages/Runs/List/index.tsx
|
|
134136
|
-
var
|
|
135723
|
+
function src_List_ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function src_List_objectSpread(e){for(var t,r=1;r<arguments.length;r++)t=null==arguments[r]?{}:arguments[r],r%2?src_List_ownKeys(Object(t),!0).forEach(function(r){src_defineProperty_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):src_List_ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))});return e}var src_RunList=function(){var _useTranslation=src_useTranslation_useTranslation(),t=_useTranslation.t,_useRunListPreference=src_useRunListPreferences(),_useRunListPreference2=src_slicedToArray_slicedToArray(_useRunListPreference,1),preferences=_useRunListPreference2[0];src_useBreadcrumbs_useBreadcrumbs([{text:t("projects.runs"),href:src_routes_ROUTES.RUNS.LIST}]);var _useFilters=src_hooks_useFilters_useFilters({localStorePrefix:"administration-run-list-page"}),clearFilter=_useFilters.clearFilter,propertyFilterQuery=_useFilters.propertyFilterQuery,onChangePropertyFilter=_useFilters.onChangePropertyFilter,filteringOptions=_useFilters.filteringOptions,filteringProperties=_useFilters.filteringProperties,filteringRequestParams=_useFilters.filteringRequestParams,onlyActive=_useFilters.onlyActive,onChangeOnlyActive=_useFilters.onChangeOnlyActive,_useInfiniteScroll=src_useInfiniteScroll({useLazyQuery:src_useLazyGetRunsQuery,args:src_List_objectSpread(src_List_objectSpread({},filteringRequestParams),{},{limit:src_DEFAULT_TABLE_PAGE_SIZE}),getPaginationParams:function(lastRun){return{prev_submitted_at:lastRun.submitted_at}}}),data=_useInfiniteScroll.data,isLoading=_useInfiniteScroll.isLoading,refreshList=_useInfiniteScroll.refreshList,isLoadingMore=_useInfiniteScroll.isLoadingMore,_useStopRuns=src_useStopRuns(),stopRuns=_useStopRuns.stopRuns,isStopping=_useStopRuns.isStopping,_useAbortRuns=src_useAbortRuns(),abortRuns=_useAbortRuns.abortRuns,isAborting=_useAbortRuns.isAborting,_useDeleteRuns=src_useDeleteRuns(),isDeleting=_useDeleteRuns.isDeleting,_useColumnsDefinition=src_List_hooks_useColumnsDefinitions_useColumnsDefinitions(),columns=_useColumnsDefinition.columns,_useEmptyMessages=src_useEmptyMessages_useEmptyMessages({clearFilter:clearFilter,noData:!data.length,isDisabledClearFilter:1>=Object.keys(filteringRequestParams).length&&!filteringRequestParams.only_active}),renderEmptyMessage=_useEmptyMessages.renderEmptyMessage,renderNoMatchMessage=_useEmptyMessages.renderNoMatchMessage,_useCollection=src_use_collection_useCollection(null!==data&&void 0!==data?data:[],{filtering:{empty:renderEmptyMessage(),noMatch:renderNoMatchMessage()},selection:{}}),items=_useCollection.items,actions=_useCollection.actions,collectionProps=_useCollection.collectionProps,selectedItems=collectionProps.selectedItems,_useDisabledStatesFor=src_useDisabledStatesForButtons({selectedRuns:selectedItems,isStopping:isStopping,isAborting:isAborting,isDeleting:isDeleting}),isDisabledAbortButton=_useDisabledStatesFor.isDisabledAbortButton,isDisabledStopButton=_useDisabledStatesFor.isDisabledStopButton;// const deleteClickHandle = () => {
|
|
135724
|
+
// if (!selectedItems?.length) return;
|
|
135725
|
+
//
|
|
135726
|
+
// deleteRuns([...selectedItems]).catch(console.log);
|
|
135727
|
+
// };
|
|
135728
|
+
return/*#__PURE__*/src_react.createElement(src_table,src_extends_extends({},collectionProps,{variant:"full-page",columnDefinitions:columns,items:items,loading:isLoading,loadingText:t("common.loading"),selectionType:"multi",stickyHeader:!0,columnDisplay:preferences.contentDisplay,preferences:/*#__PURE__*/src_react.createElement(src_Preferences_Preferences,null),header:/*#__PURE__*/src_react.createElement(src_components_header_Header,{variant:"awsui-h1-sticky",actions:/*#__PURE__*/src_react.createElement(src_space_between_SpaceBetween,{size:"xs",direction:"horizontal"},/*#__PURE__*/src_react.createElement(src_Button_Button,{formAction:"none",onClick:function(){null!==selectedItems&&void 0!==selectedItems&&selectedItems.length&&abortRuns(src_toConsumableArray_toConsumableArray(selectedItems)).then(function(){return actions.setSelectedItems([])})},disabled:isDisabledAbortButton},t("common.abort")),/*#__PURE__*/src_react.createElement(src_Button_Button,{formAction:"none",onClick:function(){null!==selectedItems&&void 0!==selectedItems&&selectedItems.length&&stopRuns(src_toConsumableArray_toConsumableArray(selectedItems)).then(function(){return actions.setSelectedItems([])})},disabled:isDisabledStopButton},t("common.stop")),/*#__PURE__*/src_react.createElement(src_Button_Button,{iconName:"refresh",disabled:isLoading,ariaLabel:t("common.refresh"),onClick:refreshList}))},t("projects.runs")),filter:/*#__PURE__*/src_react.createElement("div",{className:src_Runs_List_styles_module.selectFilters},/*#__PURE__*/src_react.createElement("div",{className:src_Runs_List_styles_module.propertyFilter},/*#__PURE__*/src_react.createElement(src_property_filter,{query:propertyFilterQuery,onChange:onChangePropertyFilter,expandToViewport:!0,hideOperations:!0,i18nStrings:{clearFiltersText:t("common.clearFilter"),filteringAriaLabel:t("projects.run.filter_property_placeholder"),filteringPlaceholder:t("projects.run.filter_property_placeholder"),operationAndText:"and"},filteringOptions:filteringOptions,filteringProperties:filteringProperties})),/*#__PURE__*/src_react.createElement("div",{className:src_Runs_List_styles_module.activeOnly},/*#__PURE__*/src_react.createElement(src_toggle,{onChange:onChangeOnlyActive,checked:onlyActive},t("projects.run.active_only")))),footer:/*#__PURE__*/src_react.createElement(src_Loader_Loader,{show:isLoadingMore,padding:{vertical:"m"}})}))};
|
|
134137
135729
|
;// ./src/pages/Runs/Details/styles.module.scss
|
|
134138
135730
|
// extracted by mini-css-extract-plugin
|
|
134139
135731
|
/* harmony default export */ const src_Runs_Details_styles_module = ({"page":"sbwRz"});
|
|
134140
135732
|
;// ./src/pages/Runs/Details/index.tsx
|
|
134141
|
-
var src_Details_CodeTab=/*#__PURE__*/function(CodeTab){return CodeTab.Details="details",CodeTab.Metrics="metrics",CodeTab}(src_Details_CodeTab||{});var src_RunDetailsPage=function(){var _params$projectName,_params$runId,_runData$run_spec$run,_runData$run_spec,_runData$run_spec$run2,_runData$run_spec2,_useTranslation=src_useTranslation_useTranslation(),t=_useTranslation.t,
|
|
135733
|
+
var src_Details_CodeTab=/*#__PURE__*/function(CodeTab){return CodeTab.Details="details",CodeTab.Metrics="metrics",CodeTab}(src_Details_CodeTab||{});var src_RunDetailsPage=function(){var _params$projectName,_params$runId,_runData$run_spec$run,_runData$run_spec,_runData$run_spec$run2,_runData$run_spec2,_useTranslation=src_useTranslation_useTranslation(),t=_useTranslation.t,params=src_dist_useParams(),paramProjectName=null!==(_params$projectName=params.projectName)&&void 0!==_params$projectName?_params$projectName:"",paramRunId=null!==(_params$runId=params.runId)&&void 0!==_params$runId?_params$runId:"",_useNotifications=src_useNotifications_useNotifications(),_useNotifications2=src_slicedToArray_slicedToArray(_useNotifications,1),pushNotification=_useNotifications2[0],_useGetRunQuery=src_useGetRunQuery({project_name:paramProjectName,id:paramRunId}),runData=_useGetRunQuery.data,runError=_useGetRunQuery.error,isLoading=_useGetRunQuery.isLoading,refetch=_useGetRunQuery.refetch;// const navigate = useNavigate();
|
|
135734
|
+
(0,src_react.useEffect)(function(){404===(null===runError||void 0===runError?void 0:runError.status)&&src_riseRouterException()},[runError]);var _useStopRunsMutation=src_useStopRunsMutation(),_useStopRunsMutation2=src_slicedToArray_slicedToArray(_useStopRunsMutation,2),stopRun=_useStopRunsMutation2[0],isStopping=_useStopRunsMutation2[1].isLoading,_useDeleteRunsMutatio=src_useDeleteRunsMutation(),_useDeleteRunsMutatio2=src_slicedToArray_slicedToArray(_useDeleteRunsMutatio,2),isDeleting=_useDeleteRunsMutatio2[1].isLoading;src_useBreadcrumbs_useBreadcrumbs([{text:t("navigation.project_other"),href:src_routes_ROUTES.PROJECT.LIST},{text:paramProjectName,href:src_routes_ROUTES.PROJECT.DETAILS.FORMAT(paramProjectName)},{text:t("projects.runs"),href:src_routes_ROUTES.RUNS.LIST},{text:null!==(_runData$run_spec$run=null===runData||void 0===runData||null===(_runData$run_spec=runData.run_spec)||void 0===_runData$run_spec?void 0:_runData$run_spec.run_name)&&void 0!==_runData$run_spec$run?_runData$run_spec$run:"",href:src_routes_ROUTES.PROJECT.DETAILS.RUNS.DETAILS.FORMAT(paramProjectName,paramRunId)}]);var isDisabledAbortButton=!runData||!src_isAvailableAbortingForRun(runData.status)||isStopping||isDeleting,isDisabledStopButton=!runData||!src_isAvailableStoppingForRun(runData.status)||isStopping||isDeleting;// const deleteClickHandle = () => {
|
|
135735
|
+
// if (!runData) {
|
|
135736
|
+
// return;
|
|
135737
|
+
// }
|
|
135738
|
+
//
|
|
135739
|
+
// deleteRun({
|
|
135740
|
+
// project_name: paramProjectName,
|
|
135741
|
+
// runs_names: [runData.run_spec.run_name],
|
|
135742
|
+
// })
|
|
135743
|
+
// .unwrap()
|
|
135744
|
+
// .then(() => {
|
|
135745
|
+
// navigate(ROUTES.RUNS.LIST);
|
|
135746
|
+
// })
|
|
135747
|
+
// .catch((error) => {
|
|
135748
|
+
// pushNotification({
|
|
135749
|
+
// type: 'error',
|
|
135750
|
+
// content: t('common.server_error', { error: getServerError(error) }),
|
|
135751
|
+
// });
|
|
135752
|
+
// });
|
|
135753
|
+
// };
|
|
135754
|
+
// const isDisabledDeleteButton = !runData || !isAvailableDeletingForRun(runData.status) || isStopping || isDeleting;
|
|
135755
|
+
return/*#__PURE__*/src_react.createElement("div",{className:src_Runs_Details_styles_module.page},/*#__PURE__*/src_react.createElement(src_ContentLayout,{header:/*#__PURE__*/src_react.createElement(src_DetailsHeader,{title:null!==(_runData$run_spec$run2=null===runData||void 0===runData||null===(_runData$run_spec2=runData.run_spec)||void 0===_runData$run_spec2?void 0:_runData$run_spec2.run_name)&&void 0!==_runData$run_spec$run2?_runData$run_spec$run2:"",actionButtons:/*#__PURE__*/src_react.createElement(src_react.Fragment,null,/*#__PURE__*/src_react.createElement(src_components_button,{onClick:function(){runData&&stopRun({project_name:paramProjectName,runs_names:[runData.run_spec.run_name],abort:!0}).unwrap().catch(function(error){pushNotification({type:"error",content:t("common.server_error",{error:src_serverErrors_getServerError(error)})})})},disabled:isDisabledAbortButton},t("common.abort")),/*#__PURE__*/src_react.createElement(src_components_button,{onClick:function(){runData&&stopRun({project_name:paramProjectName,runs_names:[runData.run_spec.run_name],abort:!1}).unwrap().catch(function(error){pushNotification({type:"error",content:t("common.server_error",{error:src_serverErrors_getServerError(error)})})})},disabled:isDisabledStopButton},t("common.stop")),/*#__PURE__*/src_react.createElement(src_components_button,{iconName:"refresh",disabled:isLoading,ariaLabel:t("common.refresh"),onClick:refetch}))})},/*#__PURE__*/src_react.createElement(src_react.Fragment,null,1===(null===runData||void 0===runData?void 0:runData.jobs.length)&&/*#__PURE__*/src_react.createElement(src_Tabs_Tabs,{withNavigation:!0,tabs:[{label:"Details",id:src_Details_CodeTab.Details,href:src_routes_ROUTES.PROJECT.DETAILS.RUNS.DETAILS.FORMAT(paramProjectName,paramRunId)},{label:"Metrics",id:src_Details_CodeTab.Metrics,href:src_routes_ROUTES.PROJECT.DETAILS.RUNS.DETAILS.METRICS.FORMAT(paramProjectName,paramRunId)}]}),/*#__PURE__*/src_react.createElement(src_Outlet,null))))};
|
|
134142
135756
|
;// ./src/pages/Runs/Details/Jobs/List/hooks.tsx
|
|
134143
|
-
var src_List_hooks_useColumnsDefinitions=function(_ref){var projectName=_ref.projectName,runId=_ref.runId,_useTranslation=src_useTranslation_useTranslation(),t=_useTranslation.t,columns=[{id:"job_name",header:t("projects.run.job_name"),cell:function(item){return/*#__PURE__*/src_react.createElement(src_NavigateLink_NavigateLink,{href:src_routes_ROUTES.PROJECT.DETAILS.RUNS.DETAILS.JOBS.DETAILS.FORMAT(projectName,runId,item.job_spec.job_name)},item.job_spec.job_name)}},{id:"submitted_at",header:t("projects.run.submitted_at"),cell:src_getJobSubmittedAt},{id:"status",header:t("projects.run.status"),cell:function(item){var status=src_getJobStatus(item);return
|
|
135757
|
+
var src_List_hooks_useColumnsDefinitions=function(_ref){var projectName=_ref.projectName,runId=_ref.runId,runPriority=_ref.runPriority,_useTranslation=src_useTranslation_useTranslation(),t=_useTranslation.t,columns=[{id:"job_name",header:t("projects.run.job_name"),cell:function(item){return/*#__PURE__*/src_react.createElement(src_NavigateLink_NavigateLink,{href:src_routes_ROUTES.PROJECT.DETAILS.RUNS.DETAILS.JOBS.DETAILS.FORMAT(projectName,runId,item.job_spec.job_name)},item.job_spec.job_name)}},{id:"submitted_at",header:t("projects.run.submitted_at"),cell:src_getJobSubmittedAt},{id:"status",header:t("projects.run.status"),cell:function(item){var status=src_getJobStatus(item);return/*#__PURE__*/src_react.createElement(src_status_indicator_StatusIndicator,{type:src_getStatusIconType(status,src_getJobTerminationReason(item))},src_getJobStatusMessage(item))}},{id:"priority",header:t("projects.run.priority"),cell:function(){return runPriority}},{id:"error",header:t("projects.run.error"),cell:function(item){return src_getJobError(item)}},{id:"resources",header:"".concat(t("projects.run.resources")),cell:src_getJobListItemResources},{id:"spot",header:"".concat(t("projects.run.spot")),cell:src_getJobListItemSpot},{id:"price",header:"".concat(t("projects.run.price")),cell:src_getJobListItemPrice},{id:"instance",header:"".concat(t("projects.run.instance")),cell:src_getJobListItemInstance},{id:"region",header:"".concat(t("projects.run.region")),cell:src_getJobListItemRegion},{id:"backend",header:"".concat(t("projects.run.backend")),cell:src_getJobListItemBackend}];return{columns:columns}};
|
|
134144
135758
|
;// ./src/pages/Runs/Details/Jobs/List/index.tsx
|
|
134145
|
-
var src_JobList=function(_ref){var jobs=_ref.jobs,projectName=_ref.projectName,runId=_ref.runId,_useTranslation=src_useTranslation_useTranslation(),t=_useTranslation.t,_useColumnsDefinition=src_List_hooks_useColumnsDefinitions({projectName:projectName,runId:runId}),columns=_useColumnsDefinition.columns,_useCollection=src_use_collection_useCollection(jobs,{pagination:{pageSize:20}}),items=_useCollection.items,collectionProps=_useCollection.collectionProps,paginationProps=_useCollection.paginationProps;return/*#__PURE__*/src_react.createElement(src_table,src_extends_extends({},collectionProps,{columnDefinitions:columns,items:items,header:/*#__PURE__*/src_react.createElement(src_components_header_Header,null,t("projects.run.jobs")),pagination:/*#__PURE__*/src_react.createElement(src_pagination_Pagination,paginationProps)}))};
|
|
135759
|
+
var src_JobList=function(_ref){var jobs=_ref.jobs,projectName=_ref.projectName,runId=_ref.runId,runPriority=_ref.runPriority,_useTranslation=src_useTranslation_useTranslation(),t=_useTranslation.t,_useColumnsDefinition=src_List_hooks_useColumnsDefinitions({projectName:projectName,runId:runId,runPriority:runPriority}),columns=_useColumnsDefinition.columns,_useCollection=src_use_collection_useCollection(jobs,{pagination:{pageSize:20}}),items=_useCollection.items,collectionProps=_useCollection.collectionProps,paginationProps=_useCollection.paginationProps;return/*#__PURE__*/src_react.createElement(src_table,src_extends_extends({},collectionProps,{columnDefinitions:columns,items:items,header:/*#__PURE__*/src_react.createElement(src_components_header_Header,null,t("projects.run.jobs")),pagination:/*#__PURE__*/src_react.createElement(src_pagination_Pagination,paginationProps)}))};
|
|
134146
135760
|
// EXTERNAL MODULE: ./node_modules/@xterm/addon-fit/lib/addon-fit.js
|
|
134147
135761
|
var src_addon_fit = __webpack_require__(3616);
|
|
134148
135762
|
// EXTERNAL MODULE: ./node_modules/@xterm/xterm/lib/xterm.js
|
|
@@ -134151,14 +135765,14 @@ var src_xterm = __webpack_require__(7856);
|
|
|
134151
135765
|
// extracted by mini-css-extract-plugin
|
|
134152
135766
|
/* harmony default export */ const src_Logs_styles_module = ({"logs":"Lym9X","loader":"AsNP2","terminal":"Vs5Qg","scroll":"ZXmZb"});
|
|
134153
135767
|
;// ./src/pages/Runs/Details/Logs/index.tsx
|
|
134154
|
-
var src_LIMIT_LOG_ROWS=1e3;var src_Logs=function(_ref){var className=_ref.className,projectName=_ref.projectName,runName=_ref.runName,jobSubmissionId=_ref.jobSubmissionId,_useTranslation=src_useTranslation_useTranslation(),t=_useTranslation.t,appliedTheme=src_hooks_useAppSelector(src_selectSystemMode),terminalInstance=(0,src_react.useRef)(new src_xterm.Terminal),fitAddonInstance=(0,src_react.useRef)(new src_addon_fit.FitAddon),_useState=(0,src_react.useState)([]),_useState2=src_slicedToArray_slicedToArray(_useState,2),logsData=_useState2[0],setLogsData=_useState2[1];(0,src_react.useEffect)(function(){terminalInstance.current.options.theme=appliedTheme===src_Mode.Light?{foreground:"#000716",background:"#ffffff"}:{foreground:"#b6bec9",background:"#
|
|
135768
|
+
var src_LIMIT_LOG_ROWS=1e3;var src_Logs=function(_ref){var className=_ref.className,projectName=_ref.projectName,runName=_ref.runName,jobSubmissionId=_ref.jobSubmissionId,_useTranslation=src_useTranslation_useTranslation(),t=_useTranslation.t,appliedTheme=src_hooks_useAppSelector(src_selectSystemMode),terminalInstance=(0,src_react.useRef)(new src_xterm.Terminal),fitAddonInstance=(0,src_react.useRef)(new src_addon_fit.FitAddon),_useState=(0,src_react.useState)([]),_useState2=src_slicedToArray_slicedToArray(_useState,2),logsData=_useState2[0],setLogsData=_useState2[1];(0,src_react.useEffect)(function(){terminalInstance.current.options.theme=appliedTheme===src_Mode.Light?{foreground:"#000716",background:"#ffffff",selectionBackground:"#B4D5FE"}:{foreground:"#b6bec9",background:"#161d26"}},[appliedTheme]),(0,src_react.useEffect)(function(){terminalInstance.current.loadAddon(fitAddonInstance.current);var onResize=function(){fitAddonInstance.current.fit()};return window.addEventListener("resize",onResize),function(){window.removeEventListener("resize",onResize)}},[]);var _useGetProjectLogsQue=src_useGetProjectLogsQuery({project_name:projectName,run_name:runName,descending:!0,job_submission_id:null!==jobSubmissionId&&void 0!==jobSubmissionId?jobSubmissionId:"",limit:src_LIMIT_LOG_ROWS},{skip:!jobSubmissionId}),fetchData=_useGetProjectLogsQue.data,isLoading=_useGetProjectLogsQue.isLoading,isFetchingLogs=_useGetProjectLogsQue.isFetching;return (0,src_react.useEffect)(function(){if(fetchData){var reversed=src_toConsumableArray_toConsumableArray(fetchData).reverse();setLogsData(function(old){return[].concat(src_toConsumableArray_toConsumableArray(reversed),src_toConsumableArray_toConsumableArray(old))})}},[fetchData]),(0,src_react.useEffect)(function(){var element=document.getElementById("terminal");logsData.length&&terminalInstance.current&&element&&(terminalInstance.current.open(element),logsData.forEach(function(logItem){terminalInstance.current.write(logItem.message)}),fitAddonInstance.current.fit())},[logsData]),/*#__PURE__*/src_react.createElement("div",{className:src_classnames_default()(src_Logs_styles_module.logs,className)},/*#__PURE__*/src_react.createElement(src_container_Container,{header:/*#__PURE__*/src_react.createElement(src_components_header_Header,{variant:"h2"},t("projects.run.log"))},/*#__PURE__*/src_react.createElement(src_TextContent,null,/*#__PURE__*/src_react.createElement(src_Loader_Loader,{padding:"n",className:src_classnames_default()(src_Logs_styles_module.loader,{show:isLoading||isFetchingLogs})}),!isLoading&&!logsData.length&&/*#__PURE__*/src_react.createElement(src_ListEmptyMessage_ListEmptyMessage,{title:t("projects.run.log_empty_message_title"),message:t("projects.run.log_empty_message_text")}),/*#__PURE__*/src_react.createElement("div",{className:src_Logs_styles_module.terminal,id:"terminal"}))))};
|
|
134155
135769
|
;// ./src/pages/Runs/Details/Logs/helpers.ts
|
|
134156
135770
|
var src_getJobSubmissionId=function(run){var _lastJob$job_submissi;if(run){var lastJob=run.jobs[run.jobs.length-1];return lastJob?null===(_lastJob$job_submissi=lastJob.job_submissions[lastJob.job_submissions.length-1])||void 0===_lastJob$job_submissi?void 0:_lastJob$job_submissi.id:void 0}};
|
|
134157
135771
|
;// ./src/pages/Runs/Details/RunDetails/styles.module.scss
|
|
134158
135772
|
// extracted by mini-css-extract-plugin
|
|
134159
135773
|
/* harmony default export */ const src_RunDetails_styles_module = ({"logs":"tVvb0"});
|
|
134160
135774
|
;// ./src/pages/Runs/Details/RunDetails/index.tsx
|
|
134161
|
-
var src_RunDetails=function(){var _params$projectName,_params$runId,_runData$run_spec$run,_runData$run_spec,_useTranslation=src_useTranslation_useTranslation(),t=_useTranslation.t,params=src_dist_useParams(),paramProjectName=null!==(_params$projectName=params.projectName)&&void 0!==_params$projectName?_params$projectName:"",paramRunId=null!==(_params$runId=params.runId)&&void 0!==_params$runId?_params$runId:"",_useGetRunQuery=src_useGetRunQuery({project_name:paramProjectName,id:paramRunId}),runData=_useGetRunQuery.data,isLoadingRun=_useGetRunQuery.isLoading,serviceUrl=runData?src_getRunListItemServiceUrl(runData):null;return
|
|
135775
|
+
var src_RunDetails=function(){var _params$projectName,_params$runId,_runData$latest_job_s,_runData$latest_job_s2,_runData$latest_job_s3,_runData$run_spec$run,_runData$run_spec,_useTranslation=src_useTranslation_useTranslation(),t=_useTranslation.t,params=src_dist_useParams(),paramProjectName=null!==(_params$projectName=params.projectName)&&void 0!==_params$projectName?_params$projectName:"",paramRunId=null!==(_params$runId=params.runId)&&void 0!==_params$runId?_params$runId:"",_useGetRunQuery=src_useGetRunQuery({project_name:paramProjectName,id:paramRunId}),runData=_useGetRunQuery.data,isLoadingRun=_useGetRunQuery.isLoading,serviceUrl=runData?src_getRunListItemServiceUrl(runData):null;if(isLoadingRun)return/*#__PURE__*/src_react.createElement(src_container_Container,null,/*#__PURE__*/src_react.createElement(src_Loader_Loader,null));if(!runData)return null;var status=src_finishedRunStatuses.includes(runData.status)?null!==(_runData$latest_job_s=null===(_runData$latest_job_s2=runData.latest_job_submission)||void 0===_runData$latest_job_s2?void 0:_runData$latest_job_s2.status)&&void 0!==_runData$latest_job_s?_runData$latest_job_s:runData.status:runData.status,terminationReason=src_finishedRunStatuses.includes(runData.status)?null===(_runData$latest_job_s3=runData.latest_job_submission)||void 0===_runData$latest_job_s3?void 0:_runData$latest_job_s3.termination_reason:null;return/*#__PURE__*/src_react.createElement(src_react.Fragment,null,/*#__PURE__*/src_react.createElement(src_container_Container,{header:/*#__PURE__*/src_react.createElement(src_components_header_Header,{variant:"h2"},t("common.general"))},/*#__PURE__*/src_react.createElement(src_column_layout_ColumnLayout,{columns:4,variant:"text-grid"},/*#__PURE__*/src_react.createElement("div",null,/*#__PURE__*/src_react.createElement(src_box_Box,{variant:"awsui-key-label"},t("projects.run.project")),/*#__PURE__*/src_react.createElement("div",null,/*#__PURE__*/src_react.createElement(src_NavigateLink_NavigateLink,{href:src_routes_ROUTES.PROJECT.DETAILS.FORMAT(runData.project_name)},runData.project_name))),/*#__PURE__*/src_react.createElement("div",null,/*#__PURE__*/src_react.createElement(src_box_Box,{variant:"awsui-key-label"},t("projects.run.repo")),/*#__PURE__*/src_react.createElement("div",null,(0,src_lodash.get)(runData.run_spec.repo_data,"repo_name",(0,src_lodash.get)(runData.run_spec.repo_data,"repo_dir","-")))),/*#__PURE__*/src_react.createElement("div",null,/*#__PURE__*/src_react.createElement(src_box_Box,{variant:"awsui-key-label"},t("projects.run.hub_user_name")),/*#__PURE__*/src_react.createElement("div",null,/*#__PURE__*/src_react.createElement(src_NavigateLink_NavigateLink,{href:src_routes_ROUTES.USER.DETAILS.FORMAT(runData.user)},runData.user))),/*#__PURE__*/src_react.createElement("div",null,/*#__PURE__*/src_react.createElement(src_box_Box,{variant:"awsui-key-label"},t("projects.run.configuration")),/*#__PURE__*/src_react.createElement("div",null,runData.run_spec.configuration_path)),/*#__PURE__*/src_react.createElement("div",null,/*#__PURE__*/src_react.createElement(src_box_Box,{variant:"awsui-key-label"},t("projects.run.submitted_at")),/*#__PURE__*/src_react.createElement("div",null,src_format_format(new Date(runData.submitted_at),src_consts_DATE_TIME_FORMAT))),/*#__PURE__*/src_react.createElement("div",null,/*#__PURE__*/src_react.createElement(src_box_Box,{variant:"awsui-key-label"},t("projects.run.finished_at")),/*#__PURE__*/src_react.createElement("div",null,runData.terminated_at?src_format_format(new Date(runData.terminated_at),src_consts_DATE_TIME_FORMAT):"-")),/*#__PURE__*/src_react.createElement("div",null,/*#__PURE__*/src_react.createElement(src_box_Box,{variant:"awsui-key-label"},t("projects.run.status")),/*#__PURE__*/src_react.createElement("div",null,/*#__PURE__*/src_react.createElement(src_status_indicator_StatusIndicator,{type:src_getStatusIconType(status,terminationReason),colorOverride:src_getStatusIconColor(status,terminationReason)},src_getRunStatusMessage(runData)))),/*#__PURE__*/src_react.createElement("div",null,/*#__PURE__*/src_react.createElement(src_box_Box,{variant:"awsui-key-label"},t("projects.run.error")),/*#__PURE__*/src_react.createElement("div",null,src_getRunError(runData))),/*#__PURE__*/src_react.createElement("div",null,/*#__PURE__*/src_react.createElement(src_box_Box,{variant:"awsui-key-label"},t("projects.run.priority")),/*#__PURE__*/src_react.createElement("div",null,src_getRunPriority(runData))),/*#__PURE__*/src_react.createElement("div",null,/*#__PURE__*/src_react.createElement(src_box_Box,{variant:"awsui-key-label"},t("projects.run.cost")),/*#__PURE__*/src_react.createElement("div",null,"$",runData.cost)),/*#__PURE__*/src_react.createElement("div",null,/*#__PURE__*/src_react.createElement(src_box_Box,{variant:"awsui-key-label"},t("projects.run.price")),/*#__PURE__*/src_react.createElement("div",null,src_getRunListItemPrice(runData))),/*#__PURE__*/src_react.createElement("div",null,/*#__PURE__*/src_react.createElement(src_box_Box,{variant:"awsui-key-label"},t("projects.run.resources")),/*#__PURE__*/src_react.createElement("div",null,src_getRunListItemResources(runData))),/*#__PURE__*/src_react.createElement("div",null,/*#__PURE__*/src_react.createElement(src_box_Box,{variant:"awsui-key-label"},t("projects.run.region")),/*#__PURE__*/src_react.createElement("div",null,src_getRunListItemRegion(runData))),/*#__PURE__*/src_react.createElement("div",null,/*#__PURE__*/src_react.createElement(src_box_Box,{variant:"awsui-key-label"},t("projects.run.instance_id")),/*#__PURE__*/src_react.createElement("div",null,src_getRunListItemInstanceId(runData))),/*#__PURE__*/src_react.createElement("div",null,/*#__PURE__*/src_react.createElement(src_box_Box,{variant:"awsui-key-label"},t("projects.run.spot")),/*#__PURE__*/src_react.createElement("div",null,src_getRunListItemSpot(runData))),/*#__PURE__*/src_react.createElement("div",null,/*#__PURE__*/src_react.createElement(src_box_Box,{variant:"awsui-key-label"},t("projects.run.backend")),/*#__PURE__*/src_react.createElement("div",null,src_getRunListItemBackend(runData)))),serviceUrl&&/*#__PURE__*/src_react.createElement(src_column_layout_ColumnLayout,{columns:1,variant:"text-grid"},/*#__PURE__*/src_react.createElement("div",null,/*#__PURE__*/src_react.createElement(src_box_Box,{variant:"awsui-key-label"},t("projects.run.service_url")),/*#__PURE__*/src_react.createElement("div",null,/*#__PURE__*/src_react.createElement("a",{href:serviceUrl},serviceUrl))))),1===runData.jobs.length&&/*#__PURE__*/src_react.createElement(src_Logs,{projectName:paramProjectName,runName:null!==(_runData$run_spec$run=null===runData||void 0===runData||null===(_runData$run_spec=runData.run_spec)||void 0===_runData$run_spec?void 0:_runData$run_spec.run_name)&&void 0!==_runData$run_spec$run?_runData$run_spec$run:"",jobSubmissionId:src_getJobSubmissionId(runData),className:src_RunDetails_styles_module.logs}),1<runData.jobs.length&&/*#__PURE__*/src_react.createElement(src_JobList,{projectName:paramProjectName,runId:paramRunId,jobs:runData.jobs,runPriority:src_getRunPriority(runData)}))};
|
|
134162
135776
|
;// ./src/pages/Runs/Details/Jobs/Metrics/consts.ts
|
|
134163
135777
|
var src_consts_second=1e3;var src_minute=60*src_consts_second;var src_hour=60*src_minute;var src_kByte=1024;var src_MByte=1024*src_kByte;var src_GByte=1024*src_MByte;var src_CPU_NUMS="cpus_detected_num";var src_ALL_CPU_USAGE="cpu_usage_percent";var src_MEMORY_WORKING_SET="memory_working_set_bytes";var src_MEMORY_TOTAL="memory_total_bytes";var src_EACH_GPU_USAGE_PREFIX="gpu_util_percent_gpu";var src_EACH_GPU_MEMORY_USAGE_PREFIX="gpu_memory_usage_bytes_gpu";var src_EACH_GPU_MEMORY_TOTAL="gpu_memory_total_bytes";
|
|
134164
135778
|
;// ./src/pages/Runs/Details/Jobs/Metrics/helpers.ts
|
|
@@ -134184,7 +135798,7 @@ var src_Jobs_Details_CodeTab=/*#__PURE__*/function(CodeTab){return CodeTab.Detai
|
|
|
134184
135798
|
;// ./src/pages/User/List/index.tsx
|
|
134185
135799
|
var src_UserList=function(){var _userData$global_role,_useTranslation=src_useTranslation_useTranslation(),t=_useTranslation.t,_useState=(0,src_react.useState)(!1),_useState2=src_slicedToArray_slicedToArray(_useState,2),showDeleteConfirm=_useState2[0],setShowConfirmDelete=_useState2[1],userData=src_hooks_useAppSelector(src_selectUserData),userGlobalRole=null!==(_userData$global_role=null===userData||void 0===userData?void 0:userData.global_role)&&void 0!==_userData$global_role?_userData$global_role:"",_useGetUserListQuery=src_useGetUserListQuery(),isLoading=_useGetUserListQuery.isLoading,isFetching=_useGetUserListQuery.isFetching,data=_useGetUserListQuery.data,refetch=_useGetUserListQuery.refetch,_useDeleteUsersMutati=src_useDeleteUsersMutation(),_useDeleteUsersMutati2=src_slicedToArray_slicedToArray(_useDeleteUsersMutati,2),deleteUsers=_useDeleteUsersMutati2[0],isDeleting=_useDeleteUsersMutati2[1].isLoading,navigate=src_dist_useNavigate(),_useNotifications=src_useNotifications_useNotifications(),_useNotifications2=src_slicedToArray_slicedToArray(_useNotifications,1),pushNotification=_useNotifications2[0],sortedData=(0,src_react.useMemo)(function(){return data?src_toConsumableArray_toConsumableArray(data).sort(function(a,b){return new Date(b.created_at)-new Date(a.created_at)}):[];// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
134186
135800
|
// @ts-ignore
|
|
134187
|
-
},[data]);src_useBreadcrumbs_useBreadcrumbs([{text:t("navigation.account"),href:src_routes_ROUTES.USER.LIST}]);var COLUMN_DEFINITIONS=[{id:"name",header:t("users.user_name"),cell:function(item){return/*#__PURE__*/src_react.createElement(src_NavigateLink_NavigateLink,{href:src_routes_ROUTES.USER.DETAILS.FORMAT(item.username)},item.username)}},{id:"email",header:t("users.email"),cell:function(item){
|
|
135801
|
+
},[data]);src_useBreadcrumbs_useBreadcrumbs([{text:t("navigation.account"),href:src_routes_ROUTES.USER.LIST}]);var COLUMN_DEFINITIONS=[{id:"name",header:t("users.user_name"),cell:function(item){return/*#__PURE__*/src_react.createElement(src_NavigateLink_NavigateLink,{href:src_routes_ROUTES.USER.DETAILS.FORMAT(item.username)},item.username)}},{id:"email",header:t("users.email"),cell:function(item){return item.email?/*#__PURE__*/src_react.createElement(src_components_link,{href:"mailto:".concat(item.email)},item.email):"-"}},{id:"global_role",header:t("users.global_role"),cell:function(item){return t("roles.".concat(item.global_role))}}, false&&0].filter(Boolean),toggleDeleteConfirm=function(){setShowConfirmDelete(function(val){return!val})},addUserHandler=function(){navigate(src_routes_ROUTES.USER.ADD)},_useCollection=src_use_collection_useCollection(sortedData,{filtering:{empty:function(){return/*#__PURE__*/src_react.createElement(src_ListEmptyMessage_ListEmptyMessage,{title:t("users.empty_message_title"),message:t("projects.empty_message_text")},/*#__PURE__*/src_react.createElement(src_Button_Button,{onClick:addUserHandler},t("common.add")))}(),noMatch:function(onClearFilter){return/*#__PURE__*/src_react.createElement(src_ListEmptyMessage_ListEmptyMessage,{title:t("users.nomatch_message_title"),message:t("users.nomatch_message_text")},/*#__PURE__*/src_react.createElement(src_Button_Button,{onClick:onClearFilter},t("common.clearFilter")))}(function(){return actions.setFiltering("")}),filteringFunction:function(user,filteringText){var _user$email;return src_includeSubString(user.username,filteringText)||src_includeSubString(null!==(_user$email=user.email)&&void 0!==_user$email?_user$email:"",filteringText)}},pagination:{pageSize:20},selection:{}}),items=_useCollection.items,actions=_useCollection.actions,filteredItemsCount=_useCollection.filteredItemsCount,collectionProps=_useCollection.collectionProps,filterProps=_useCollection.filterProps,paginationProps=_useCollection.paginationProps,isDisabledDelete=(0,src_react.useMemo)(function(){var _collectionProps$sele;return isDeleting||0===(null===(_collectionProps$sele=collectionProps.selectedItems)||void 0===_collectionProps$sele?void 0:_collectionProps$sele.length)||"admin"!==userGlobalRole},[collectionProps.selectedItems]),isDisabledEdit=(0,src_react.useMemo)(function(){var _collectionProps$sele2;return isDeleting||1!==(null===(_collectionProps$sele2=collectionProps.selectedItems)||void 0===_collectionProps$sele2?void 0:_collectionProps$sele2.length)||"admin"!==userGlobalRole},[collectionProps.selectedItems]);return/*#__PURE__*/src_react.createElement(src_react.Fragment,null,/*#__PURE__*/src_react.createElement(src_table,src_extends_extends({},collectionProps,{variant:"full-page",isItemDisabled:function(){return isDeleting},columnDefinitions:COLUMN_DEFINITIONS,items:items,loading:isLoading||isFetching,loadingText:t("common.loading"),selectionType:"multi",stickyHeader:!0,header:/*#__PURE__*/src_react.createElement(src_components_header_Header,{variant:"awsui-h1-sticky",counter:function(){var _data$length,selectedItems=collectionProps.selectedItems;return null!==data&&void 0!==data&&data.length?null!==selectedItems&&void 0!==selectedItems&&selectedItems.length?"(".concat(null===selectedItems||void 0===selectedItems?void 0:selectedItems.length,"/").concat(null!==(_data$length=null===data||void 0===data?void 0:data.length)&&void 0!==_data$length?_data$length:0,")"):"(".concat(data.length,")"):""}(),actions:/*#__PURE__*/src_react.createElement(src_space_between_SpaceBetween,{size:"xs",direction:"horizontal"},/*#__PURE__*/src_react.createElement(src_Button_Button,{formAction:"none",onClick:function(){var selectedItems=collectionProps.selectedItems;null!==selectedItems&&void 0!==selectedItems&&selectedItems.length&&navigate(src_routes_ROUTES.USER.EDIT.FORMAT(selectedItems[0].username))},disabled:isDisabledEdit},t("common.edit")),/*#__PURE__*/src_react.createElement(src_Button_Button,{formAction:"none",onClick:toggleDeleteConfirm,disabled:isDisabledDelete},t("common.delete")),/*#__PURE__*/src_react.createElement(src_Button_Button,{formAction:"none",onClick:addUserHandler,disabled:"admin"!==userGlobalRole},t("common.add")),/*#__PURE__*/src_react.createElement(src_Button_Button,{iconName:"refresh",disabled:isLoading||isFetching,ariaLabel:t("common.refresh"),onClick:refetch}))},t("users.page_title")),filter:/*#__PURE__*/src_react.createElement(src_text_filter,src_extends_extends({},filterProps,{filteringPlaceholder:t("users.search_placeholder"),countText:t("common.match_count_with_value",{count:filteredItemsCount}),disabled:isLoading})),pagination:/*#__PURE__*/src_react.createElement(src_pagination_Pagination,src_extends_extends({},paginationProps,{disabled:isLoading}))})),/*#__PURE__*/src_react.createElement(src_ConfirmationDialog,{visible:showDeleteConfirm,onDiscard:toggleDeleteConfirm,onConfirm:function(){var selectedItems=collectionProps.selectedItems;null!==selectedItems&&void 0!==selectedItems&&selectedItems.length&&deleteUsers(selectedItems.map(function(user){return user.username})).unwrap().then(function(){return actions.setSelectedItems([])}).catch(function(error){pushNotification({type:"error",content:t("common.server_error",{error:src_serverErrors_getServerError(error)})})}),setShowConfirmDelete(!1)}}))};
|
|
134188
135802
|
;// ./src/pages/User/Details/types.ts
|
|
134189
135803
|
var src_UserDetailsTabTypeEnum=/*#__PURE__*/function(UserDetailsTabTypeEnum){return UserDetailsTabTypeEnum.SETTINGS="settings",UserDetailsTabTypeEnum.PROJECTS="projects",UserDetailsTabTypeEnum.BILLING="billing",UserDetailsTabTypeEnum}({});
|
|
134190
135804
|
;// ./src/components/PermissionGuard/index.tsx
|
|
@@ -134193,7 +135807,7 @@ var src_PermissionGuard_excluded=["children"];var src_PermissionGuard_Permission
|
|
|
134193
135807
|
// extracted by mini-css-extract-plugin
|
|
134194
135808
|
/* harmony default export */ const src_Details_Settings_styles_module = ({"token":"NFFr1"});
|
|
134195
135809
|
;// ./src/pages/User/Details/Settings/index.tsx
|
|
134196
|
-
var src_Settings=function(){var _params$userName,
|
|
135810
|
+
var src_Settings=function(){var _params$userName,_useTranslation=src_useTranslation_useTranslation(),t=_useTranslation.t,userData=src_hooks_useAppSelector(src_selectUserData),params=src_dist_useParams(),paramUserName=null!==(_params$userName=params.userName)&&void 0!==_params$userName?_params$userName:"",navigate=src_dist_useNavigate(),_useGetUserQuery=src_useGetUserQuery({name:paramUserName},{skip:!params.userName}),isLoading=_useGetUserQuery.isLoading,data=_useGetUserQuery.data,_useDeleteUsersMutati=src_useDeleteUsersMutation(),_useDeleteUsersMutati2=src_slicedToArray_slicedToArray(_useDeleteUsersMutati,2),isDeleting=_useDeleteUsersMutati2[1].isLoading,_usePermissionGuard=src_usePermissionGuard({allowedGlobalRoles:[src_types_GlobalUserRole.ADMIN]}),_usePermissionGuard2=src_slicedToArray_slicedToArray(_usePermissionGuard,1),isAvailableDelete=_usePermissionGuard2[0];src_useBreadcrumbs_useBreadcrumbs([{text:t("navigation.account"),href:src_routes_ROUTES.USER.LIST},{text:paramUserName,href:src_routes_ROUTES.USER.DETAILS.FORMAT(paramUserName)}]);return/*#__PURE__*/src_react.createElement("div",null,/*#__PURE__*/src_react.createElement(src_container_Container,{header:/*#__PURE__*/src_react.createElement(src_components_header_Header,{variant:"h2",actions:/*#__PURE__*/src_react.createElement(src_Button_Button,{onClick:function(){navigate(src_routes_ROUTES.USER.EDIT.FORMAT(paramUserName))},disabled:function(){return isDeleting||!isAvailableDelete&&(null===userData||void 0===userData?void 0:userData.username)!==paramUserName}()},t("common.edit"))},t("users.account_settings"))},isLoading&&/*#__PURE__*/src_react.createElement(src_Loader_Loader,null),data&&/*#__PURE__*/src_react.createElement(src_column_layout_ColumnLayout,{columns:2,variant:"text-grid"},/*#__PURE__*/src_react.createElement(src_space_between_SpaceBetween,{size:"l"},/*#__PURE__*/src_react.createElement("div",null,/*#__PURE__*/src_react.createElement(src_box_Box,{variant:"awsui-key-label"},t("users.email")),/*#__PURE__*/src_react.createElement("div",null,data.email?/*#__PURE__*/src_react.createElement(src_components_link,{href:"mailto:".concat(data.email)},data.email):"-")),/*#__PURE__*/src_react.createElement(src_PermissionGuard_PermissionGuard,{allowedGlobalRoles:[src_types_GlobalUserRole.ADMIN]},/*#__PURE__*/src_react.createElement("div",null,/*#__PURE__*/src_react.createElement(src_box_Box,{variant:"awsui-key-label"},t("users.global_role")),/*#__PURE__*/src_react.createElement("div",null,t("roles.".concat(data.global_role))))),/*#__PURE__*/src_react.createElement("div",null,/*#__PURE__*/src_react.createElement(src_box_Box,{variant:"awsui-key-label"},t("users.token")),/*#__PURE__*/src_react.createElement("div",{className:src_Details_Settings_styles_module.token},/*#__PURE__*/src_react.createElement(src_popover,{dismissButton:!1,position:"top",size:"small",triggerType:"custom",content:/*#__PURE__*/src_react.createElement(src_status_indicator_StatusIndicator,{type:"success"},t("users.token_copied"))},/*#__PURE__*/src_react.createElement(src_Button_Button,{formAction:"none",iconName:"copy",variant:"link",onClick:function(){var _data$creds$token;src_copyToClipboard(null!==(_data$creds$token=null===data||void 0===data?void 0:data.creds.token)&&void 0!==_data$creds$token?_data$creds$token:"")}})),/*#__PURE__*/src_react.createElement("div",null,data.creds.token)))))))};
|
|
134197
135811
|
;// ./src/pages/User/Details/Payments/index.tsx
|
|
134198
135812
|
var src_Payments_Payments=function(_ref){var payments=_ref.payments,emptyMessageContent=_ref.emptyMessageContent,isLoading=_ref.isLoading,tableHeaderContent=_ref.tableHeaderContent,_useTranslation=useTranslation(),t=_useTranslation.t,_useCollection=useCollection(payments,{filtering:{empty:function(){return/*#__PURE__*/React.createElement(ListEmptyMessage,{title:t("users.manual_payments.empty_message_title"),message:t("users.manual_payments.empty_message_text")},emptyMessageContent)}()},pagination:{pageSize:20},selection:{}}),items=_useCollection.items,collectionProps=_useCollection.collectionProps,paginationProps=_useCollection.paginationProps,columns=[{id:"value",header:"".concat(t("users.manual_payments.edit.value")),cell:function(item){return"".concat(centsToFormattedString(item.value,"$"))}},{id:"created_at",header:t("users.manual_payments.edit.created_at"),cell:function(item){return format(new Date(item.created_at),DATE_TIME_FORMAT)}},{id:"description",header:"".concat(t("users.manual_payments.edit.description")),cell:function(item){return item.description}}];return/*#__PURE__*/React.createElement(Table,_extends({},collectionProps,{columnDefinitions:columns,items:items,loading:isLoading,loadingText:t("common.loading"),stickyHeader:!0,header:tableHeaderContent,pagination:/*#__PURE__*/React.createElement(Pagination,_extends({},paginationProps,{disabled:isLoading}))}))};
|
|
134199
135813
|
;// ./src/pages/User/Details/CreditsHistory/constants.tsx
|
|
@@ -134208,7 +135822,22 @@ var src_AmountField_AmountField=function(props){return/*#__PURE__*/src_react.cre
|
|
|
134208
135822
|
;// ./src/pages/User/Details/Billing/PayForm/index.tsx
|
|
134209
135823
|
var src_PayForm_MINIMAL_AMOUNT=5;var src_PayForm_PayForm=function(_ref){var defaultValues=_ref.defaultValues,isLoading=_ref.isLoading,onCancel=_ref.onCancel,onSubmitProp=_ref.onSubmit,_useTranslation=useTranslation(),t=_useTranslation.t,_useForm=useForm({defaultValues:defaultValues}),handleSubmit=_useForm.handleSubmit,control=_useForm.control;return/*#__PURE__*/React.createElement("form",{onSubmit:handleSubmit(function(values){onSubmitProp(values)})},/*#__PURE__*/React.createElement(FormUI,{actions:/*#__PURE__*/React.createElement(SpaceBetween,{direction:"horizontal",size:"xs"},/*#__PURE__*/React.createElement(Button,{formAction:"none",disabled:isLoading,variant:"link",onClick:onCancel},t("common.cancel")),/*#__PURE__*/React.createElement(Hotspot,{hotspotId:HotspotIds.PAYMENT_CONTINUE_BUTTON},/*#__PURE__*/React.createElement(Button,{loading:isLoading,disabled:isLoading,variant:"primary"},t("common.continue"))))},/*#__PURE__*/React.createElement(SpaceBetween,{size:"l"},/*#__PURE__*/React.createElement(AmountField,{label:t("billing.payment_amount"),description:t("billing.amount_description",{value:src_PayForm_MINIMAL_AMOUNT.toFixed(2)}),control:control,name:"amount",inputMode:"numeric",step:.01,disabled:isLoading,rules:{required:t("validation.required"),min:{value:src_PayForm_MINIMAL_AMOUNT,message:t("billing.min_amount_error_message",{value:src_PayForm_MINIMAL_AMOUNT})}}}))))};
|
|
134210
135824
|
;// ./src/pages/User/Details/Billing/index.tsx
|
|
134211
|
-
var src_Billing=function(){var _useAppSelector,_params$userName,_data$balance,_data$billing_history,_toFixed,_useTranslation=useTranslation(),t=_useTranslation.t,_useNotifications=useNotifications(),_useNotifications2=_slicedToArray(_useNotifications,1),pushNotification=_useNotifications2[0],_useSearchParams=useSearchParams(),_useSearchParams2=_slicedToArray(_useSearchParams,2),searchParams=_useSearchParams2[0],setSearchParams=_useSearchParams2[1],_useState=useState(!1),_useState2=_slicedToArray(_useState,2),showPaymentModal=_useState2[0],setShowPaymentModal=_useState2[1],userName=null!==(_useAppSelector=useAppSelector(selectUserName))&&void 0!==_useAppSelector?_useAppSelector:"",params=useParams(),paramUserName=null!==(_params$userName=params.userName)&&void 0!==_params$userName?_params$userName:"",_useGetUserBillingInf=useGetUserBillingInfoQuery({username:paramUserName}),data=_useGetUserBillingInf.data,isLoading=_useGetUserBillingInf.isLoading,_useUserBillingChecko=useUserBillingCheckoutSessionMutation(),_useUserBillingChecko2=_slicedToArray(_useUserBillingChecko,2),billingCheckout=_useUserBillingChecko2[0],isLoadingBillingCheckout=_useUserBillingChecko2[1].isLoading
|
|
135825
|
+
var src_Billing=function(){var _useAppSelector,_params$userName,_data$balance,_data$billing_history,_toFixed,_useTranslation=useTranslation(),t=_useTranslation.t,_useNotifications=useNotifications(),_useNotifications2=_slicedToArray(_useNotifications,1),pushNotification=_useNotifications2[0],_useSearchParams=useSearchParams(),_useSearchParams2=_slicedToArray(_useSearchParams,2),searchParams=_useSearchParams2[0],setSearchParams=_useSearchParams2[1],_useState=useState(!1),_useState2=_slicedToArray(_useState,2),showPaymentModal=_useState2[0],setShowPaymentModal=_useState2[1],userName=null!==(_useAppSelector=useAppSelector(selectUserName))&&void 0!==_useAppSelector?_useAppSelector:"",params=useParams(),paramUserName=null!==(_params$userName=params.userName)&&void 0!==_params$userName?_params$userName:"",_useGetUserBillingInf=useGetUserBillingInfoQuery({username:paramUserName}),data=_useGetUserBillingInf.data,isLoading=_useGetUserBillingInf.isLoading,_useUserBillingChecko=useUserBillingCheckoutSessionMutation(),_useUserBillingChecko2=_slicedToArray(_useUserBillingChecko,2),billingCheckout=_useUserBillingChecko2[0],isLoadingBillingCheckout=_useUserBillingChecko2[1].isLoading;// const [billingPortalSession, { isLoading: isLoadingBillingPortalSession }] = useUserBillingPortalSessionMutation();
|
|
135826
|
+
useBreadcrumbs([{text:t("navigation.account"),href:ROUTES.USER.LIST},{text:paramUserName,href:ROUTES.USER.DETAILS.FORMAT(paramUserName)}]),useEffect(function(){"success"===searchParams.get("payment_status")&&(pushNotification({type:"success",content:t("billing.payment_success_message")}),setSearchParams({}))},[]);var closeModal=function(){setShowPaymentModal(!1)};// const editPaymentMethod = () => {
|
|
135827
|
+
// billingPortalSession({
|
|
135828
|
+
// username: paramUserName,
|
|
135829
|
+
// })
|
|
135830
|
+
// .unwrap()
|
|
135831
|
+
// .then((data) => goToUrl(data.url))
|
|
135832
|
+
// .catch((error) => {
|
|
135833
|
+
// pushNotification({
|
|
135834
|
+
// type: 'error',
|
|
135835
|
+
// content: t('common.server_error', { error: getServerError(error) }),
|
|
135836
|
+
// });
|
|
135837
|
+
// })
|
|
135838
|
+
// .finally(closeModal);
|
|
135839
|
+
// };
|
|
135840
|
+
return/*#__PURE__*/React.createElement(SpaceBetween,{size:"l"},/*#__PURE__*/React.createElement(Container,{header:/*#__PURE__*/React.createElement(Header,{variant:"h2"},t("billing.balance"))},isLoading&&/*#__PURE__*/React.createElement(Loader,null),data&&/*#__PURE__*/React.createElement(SpaceBetween,{size:"m"},/*#__PURE__*/React.createElement(Box,{variant:"awsui-value-large"},centsToFormattedString(null!==(_data$balance=null===data||void 0===data?void 0:data.balance)&&void 0!==_data$balance?_data$balance:0,"$")),/*#__PURE__*/React.createElement(SpaceBetween,{direction:"horizontal",size:"m"},userName===paramUserName&&/*#__PURE__*/React.createElement(Hotspot,{renderHotspot:!showPaymentModal,hotspotId:HotspotIds.ADD_TOP_UP_BALANCE},/*#__PURE__*/React.createElement(Button,{formAction:"none",onClick:function(){setShowPaymentModal(!0)}},t("billing.top_up_balance")))))),/*#__PURE__*/React.createElement(Payments,{payments:null!==(_data$billing_history=null===data||void 0===data?void 0:data.billing_history)&&void 0!==_data$billing_history?_data$billing_history:[],isLoading:isLoading,tableHeaderContent:/*#__PURE__*/React.createElement(Header,{variant:"h2"},t("billing.billing_history"))}),/*#__PURE__*/React.createElement(PermissionGuard,{allowedGlobalRoles:[GlobalUserRole.ADMIN]},/*#__PURE__*/React.createElement(CreditsHistory,{username:paramUserName})),showPaymentModal&&/*#__PURE__*/React.createElement(Modal,{onDismiss:closeModal,visible:!0,closeAriaLabel:"Close modal",header:t("billing.top_up_balance")},data&&/*#__PURE__*/React.createElement(PayForm,{isLoading:isLoadingBillingCheckout,onCancel:closeModal,onSubmit:function(_ref){var amount=_ref.amount;billingCheckout({username:paramUserName,// Because the server needs amount value as cents
|
|
134212
135841
|
amount:100*amount}).unwrap().then(function(data){return goToUrl(data.url)}).catch(function(error){pushNotification({type:"error",content:t("common.server_error",{error:getServerError(error)})})}).finally(closeModal)},defaultValues:{// Todo решить с типама формы
|
|
134213
135842
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
134214
135843
|
// @ts-ignore
|
|
@@ -134218,7 +135847,9 @@ var src_UserProjectList=function(){var _params$userName,_useTranslation=src_useT
|
|
|
134218
135847
|
// @ts-ignore
|
|
134219
135848
|
},[data]),_useCollection=src_use_collection_useCollection(filteredData,{filtering:{empty:function(){return/*#__PURE__*/src_react.createElement(src_ListEmptyMessage_ListEmptyMessage,{title:t("projects.empty_message_title"),message:t("projects.empty_message_text")})}()},pagination:{pageSize:20},selection:{}}),items=_useCollection.items,collectionProps=_useCollection.collectionProps,paginationProps=_useCollection.paginationProps,columns=[{id:"project_name",header:"".concat(t("projects.edit.project_name")),cell:function(project){return/*#__PURE__*/src_react.createElement(src_NavigateLink_NavigateLink,{href:src_routes_ROUTES.PROJECT.DETAILS.FORMAT(project.project_name)},project.project_name)}}];return/*#__PURE__*/src_react.createElement(src_table,src_extends_extends({},collectionProps,{columnDefinitions:columns,items:items,loading:isLoading||isFetching,loadingText:t("common.loading"),pagination:/*#__PURE__*/src_react.createElement(src_pagination_Pagination,src_extends_extends({},paginationProps,{disabled:isLoading}))}))};
|
|
134220
135849
|
;// ./src/pages/User/Details/index.tsx
|
|
134221
|
-
|
|
135850
|
+
// import { GlobalUserRole } from '../../../types';
|
|
135851
|
+
var src_UserDetails=function(){var _params$userName,_useTranslation=src_useTranslation_useTranslation(),t=_useTranslation.t,_useState=(0,src_react.useState)(!1),_useState2=src_slicedToArray_slicedToArray(_useState,2),showDeleteConfirm=_useState2[0],setShowConfirmDelete=_useState2[1],params=src_dist_useParams(),paramUserName=null!==(_params$userName=params.userName)&&void 0!==_params$userName?_params$userName:"",navigate=src_dist_useNavigate(),_useGetUserQuery=src_useGetUserQuery({name:paramUserName}),userError=_useGetUserQuery.error,_useDeleteUsersMutati=src_useDeleteUsersMutation(),_useDeleteUsersMutati2=src_slicedToArray_slicedToArray(_useDeleteUsersMutati,1),deleteUsers/*, { isLoading: isDeleting }*/=_useDeleteUsersMutati2[0],_useNotifications=src_useNotifications_useNotifications(),_useNotifications2=src_slicedToArray_slicedToArray(_useNotifications,1),pushNotification=_useNotifications2[0];// const [isAvailableDeleteUser] = usePermissionGuard({ allowedGlobalRoles: [GlobalUserRole.ADMIN] });
|
|
135852
|
+
(0,src_react.useEffect)(function(){404===(null===userError||void 0===userError?void 0:userError.status)&&src_riseRouterException()},[userError]);var tabs=[{label:t("users.settings"),id:src_UserDetailsTabTypeEnum.SETTINGS,href:src_routes_ROUTES.USER.DETAILS.FORMAT(paramUserName)},{label:t("users.projects"),id:src_UserDetailsTabTypeEnum.PROJECTS,href:src_routes_ROUTES.USER.PROJECTS.FORMAT(paramUserName)}, false&&0].filter(Boolean);return/*#__PURE__*/src_react.createElement(src_react.Fragment,null,/*#__PURE__*/src_react.createElement(src_ContentLayout,{header:/*#__PURE__*/src_react.createElement(src_DetailsHeader,{title:paramUserName// deleteAction={isAvailableDeleteUser ? toggleDeleteConfirm : undefined}
|
|
134222
135853
|
// deleteDisabled={isDeleting}
|
|
134223
135854
|
})},/*#__PURE__*/src_react.createElement(src_space_between_SpaceBetween,{size:"l"},/*#__PURE__*/src_react.createElement("div",null),/*#__PURE__*/src_react.createElement("div",null),/*#__PURE__*/src_react.createElement(src_Tabs_Tabs,{withNavigation:!0,tabs:tabs}),/*#__PURE__*/src_react.createElement(src_Outlet,null))),/*#__PURE__*/src_react.createElement(src_ConfirmationDialog,{visible:showDeleteConfirm,onDiscard:function(){setShowConfirmDelete(function(val){return!val})},onConfirm:function(){deleteUsers([paramUserName]).unwrap().then(function(){return navigate(src_routes_ROUTES.USER.LIST)}).catch(function(error){pushNotification({type:"error",content:t("common.server_error",{error:src_serverErrors_getServerError(error)})})}),setShowConfirmDelete(!1)}}))};
|
|
134224
135855
|
;// ./src/pages/User/Form/index.tsx
|
|
@@ -134242,7 +135873,7 @@ var src_User=function(){return null};
|
|
|
134242
135873
|
// extracted by mini-css-extract-plugin
|
|
134243
135874
|
/* harmony default export */ const src_JobDetails_styles_module = ({"details":"OBVS0","logs":"mMHsi"});
|
|
134244
135875
|
;// ./src/pages/Runs/Details/Jobs/Details/JobDetails/index.tsx
|
|
134245
|
-
var src_JobDetails_getJobSubmissionId=function(job){var _job$job_submissions;return job?null===(_job$job_submissions=job.job_submissions[job.job_submissions.length-1])||void 0===_job$job_submissions?void 0:_job$job_submissions.id:void 0};var src_JobDetails=function(){var _params$projectName,_params$runId,_params$jobName,_runData$run_spec$run,_runData$run_spec,_useTranslation=src_useTranslation_useTranslation(),t=_useTranslation.t,params=src_dist_useParams(),paramProjectName=null!==(_params$projectName=params.projectName)&&void 0!==_params$projectName?_params$projectName:"",paramRunId=null!==(_params$runId=params.runId)&&void 0!==_params$runId?_params$runId:"",paramJobName=null!==(_params$jobName=params.jobName)&&void 0!==_params$jobName?_params$jobName:"",_useGetRunQuery=src_useGetRunQuery({project_name:paramProjectName,id:paramRunId}),runData=_useGetRunQuery.data,isLoadingRun=_useGetRunQuery.isLoading,jobData=(0,src_react.useMemo)(function(){var _runData$jobs$find;return runData?null!==(_runData$jobs$find=runData.jobs.find(function(job){return job.job_spec.job_name===paramJobName}))&&void 0!==_runData$jobs$find?_runData$jobs$find:null:null},[runData]);return isLoadingRun?/*#__PURE__*/src_react.createElement(src_container_Container,null,/*#__PURE__*/src_react.createElement(src_Loader_Loader,null)):jobData?/*#__PURE__*/src_react.createElement("div",{className:src_JobDetails_styles_module.details},/*#__PURE__*/src_react.createElement(src_container_Container,{header:/*#__PURE__*/src_react.createElement(src_components_header_Header,{variant:"h2"},t("common.general"))},/*#__PURE__*/src_react.createElement(src_column_layout_ColumnLayout,{columns:4,variant:"text-grid"},/*#__PURE__*/src_react.createElement("div",null,/*#__PURE__*/src_react.createElement(src_box_Box,{variant:"awsui-key-label"},t("projects.run.submitted_at")),/*#__PURE__*/src_react.createElement("div",null,src_getJobSubmittedAt(jobData))),/*#__PURE__*/src_react.createElement("div",null,/*#__PURE__*/src_react.createElement(src_box_Box,{variant:"awsui-key-label"},t("projects.run.status")),/*#__PURE__*/src_react.createElement("div",null,/*#__PURE__*/src_react.createElement(src_status_indicator_StatusIndicator,{type:src_getStatusIconType(src_getJobStatus(jobData))},
|
|
135876
|
+
var src_JobDetails_getJobSubmissionId=function(job){var _job$job_submissions;return job?null===(_job$job_submissions=job.job_submissions[job.job_submissions.length-1])||void 0===_job$job_submissions?void 0:_job$job_submissions.id:void 0};var src_JobDetails=function(){var _params$projectName,_params$runId,_params$jobName,_runData$run_spec$run,_runData$run_spec,_useTranslation=src_useTranslation_useTranslation(),t=_useTranslation.t,params=src_dist_useParams(),paramProjectName=null!==(_params$projectName=params.projectName)&&void 0!==_params$projectName?_params$projectName:"",paramRunId=null!==(_params$runId=params.runId)&&void 0!==_params$runId?_params$runId:"",paramJobName=null!==(_params$jobName=params.jobName)&&void 0!==_params$jobName?_params$jobName:"",_useGetRunQuery=src_useGetRunQuery({project_name:paramProjectName,id:paramRunId}),runData=_useGetRunQuery.data,isLoadingRun=_useGetRunQuery.isLoading,jobData=(0,src_react.useMemo)(function(){var _runData$jobs$find;return runData?null!==(_runData$jobs$find=runData.jobs.find(function(job){return job.job_spec.job_name===paramJobName}))&&void 0!==_runData$jobs$find?_runData$jobs$find:null:null},[runData]);return isLoadingRun?/*#__PURE__*/src_react.createElement(src_container_Container,null,/*#__PURE__*/src_react.createElement(src_Loader_Loader,null)):jobData?/*#__PURE__*/src_react.createElement("div",{className:src_JobDetails_styles_module.details},/*#__PURE__*/src_react.createElement(src_container_Container,{header:/*#__PURE__*/src_react.createElement(src_components_header_Header,{variant:"h2"},t("common.general"))},/*#__PURE__*/src_react.createElement(src_column_layout_ColumnLayout,{columns:4,variant:"text-grid"},/*#__PURE__*/src_react.createElement("div",null,/*#__PURE__*/src_react.createElement(src_box_Box,{variant:"awsui-key-label"},t("projects.run.submitted_at")),/*#__PURE__*/src_react.createElement("div",null,src_getJobSubmittedAt(jobData))),/*#__PURE__*/src_react.createElement("div",null,/*#__PURE__*/src_react.createElement(src_box_Box,{variant:"awsui-key-label"},t("projects.run.status")),/*#__PURE__*/src_react.createElement("div",null,/*#__PURE__*/src_react.createElement(src_status_indicator_StatusIndicator,{type:src_getStatusIconType(src_getJobStatus(jobData),src_getJobTerminationReason(jobData))},src_getJobStatusMessage(jobData)))),/*#__PURE__*/src_react.createElement("div",null,/*#__PURE__*/src_react.createElement(src_box_Box,{variant:"awsui-key-label"},t("projects.run.error")),/*#__PURE__*/src_react.createElement("div",null,src_getJobError(jobData))),/*#__PURE__*/src_react.createElement("div",null,/*#__PURE__*/src_react.createElement(src_box_Box,{variant:"awsui-key-label"},t("projects.run.backend")),/*#__PURE__*/src_react.createElement("div",null,src_getJobListItemBackend(jobData))),/*#__PURE__*/src_react.createElement("div",null,/*#__PURE__*/src_react.createElement(src_box_Box,{variant:"awsui-key-label"},t("projects.run.region")),/*#__PURE__*/src_react.createElement("div",null,src_getJobListItemRegion(jobData))),/*#__PURE__*/src_react.createElement("div",null,/*#__PURE__*/src_react.createElement(src_box_Box,{variant:"awsui-key-label"},t("projects.run.instance")),/*#__PURE__*/src_react.createElement("div",null,src_getJobListItemInstance(jobData))),/*#__PURE__*/src_react.createElement("div",null,/*#__PURE__*/src_react.createElement(src_box_Box,{variant:"awsui-key-label"},t("projects.run.resources")),/*#__PURE__*/src_react.createElement("div",null,src_getJobListItemResources(jobData))),/*#__PURE__*/src_react.createElement("div",null,/*#__PURE__*/src_react.createElement(src_box_Box,{variant:"awsui-key-label"},t("projects.run.spot")),/*#__PURE__*/src_react.createElement("div",null,src_getJobListItemSpot(jobData))),/*#__PURE__*/src_react.createElement("div",null,/*#__PURE__*/src_react.createElement(src_box_Box,{variant:"awsui-key-label"},t("projects.run.price")),/*#__PURE__*/src_react.createElement("div",null,src_getJobListItemPrice(jobData))))),/*#__PURE__*/src_react.createElement(src_Logs,{projectName:paramProjectName,runName:null!==(_runData$run_spec$run=null===runData||void 0===runData||null===(_runData$run_spec=runData.run_spec)||void 0===_runData$run_spec?void 0:_runData$run_spec.run_name)&&void 0!==_runData$run_spec$run?_runData$run_spec$run:"",jobSubmissionId:src_JobDetails_getJobSubmissionId(jobData),className:src_JobDetails_styles_module.logs})):null};
|
|
134246
135877
|
;// ./src/services/volume.ts
|
|
134247
135878
|
var src_volumeApi=src_rtk_query_react_esm_createApi({reducerPath:"volumeApi",baseQuery:src_fetchBaseQuery({prepareHeaders:src_fetchBaseQueryHeaders}),tagTypes:["Volumes"],endpoints:function(builder){return{getAllVolumes:builder.query({query:function(body){return{url:src_API.VOLUME.LIST(),method:"POST",body:body}},providesTags:function(result){return result?[].concat(src_toConsumableArray_toConsumableArray(result.map(function(_ref){var id=_ref.id;return{type:"Volumes",id:id}})),["Volumes"]):["Volumes"]}}),deleteVolumes:builder.mutation({query:function(_ref2){var project_name=_ref2.project_name,names=_ref2.names;return{url:src_API.PROJECTS.VOLUMES_DELETE(project_name),method:"POST",body:{names:names}}},invalidatesTags:function(){return["Volumes"]}})}}});var src_useLazyGetAllVolumesQuery=src_volumeApi.useLazyGetAllVolumesQuery,src_useDeleteVolumesMutation=src_volumeApi.useDeleteVolumesMutation;
|
|
134248
135879
|
;// ./src/libs/volumes.ts
|
|
@@ -136468,7 +138099,7 @@ const src_i18next_loadLanguages = src_instance.loadLanguages;
|
|
|
136468
138099
|
|
|
136469
138100
|
|
|
136470
138101
|
;// ./src/locale/en.json
|
|
136471
|
-
const src_en_namespaceObject = /*#__PURE__*/JSON.parse('{"dstack":"Dstack","common":{"loading":"Loading","add":"Add","yes":"Yes","no":"No","create":"Create {{text}}","edit":"Edit","delete":"Delete","remove":"Remove","apply":"Apply","settings":"Settings","match_count_with_value_one":"{{count}} match","match_count_with_value_other":"{{count}} matches","nomatch_message_title":"No matches","nomatch_message_text":"We can\'t find a match.","sign_out":"Sign out","cancel":"Cancel","save":"Save","send":"Send","profile":"Profile","copied":"Copied","copy":"Copy","info":"Info","stop":"Stop","abort":"Abort","close":"Close","clearFilter":"Clear filter","server_error":"Server error: {{error}}","login":"Sign in","login_github":"Sign in with GitHub","login_okta":"Sign in with Okta","login_entra":"Sign in with EntraID","general":"General","test":"Test","local_storage_unavailable":"Local Storage is unavailable","local_storage_unavailable_message":"Your browser doesn\'t support local storage","object":"Object","objects_other":"Objects","continue":"Continue","select_visible_columns":"Select visible columns","tutorial":"Tutorials","tutorial_other":"Tour","docs":"Docs","discord":"Discord","danger_zone":"Danger Zone","control_plane":"Control plane","refresh":"Refresh"},"auth":{"invalid_token":"Invalid token","you_are_not_logged_in":"You are not logged in","contact_to_administrator":"For getting the authorization token, contact to the administrator","sign_in_to_dstack":"Welcome to dstack Sky","sign_in_to_dstack_enterprise":"Welcome to dstack","authorization_failed":"Authorization is failed","try_again":"Please try again","login_by_token":"Sign in via a token","another_login_methods":"Other sign in options"},"navigation":{"settings":"Settings","runs":"Runs","models":"Models","fleets":"Fleets","project":"Project","project_other":"Projects","general":"General","users":"Users","user_settings":"User settings","account":"User","billing":"Billing","resources":"Resources","volumes":"Volumes","instances":"Instances"},"backend":{"page_title_one":"Backend","page_title_other":"Backends","add_backend":"Add backend","edit_backend":"Edit backend","empty_message_title":"No backends","empty_message_text":"No backends to display.","type":{"aws":"AWS","aws_description":"Run workflows and store data in Amazon Web Services ","gcp":"GCP","gcp_description":"Run workflows and store data in Google Cloud Platform","azure":"Azure","azure_description":"Run workflows and store data in Microsoft Azure","lambda":"Lambda","lambda_description":"Run workflows and store data in Lambda","local":"Local","local_description":"Run workflows and store data locally via Docker"},"table":{"region":"Region","bucket":"Storage"},"edit":{"success_notification":"Project updating is successful","delete_backend_confirm_title":"Delete backend","delete_backend_confirm_message":"Are you sure you want to delete this backend?","delete_backends_confirm_title":"Delete backends","delete_backends_confirm_message":"Are you sure you want to delete these backends?"},"create":{"success_notification":"Backend is created"}},"gateway":{"page_title_one":"Gateway","page_title_other":"Gateways","add_gateway":"Add gateway","edit_gateway":"Edit gateway","empty_message_title":"No gateways","empty_message_text":"No gateways to display.","edit":{"backend":"Backend","backend_description":"Select a backend","region":"Region","region_description":"Select a region","default":"Default","default_checkbox":"Turn on default","external_ip":"External IP","wildcard_domain":"Wildcard domain","wildcard_domain_description":"Specify the wildcard domain mapped to the external IP.","wildcard_domain_placeholder":"*.mydomain.com","delete_gateway_confirm_title":"Delete gateway","delete_gateway_confirm_message":"Are you sure you want to delete this gateway?","delete_gateways_confirm_title":"Delete gateways","delete_gateways_confirm_message":"Are you sure you want to delete these gateways?","validation":{"wildcard_domain_format":"Should use next format: {{pattern}}"}},"create":{"success_notification":"Gateway is created","creating_notification":"The gateway is creating. It may take some time"},"update":{"success_notification":"Gateway is updated"},"test_domain":{"success_notification":"Domain is valid"}},"projects":{"page_title":"Projects","search_placeholder":"Find projects","empty_message_title":"No projects","empty_message_text":"No projects to display.","nomatch_message_title":"No matches","nomatch_message_text":"We can\'t find a match.","nomatch_message_button_label":"Clear filter","repositories":"Repositories","runs":"Runs","tags":"Tags","settings":"Settings","card":{"backend":"Backend","settings":"Settings"},"edit":{"general":"General","project_name":"Project name","owner":"Owner","project_name_description":"Only latin characters, dashes, underscores, and digits","backend":"Backend","backend_config":"Backend config","backend_config_description":"Specify the backend config in the YAML format. Click Info for examples.","backend_type":"Type","backend_type_description":"Select a backend type","members_empty_message_title":"No members","members_empty_message_text":"Select project\'s members","update_members_success":"Members are updated","delete_project_confirm_title":"Delete project","delete_project_confirm_message":"Are you sure you want to delete this project?","delete_projects_confirm_title":"Delete projects","delete_projects_confirm_message":"Are you sure you want to delete these projects?","delete_this_project":"Delete this project","cli":"CLI","aws":{"authorization":"Authorization","authorization_default":"Default credentials","authorization_access_key":"Access key","access_key":"Access key","access_key_id":"Access key ID","access_key_id_description":"Specify the AWS access key ID","secret_key":"Secret key","secret_key_id":"Secret access key","secret_key_id_description":"Specify the AWS secret access key","regions":"Regions","regions_description":"Select regions to run workflows and store artifacts","regions_placeholder":"Select regions","s3_bucket_name":"Bucket","s3_bucket_name_description":"Select an S3 bucket to store artifacts","ec2_subnet_id":"Subnet","ec2_subnet_id_description":"Select a subnet to run workflows in","ec2_subnet_id_placeholder":"Not selected","vpc_name":"VPC","vpc_name_description":"Enter a vpc"},"azure":{"authorization":"Authorization","authorization_default":"Default credentials","authorization_client":"Client secret","tenant_id":"Tenant ID","tenant_id_description":"Specify an Azure tenant ID","tenant_id_placeholder":"Not selected","client_id":"Client ID","client_id_description":"Specify an Azure client (application) ID","client_secret":"Client secret","client_secret_description":"Specify an Azure client (application) secret","subscription_id":"Subscription ID","subscription_id_description":"Select an Azure subscription ID","subscription_id_placeholder":"Not selected","locations":"Locations","locations_description":"Select locations to run workflows","locations_placeholder":"Select locations","storage_account":"Storage account","storage_account_description":"Select an Azure storage account to store artifacts","storage_account_placeholder":"Not selected"},"gcp":{"authorization":"Authorization","authorization_default":"Default credentials","service_account":"Service account key","credentials_description":"Credentials description","credentials_placeholder":"Credentials placeholder","regions":"Regions","regions_description":"Select regions to run workflows and store artifacts","regions_placeholder":"Select regions","project_id":"Project Id","project_id_description":"Select a project id","project_id_placeholder":"Select a project Id"},"lambda":{"api_key":"API key","api_key_description":"Specify the Lambda API key","regions":"Regions","regions_description":"Select regions to run workflows","regions_placeholder":"Select regions","storage_backend":{"type":"Storage","type_description":"Select backend storage","type_placeholder":"Select type","credentials":{"access_key_id":"Access key ID","access_key_id_description":"Specify the AWS access key ID","secret_key_id":"Secret access key","secret_key_id_description":"Specify the AWS secret access key"},"s3_bucket_name":"Bucket","s3_bucket_name_description":"Select an S3 bucket to store artifacts"}},"local":{"path":"Files path"},"members":{"section_title":"Members","name":"User name","role":"Project role"},"error_notification":"Update project error","validation":{"user_name_format":"Only letters, numbers, - or _"}},"create":{"page_title":"Create project","error_notification":"Create project error","success_notification":"Project is created"},"repo":{"search_placeholder":"Find repositories","empty_message_title":"No repositories","empty_message_text":"No repositories to display.","nomatch_message_title":"No matches","nomatch_message_text":"We can\'t find a match.","card":{"owner":"Owner","last_run":"Last run","tags_count":"Tags count","directory":"Directory"},"secrets":{"table_title":"Secrets","add_modal_title":"Add secret","update_modal_title":"Update secret","name":"Secret name","name_description":"Secret name","value":"Secret value","value_description":"Secret value","search_placeholder":"Find secrets","empty_message_title":"No secrets","empty_message_text":"No secrets to display."}},"run":{"list_page_title":"Runs","search_placeholder":"Find runs","empty_message_title":"No runs","empty_message_text":"No runs to display.","nomatch_message_title":"No matches","nomatch_message_text":"We can\'t find a match. Try to change project or clear filter","project":"Project","project_placeholder":"Filtering by project","repo":"Repository","repo_placeholder":"Filtering by repository","user":"User","user_placeholder":"Filtering by user","active_only":"Active runs","log":"Logs","log_empty_message_title":"No logs","log_empty_message_text":"No logs to display.","run_name":"Name","workflow_name":"Workflow","configuration":"Configuration","instance":"Instance","provider_name":"Provider","status":"Status","submitted_at":"Submitted","finished_at":"Finished","metrics":{"title":"Metrics","show_metrics":"Show metrics","cpu_utilization":"CPU utilization %","memory_used":"System memory used","per_each_cpu_utilization":"GPU utilization %","per_each_memory_used":"GPU memory used"},"jobs":"Jobs","job_name":"Job Name","cost":"Cost","backend":"Backend","region":"Region","instance_id":"Instance ID","resources":"Resources","spot":"Spot","termination_reason":"Termination reason","price":"Price","error":"Error","artifacts":"Artifacts","artifacts_count":"Artifacts","hub_user_name":"User","service_url":"Service URL","statuses":{"pending":"Pending","submitted":"Submitted","provisioning":"Provisioning","pulling":"Pulling","downloading":"Downloading","running":"Running","uploading":"Uploading","stopping":"Stopping","stopped":"Stopped","terminating":"Terminating","terminated":"Terminated","aborting":"Aborting","aborted":"Aborted","failed":"Failed","done":"Done","building":"Building"}},"tag":{"list_page_title":"Artifacts","search_placeholder":"Find tags","empty_message_title":"No tags","empty_message_text":"No tags to display.","tag_name":"Tag","run_name":"Run","artifacts":"Files"},"artifact":{"list_page_title":"Artifacts","search_placeholder":"Find objects","empty_message_title":"No objects","empty_message_text":"No objects to display.","nomatch_message_title":"No matches","nomatch_message_text":"We can\'t find a match.","name":"Name","type":"Type","size":"Size"}},"models":{"model_name":"Name","url":"URL","gateway":"Gateway","type":"Type","run":"Run","resources":"Resources","price":"Price","submitted_at":"Submitted","user":"User","repository":"Repository","backend":"Backend","code":"Code","empty_message_title":"No models","empty_message_text":"No models to display.","nomatch_message_title":"No matches","nomatch_message_text":"We can\'t find a match.","nomatch_message_button_label":"Clear filter","details":{"instructions":"System","instructions_description":"Specify system","message_placeholder":"Enter your question","chat_empty_title":"No messages yet","chat_empty_message":"Please start a chat","run_name":"Run name","view_code":"View code","view_code_description":"You can use the following code to start integrating your current prompt and settings into your application."}},"fleets":{"fleet":"Fleet","fleet_placeholder":"Filtering by fleet","fleet_name":"Fleet name","total_instances":"Number of instances","empty_message_title":"No fleets","empty_message_text":"No fleets to display.","nomatch_message_title":"No matches","nomatch_message_text":"We can\'t find a match.","nomatch_message_button_label":"Clear filter","active_only":"Active fleets","statuses":{"active":"Active","submitted":"Submitted","failed":"Failed","terminating":"Terminating","terminated":"Terminated"},"instances":{"active_only":"Active instances","title":"Instances","empty_message_title":"No instances","empty_message_text":"No instances to display.","nomatch_message_title":"No matches","nomatch_message_text":"We can\'t find a match.","instance_name":"Instance","instance_num":"Instance num","created":"Created","status":"Status","project":"Project","hostname":"Host name","instance_type":"Type","statuses":{"pending":"Pending","provisioning":"Provisioning","idle":"Idle","busy":"Busy","terminating":"Terminating","terminated":"Terminated"},"resources":"Resources","backend":"Backend","region":"Region","spot":"Spot","started":"Started","price":"Price"}},"volume":{"volumes":"Volumes","empty_message_title":"No volumes","empty_message_text":"No volumes to display.","nomatch_message_title":"No matches","nomatch_message_text":"We can\'t find a match.","delete_volumes_confirm_title":"Delete volumes","delete_volumes_confirm_message":"Are you sure you want to delete these volumes?","active_only":"Active volumes","name":"Name","project":"Project name","region":"Region","backend":"Backend","status":"Status","created":"Created","finished":"Finished","price":"Price (per month)","cost":"Cost","statuses":{"failed":"Failed","submitted":"Submitted","provisioning":"Provisioning","active":"Active","deleted":"Deleted"}},"users":{"page_title":"Users","search_placeholder":"Find members","empty_message_title":"No members","empty_message_text":"No members to display.","nomatch_message_title":"No matches","nomatch_message_text":"We can\'t find a match.","user_name":"User name","user_name_description":"Only latin characters, dashes, underscores, and digits","global_role_description":"Whether the user is an administrator or not","email_description":"Enter user email","token":"Token","token_description":"Specify use your personal access token","global_role":"Global role","active":"Active","active_description":"Specify user activation","activated":"Activated","deactivated":"Deactivated","email":"Email","created_at":"Created at","account":"User","account_settings":"User settings","settings":"Settings","projects":"Projects","create":{"page_title":"Create user","error_notification":"Create user error","success_notification":"User is created"},"edit":{"error_notification":"Update user error","success_notification":"User updating is successful","refresh_token_success_notification":"Token rotating is successful","refresh_token_error_notification":"Token rotating error","refresh_token_confirm_title":"Rotate token","refresh_token_confirm_message":"Are you sure you want to rotate token?","refresh_token_button_label":"Rotate","validation":{"user_name_format":"Only letters, numbers, - or _","email_format":"Incorrect email"}},"manual_payments":{"title":"Credits history","add_payment":"Add payment","empty_message_title":"No payments","empty_message_text":"No payments to display.","create":{"success_notification":"Payment creating is successful"},"edit":{"value":"Amount","value_description":"Enter amount here","description":"Description","description_description":"Describe payment here","created_at":"Created at"}},"token_copied":"Token copied"},"billing":{"title":"Billing","balance":"Balance","billing_history":"Billing history","payment_method":"Payment method","no_payment_method":"No payment method attached","top_up_balance":"Top up balance","edit_payment_method":"Edit payment method","payment_amount":"Payment amount","amount_description":"Minimum: ${{value}}","make_payment":"Make a payment","min_amount_error_message":"The amount is allowed to be more than {{value}}","payment_success_message":"Payment succeeded. There can be a short delay before the balance is updated."},"validation":{"required":"This is required field"},"users_autosuggest":{"placeholder":"Enter username or email to add member","entered_text":"Add member","loading":"Loading users","no_match":"No matches found"},"roles":{"admin":"Admin","manager":"Manager","user":"User"},"confirm_dialog":{"title":"Confirm delete","message":"Are you sure you want to delete?"}}');
|
|
138102
|
+
const src_en_namespaceObject = /*#__PURE__*/JSON.parse('{"dstack":"Dstack","common":{"loading":"Loading","add":"Add","yes":"Yes","no":"No","create":"Create {{text}}","edit":"Edit","delete":"Delete","remove":"Remove","apply":"Apply","settings":"Settings","match_count_with_value_one":"{{count}} match","match_count_with_value_other":"{{count}} matches","nomatch_message_title":"No matches","nomatch_message_text":"We can\'t find a match.","sign_out":"Sign out","cancel":"Cancel","save":"Save","send":"Send","profile":"Profile","copied":"Copied","copy":"Copy","info":"Info","stop":"Stop","abort":"Abort","close":"Close","clearFilter":"Clear filter","server_error":"Server error: {{error}}","login":"Sign in","login_github":"Sign in with GitHub","login_okta":"Sign in with Okta","login_entra":"Sign in with EntraID","general":"General","test":"Test","local_storage_unavailable":"Local Storage is unavailable","local_storage_unavailable_message":"Your browser doesn\'t support local storage","object":"Object","objects_other":"Objects","continue":"Continue","select_visible_columns":"Select visible columns","tutorial":"Tutorials","tutorial_other":"Tour","docs":"Docs","discord":"Discord","danger_zone":"Danger Zone","control_plane":"Control plane","refresh":"Refresh","quickstart":"Quickstart"},"auth":{"invalid_token":"Invalid token","you_are_not_logged_in":"You are not logged in","contact_to_administrator":"For getting the authorization token, contact to the administrator","sign_in_to_dstack":"Welcome to dstack Sky","sign_in_to_dstack_enterprise":"Welcome to dstack","authorization_failed":"Authorization is failed","try_again":"Please try again","login_by_token":"Sign in via a token","another_login_methods":"Other sign in options"},"navigation":{"settings":"Settings","runs":"Runs","models":"Models","fleets":"Fleets","project":"Project","project_other":"Projects","general":"General","users":"Users","user_settings":"User settings","account":"User","billing":"Billing","resources":"Resources","volumes":"Volumes","instances":"Instances"},"backend":{"page_title_one":"Backend","page_title_other":"Backends","add_backend":"Add backend","edit_backend":"Edit backend","empty_message_title":"No backends","empty_message_text":"No backends to display.","type":{"aws":"AWS","aws_description":"Run workflows and store data in Amazon Web Services ","gcp":"GCP","gcp_description":"Run workflows and store data in Google Cloud Platform","azure":"Azure","azure_description":"Run workflows and store data in Microsoft Azure","lambda":"Lambda","lambda_description":"Run workflows and store data in Lambda","local":"Local","local_description":"Run workflows and store data locally via Docker"},"table":{"region":"Region","bucket":"Storage"},"edit":{"success_notification":"Project updating is successful","delete_backend_confirm_title":"Delete backend","delete_backend_confirm_message":"Are you sure you want to delete this backend?","delete_backends_confirm_title":"Delete backends","delete_backends_confirm_message":"Are you sure you want to delete these backends?"},"create":{"success_notification":"Backend is created"}},"gateway":{"page_title_one":"Gateway","page_title_other":"Gateways","add_gateway":"Add gateway","edit_gateway":"Edit gateway","empty_message_title":"No gateways","empty_message_text":"No gateways to display.","edit":{"backend":"Backend","backend_description":"Select a backend","region":"Region","region_description":"Select a region","default":"Default","default_checkbox":"Turn on default","external_ip":"External IP","wildcard_domain":"Wildcard domain","wildcard_domain_description":"Specify the wildcard domain mapped to the external IP.","wildcard_domain_placeholder":"*.mydomain.com","delete_gateway_confirm_title":"Delete gateway","delete_gateway_confirm_message":"Are you sure you want to delete this gateway?","delete_gateways_confirm_title":"Delete gateways","delete_gateways_confirm_message":"Are you sure you want to delete these gateways?","validation":{"wildcard_domain_format":"Should use next format: {{pattern}}"}},"create":{"success_notification":"Gateway is created","creating_notification":"The gateway is creating. It may take some time"},"update":{"success_notification":"Gateway is updated"},"test_domain":{"success_notification":"Domain is valid"}},"projects":{"page_title":"Projects","search_placeholder":"Find projects","empty_message_title":"No projects","empty_message_text":"No projects to display.","nomatch_message_title":"No matches","nomatch_message_text":"We can\'t find a match.","nomatch_message_button_label":"Clear filter","repositories":"Repositories","runs":"Runs","tags":"Tags","settings":"Settings","card":{"backend":"Backend","settings":"Settings"},"edit":{"general":"General","project_name":"Project name","owner":"Owner","project_name_description":"Only latin characters, dashes, underscores, and digits","backend":"Backend","backend_config":"Backend config","backend_config_description":"Specify the backend config in the YAML format. Click Info for examples.","backend_type":"Type","backend_type_description":"Select a backend type","members_empty_message_title":"No members","members_empty_message_text":"Select project\'s members","update_members_success":"Members are updated","delete_project_confirm_title":"Delete project","delete_project_confirm_message":"Are you sure you want to delete this project?","delete_projects_confirm_title":"Delete projects","delete_projects_confirm_message":"Are you sure you want to delete these projects?","delete_this_project":"Delete this project","cli":"CLI","aws":{"authorization":"Authorization","authorization_default":"Default credentials","authorization_access_key":"Access key","access_key":"Access key","access_key_id":"Access key ID","access_key_id_description":"Specify the AWS access key ID","secret_key":"Secret key","secret_key_id":"Secret access key","secret_key_id_description":"Specify the AWS secret access key","regions":"Regions","regions_description":"Select regions to run workflows and store artifacts","regions_placeholder":"Select regions","s3_bucket_name":"Bucket","s3_bucket_name_description":"Select an S3 bucket to store artifacts","ec2_subnet_id":"Subnet","ec2_subnet_id_description":"Select a subnet to run workflows in","ec2_subnet_id_placeholder":"Not selected","vpc_name":"VPC","vpc_name_description":"Enter a vpc"},"azure":{"authorization":"Authorization","authorization_default":"Default credentials","authorization_client":"Client secret","tenant_id":"Tenant ID","tenant_id_description":"Specify an Azure tenant ID","tenant_id_placeholder":"Not selected","client_id":"Client ID","client_id_description":"Specify an Azure client (application) ID","client_secret":"Client secret","client_secret_description":"Specify an Azure client (application) secret","subscription_id":"Subscription ID","subscription_id_description":"Select an Azure subscription ID","subscription_id_placeholder":"Not selected","locations":"Locations","locations_description":"Select locations to run workflows","locations_placeholder":"Select locations","storage_account":"Storage account","storage_account_description":"Select an Azure storage account to store artifacts","storage_account_placeholder":"Not selected"},"gcp":{"authorization":"Authorization","authorization_default":"Default credentials","service_account":"Service account key","credentials_description":"Credentials description","credentials_placeholder":"Credentials placeholder","regions":"Regions","regions_description":"Select regions to run workflows and store artifacts","regions_placeholder":"Select regions","project_id":"Project Id","project_id_description":"Select a project id","project_id_placeholder":"Select a project Id"},"lambda":{"api_key":"API key","api_key_description":"Specify the Lambda API key","regions":"Regions","regions_description":"Select regions to run workflows","regions_placeholder":"Select regions","storage_backend":{"type":"Storage","type_description":"Select backend storage","type_placeholder":"Select type","credentials":{"access_key_id":"Access key ID","access_key_id_description":"Specify the AWS access key ID","secret_key_id":"Secret access key","secret_key_id_description":"Specify the AWS secret access key"},"s3_bucket_name":"Bucket","s3_bucket_name_description":"Select an S3 bucket to store artifacts"}},"local":{"path":"Files path"},"members":{"section_title":"Members","name":"User name","role":"Project role"},"error_notification":"Update project error","validation":{"user_name_format":"Only letters, numbers, - or _"}},"create":{"page_title":"Create project","error_notification":"Create project error","success_notification":"Project is created"},"repo":{"search_placeholder":"Find repositories","empty_message_title":"No repositories","empty_message_text":"No repositories to display.","nomatch_message_title":"No matches","nomatch_message_text":"We can\'t find a match.","card":{"owner":"Owner","last_run":"Last run","tags_count":"Tags count","directory":"Directory"},"secrets":{"table_title":"Secrets","add_modal_title":"Add secret","update_modal_title":"Update secret","name":"Secret name","name_description":"Secret name","value":"Secret value","value_description":"Secret value","search_placeholder":"Find secrets","empty_message_title":"No secrets","empty_message_text":"No secrets to display."}},"run":{"list_page_title":"Runs","search_placeholder":"Find runs","empty_message_title":"No runs","empty_message_text":"No runs to display.","quickstart_message_text":"Check out the quickstart guide to get started with dstack","nomatch_message_title":"No matches","nomatch_message_text":"We can\'t find a match. Try to change project or clear filter","filter_property_placeholder":"Filter runs by properties","project":"Project","project_placeholder":"Filtering by project","repo":"Repository","repo_placeholder":"Filtering by repository","user":"User","user_placeholder":"Filtering by user","active_only":"Active runs","log":"Logs","log_empty_message_title":"No logs","log_empty_message_text":"No logs to display.","run_name":"Name","workflow_name":"Workflow","configuration":"Configuration","instance":"Instance","priority":"Priority","provider_name":"Provider","status":"Status","submitted_at":"Submitted","finished_at":"Finished","metrics":{"title":"Metrics","show_metrics":"Show metrics","cpu_utilization":"CPU utilization %","memory_used":"System memory used","per_each_cpu_utilization":"GPU utilization %","per_each_memory_used":"GPU memory used"},"jobs":"Jobs","job_name":"Job Name","cost":"Cost","backend":"Backend","region":"Region","instance_id":"Instance ID","resources":"Resources","spot":"Spot","termination_reason":"Termination reason","price":"Price","error":"Error","artifacts":"Artifacts","artifacts_count":"Artifacts","hub_user_name":"User","service_url":"Service URL","statuses":{"pending":"Pending","submitted":"Submitted","provisioning":"Provisioning","pulling":"Pulling","downloading":"Downloading","running":"Running","uploading":"Uploading","stopping":"Stopping","stopped":"Stopped","terminating":"Terminating","terminated":"Terminated","aborting":"Aborting","aborted":"Aborted","failed":"Failed","done":"Done","building":"Building"}},"tag":{"list_page_title":"Artifacts","search_placeholder":"Find tags","empty_message_title":"No tags","empty_message_text":"No tags to display.","tag_name":"Tag","run_name":"Run","artifacts":"Files"},"artifact":{"list_page_title":"Artifacts","search_placeholder":"Find objects","empty_message_title":"No objects","empty_message_text":"No objects to display.","nomatch_message_title":"No matches","nomatch_message_text":"We can\'t find a match.","name":"Name","type":"Type","size":"Size"}},"models":{"model_name":"Name","url":"URL","gateway":"Gateway","type":"Type","run":"Run","resources":"Resources","price":"Price","submitted_at":"Submitted","user":"User","repository":"Repository","backend":"Backend","code":"Code","empty_message_title":"No models","empty_message_text":"No models to display.","nomatch_message_title":"No matches","nomatch_message_text":"We can\'t find a match.","nomatch_message_button_label":"Clear filter","details":{"instructions":"System","instructions_description":"Specify system","message_placeholder":"Enter your question","chat_empty_title":"No messages yet","chat_empty_message":"Please start a chat","run_name":"Run name","view_code":"View code","view_code_description":"You can use the following code to start integrating your current prompt and settings into your application."}},"fleets":{"fleet":"Fleet","fleet_placeholder":"Filtering by fleet","fleet_name":"Fleet name","total_instances":"Number of instances","empty_message_title":"No fleets","empty_message_text":"No fleets to display.","nomatch_message_title":"No matches","nomatch_message_text":"We can\'t find a match.","nomatch_message_button_label":"Clear filter","active_only":"Active fleets","statuses":{"active":"Active","submitted":"Submitted","failed":"Failed","terminating":"Terminating","terminated":"Terminated"},"instances":{"active_only":"Active instances","title":"Instances","empty_message_title":"No instances","empty_message_text":"No instances to display.","nomatch_message_title":"No matches","nomatch_message_text":"We can\'t find a match.","instance_name":"Instance","instance_num":"Instance num","created":"Created","status":"Status","project":"Project","hostname":"Host name","instance_type":"Type","statuses":{"pending":"Pending","provisioning":"Provisioning","idle":"Idle","busy":"Busy","terminating":"Terminating","terminated":"Terminated"},"resources":"Resources","backend":"Backend","region":"Region","spot":"Spot","started":"Started","price":"Price"}},"volume":{"volumes":"Volumes","empty_message_title":"No volumes","empty_message_text":"No volumes to display.","nomatch_message_title":"No matches","nomatch_message_text":"We can\'t find a match.","delete_volumes_confirm_title":"Delete volumes","delete_volumes_confirm_message":"Are you sure you want to delete these volumes?","active_only":"Active volumes","name":"Name","project":"Project name","region":"Region","backend":"Backend","status":"Status","created":"Created","finished":"Finished","price":"Price (per month)","cost":"Cost","statuses":{"failed":"Failed","submitted":"Submitted","provisioning":"Provisioning","active":"Active","deleted":"Deleted"}},"users":{"page_title":"Users","search_placeholder":"Find members","empty_message_title":"No members","empty_message_text":"No members to display.","nomatch_message_title":"No matches","nomatch_message_text":"We can\'t find a match.","user_name":"User name","user_name_description":"Only latin characters, dashes, underscores, and digits","global_role_description":"Whether the user is an administrator or not","email_description":"Enter user email","token":"Token","token_description":"Specify use your personal access token","global_role":"Global role","active":"Active","active_description":"Specify user activation","activated":"Activated","deactivated":"Deactivated","email":"Email","created_at":"Created at","account":"User","account_settings":"User settings","settings":"Settings","projects":"Projects","create":{"page_title":"Create user","error_notification":"Create user error","success_notification":"User is created"},"edit":{"error_notification":"Update user error","success_notification":"User updating is successful","refresh_token_success_notification":"Token rotating is successful","refresh_token_error_notification":"Token rotating error","refresh_token_confirm_title":"Rotate token","refresh_token_confirm_message":"Are you sure you want to rotate token?","refresh_token_button_label":"Rotate","validation":{"user_name_format":"Only letters, numbers, - or _","email_format":"Incorrect email"}},"manual_payments":{"title":"Credits history","add_payment":"Add payment","empty_message_title":"No payments","empty_message_text":"No payments to display.","create":{"success_notification":"Payment creating is successful"},"edit":{"value":"Amount","value_description":"Enter amount here","description":"Description","description_description":"Describe payment here","created_at":"Created at"}},"token_copied":"Token copied"},"billing":{"title":"Billing","balance":"Balance","billing_history":"Billing history","payment_method":"Payment method","no_payment_method":"No payment method attached","top_up_balance":"Top up balance","edit_payment_method":"Edit payment method","payment_amount":"Payment amount","amount_description":"Minimum: ${{value}}","make_payment":"Make a payment","min_amount_error_message":"The amount is allowed to be more than {{value}}","payment_success_message":"Payment succeeded. There can be a short delay before the balance is updated."},"validation":{"required":"This is required field"},"users_autosuggest":{"placeholder":"Enter username or email to add member","entered_text":"Add member","loading":"Loading users","no_match":"No matches found"},"roles":{"admin":"Admin","manager":"Manager","user":"User"},"confirm_dialog":{"title":"Confirm delete","message":"Are you sure you want to delete?"}}');
|
|
136472
138103
|
;// ./src/locale/index.ts
|
|
136473
138104
|
src_instance.use(src_initReactI18next).init({returnNull:!1,resources:{en:{translation:src_en_namespaceObject}},fallbackLng:"en",interpolation:{escapeValue:!1}});
|
|
136474
138105
|
;// ./src/index.tsx
|
|
@@ -136477,4 +138108,4 @@ var src_container=document.getElementById("root"),src_src_theme={tokens:{fontFam
|
|
|
136477
138108
|
|
|
136478
138109
|
/******/ })()
|
|
136479
138110
|
;
|
|
136480
|
-
//# sourceMappingURL=main-
|
|
138111
|
+
//# sourceMappingURL=main-2066f1f22ddb4557bcde.js.map
|