type stringclasses 7
values | content stringlengths 4 9.55k | repo stringlengths 7 96 | path stringlengths 4 178 | language stringclasses 1
value |
|---|---|---|---|---|
MethodDeclaration |
ngOnInit() {
this.createIdeogram();
} | Zhu-Ying/ideogram | examples/angular/src/app/ideogram/ideogram.component.ts | TypeScript |
MethodDeclaration |
createIdeogram() {
const ideogram = new Ideogram({
organism: 'human',
dataDir: 'https://unpkg.com/ideogram@0.10.0/dist/data/bands/native/',
container: '#ideo-container'
});
} | Zhu-Ying/ideogram | examples/angular/src/app/ideogram/ideogram.component.ts | TypeScript |
ArrowFunction |
() => this.alive | vladhj38/ngx-admin | src/app/@theme/components/banner/banner.component.ts | TypeScript |
ArrowFunction |
({ name }) => this.isDarkTheme = name === 'cosmic' | vladhj38/ngx-admin | src/app/@theme/components/banner/banner.component.ts | TypeScript |
ClassDeclaration |
@Component({
selector: 'ngx-release-banner',
template: `
<div class="heading-with-icon">
<img class="icon" [src]="getBellPath()" alt="bell">
<h1 class="banner-heading">Nebular 2.0 stable <br> with 30+ components is out!</h1>
<button class="close-button" aria-label="close" (click)="closeBanner... | vladhj38/ngx-admin | src/app/@theme/components/banner/banner.component.ts | TypeScript |
MethodDeclaration |
ngOnInit() {
this.storage = this.window.localStorage;
this.isHidden = this.storage && this.storage.getItem(HIDE_BANNER_KEY)
? true
: null;
this.isDarkTheme = this.themeService.currentTheme === 'cosmic';
this.themeService.onThemeChange()
.pipe(takeWhile(() => this.alive))
.subs... | vladhj38/ngx-admin | src/app/@theme/components/banner/banner.component.ts | TypeScript |
MethodDeclaration |
closeBanner() {
if (this.storage) {
this.storage.setItem(HIDE_BANNER_KEY, 'true');
}
this.isHidden = true;
} | vladhj38/ngx-admin | src/app/@theme/components/banner/banner.component.ts | TypeScript |
MethodDeclaration |
getBellPath() {
return `assets/images/bell${this.isDarkTheme ? '' : '-white'}.svg`;
} | vladhj38/ngx-admin | src/app/@theme/components/banner/banner.component.ts | TypeScript |
MethodDeclaration |
ngOnDestroy() {
this.alive = false;
} | vladhj38/ngx-admin | src/app/@theme/components/banner/banner.component.ts | TypeScript |
InterfaceDeclaration |
interface GroupItem {
title: string;
icon: string;
color: string;
desc: string;
date: string;
group: string;
} | sunchir/vue3-xd-fundamental | src/views/dashboard/workbench/components/data.ts | TypeScript |
InterfaceDeclaration |
interface NavItem {
title: string;
icon: string;
color: string;
} | sunchir/vue3-xd-fundamental | src/views/dashboard/workbench/components/data.ts | TypeScript |
InterfaceDeclaration |
interface DynamicInfoItem {
avatar: string;
name: string;
date: string;
desc: string;
} | sunchir/vue3-xd-fundamental | src/views/dashboard/workbench/components/data.ts | TypeScript |
InterfaceDeclaration |
interface GroupTitleItems {
appNum?: number;
id: number;
isInit?: number;
name: String;
parentId?: number;
} | sunchir/vue3-xd-fundamental | src/views/dashboard/workbench/components/data.ts | TypeScript |
InterfaceDeclaration |
interface AppList {
appId: string;
appSecret: string;
appUrl?: string;
categoryId?: number;
description: string;
h5Url?: string;
icon?: string;
id: number;
isInit?: number;
maintenanceUrl?: string;
name: string;
orgName?: string;
orgSn?: string;
sort?: number;
thirdApp?: number;
type?: ... | sunchir/vue3-xd-fundamental | src/views/dashboard/workbench/components/data.ts | TypeScript |
ArrowFunction |
(hasSeenTutorial) => {
if (hasSeenTutorial) {
this.rootPage = TabsPage;
} else {
this.rootPage = TutorialPage;
}
this.platformReady()
} | Levitskyi/test-music-app | src/app/app.component.ts | TypeScript |
ArrowFunction |
(hasLoggedIn) => {
this.enableMenu(hasLoggedIn === true);
} | Levitskyi/test-music-app | src/app/app.component.ts | TypeScript |
ArrowFunction |
(err: any) => {
console.log(`Didn't set nav root: ${err}`);
} | Levitskyi/test-music-app | src/app/app.component.ts | TypeScript |
ArrowFunction |
() => {
this.enableMenu(true);
} | Levitskyi/test-music-app | src/app/app.component.ts | TypeScript |
ArrowFunction |
() => {
this.enableMenu(false);
} | Levitskyi/test-music-app | src/app/app.component.ts | TypeScript |
ArrowFunction |
() => {
this.splashScreen.hide();
} | Levitskyi/test-music-app | src/app/app.component.ts | TypeScript |
ClassDeclaration |
@Component({
templateUrl: 'app.template.html'
})
export class ConferenceApp {
// the root nav is a child of the root app component
// @ViewChild(Nav) gets a reference to the app's root nav
@ViewChild(Nav) nav: Nav;
// List of pages that can be navigated to from the left menu
// the left menu only works af... | Levitskyi/test-music-app | src/app/app.component.ts | TypeScript |
InterfaceDeclaration |
export interface PageInterface {
title: string;
name: string;
component: any;
icon: string;
logsOut?: boolean;
index?: number;
tabName?: string;
tabComponent?: any;
} | Levitskyi/test-music-app | src/app/app.component.ts | TypeScript |
MethodDeclaration |
openPage(page: PageInterface) {
let params = {};
// the nav component was found using @ViewChild(Nav)
// setRoot on the nav to remove previous pages and only have this page
// we wouldn't want the back button to show in this scenario
if (page.index) {
params = { tabIndex: page.index };
}... | Levitskyi/test-music-app | src/app/app.component.ts | TypeScript |
MethodDeclaration |
openTutorial() {
this.nav.setRoot(TutorialPage);
} | Levitskyi/test-music-app | src/app/app.component.ts | TypeScript |
MethodDeclaration |
listenToLoginEvents() {
this.events.subscribe('user:login', () => {
this.enableMenu(true);
});
this.events.subscribe('user:signup', () => {
this.enableMenu(true);
});
this.events.subscribe('user:logout', () => {
this.enableMenu(false);
});
} | Levitskyi/test-music-app | src/app/app.component.ts | TypeScript |
MethodDeclaration |
enableMenu(loggedIn: boolean) {
this.menu.enable(loggedIn, 'loggedInMenu');
this.menu.enable(!loggedIn, 'loggedOutMenu');
} | Levitskyi/test-music-app | src/app/app.component.ts | TypeScript |
MethodDeclaration |
platformReady() {
// Call any initial plugins when ready
this.platform.ready().then(() => {
this.splashScreen.hide();
});
} | Levitskyi/test-music-app | src/app/app.component.ts | TypeScript |
MethodDeclaration |
isActive(page: PageInterface) {
let childNav = this.nav.getActiveChildNav();
// Tabs are a special case because they have their own navigation
if (childNav) {
if (childNav.getSelected() && childNav.getSelected().root === page.tabComponent) {
return 'primary';
}
return;
}
... | Levitskyi/test-music-app | src/app/app.component.ts | TypeScript |
ClassDeclaration |
@NgModule({
imports: [CommonModule, MATERIAL_MODULES, RouterModule.forChild(routes)],
declarations: [FAQ]
})
export class FAQModule {} | qdouble/material | src/app/features/faq/index.ts | TypeScript |
ArrowFunction |
(response: any) => {
return (
_.map(response.data.value, val => {
return { text: val.name, value: val.properties.customerId };
}) || []
);
} | Amann1965/mygrafana | public/app/plugins/datasource/grafana-azure-monitor-datasource/azure_log_analytics/azure_log_analytics_datasource.ts | TypeScript |
ArrowFunction |
val => {
return { text: val.name, value: val.properties.customerId };
} | Amann1965/mygrafana | public/app/plugins/datasource/grafana-azure-monitor-datasource/azure_log_analytics/azure_log_analytics_datasource.ts | TypeScript |
ArrowFunction |
(response: any) => {
return new ResponseParser(response.data).parseSchemaResult();
} | Amann1965/mygrafana | public/app/plugins/datasource/grafana-azure-monitor-datasource/azure_log_analytics/azure_log_analytics_datasource.ts | TypeScript |
ArrowFunction |
item => {
return item.hide !== true;
} | Amann1965/mygrafana | public/app/plugins/datasource/grafana-azure-monitor-datasource/azure_log_analytics/azure_log_analytics_datasource.ts | TypeScript |
ArrowFunction |
target => {
const item = target.azureLogAnalytics;
const querystringBuilder = new LogAnalyticsQuerystringBuilder(
this.templateSrv.replace(item.query, options.scopedVars, this.interpolateVariable),
options,
'TimeGenerated'
);
const generated = querystringBuilder.generat... | Amann1965/mygrafana | public/app/plugins/datasource/grafana-azure-monitor-datasource/azure_log_analytics/azure_log_analytics_datasource.ts | TypeScript |
ArrowFunction |
results => {
return new ResponseParser(results).parseQueryResult();
} | Amann1965/mygrafana | public/app/plugins/datasource/grafana-azure-monitor-datasource/azure_log_analytics/azure_log_analytics_datasource.ts | TypeScript |
ArrowFunction |
(workspace: any) => {
const queries: any[] = this.buildQuery(query, null, workspace);
const promises = this.doQueries(queries);
return this.$q
.all(promises)
.then(results => {
return new ResponseParser(results).parseToVariables();
})
.catch(err => {
... | Amann1965/mygrafana | public/app/plugins/datasource/grafana-azure-monitor-datasource/azure_log_analytics/azure_log_analytics_datasource.ts | TypeScript |
ArrowFunction |
results => {
return new ResponseParser(results).parseToVariables();
} | Amann1965/mygrafana | public/app/plugins/datasource/grafana-azure-monitor-datasource/azure_log_analytics/azure_log_analytics_datasource.ts | TypeScript |
ArrowFunction |
err => {
if (
err.error &&
err.error.data &&
err.error.data.error &&
err.error.data.error.innererror &&
err.error.data.error.innererror.innererror
) {
throw { message: err.error.data.error.innererror.innererror.message };
... | Amann1965/mygrafana | public/app/plugins/datasource/grafana-azure-monitor-datasource/azure_log_analytics/azure_log_analytics_datasource.ts | TypeScript |
ArrowFunction |
val => {
if (typeof value === 'number') {
return value;
}
return "'" + val + "'";
} | Amann1965/mygrafana | public/app/plugins/datasource/grafana-azure-monitor-datasource/azure_log_analytics/azure_log_analytics_datasource.ts | TypeScript |
ArrowFunction |
(workspaces: any[]) => {
this.defaultOrFirstWorkspace = workspaces[0].value;
return this.defaultOrFirstWorkspace;
} | Amann1965/mygrafana | public/app/plugins/datasource/grafana-azure-monitor-datasource/azure_log_analytics/azure_log_analytics_datasource.ts | TypeScript |
ArrowFunction |
results => {
const annotations = new ResponseParser(results).transformToAnnotations(options);
return annotations;
} | Amann1965/mygrafana | public/app/plugins/datasource/grafana-azure-monitor-datasource/azure_log_analytics/azure_log_analytics_datasource.ts | TypeScript |
ArrowFunction |
query => {
return this.doRequest(query.url)
.then((result: any) => {
return {
result: result,
query: query,
};
})
.catch((err: any) => {
throw {
error: err,
query: query,
};
});
} | Amann1965/mygrafana | public/app/plugins/datasource/grafana-azure-monitor-datasource/azure_log_analytics/azure_log_analytics_datasource.ts | TypeScript |
ArrowFunction |
(result: any) => {
return {
result: result,
query: query,
};
} | Amann1965/mygrafana | public/app/plugins/datasource/grafana-azure-monitor-datasource/azure_log_analytics/azure_log_analytics_datasource.ts | TypeScript |
ArrowFunction |
(err: any) => {
throw {
error: err,
query: query,
};
} | Amann1965/mygrafana | public/app/plugins/datasource/grafana-azure-monitor-datasource/azure_log_analytics/azure_log_analytics_datasource.ts | TypeScript |
ArrowFunction |
(error: any) => {
if (maxRetries > 0) {
return this.doRequest(url, maxRetries - 1);
}
throw error;
} | Amann1965/mygrafana | public/app/plugins/datasource/grafana-azure-monitor-datasource/azure_log_analytics/azure_log_analytics_datasource.ts | TypeScript |
ArrowFunction |
(ws: any) => {
const url = `${this.baseUrl}/${ws}/metadata`;
return this.doRequest(url);
} | Amann1965/mygrafana | public/app/plugins/datasource/grafana-azure-monitor-datasource/azure_log_analytics/azure_log_analytics_datasource.ts | TypeScript |
ArrowFunction |
(response: any) => {
if (response.status === 200) {
return {
status: 'success',
message: 'Successfully queried the Azure Log Analytics service.',
title: 'Success',
};
}
return {
status: 'error',
message: 'Returned http... | Amann1965/mygrafana | public/app/plugins/datasource/grafana-azure-monitor-datasource/azure_log_analytics/azure_log_analytics_datasource.ts | TypeScript |
ArrowFunction |
(error: any) => {
let message = 'Azure Log Analytics: ';
if (error.config && error.config.url && error.config.url.indexOf('workspacesloganalytics') > -1) {
message = 'Azure Log Analytics requires access to Azure Monitor but had the following error: ';
}
message = this.getErro... | Amann1965/mygrafana | public/app/plugins/datasource/grafana-azure-monitor-datasource/azure_log_analytics/azure_log_analytics_datasource.ts | TypeScript |
MethodDeclaration |
isConfigured(): boolean {
return (
(!!this.instanceSettings.jsonData.logAnalyticsSubscriptionId &&
this.instanceSettings.jsonData.logAnalyticsSubscriptionId.length > 0) ||
!!this.instanceSettings.jsonData.azureLogAnalyticsSameAs
);
} | Amann1965/mygrafana | public/app/plugins/datasource/grafana-azure-monitor-datasource/azure_log_analytics/azure_log_analytics_datasource.ts | TypeScript |
MethodDeclaration |
setWorkspaceUrl() {
if (!!this.instanceSettings.jsonData.subscriptionId || !!this.instanceSettings.jsonData.azureLogAnalyticsSameAs) {
this.subscriptionId = this.instanceSettings.jsonData.subscriptionId;
const azureCloud = this.instanceSettings.jsonData.cloudName || 'azuremonitor';
this.azureMoni... | Amann1965/mygrafana | public/app/plugins/datasource/grafana-azure-monitor-datasource/azure_log_analytics/azure_log_analytics_datasource.ts | TypeScript |
MethodDeclaration |
getWorkspaces(subscription: string) {
const subscriptionId = this.templateSrv.replace(subscription || this.subscriptionId);
const workspaceListUrl =
this.azureMonitorUrl +
`/${subscriptionId}/providers/Microsoft.OperationalInsights/workspaces?api-version=2017-04-26-preview`;
return this.doRequ... | Amann1965/mygrafana | public/app/plugins/datasource/grafana-azure-monitor-datasource/azure_log_analytics/azure_log_analytics_datasource.ts | TypeScript |
MethodDeclaration |
getSchema(workspace: string) {
if (!workspace) {
return Promise.resolve();
}
const url = `${this.baseUrl}/${workspace}/metadata`;
return this.doRequest(url).then((response: any) => {
return new ResponseParser(response.data).parseSchemaResult();
});
} | Amann1965/mygrafana | public/app/plugins/datasource/grafana-azure-monitor-datasource/azure_log_analytics/azure_log_analytics_datasource.ts | TypeScript |
MethodDeclaration |
async query(options: DataQueryRequest<AzureMonitorQuery>) {
const queries = _.filter(options.targets, item => {
return item.hide !== true;
}).map(target => {
const item = target.azureLogAnalytics;
const querystringBuilder = new LogAnalyticsQuerystringBuilder(
this.templateSrv.replace... | Amann1965/mygrafana | public/app/plugins/datasource/grafana-azure-monitor-datasource/azure_log_analytics/azure_log_analytics_datasource.ts | TypeScript |
MethodDeclaration |
metricFindQuery(query: string) {
return this.getDefaultOrFirstWorkspace().then((workspace: any) => {
const queries: any[] = this.buildQuery(query, null, workspace);
const promises = this.doQueries(queries);
return this.$q
.all(promises)
.then(results => {
return new Re... | Amann1965/mygrafana | public/app/plugins/datasource/grafana-azure-monitor-datasource/azure_log_analytics/azure_log_analytics_datasource.ts | TypeScript |
MethodDeclaration |
private buildQuery(query: string, options: any, workspace: any) {
const querystringBuilder = new LogAnalyticsQuerystringBuilder(
this.templateSrv.replace(query, {}, this.interpolateVariable),
options,
'TimeGenerated'
);
const querystring = querystringBuilder.generate().uriString;
cons... | Amann1965/mygrafana | public/app/plugins/datasource/grafana-azure-monitor-datasource/azure_log_analytics/azure_log_analytics_datasource.ts | TypeScript |
MethodDeclaration |
interpolateVariable(value: string, variable: { multi: any; includeAll: any }) {
if (typeof value === 'string') {
if (variable.multi || variable.includeAll) {
return "'" + value + "'";
} else {
return value;
}
}
if (typeof value === 'number') {
return value;
}
... | Amann1965/mygrafana | public/app/plugins/datasource/grafana-azure-monitor-datasource/azure_log_analytics/azure_log_analytics_datasource.ts | TypeScript |
MethodDeclaration |
getDefaultOrFirstWorkspace() {
if (this.defaultOrFirstWorkspace) {
return Promise.resolve(this.defaultOrFirstWorkspace);
}
return this.getWorkspaces(this.subscriptionId).then((workspaces: any[]) => {
this.defaultOrFirstWorkspace = workspaces[0].value;
return this.defaultOrFirstWorkspace;... | Amann1965/mygrafana | public/app/plugins/datasource/grafana-azure-monitor-datasource/azure_log_analytics/azure_log_analytics_datasource.ts | TypeScript |
MethodDeclaration |
annotationQuery(options: any) {
if (!options.annotation.rawQuery) {
return this.$q.reject({
message: 'Query missing in annotation definition',
});
}
const queries: any[] = this.buildQuery(options.annotation.rawQuery, options, options.annotation.workspace);
const promises = this.do... | Amann1965/mygrafana | public/app/plugins/datasource/grafana-azure-monitor-datasource/azure_log_analytics/azure_log_analytics_datasource.ts | TypeScript |
MethodDeclaration |
doQueries(queries: any[]) {
return _.map(queries, query => {
return this.doRequest(query.url)
.then((result: any) => {
return {
result: result,
query: query,
};
})
.catch((err: any) => {
throw {
error: err,
... | Amann1965/mygrafana | public/app/plugins/datasource/grafana-azure-monitor-datasource/azure_log_analytics/azure_log_analytics_datasource.ts | TypeScript |
MethodDeclaration |
doRequest(url: string, maxRetries = 1) {
return this.backendSrv
.datasourceRequest({
url: this.url + url,
method: 'GET',
})
.catch((error: any) => {
if (maxRetries > 0) {
return this.doRequest(url, maxRetries - 1);
}
throw error;
});
} | Amann1965/mygrafana | public/app/plugins/datasource/grafana-azure-monitor-datasource/azure_log_analytics/azure_log_analytics_datasource.ts | TypeScript |
MethodDeclaration |
testDatasource() {
const validationError = this.isValidConfig();
if (validationError) {
return validationError;
}
return this.getDefaultOrFirstWorkspace()
.then((ws: any) => {
const url = `${this.baseUrl}/${ws}/metadata`;
return this.doRequest(url);
})
.then((r... | Amann1965/mygrafana | public/app/plugins/datasource/grafana-azure-monitor-datasource/azure_log_analytics/azure_log_analytics_datasource.ts | TypeScript |
MethodDeclaration |
private getErrorMessage(message: string, error: any) {
message += error.statusText ? error.statusText + ': ' : '';
if (error.data && error.data.error && error.data.error.code) {
message += error.data.error.code + '. ' + error.data.error.message;
} else if (error.data && error.data.error) {
mess... | Amann1965/mygrafana | public/app/plugins/datasource/grafana-azure-monitor-datasource/azure_log_analytics/azure_log_analytics_datasource.ts | TypeScript |
MethodDeclaration |
isValidConfig() {
if (this.instanceSettings.jsonData.azureLogAnalyticsSameAs) {
return undefined;
}
if (!this.isValidConfigField(this.instanceSettings.jsonData.logAnalyticsSubscriptionId)) {
return {
status: 'error',
message: 'The Subscription Id field is required.',
};
... | Amann1965/mygrafana | public/app/plugins/datasource/grafana-azure-monitor-datasource/azure_log_analytics/azure_log_analytics_datasource.ts | TypeScript |
MethodDeclaration |
isValidConfigField(field: string) {
return field && field.length > 0;
} | Amann1965/mygrafana | public/app/plugins/datasource/grafana-azure-monitor-datasource/azure_log_analytics/azure_log_analytics_datasource.ts | TypeScript |
ArrowFunction |
(accmulator, current) => {
if (current.id !== botID) {
accmulator.push(current.tag ? current.tag : current.username);
}
return accmulator;
} | tenkawa0/DuskBot | src/events/reactionAdd.ts | TypeScript |
ArrowFunction |
(accmulator, current) => {
const weapons = Array.from(new Set(data));
const weapon = weapons.splice(
Math.floor(Math.random() * weapons.length),
1
);
accmulator.push(weapon[0]);
return accmulator;
} | tenkawa0/DuskBot | src/events/reactionAdd.ts | TypeScript |
ArrowFunction |
(user, index) => {
embed.addField(
[icons[index], user].join(""),
["```", chooseRandom(results[index].value), "```"].join("")
);
} | tenkawa0/DuskBot | src/events/reactionAdd.ts | TypeScript |
ClassDeclaration |
export class QuestionUpdatedPublisher extends Publisher<QuestionUpdatedEvent> {
readonly subject = Subjects.QuestionUpdated;
} | wat1881mayer/remember-commnad | questions/src/events/publisher/question-updated-publisher.ts | TypeScript |
ArrowFunction |
(cv: ClusterVersionKind): ClusterUpdate[] => {
return _.get(cv, 'status.availableUpdates', []);
} | DaoDaoNoCode/console | frontend/public/module/k8s/cluster-settings.ts | TypeScript |
ArrowFunction |
(cv: ClusterVersionKind): ClusterUpdate[] => {
const available = getAvailableClusterUpdates(cv) || [];
try {
return available.sort(({ version: left }, { version: right }) => semver.rcompare(left, right));
} catch (e) {
// eslint-disable-next-line no-console
console.error('error sorting cluster update... | DaoDaoNoCode/console | frontend/public/module/k8s/cluster-settings.ts | TypeScript |
ArrowFunction |
({ version: left }, { version: right }) => semver.rcompare(left, right) | DaoDaoNoCode/console | frontend/public/module/k8s/cluster-settings.ts | TypeScript |
ArrowFunction |
(currentVersion, availableUpdates) => {
const currentVersionParsed = semver.parse(currentVersion);
return availableUpdates?.find(
// find the next minor version update, which there should never be more than one
(update) => {
const updateParsed = semver.parse(update.version);
return semver.gt(
... | DaoDaoNoCode/console | frontend/public/module/k8s/cluster-settings.ts | TypeScript |
ArrowFunction | // find the next minor version update, which there should never be more than one
(update) => {
const updateParsed = semver.parse(update.version);
return semver.gt(
semver.coerce(`${updateParsed.major}.${updateParsed.minor}`),
semver.coerce(`${currentVersionParsed.major}.${currentVersionParse... | DaoDaoNoCode/console | frontend/public/module/k8s/cluster-settings.ts | TypeScript |
ArrowFunction |
(currentVersion, otherVersion) => {
const currentVersionParsed = semver.parse(currentVersion);
const otherVersionParsed = semver.parse(otherVersion);
return semver.gt(
semver.coerce(`${otherVersionParsed.major}.${otherVersionParsed.minor}`),
semver.coerce(`${currentVersionParsed.major}.${currentVersionPa... | DaoDaoNoCode/console | frontend/public/module/k8s/cluster-settings.ts | TypeScript |
ArrowFunction |
(cv) => {
return cv?.status?.desired?.channels || [];
} | DaoDaoNoCode/console | frontend/public/module/k8s/cluster-settings.ts | TypeScript |
ArrowFunction |
(cv: ClusterVersionKind): string => {
return _.get(cv, 'status.desired.version');
} | DaoDaoNoCode/console | frontend/public/module/k8s/cluster-settings.ts | TypeScript |
ArrowFunction |
(cv: ClusterVersionKind): string => cv?.spec?.channel | DaoDaoNoCode/console | frontend/public/module/k8s/cluster-settings.ts | TypeScript |
ArrowFunction |
(channel: string) => {
const parsed = /^(.+)-(\d\.\d+)$/.exec(channel);
return parsed ? { prefix: parsed[1], version: parsed[2] } : null;
} | DaoDaoNoCode/console | frontend/public/module/k8s/cluster-settings.ts | TypeScript |
ArrowFunction |
(cv, currentPrefix) => {
return getAvailableClusterChannels(cv).filter((channel: string) => {
return currentPrefix && splitClusterVersionChannel(channel)?.prefix === currentPrefix;
});
} | DaoDaoNoCode/console | frontend/public/module/k8s/cluster-settings.ts | TypeScript |
ArrowFunction |
(channel: string) => {
return currentPrefix && splitClusterVersionChannel(channel)?.prefix === currentPrefix;
} | DaoDaoNoCode/console | frontend/public/module/k8s/cluster-settings.ts | TypeScript |
ArrowFunction |
(similarChannels, currentChannel) => {
return similarChannels.find(
// find the next minor version, which there should never be more than one
(channel) => semver.gt(semver.coerce(channel).version, semver.coerce(currentChannel).version),
);
} | DaoDaoNoCode/console | frontend/public/module/k8s/cluster-settings.ts | TypeScript |
ArrowFunction | // find the next minor version, which there should never be more than one
(channel) => semver.gt(semver.coerce(channel).version, semver.coerce(currentChannel).version) | DaoDaoNoCode/console | frontend/public/module/k8s/cluster-settings.ts | TypeScript |
ArrowFunction |
(cv: ClusterVersionKind): string => {
const history: UpdateHistory[] = _.get(cv, 'status.history', []);
const lastCompleted: UpdateHistory = history.find((update) => update.state === 'Completed');
return lastCompleted && lastCompleted.version;
} | DaoDaoNoCode/console | frontend/public/module/k8s/cluster-settings.ts | TypeScript |
ArrowFunction |
(update) => update.state === 'Completed' | DaoDaoNoCode/console | frontend/public/module/k8s/cluster-settings.ts | TypeScript |
ArrowFunction |
(
cv: ClusterVersionKind,
type: ClusterVersionConditionType,
status: K8sResourceConditionStatus = undefined,
): ClusterVersionCondition => {
const conditions: ClusterVersionCondition[] = _.get(cv, 'status.conditions');
if (status) {
return _.find(conditions, { type, status });
}
return _.find(conditi... | DaoDaoNoCode/console | frontend/public/module/k8s/cluster-settings.ts | TypeScript |
ArrowFunction |
(cv: ClusterVersionKind): boolean => {
return !_.isEmpty(
getClusterVersionCondition(
cv,
ClusterVersionConditionType.Progressing,
K8sResourceConditionStatus.True,
),
);
} | DaoDaoNoCode/console | frontend/public/module/k8s/cluster-settings.ts | TypeScript |
ArrowFunction |
(cv: ClusterVersionKind): boolean => {
return !_.isEmpty(
getClusterVersionCondition(
cv,
ClusterVersionConditionType.Invalid,
K8sResourceConditionStatus.True,
),
);
} | DaoDaoNoCode/console | frontend/public/module/k8s/cluster-settings.ts | TypeScript |
ArrowFunction |
(cv: ClusterVersionKind): boolean => {
return !_.isEmpty(
getClusterVersionCondition(
cv,
ClusterVersionConditionType.RetrievedUpdates,
K8sResourceConditionStatus.False,
),
);
} | DaoDaoNoCode/console | frontend/public/module/k8s/cluster-settings.ts | TypeScript |
ArrowFunction |
(cv: ClusterVersionKind): boolean => {
return !_.isEmpty(
getClusterVersionCondition(
cv,
ClusterVersionConditionType.Failing,
K8sResourceConditionStatus.True,
),
);
} | DaoDaoNoCode/console | frontend/public/module/k8s/cluster-settings.ts | TypeScript |
ArrowFunction |
(cv: ClusterVersionKind): boolean => {
return !_.isEmpty(getAvailableClusterUpdates(cv));
} | DaoDaoNoCode/console | frontend/public/module/k8s/cluster-settings.ts | TypeScript |
ArrowFunction |
(cv: ClusterVersionKind): ClusterUpdateStatus => {
if (invalid(cv)) {
return ClusterUpdateStatus.Invalid;
}
if (isProgressing(cv) && updateFailing(cv)) {
return ClusterUpdateStatus.UpdatingAndFailing;
}
if (updateFailing(cv)) {
return ClusterUpdateStatus.Failing;
}
if (isProgressing(cv)) {... | DaoDaoNoCode/console | frontend/public/module/k8s/cluster-settings.ts | TypeScript |
ArrowFunction |
(k8sVersionResponse): string =>
_.get(k8sVersionResponse, 'gitVersion') | DaoDaoNoCode/console | frontend/public/module/k8s/cluster-settings.ts | TypeScript |
ArrowFunction |
(cv: ClusterVersionKind): string => {
const lastUpdate: UpdateHistory = _.get(cv, 'status.history[0]');
if (!lastUpdate) {
return null;
}
return lastUpdate.state === 'Partial' ? `Updating to ${lastUpdate.version}` : lastUpdate.version;
} | DaoDaoNoCode/console | frontend/public/module/k8s/cluster-settings.ts | TypeScript |
ArrowFunction |
(cv: ClusterVersionKind): string => {
return _.get(cv, 'status.history[0].version') || _.get(cv, 'spec.desiredUpdate.version');
} | DaoDaoNoCode/console | frontend/public/module/k8s/cluster-settings.ts | TypeScript |
ArrowFunction |
(cv: ClusterVersionKind): { label: string; href: string } => {
const version: string = getCurrentVersion(cv);
const parsed = semver.parse(version);
if (!parsed) {
return null;
}
// Show a Bugzilla link for prerelease versions and a support case link for supported versions.
const { major, minor, prerel... | DaoDaoNoCode/console | frontend/public/module/k8s/cluster-settings.ts | TypeScript |
ArrowFunction |
(): boolean => {
return window.SERVER_FLAGS.branding === 'ocp';
} | DaoDaoNoCode/console | frontend/public/module/k8s/cluster-settings.ts | TypeScript |
ArrowFunction |
(version: string): string => {
if (!showReleaseNotes()) {
return null;
}
const parsed = semver.parse(version);
if (!parsed) {
return null;
}
const { major, minor, patch, prerelease } = parsed;
if (major !== 4 || !_.isEmpty(prerelease)) {
return null;
}
return `https://access.redhat.com... | DaoDaoNoCode/console | frontend/public/module/k8s/cluster-settings.ts | TypeScript |
ArrowFunction |
(): string => window.SERVER_FLAGS.kubeAPIServerURL || null | DaoDaoNoCode/console | frontend/public/module/k8s/cluster-settings.ts | TypeScript |
ArrowFunction |
(cv: ClusterVersionKind): string => _.get(cv, 'spec.clusterID') | DaoDaoNoCode/console | frontend/public/module/k8s/cluster-settings.ts | TypeScript |
ArrowFunction |
(clusterID: string): string =>
`https://console.redhat.com/openshift/details/${clusterID}` | DaoDaoNoCode/console | frontend/public/module/k8s/cluster-settings.ts | TypeScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.