Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
origin-web-common
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Java-于龙
origin-web-common
Commits
bc4c298c
Commit
bc4c298c
authored
Oct 11, 2017
by
Jeffrey Phillips
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add common filters for service instance values
parent
bb3419e7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
136 additions
and
0 deletions
+136
-0
origin-web-common-ui.js
dist/origin-web-common-ui.js
+39
-0
origin-web-common.js
dist/origin-web-common.js
+39
-0
origin-web-common.min.js
dist/origin-web-common.min.js
+19
-0
resources.js
src/filters/resources.js
+39
-0
No files found.
dist/origin-web-common-ui.js
View file @
bc4c298c
...
@@ -1816,6 +1816,45 @@ angular.module('openshiftCommonUI')
...
@@ -1816,6 +1816,45 @@ angular.module('openshiftCommonUI')
return
!!
annotationFilter
(
deployment
,
'deploymentConfig'
);
return
!!
annotationFilter
(
deployment
,
'deploymentConfig'
);
};
};
})
})
.
filter
(
'serviceClassDisplayName'
,
function
()
{
return
function
(
serviceClass
)
{
var
serviceClassDisplayName
=
_
.
get
(
serviceClass
,
'spec.externalMetadata.displayName'
);
if
(
serviceClassDisplayName
)
{
return
serviceClassDisplayName
;
}
var
serviceClassExternalName
=
_
.
get
(
serviceClass
,
'spec.externalName'
);
if
(
serviceClassExternalName
)
{
return
serviceClassExternalName
;
}
return
_
.
get
(
serviceClass
,
'metadata.name'
);
};
})
.
filter
(
'serviceInstanceDisplayName'
,
function
(
serviceClassDisplayNameFilter
)
{
return
function
(
instance
,
serviceClass
)
{
if
(
serviceClass
)
{
return
serviceClassDisplayNameFilter
(
serviceClass
);
}
return
_
.
get
(
instance
,
'metadata.name'
);
};
})
.
filter
(
'serviceInstanceStatus'
,
function
(
isServiceInstanceReadyFilter
)
{
return
function
(
instance
)
{
var
status
=
'Pending'
;
var
conditions
=
_
.
get
(
instance
,
'status.conditions'
);
var
instanceError
=
_
.
find
(
conditions
,
{
type
:
'Failed'
,
status
:
'True'
});
if
(
instanceError
)
{
status
=
'Failed'
;
}
else
if
(
isServiceInstanceReadyFilter
(
instance
))
{
status
=
'Ready'
;
}
return
status
;
};
})
;
;
;
'use strict'
;
;
'use strict'
;
angular
.
module
(
'openshiftCommonUI'
)
angular
.
module
(
'openshiftCommonUI'
)
...
...
dist/origin-web-common.js
View file @
bc4c298c
...
@@ -2029,6 +2029,45 @@ angular.module('openshiftCommonUI')
...
@@ -2029,6 +2029,45 @@ angular.module('openshiftCommonUI')
return
!!
annotationFilter
(
deployment
,
'deploymentConfig'
);
return
!!
annotationFilter
(
deployment
,
'deploymentConfig'
);
};
};
}])
}])
.
filter
(
'serviceClassDisplayName'
,
function
()
{
return
function
(
serviceClass
)
{
var
serviceClassDisplayName
=
_
.
get
(
serviceClass
,
'spec.externalMetadata.displayName'
);
if
(
serviceClassDisplayName
)
{
return
serviceClassDisplayName
;
}
var
serviceClassExternalName
=
_
.
get
(
serviceClass
,
'spec.externalName'
);
if
(
serviceClassExternalName
)
{
return
serviceClassExternalName
;
}
return
_
.
get
(
serviceClass
,
'metadata.name'
);
};
})
.
filter
(
'serviceInstanceDisplayName'
,
[
"serviceClassDisplayNameFilter"
,
function
(
serviceClassDisplayNameFilter
)
{
return
function
(
instance
,
serviceClass
)
{
if
(
serviceClass
)
{
return
serviceClassDisplayNameFilter
(
serviceClass
);
}
return
_
.
get
(
instance
,
'metadata.name'
);
};
}])
.
filter
(
'serviceInstanceStatus'
,
[
"isServiceInstanceReadyFilter"
,
function
(
isServiceInstanceReadyFilter
)
{
return
function
(
instance
)
{
var
status
=
'Pending'
;
var
conditions
=
_
.
get
(
instance
,
'status.conditions'
);
var
instanceError
=
_
.
find
(
conditions
,
{
type
:
'Failed'
,
status
:
'True'
});
if
(
instanceError
)
{
status
=
'Failed'
;
}
else
if
(
isServiceInstanceReadyFilter
(
instance
))
{
status
=
'Ready'
;
}
return
status
;
};
}])
;
;
;
'use strict'
;
;
'use strict'
;
angular
.
module
(
'openshiftCommonUI'
)
angular
.
module
(
'openshiftCommonUI'
)
...
...
dist/origin-web-common.min.js
View file @
bc4c298c
...
@@ -909,6 +909,25 @@ return !!annotationFilter(object, "deployment.kubernetes.io/revision");
...
@@ -909,6 +909,25 @@ return !!annotationFilter(object, "deployment.kubernetes.io/revision");
return
function
(
deployment
)
{
return
function
(
deployment
)
{
return
!!
annotationFilter
(
deployment
,
"deploymentConfig"
);
return
!!
annotationFilter
(
deployment
,
"deploymentConfig"
);
};
};
}
]).
filter
(
"serviceClassDisplayName"
,
function
()
{
return
function
(
serviceClass
)
{
var
serviceClassDisplayName
=
_
.
get
(
serviceClass
,
"spec.externalMetadata.displayName"
);
if
(
serviceClassDisplayName
)
return
serviceClassDisplayName
;
var
serviceClassExternalName
=
_
.
get
(
serviceClass
,
"spec.externalName"
);
return
serviceClassExternalName
?
serviceClassExternalName
:
_
.
get
(
serviceClass
,
"metadata.name"
);
};
}).
filter
(
"serviceInstanceDisplayName"
,
[
"serviceClassDisplayNameFilter"
,
function
(
serviceClassDisplayNameFilter
)
{
return
function
(
instance
,
serviceClass
)
{
return
serviceClass
?
serviceClassDisplayNameFilter
(
serviceClass
)
:
_
.
get
(
instance
,
"metadata.name"
);
};
}
]).
filter
(
"serviceInstanceStatus"
,
[
"isServiceInstanceReadyFilter"
,
function
(
isServiceInstanceReadyFilter
)
{
return
function
(
instance
)
{
var
status
=
"Pending"
,
conditions
=
_
.
get
(
instance
,
"status.conditions"
),
instanceError
=
_
.
find
(
conditions
,
{
type
:
"Failed"
,
status
:
"True"
});
return
instanceError
?
status
=
"Failed"
:
isServiceInstanceReadyFilter
(
instance
)
&&
(
status
=
"Ready"
),
status
;
};
}
]),
angular
.
module
(
"openshiftCommonUI"
).
filter
(
"camelToLower"
,
function
()
{
}
]),
angular
.
module
(
"openshiftCommonUI"
).
filter
(
"camelToLower"
,
function
()
{
return
function
(
str
)
{
return
function
(
str
)
{
return
str
?
_
.
startCase
(
str
).
toLowerCase
()
:
str
;
return
str
?
_
.
startCase
(
str
).
toLowerCase
()
:
str
;
...
...
src/filters/resources.js
View file @
bc4c298c
...
@@ -174,4 +174,43 @@ angular.module('openshiftCommonUI')
...
@@ -174,4 +174,43 @@ angular.module('openshiftCommonUI')
return
!!
annotationFilter
(
deployment
,
'deploymentConfig'
);
return
!!
annotationFilter
(
deployment
,
'deploymentConfig'
);
};
};
})
})
.
filter
(
'serviceClassDisplayName'
,
function
()
{
return
function
(
serviceClass
)
{
var
serviceClassDisplayName
=
_
.
get
(
serviceClass
,
'spec.externalMetadata.displayName'
);
if
(
serviceClassDisplayName
)
{
return
serviceClassDisplayName
;
}
var
serviceClassExternalName
=
_
.
get
(
serviceClass
,
'spec.externalName'
);
if
(
serviceClassExternalName
)
{
return
serviceClassExternalName
;
}
return
_
.
get
(
serviceClass
,
'metadata.name'
);
};
})
.
filter
(
'serviceInstanceDisplayName'
,
function
(
serviceClassDisplayNameFilter
)
{
return
function
(
instance
,
serviceClass
)
{
if
(
serviceClass
)
{
return
serviceClassDisplayNameFilter
(
serviceClass
);
}
return
_
.
get
(
instance
,
'metadata.name'
);
};
})
.
filter
(
'serviceInstanceStatus'
,
function
(
isServiceInstanceReadyFilter
)
{
return
function
(
instance
)
{
var
status
=
'Pending'
;
var
conditions
=
_
.
get
(
instance
,
'status.conditions'
);
var
instanceError
=
_
.
find
(
conditions
,
{
type
:
'Failed'
,
status
:
'True'
});
if
(
instanceError
)
{
status
=
'Failed'
;
}
else
if
(
isServiceInstanceReadyFilter
(
instance
))
{
status
=
'Ready'
;
}
return
status
;
};
})
;
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment