Upgraded all libraries, switched to npm, upgraded angular and jdk21
Locusworks Team/portal-webapp/pipeline/head There was a failure building this commit
Locusworks Team/portal-webapp/pipeline/head There was a failure building this commit
This commit is contained in:
1 parent
c2f8e20fad
commit
a6df549919
335 files changed
+10923
-12700
No files matched your search
+8
-13
@@ -2,19 +2,15 @@
|
||||
.idea
|
||||
.project
|
||||
.settings
|
||||
portal_client/dist/
|
||||
portal_client/nbproject/private/
|
||||
portal_client/node/
|
||||
portal_client/node_modules/
|
||||
portal_client/test_out/
|
||||
portal_client/temp/
|
||||
portal_client/app/compiled-less
|
||||
portal_client/app/index.html
|
||||
portal_client/app/yarn_components/**
|
||||
portal_client/dist/
|
||||
portal_client/.angular/
|
||||
portal_client/nbproject/private/
|
||||
portal_client/node/
|
||||
portal_client/node_modules/
|
||||
portal_client/test_out/
|
||||
portal_client/temp/
|
||||
portal_webapp/.externalToolBuilders/
|
||||
portal_client/yarn.l*
|
||||
portal_client/yarn-*
|
||||
npm-debug.log
|
||||
npm-debug.log
|
||||
phantomjs
|
||||
tags
|
||||
*.DS_Store
|
||||
@@ -29,7 +25,6 @@ tags
|
||||
/filerepo_api/
|
||||
**/*.aux
|
||||
**/*.bbl
|
||||
**/yarn.lock
|
||||
**/*.blg
|
||||
**/*.log
|
||||
**/*.out
|
||||
Vendored
+85
@@ -0,0 +1,85 @@
|
||||
pipeline {
|
||||
agent any
|
||||
|
||||
options {
|
||||
buildDiscarder(logRotator(numToKeepStr: '5'))
|
||||
disableConcurrentBuilds()
|
||||
skipDefaultCheckout(true)
|
||||
timestamps()
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Checkout') {
|
||||
steps { checkout scm }
|
||||
}
|
||||
|
||||
stage('Set version') {
|
||||
steps {
|
||||
script {
|
||||
String branch = env.BRANCH_NAME
|
||||
if (!branch) { error('BRANCH_NAME is unavailable; this pipeline must run as a multibranch job') }
|
||||
env.DEPLOY_BUILD = 'false'
|
||||
def releaseMatch = branch =~ /^release\/(\d+\.\d+(?:\.\d+)?)$/
|
||||
if (releaseMatch.matches()) {
|
||||
env.BUILD_VERSION = "${releaseMatch[0][1]}.${env.BUILD_NUMBER}-RELEASE"
|
||||
env.DEPLOY_BUILD = 'true'
|
||||
} else if (branch == 'develop') {
|
||||
env.BUILD_VERSION = "develop.${env.BUILD_NUMBER}-SNAPSHOT"
|
||||
env.DEPLOY_BUILD = 'true'
|
||||
} else {
|
||||
String safeBranch = branch.replaceAll(/[^A-Za-z0-9._-]/, '-')
|
||||
env.BUILD_VERSION = "0.0.${env.BUILD_NUMBER}-${safeBranch}-SNAPSHOT"
|
||||
}
|
||||
currentBuild.displayName = env.BUILD_VERSION
|
||||
}
|
||||
withMaven(maven: 'maven-3.9.16', globalMavenSettingsConfig: 'locusworks-settings') {
|
||||
sh 'mvn -B org.codehaus.mojo:versions-maven-plugin:2.21.0:set -DprocessAllModules=true -DgenerateBackupPoms=false -DnewVersion="$BUILD_VERSION"'
|
||||
sh 'mvn -B org.codehaus.mojo:versions-maven-plugin:2.21.0:set-property -Dproperty=current.version -DgenerateBackupPoms=false -DnewVersion="$BUILD_VERSION"'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Prepare OWASP cache') {
|
||||
steps {
|
||||
withCredentials([string(credentialsId: 'nvd-api-key', variable: 'NVD_API_KEY')]) {
|
||||
lock(resource: 'owasp-nvd-cache') {
|
||||
withMaven(maven: 'maven-3.9.16', globalMavenSettingsConfig: 'locusworks-settings') {
|
||||
sh 'mkdir -p "$HOME/.cache/dependency-check"'
|
||||
sh 'mvn -B org.owasp:dependency-check-maven:13.0.0:update-only -DdataDirectory="$HOME/.cache/dependency-check"'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Build and test') {
|
||||
steps {
|
||||
withMaven(maven: 'maven-3.9.16', globalMavenSettingsConfig: 'locusworks-settings') {
|
||||
sh 'mvn -B clean verify -DdataDirectory="$HOME/.cache/dependency-check" -DautoUpdate=false -Dbuild.revision="$GIT_COMMIT"'
|
||||
}
|
||||
}
|
||||
post {
|
||||
always { junit allowEmptyResults: true, testResults: '**/target/surefire-reports/*.xml' }
|
||||
success {
|
||||
archiveArtifacts artifacts: '**/target/*.jar', fingerprint: true
|
||||
archiveArtifacts artifacts: '**/target/site/jacoco/**', fingerprint: true, allowEmptyArchive: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Deploy') {
|
||||
when { expression { env.DEPLOY_BUILD == 'true' } }
|
||||
steps {
|
||||
withMaven(maven: 'maven-3.9.16', globalMavenSettingsConfig: 'locusworks-settings') {
|
||||
sh 'mvn -B deploy -DskipTests -Ddependency-check.skip=true -Dbuild.number="$BUILD_NUMBER" -Dbuild.revision="$GIT_COMMIT"'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
post {
|
||||
success { echo "Published build ${env.BUILD_VERSION} successfully" }
|
||||
failure { echo "Build ${env.BUILD_VERSION ?: env.BUILD_NUMBER} failed" }
|
||||
cleanup { deleteDir() }
|
||||
}
|
||||
}
|
||||
@@ -2,23 +2,41 @@
|
||||
---
|
||||
1. Clone the repository from BigMac:
|
||||
- Add your public key to BigMac account.
|
||||
- Clone the repository: `git clone "ssh://git@bigmac.northgrum.com:8010/saipt/portal-webapp.git"`
|
||||
- Clone the repository: `git clone "ssh://git@bigmac.locusworks.net:8010/saipt/portal-webapp.git"`
|
||||
2. Create/Edit `settings.xml` in your `.m2` folder (see next section for example)
|
||||
3. This project requires ngas-commons to be built prior to building this application
|
||||
- Checkout `ngas-commons` (`"ssh://git@bigmac.northgrum.com:8010/saipt/ngas-commons.git"`)
|
||||
- Change directories into `ngas-commons` and run `mvn clean install`
|
||||
4. Change directories into the project and run `mvn clean install` (This might take awhile)
|
||||
5. Once the server launches, you should be able to access the webapp by browsing to `http://localhost:8080/portal/`
|
||||
|
||||
## Yarn
|
||||
---
|
||||
Yarn is the the new package manager used with node.js in replacement of `npm` it uses the same package.json file.
|
||||
|
||||
To download a new client side library use the command `yarn add <package_name> --save`. This will add the files to the `node_modules` library.
|
||||
|
||||
Next include the appropriate file into the `assets.js` file inside `portal_client` to make sure it will be injected into the `index.html` file during run time.
|
||||
|
||||
The `assets.js` file specifies all the vendor libraries that have to be included into the client code during build.
|
||||
3. Change directories into the project and run `mvn clean install` (this may take a while).
|
||||
4. Start the executable Spring Boot application with `java -jar portal_webapp/target/portal_webapp-1.0.0-RELEASE.jar`.
|
||||
5. Browse to `http://localhost:8080/portal/`.
|
||||
|
||||
Application configuration is stored under `${user.home}/.portal` by default. Override this persistent location with the `PORTAL_HOME` environment variable or the `-Dportal.home=/path/to/portal` JVM property. The directory contains `portal.properties`, the AES seed, logger settings, logs, and temporary key files.
|
||||
|
||||
Local runs use a persistent H2 database by default. Set `dbType=mysql` in `portal.properties` only when an external MySQL server is intended; H2 and MySQL have separate connection and credential properties.
|
||||
|
||||
External MySQL deployments require MySQL Server 8.4 or newer with Connector/J 26.7.0.
|
||||
|
||||
## npm
|
||||
---
|
||||
npm is used to install the Angular client dependencies declared in `portal_client/package.json`.
|
||||
|
||||
The Maven build provisions the supported Node.js LTS and npm versions declared in the root `pom.xml`; a global installation is not required for Maven builds.
|
||||
|
||||
From `portal_client`, run `npm ci` for a reproducible install, `npm test` for unit tests, and `npm run build` for the production bundle. Angular CLI discovers application imports and static assets directly; no legacy asset-injection manifest is required.
|
||||
|
||||
The `allowScripts` entries in `package.json` approve specific versions of the native Angular build helpers. Review and renew those entries when upgrading the corresponding packages. SockJS remains an explicitly allowed CommonJS dependency for the server's SockJS transport. STOMP uses its ESM entry through the TypeScript path mapping because version 7.3.0's browser export selects UMD.
|
||||
|
||||
## Dependency checks
|
||||
|
||||
`mvn clean install` runs OWASP Dependency-Check. NVD, RetireJS, and the npm lockfile audit remain enabled; the npm audit includes development dependencies. The Node Package Analyzer skips development dependencies to avoid treating uninstalled native binaries for other platforms as missing application packages.
|
||||
|
||||
Sonatype OSS Index requires credentials and is opt-in. Configure a Maven `settings.xml` server with ID `oss-index`, your account username, and API token, then run `mvn clean install -Dportal.ossIndexEnabled=true` to include it.
|
||||
|
||||
## H2 tests
|
||||
---
|
||||
Tests use an isolated in-memory H2 database through the `portal.database.*` system-property overrides. Production continues to default to MySQL.
|
||||
|
||||
Run the common-module datasource test with:
|
||||
|
||||
`mvn -pl portal_common -am test`
|
||||
|
||||
|
||||
## Settings.xml
|
||||
@@ -31,19 +49,19 @@ Sample:
|
||||
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
|
||||
<proxies>
|
||||
<proxy>
|
||||
<id>ngas-proxy</id>
|
||||
<id>locusworks-proxy</id>
|
||||
<active>true</active>
|
||||
<protocol>http</protocol>
|
||||
<host>eastproxy.northgrum.com</host>
|
||||
<host>eastproxy.locusworks.net</host>
|
||||
<port>80</port>
|
||||
<username>(your MyID)</username>
|
||||
<password>(your login password)</password>
|
||||
</proxy>
|
||||
<proxy>
|
||||
<id>ngas-proxy2</id>
|
||||
<id>locusworks-proxy2</id>
|
||||
<active>true</active>
|
||||
<protocol>https</protocol>
|
||||
<host>eastproxy.northgrum.com</host>
|
||||
<host>eastproxy.locusworks.net</host>
|
||||
<port>80</port>
|
||||
<username>(your MyID)</username>
|
||||
<password>(your login password)</password>
|
||||
@@ -55,29 +73,13 @@ Sample:
|
||||
<username>root</username>
|
||||
<password>(mysql root password)</password>
|
||||
</server>
|
||||
<server>
|
||||
<!-- in tomcat conf/tomcat-users.xml specify a user that has role manager-script -->
|
||||
<id>tomcat-localhost</id>
|
||||
<username>(manager-script username)</username>
|
||||
<password>(manager-script password)</password>
|
||||
</server>
|
||||
</servers>
|
||||
<profiles>
|
||||
<profile>
|
||||
<id> local-deploy </id>
|
||||
<properties>
|
||||
<tomcat-home>C:\development\apache-tomcat-8.5.24-portal</tomcat-home>
|
||||
<tomcat-version>8.5.24</tomcat-version>
|
||||
<tomcat-base-url>http://localhost:8080</tomcat-base-url>
|
||||
</properties>
|
||||
</profile>
|
||||
</profiles>
|
||||
</settings>
|
||||
```
|
||||
|
||||
## Configuring Tomcat
|
||||
---
|
||||
Tomcat cannot run on port 80 or 443 unless it is is running as root (big security concern with that). It is suggested to use proxy services like `NGINX` or `Apache` to proxy 80 or 443 traffic to redirect to tomcat
|
||||
</servers>
|
||||
</settings>
|
||||
```
|
||||
|
||||
## Running Spring Boot
|
||||
---
|
||||
The application is packaged as an executable JAR and does not require a separately installed application server. Spring Boot supplies the embedded web server. For production, NGINX or Apache can proxy ports 80 and 443 to the application on port 8080.
|
||||
|
||||
#### NGINX
|
||||
1. In the default /etc/nginx/conf.d add a file called portal.conf
|
||||
@@ -91,11 +93,11 @@ Tomcat cannot run on port 80 or 443 unless it is is running as root (big securit
|
||||
'' close;
|
||||
}
|
||||
|
||||
upstream tomcat {
|
||||
upstream portal_app {
|
||||
# Use IP Hash for session persistence
|
||||
ip_hash;
|
||||
|
||||
# List of Tomcat application servers
|
||||
# List of Portal application instances
|
||||
server 127.0.0.1:8080;
|
||||
}
|
||||
|
||||
@@ -123,7 +125,7 @@ Tomcat cannot run on port 80 or 443 unless it is is running as root (big securit
|
||||
|
||||
# WebSocket configuration
|
||||
location / {
|
||||
proxy_pass http://tomcat;
|
||||
proxy_pass http://portal_app;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
pipelines:
|
||||
default:
|
||||
- step:
|
||||
name: Portal build
|
||||
image: maven:3.3.9
|
||||
size: 2x
|
||||
caches:
|
||||
- maven
|
||||
- node
|
||||
script:
|
||||
- git clone git@bitbucket.org:locus2k/commons.git --branch 1.1.0-RELEASE
|
||||
- mvn -B install -f commons/pom.xml
|
||||
- mvn -s pipeline-settings.xml -B install # -B batch mode makes Maven less verbose
|
||||
services:
|
||||
- mysql
|
||||
|
||||
definitions:
|
||||
services:
|
||||
mysql:
|
||||
image: mysql:8.0.11
|
||||
environment:
|
||||
MYSQL_DATABASE: 'portal'
|
||||
MYSQL_ROOT_PASSWORD: 'let_me_in'
|
||||
@@ -31,11 +31,11 @@ The following is a list of software that are required to be installed and on be
|
||||
\item Ant \AntVersion\ \cite{ant}
|
||||
\end{enumerate}
|
||||
|
||||
Two projects need to be checkout out from the git repository. The \portal project and the ngas-commons project.
|
||||
Two projects need to be checkout out from the git repository. The \portal project and the locusworks-commons project.
|
||||
|
||||
Section~\ref{dev-setup} describes how to checkout the \portal project
|
||||
|
||||
Section~\ref{ngas-commons} descrives how to checkout and build the \command{ngas-commons} library. This library is needed to build the main web application
|
||||
Section~\ref{locusworks-commons} descrives how to checkout and build the \command{locusworks-commons} library. This library is needed to build the main web application
|
||||
|
||||
To build the project issue the command \command{mvn clean install antrun:run@warcopy} (if tomcat is not running) or \command{mvn clean install tomcat7:redeploy}
|
||||
(if tomcat is currently running). This might take awhile as it will download the required libraries from the internet and deploy the war file to the tomcat server.
|
||||
@@ -46,15 +46,15 @@ Once the build has completed and deployed verify in the logs the application has
|
||||
\section{Encrypted MySQL Root Password}
|
||||
\label{mysql-root-password}
|
||||
|
||||
To encrypted the mysql root password first checkout and compile the \command{ngas-commons} library (See section~\ref{ngas-commons} to perform the task).
|
||||
To encrypted the mysql root password first checkout and compile the \command{locusworks-commons} library (See section~\ref{locusworks-commons} to perform the task).
|
||||
|
||||
Once the commons library has been downloaded and installed perform the following.
|
||||
|
||||
\begin{legal}
|
||||
\item Navigate to the \command{.m2} directory located in the home directory
|
||||
\item Navigate to \filename{repository/com/ngas/ngas-commons/\ngasCommonsVersion}
|
||||
\item Navigate to \filename{repository/net/locusworks/locusworks-commons/\locusworksCommonsVersion}
|
||||
\item Execute the following command\newline
|
||||
\command{java -cp ngas-commons-\ngasCommonsVersion.jar net.locusworks.commons.crypto.AES <root-password>}\newline
|
||||
\command{java -cp locusworks-commons-\locusworksCommonsVersion.jar net.locusworks.commons.crypto.AES <root-password>}\newline
|
||||
Where ``root-password'' is the MySQL root password
|
||||
\end{legal}
|
||||
|
||||
|
||||
+12
-12
@@ -20,32 +20,32 @@ This section describes how to setup the \portal environment to be able to build
|
||||
\begin{enumerate}
|
||||
\item Add developers public key to BigMac account
|
||||
\item Clone the repository \newline
|
||||
\command{git clone ``ssh://git@bigmac.northgrum.com:8010/saipt/portal-webapp.git''}
|
||||
\command{git clone ``ssh://git@bigmac.locusworks.net:8010/saipt/portal-webapp.git''}
|
||||
\end{enumerate}
|
||||
|
||||
\item Create/Edit \command{settings.xml} in the \command{.m2} located in the home directory. See Subsection~\ref{settings.xml}
|
||||
\item \portal requires \command{ngas-commons} library to be built prior to building the web application. See Subsection~\ref{ngas-commons}
|
||||
\item \portal requires \command{locusworks-commons} library to be built prior to building the web application. See Subsection~\ref{locusworks-commons}
|
||||
\item Change directories into the project and run \command{mvn clean install antrun:run@warcopy}. This could take some time to download the required libraries.
|
||||
\item Start the tomcat server and navigate to \command{http://localhost:8080/portal/} to make sure the server comes up
|
||||
\end{enumerate}
|
||||
|
||||
\subsection{NGAS Commons}
|
||||
\label{ngas-commons}
|
||||
NGAS Commons is a common library of functions that other java applications can take advantage of.
|
||||
\subsection{Locusworks Commons}
|
||||
\label{locusworks-commons}
|
||||
Locusworks Commons is a common library of functions that other java applications can take advantage of.
|
||||
|
||||
To checkout the library:\newline
|
||||
\command{git clone ``ssh://git@bigmac.northgrum.com:8010/saipt/ngas-commons.git''}
|
||||
\command{git clone ``ssh://git@bigmac.locusworks.net:8010/saipt/locusworks-commons.git''}
|
||||
|
||||
To build:\newline
|
||||
\command{mvn clean install}
|
||||
|
||||
Note: \command{ngas-commons} needs to be built prior to building the main application
|
||||
Note: \command{locusworks-commons} needs to be built prior to building the main application
|
||||
|
||||
\section{Yarn}
|
||||
\label{yarn}
|
||||
Yarn is the new package manager used with \command{node.js} in replacement of \command{npm} it uses the same \command{pacakge.json} file that \command{npm} did.
|
||||
|
||||
To download a new client side library use the command \command{yarn add <package-name> --save}. This will add the file to the \command{node\_modules} library.
|
||||
\section{npm}
|
||||
\label{npm}
|
||||
npm installs the client-side dependencies declared in \command{package.json}.
|
||||
|
||||
From \command{portal\_client}, run \command{npm install} to install dependencies. To add a client-side library, run \command{npm install <package-name> --save}.
|
||||
|
||||
Next include the appropriate file into the \command{assets.js} file inside \command{portal\_client} to make sure it will be injected into the \command{index.html} file during compile time.
|
||||
|
||||
|
||||
+11
-14
@@ -20,7 +20,7 @@ The following list reflects the tools and libraries used by the \portal develope
|
||||
\item JSch \JSchVersion
|
||||
\item JGit \JGitVersion
|
||||
\item Node.js \NodeVersion
|
||||
\item Yarn \YarnVersion
|
||||
\item npm \NpmVersion
|
||||
\item Flyway \FlywayVersion
|
||||
\item Tomcat \TomcatVersion
|
||||
\end{itemize}
|
||||
@@ -65,7 +65,7 @@ invoke the ant process. \portal utilizes ant version \AntVersion but older versi
|
||||
\section{AngularJs}
|
||||
AngularJs\cite{angularjs} is extensively used inside the client html code along with various other 3rd party javascript libraries. The list of 3rd party libraries used in the client
|
||||
can be found in \filename{assets.js}. It is not necessary to download the AngularJs library as it will be downloaded automatically along with the other vendor libraries during the build
|
||||
process. Yarn is utilized to do this task and place references to the files inside the \filename{index.html} during build. AngularJs is specifically called out because of how much it does
|
||||
process. npm is utilized to do this task and place references to the files inside the \filename{index.html} during build. AngularJs is specifically called out because of how much it does
|
||||
inside the client and developers should be familiar with it. \portal utlizes version \AngularJsVersion of AngularJs as specified in the \filename{package.json} file.
|
||||
|
||||
\section{Spring}
|
||||
@@ -163,22 +163,20 @@ This allows the developer to make changes and not have to rebuild the whole appl
|
||||
|
||||
\portal utilizes version \NodeVersion\ of Node.js. It is possible to use older versions of Node.js but it not recommended for security concerns.
|
||||
|
||||
\section{Yarn}
|
||||
\label{yarn2}
|
||||
\section{npm}
|
||||
\label{npm2}
|
||||
|
||||
Yarn\cite{yarn} is a package manager program that allows for easy download of 3rd party javascript/typescript libraries. It caches every package so it never needs to download it again.
|
||||
Yarn is used as a replacement for node.js package manager (npm) and utilizes the same \filename{package.json} file as npm along with installing the packages in the same directory that
|
||||
npm (\filename{portal\_client/node\_modules}).
|
||||
npm is the package manager used to download third-party JavaScript libraries declared in \filename{package.json}. Packages are installed in
|
||||
\filename{portal\_client/node\_modules}.
|
||||
|
||||
This allows for developers to switch easily from npm to yarn. During build time, maven will automatically download yarn locally to the project so it can use the local process to download
|
||||
the 3rd party libraries as specified in the \filename{package.json} file.
|
||||
During build time, Maven downloads Node.js and npm locally, then installs the exact dependency tree recorded in \filename{package-lock.json}.
|
||||
|
||||
Yarn needs to be installed on the developers home path to be utilizes by the developer to install new packages. To install new packages issue the command
|
||||
\command{yarn add <package-name> --save}. This will download the request package and save the package to the \filename{package.json} file for future reference.
|
||||
To install dependencies, run \command{npm install}. To add a new package, run
|
||||
\command{npm install <package-name> --save} and commit both package files.
|
||||
|
||||
See~\ref{yarn} for more details.
|
||||
See~\ref{npm} for more details.
|
||||
|
||||
\portal utilizes version \YarnVersion of yarn. No older version can be used at this time.
|
||||
\portal utilizes version \NpmVersion of npm.
|
||||
|
||||
\section{Flyway}
|
||||
Flyway\cite{flyway} is an open source database migration tool. It strongly favors simplicity and convention over configuration. It is based around 7 basic commands: Migrate, Clean,
|
||||
@@ -244,4 +242,3 @@ The developer just has to issues the command \command{mvn tomcat7:redeploy} to d
|
||||
|
||||
\portal utilizes version \TomcatVersion of Tomcat. Older or newer versions of tomcat can be used but it is not recommend to go any lower than tomcat 7
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ The following will get a specified configuration value if that value is present
|
||||
\ApiData{\input{api/sample/request/getConfValReq}}{\input{api/sample/response/getConfValResp}}
|
||||
|
||||
\subsection{Get Configuration}
|
||||
The following will get the current configuration values associated with the server as specified in the file \filename{\$TOMCAT\_HOME/conf/portal.properties}
|
||||
The following will get the current configuration values associated with the server as specified in the file \filename{\$PORTAL\_HOME/portal.properties}
|
||||
\begin{apimethod}
|
||||
{Get Configuration}
|
||||
{config/getConfiguration.do}
|
||||
@@ -31,7 +31,7 @@ The following will get the current configuration values associated with the serv
|
||||
\ApiData{\input{api/sample/None}}{\input{api/sample/response/getConfResp}}
|
||||
|
||||
\subsection{Save Configuration}
|
||||
The following will save the server configuration values to \filename{\$TOMCAT\_HOME/conf/portal.properties}. All the parameters are option as they all do not need to be populated, just the ones that need to be changed
|
||||
The following will save the server configuration values to \filename{\$PORTAL\_HOME/portal.properties}. All the parameters are option as they all do not need to be populated, just the ones that need to be changed
|
||||
\begin{apimethod}
|
||||
{Save Configuration}
|
||||
{config/saveConfiguration.do}
|
||||
@@ -52,4 +52,3 @@ The following will save the server configuration values to \filename{\$TOMCAT\_H
|
||||
|
||||
\ApiData{\input{api/sample/response/getConfResp}}{\input{api/sample/SuccessResp}}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
\begin{lstlisting}[language=JSON]
|
||||
{
|
||||
"name": "Stig Apply",
|
||||
"scm": "https://J65594@bigmac.northgrum.com/bitbucket/scm/saipt/stig-apply.git",
|
||||
"scm": "https://J65594@bigmac.locusworks.net/bitbucket/scm/saipt/stig-apply.git",
|
||||
"branch": "develop",
|
||||
"directory": "C:\\stigapply",
|
||||
"credentials": {
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
"scriptEmails": [{
|
||||
"emailName": "Script Status",
|
||||
"recipients": [{
|
||||
"email": "portalAdmin@ngc.com",
|
||||
"email": "portalAdmin@locusworks.net",
|
||||
}]
|
||||
}],
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
"scriptEmails": [{
|
||||
"emailName": "Script Status",
|
||||
"recipients": [{
|
||||
"email": "portalAdmin@ngc.com",
|
||||
"email": "portalAdmin@locusworks.net",
|
||||
}]
|
||||
}],
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
"scriptEmails": [{
|
||||
"emailName": "Script Status",
|
||||
"recipients": [{
|
||||
"email": "portalAdmin@ngc.com",
|
||||
"email": "portalAdmin@locusworks.net",
|
||||
}]
|
||||
}],
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"password": "bar",
|
||||
"lastName": "foo",
|
||||
"firstName": "bar",
|
||||
"email": "bar@ngc.com",
|
||||
"email": "bar@locusworks.net",
|
||||
"role": "USER",
|
||||
"expirationDate": "2028-03-31T19:54:40.550Z",
|
||||
"effectiveDate": "2018-04-03T19:54:39.929Z",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
\begin{minipage}[t]{0.45\textwidth}
|
||||
\begin{lstlisting}[language=JSON]
|
||||
{
|
||||
"email": "bar@ngc.com",
|
||||
"email": "bar@locusworks.net",
|
||||
}
|
||||
\end{lstlisting}
|
||||
\end{minipage}
|
||||
@@ -3,7 +3,7 @@
|
||||
{
|
||||
"id": 5,
|
||||
"name": "Stig Apply",
|
||||
"scm": "https://J65594@bigmac.northgrum.com/bitbucket/scm/saipt/stig-apply.git",
|
||||
"scm": "https://J65594@bigmac.locusworks.net/bitbucket/scm/saipt/stig-apply.git",
|
||||
"branch": "develop",
|
||||
"directory": "C:\\stigapply",
|
||||
"credentials": {
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
"firstName": "Portal",
|
||||
"lastName": "Admin",
|
||||
"role": "ADMIN",
|
||||
"email": "portalAdmin@ngc.com",
|
||||
"email": "portalAdmin@locusworks.net",
|
||||
"expirationDate": 2.534022324e+14,
|
||||
"effectiveDate": 1519275600000,
|
||||
"enabled": true
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
"firstName": "Portal",
|
||||
"lastName": "Admin",
|
||||
"role": "ADMIN",
|
||||
"email": "portalAdmin@ngc.com",
|
||||
"email": "portalAdmin@locusworks.net",
|
||||
"expirationDate": 2.534022324e+14,
|
||||
"effectiveDate": 1519275600000,
|
||||
"enabled": true
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
"scriptEmails": [{
|
||||
"emailName": "Script Status",
|
||||
"recipients": [{
|
||||
"email": "portalAdmin@ngc.com",
|
||||
"email": "portalAdmin@locusworks.net",
|
||||
}]
|
||||
}],
|
||||
}
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
"firstName": "bar",
|
||||
"lastName": "foo",
|
||||
"role": "USER",
|
||||
"username": "bar@ngc.com",
|
||||
"username": "bar@locusworks.net",
|
||||
"password": null,
|
||||
"email": "bar@ngc.com",
|
||||
"email": "bar@locusworks.net",
|
||||
"expirationDate": 1838145280550,
|
||||
"effectiveDate": 1522785279929,
|
||||
"enabled": true
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
{
|
||||
"id": 5,
|
||||
"name": "Stig Apply",
|
||||
"scm": "https://J65594@bigmac.northgrum.com/bitbucket/scm/saipt/stig-apply.git",
|
||||
"scm": "https://J65594@bigmac.locusworks.net/bitbucket/scm/saipt/stig-apply.git",
|
||||
"branch": "develop",
|
||||
"directory": "C:\\stigapply",
|
||||
"credentials": {
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
"firstName": "Portal",
|
||||
"lastName": "Admin",
|
||||
"role": "ADMIN",
|
||||
"email": "portalAdmin@ngc.com",
|
||||
"email": "portalAdmin@locusworks.net",
|
||||
"expirationDate": 2.534022324e+14,
|
||||
"effectiveDate": 1519275600000,
|
||||
"enabled": true
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
"firstName": "Repo",
|
||||
"lastName": "Admin",
|
||||
"role": "ADMIN",
|
||||
"username": "portalAdmin@ngc.com",
|
||||
"username": "portalAdmin@locusworks.net",
|
||||
"password": null,
|
||||
"email": "portalAdmin@ngc.com",
|
||||
"email": "portalAdmin@locusworks.net",
|
||||
"expirationDate": 2.534022324e+14,
|
||||
"effectiveDate": 1517979600000,
|
||||
"enabled": true
|
||||
@@ -20,9 +20,9 @@
|
||||
"firstName": "foo",
|
||||
"lastName": "bar",
|
||||
"role": "USER",
|
||||
"username": "foo@ngc.com",
|
||||
"username": "foo@locusworks.net",
|
||||
"password": null,
|
||||
"email": "foo@ngc.com",
|
||||
"email": "foo@locusworks.net",
|
||||
"expirationDate": 1838088000000,
|
||||
"effectiveDate": 1522728000000,
|
||||
"enabled": true
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"dbUsername": "portalAdmin",
|
||||
"filepath": "C:\\tempStorage",
|
||||
"dbPassword": "CWg48+h4q7iK4ICGaDhRd10EMQfFgthm3FjhkLd6gis="
|
||||
"aesSeedFile": "C:/development/apache-tomcat-8.5.24/conf/portal.tomcat"
|
||||
"aesSeedFile": "C:/Users/user/.portal/portal.tomcat"
|
||||
}
|
||||
\end{lstlisting}
|
||||
\end{minipage}
|
||||
\end{minipage}
|
||||
@@ -6,8 +6,8 @@
|
||||
"firstName": "foo",
|
||||
"lastName": "bar",
|
||||
"role": "USER",
|
||||
"username": "foo@ngc.com",
|
||||
"email": "foo@ngc.com",
|
||||
"username": "foo@locusworks.net",
|
||||
"email": "foo@locusworks.net",
|
||||
"expirationDate": 2.534022324e+14,
|
||||
"effectiveDate": 1517979600000,
|
||||
"enabled": true,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
% FILE : ApacheAppendix.tex
|
||||
% SUBJECT : ApacheApendex.
|
||||
% AUTHOR : (C) Copyright 2018 by Northrop Grumman
|
||||
% AUTHOR : (C) Copyright 2018 by Locusworks
|
||||
%
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
% FILE : Architecture.tex
|
||||
% SUBJECT : Document describing architecture issues in the entire Patch Repository system.
|
||||
% AUTHOR : (C) Copyright 2018 by Northrop Grumman
|
||||
% AUTHOR : (C) Copyright 2018 by Locusworks
|
||||
%
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
% FILE : Architecture.tex
|
||||
% SUBJECT : Document describing architecture issues in the entire Patch Repository system.
|
||||
% AUTHOR : (C) Copyright 2018 by Northrop Grumman
|
||||
% AUTHOR : (C) Copyright 2018 by Locusworks
|
||||
%
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
% FILE : Revision.tex
|
||||
% SUBJECT : Revision history.
|
||||
% AUTHOR : (C) Copyright 2018 by Northrop Grumman
|
||||
% AUTHOR : (C) Copyright 2018 by Locusworks
|
||||
%
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
% FILE : ApacheAppendix.tex
|
||||
% SUBJECT : ApacheApendex.
|
||||
% AUTHOR : (C) Copyright 2018 by Northrop Grumman
|
||||
% AUTHOR : (C) Copyright 2018 by Locusworks
|
||||
%
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
% FILE : Architecture.tex
|
||||
% SUBJECT : Document describing architecture issues in the entire Patch Repository system.
|
||||
% AUTHOR : (C) Copyright 2018 by Northrop Grumman
|
||||
% AUTHOR : (C) Copyright 2018 by Locusworks
|
||||
%
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
userExpirationDays=3650
|
||||
logLevel=INFO
|
||||
dbHost=localhost
|
||||
dbType=h2
|
||||
h2Url=jdbc:h2:file:${portal.home}/data/portal;MODE=MySQL;DATABASE_TO_LOWER=TRUE;DEFAULT_NULL_ORDERING=HIGH;NON_KEYWORDS=VALUE;DB_CLOSE_ON_EXIT=FALSE;INIT=CREATE SCHEMA IF NOT EXISTS portal
|
||||
h2Username=sa
|
||||
h2Password=
|
||||
dbHost=localhost
|
||||
dbPort=3306
|
||||
dbUsername=portalAdmin
|
||||
dbPassword=CWg48+h4q7iK4ICGaDhRd10EMQfFgthm3FjhkLd6gis\=
|
||||
@@ -8,4 +12,4 @@ dbRootUser=root
|
||||
dbRootPassword=Em46JDIzVOWBgGFqxDrqnw\=\=
|
||||
caCertFile=${user.home}/cacerts.jks
|
||||
caCertPassword=N/OQnJ9uQh1oYxadwGC3vA==
|
||||
aesSeedFile=${catalina.base}/conf/portal.tomcat
|
||||
aesSeedFile=${portal.home}/portal.tomcat
|
||||
@@ -2,19 +2,19 @@
|
||||
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
|
||||
<proxies>
|
||||
<proxy>
|
||||
<id>ngas-proxy</id>
|
||||
<id>locusworks-proxy</id>
|
||||
<active>true</active>
|
||||
<protocol>http</protocol>
|
||||
<host>eastproxy.northgrum.com</host>
|
||||
<host>eastproxy.locusworks.net</host>
|
||||
<port>80</port>
|
||||
<username>(your MyID)</username>
|
||||
<password>(your login password)</password>
|
||||
</proxy>
|
||||
<proxy>
|
||||
<id>ngas-proxy2</id>
|
||||
<id>locusworks-proxy2</id>
|
||||
<active>true</active>
|
||||
<protocol>https</protocol>
|
||||
<host>eastproxy.northgrum.com</host>
|
||||
<host>eastproxy.locusworks.net</host>
|
||||
<port>80</port>
|
||||
<username>(your MyID)</username>
|
||||
<password>(your login password)</password>
|
||||
@@ -37,10 +37,9 @@
|
||||
<profile>
|
||||
<id> local-deploy </id>
|
||||
<properties>
|
||||
<tomcat-home>C:\development\apache-tomcat-8.5.24</tomcat-home>
|
||||
<tomcat-version>8.5.24</tomcat-version>
|
||||
<tomcat-home>C:\development\apache-tomcat-9.0.121</tomcat-home>
|
||||
<tomcat-base-url>http://localhost:8080</tomcat-base-url>
|
||||
</properties>
|
||||
</profile>
|
||||
</profiles>
|
||||
</settings>
|
||||
</settings>
|
||||
@@ -1,7 +1,7 @@
|
||||
\section{Log Level Settings}
|
||||
\label{logLevel}
|
||||
|
||||
The server utilizes loggers that logs various server events. These log are all stored in a log file on the server. If using \command{tomcat} server these logs are located at \filename{\$TOMCAT\_HOME/logs/portal.out}.
|
||||
The server uses loggers for server events. These logs are stored under \filename{\$PORTAL\_HOME/logs}; by default, \filename{\$PORTAL\_HOME} is \filename{\${user.home}/.portal}.
|
||||
|
||||
Each application component has a logger associated with it with the default log level of \command{INFO} which will show general information to highlight progress. Each log level has an assigned level of importants with \command{OFF} being the most important and \command{ALL} being the least important. When determining what the log, the event to be logged compares itself to the logger and what its level is set at. If the event being logged is less important than the current log level for the component, that event will be ignored. If it is greater than or equal to the current level, the event will be logged.
|
||||
|
||||
@@ -27,7 +27,7 @@ The level of importances from greatest to least is
|
||||
\subsection{Changing log levels}
|
||||
The following case allows a user to change the log level for server components. Upon saving the log levels, the component will now respects its new level and log according.
|
||||
|
||||
NOTE: These values are presisted. Upon server restart, the server will see if there is an entry for the logger and set the log level according, otherwise; it will set it to the default value. The location for the persisted patch repo logging file is \filename{\$TOMCAT\_HOME/conf/portal-loggers.properties}.
|
||||
NOTE: These values are persisted. Upon server restart, the server will see if there is an entry for the logger and set the log level accordingly; otherwise, it will use the default value. The location for the persisted portal logging file is \filename{\$PORTAL\_HOME/portal-loggers.properties}.
|
||||
|
||||
When displaying the log levels, the levels are displayed in alphabetical order based off the component name
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ The following case allows the user to authenticate with the server. See Figure~\
|
||||
\end{enumerate}
|
||||
\end{usecase}
|
||||
|
||||
The default username is: \bold{\command{portalAdmin@ngc.com}}
|
||||
The default username is: \bold{\command{portalAdmin@locusworks.net}}
|
||||
|
||||
The default password is: \bold{\command{portalAdmin2017!}}
|
||||
|
||||
|
||||
+5
-5
@@ -43,19 +43,19 @@
|
||||
\end{tabular}
|
||||
}
|
||||
|
||||
\newcommand{\ngasCommonsVersion}{1.0.0-RELEASE\xspace}
|
||||
\newcommand{\locusworksCommonsVersion}{1.0.0-RELEASE\xspace}
|
||||
\newcommand{\EclipseVersion}{Oxygen.2 Release (4.7.2)\xspace}
|
||||
\newcommand{\JavaVersion}{1.8.0\xspace}
|
||||
\newcommand{\JavaVersion}{21\xspace}
|
||||
\newcommand{\MavenVersion}{3.5.3\xspace}
|
||||
\newcommand{\AntVersion}{1.9.10\xspace}
|
||||
\newcommand{\AngularJsVersion}{1.6.9\xspace}
|
||||
\newcommand{\SpringVersion}{5.0.5-RELEASE\xspace}
|
||||
\newcommand{\NodeVersion}{v.8.9.4\xspace}
|
||||
\newcommand{\YarnVersion}{1.3.2\xspace}
|
||||
\newcommand{\NodeVersion}{24.20.0\xspace}
|
||||
\newcommand{\NpmVersion}{12.0.2\xspace}
|
||||
\newcommand{\HibernateVersion}{5.2.16.Final\xspace}
|
||||
\newcommand{\FlywayVersion}{5.0.7\xspace}
|
||||
\newcommand{\MySQLVersion}{5.7\xspace}
|
||||
\newcommand{\TomcatVersion}{8.5.24\xspace}
|
||||
\newcommand{\TomcatVersion}{9.0.121\xspace}
|
||||
\newcommand{\QuartzVerson}{2.3.0\xspace}
|
||||
\newcommand{\JSchVersion}{0.1.54\xspace}
|
||||
\newcommand{\JGitVersion}{4.11.0.201803080745-r\xspace}
|
||||
|
||||
+1
-1
@@ -81,7 +81,7 @@
|
||||
%Title page
|
||||
%-------------------
|
||||
%\title{\portal Documentation}
|
||||
%\author{Northrop Grumman}
|
||||
%\author{Locusworks}
|
||||
%\date{21 March, 2018}
|
||||
%\maketitle
|
||||
\begin{titlepage}
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
|
||||
<servers>
|
||||
<server>
|
||||
<id>flyway-localhost</id>
|
||||
<username>root</username>
|
||||
<password>let_me_in</password>
|
||||
</server>
|
||||
</servers>
|
||||
<profiles>
|
||||
<profile>
|
||||
<id> local-deploy </id>
|
||||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
<properties>
|
||||
<tomcat-home>D:\Development\apache-tomcat-9.0.10</tomcat-home>
|
||||
<tomcat-version>9.0.10</tomcat-version>
|
||||
<tomcat-deploy-url>http://localhost:8080</tomcat-deploy-url>
|
||||
</properties>
|
||||
</profile>
|
||||
</profiles>
|
||||
</settings>
|
||||
@@ -17,24 +17,69 @@
|
||||
</organization>
|
||||
|
||||
<scm>
|
||||
<connection>scm://git@bitbucket.org:locus2k/portal-webapp.git</connection>
|
||||
<connection>ssh://gitea@gitea.locusworks.net:7999/locusworks/portal-webapp.git</connection>
|
||||
</scm>
|
||||
|
||||
<distributionManagement>
|
||||
<snapshotRepository>
|
||||
<id>nexus-snapshot</id>
|
||||
<url>${nexus.repo}/repository/locusworks-snapshot/</url>
|
||||
</snapshotRepository>
|
||||
<repository>
|
||||
<id>nexus-release</id>
|
||||
<url>${nexus.repo}/repository/locusworks-release/</url>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>locusworks-public</id>
|
||||
<name>locusworks-public</name>
|
||||
<url>${nexus.repo}/repository/locusworks-public/</url>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>locusworks-public</id>
|
||||
<url>${nexus.repo}/repository/locusworks-public/</url>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
<spring.version>5.0.7.RELEASE</spring.version>
|
||||
<spring.security.version>5.0.6.RELEASE</spring.security.version>
|
||||
<nexus.repo>https://nexus.locusworks.net</nexus.repo>
|
||||
<java.version>21</java.version>
|
||||
<maven.compiler.release>${java.version}</maven.compiler.release>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<spring-boot.version>4.1.1</spring-boot.version>
|
||||
<tomcat.version>11.0.25</tomcat.version>
|
||||
<mysql-connector.version>26.7.0</mysql-connector.version>
|
||||
<!-- Enable with -Dportal.ossIndexEnabled=true and a Maven server named oss-index. -->
|
||||
<portal.ossIndexEnabled>false</portal.ossIndexEnabled>
|
||||
<main.basedir>${project.basedir}</main.basedir>
|
||||
<hibernate.version>5.2.16.Final</hibernate.version>
|
||||
<flyway.version>5.1.4</flyway.version>
|
||||
<leak-prevention.version>2.6.1</leak-prevention.version>
|
||||
<h2.version>2.4.240</h2.version>
|
||||
<flyway.version>13.5.0</flyway.version>
|
||||
<leak-prevention.version>2.7.0</leak-prevention.version>
|
||||
<current.version>1.0.0-RELEASE</current.version>
|
||||
<slf4j.version>1.7.25</slf4j.version>
|
||||
<findbugs.version>3.0.5</findbugs.version>
|
||||
<junit.version>4.12</junit.version>
|
||||
<war.name>portal</war.name>
|
||||
<tomcat.deploy.url>${tomcat-deploy-url}/manager/text </tomcat.deploy.url>
|
||||
<tomcat.deploy.server> tomcat-localhost </tomcat.deploy.server>
|
||||
<junit.version>4.13.2</junit.version>
|
||||
<frontend-maven-plugin.version>2.0.2</frontend-maven-plugin.version>
|
||||
<node.version>v24.20.0</node.version>
|
||||
<npm.version>12.0.2</npm.version>
|
||||
<flyway_deploy.url> jdbc:mysql://localhost:3306 </flyway_deploy.url>
|
||||
<flyway_deploy.server> flyway-localhost </flyway_deploy.server>
|
||||
</properties>
|
||||
@@ -53,37 +98,37 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<version>3.12.0</version>
|
||||
<configuration>
|
||||
<additionalparam>-Xdoclint:none</additionalparam>
|
||||
<failOnError>false</failOnError>
|
||||
<additionalDependencies>
|
||||
<additionalDependency>
|
||||
<groupId>javax.interceptor</groupId>
|
||||
<artifactId>javax.interceptor-api</artifactId>
|
||||
<version>1.2.1</version>
|
||||
<groupId>jakarta.interceptor</groupId>
|
||||
<artifactId>jakarta.interceptor-api</artifactId>
|
||||
<version>2.2.0</version>
|
||||
</additionalDependency>
|
||||
<additionalDependency>
|
||||
<groupId>javax.annotation</groupId>
|
||||
<artifactId>javax.annotation-api</artifactId>
|
||||
<version>1.3.1</version>
|
||||
<groupId>jakarta.annotation</groupId>
|
||||
<artifactId>jakarta.annotation-api</artifactId>
|
||||
<version>3.0.0</version>
|
||||
</additionalDependency>
|
||||
</additionalDependencies>
|
||||
<groups>
|
||||
<group>
|
||||
<title>NGAS Portal Common Library</title>
|
||||
<title>Locusworks Portal Common Library</title>
|
||||
<packages>net.locusworks.portal.common*</packages>
|
||||
</group>
|
||||
<group>
|
||||
<title>NGAS Portal Database Library</title>
|
||||
<title>Locusworks Portal Database Library</title>
|
||||
<packages>net.locusworks.portal.database*</packages>
|
||||
</group>
|
||||
<group>
|
||||
<title>NGAS Portal Migration Library</title>
|
||||
<title>Locusworks Portal Migration Library</title>
|
||||
<packages>net.locusworks.portal.migration*</packages>
|
||||
</group>
|
||||
<group>
|
||||
<title>NGAS Portal WebApp Library</title>
|
||||
<title>Locusworks Portal WebApp Library</title>
|
||||
<packages>
|
||||
net.locusworks.portal.config
|
||||
:net.locusworks.portal.controllers
|
||||
@@ -130,7 +175,7 @@
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>versions-maven-plugin</artifactId>
|
||||
<version>2.2</version>
|
||||
<version>2.21.0</version>
|
||||
<configuration>
|
||||
<generateBackupPoms>false</generateBackupPoms>
|
||||
</configuration>
|
||||
@@ -141,14 +186,19 @@
|
||||
<plugin>
|
||||
<groupId>org.owasp</groupId>
|
||||
<artifactId>dependency-check-maven</artifactId>
|
||||
<version>3.1.2</version>
|
||||
<version>13.0.0</version>
|
||||
<configuration>
|
||||
<mavenSettingsProxyId>ngas-proxy2</mavenSettingsProxyId>
|
||||
<skipProvidedScope>true</skipProvidedScope>
|
||||
<skipTestScope>true</skipTestScope>
|
||||
<skipTestScope>true</skipTestScope>
|
||||
<!-- OSS Index cannot run anonymously; NVD and other analyzers remain enabled. -->
|
||||
<ossIndexAnalyzerEnabled>${portal.ossIndexEnabled}</ossIndexAnalyzerEnabled>
|
||||
<!-- Native dev-tool binaries for other platforms are not deployed.
|
||||
Keep the lockfile audit of ALL npm dependencies, including dev tools. -->
|
||||
<nodePackageSkipDevDependencies>true</nodePackageSkipDevDependencies>
|
||||
<nodeAuditSkipDevDependencies>false</nodeAuditSkipDevDependencies>
|
||||
<failOnError>false</failOnError>
|
||||
<versionCheckEnabled>true</versionCheckEnabled>
|
||||
</configuration>
|
||||
<nvdApiKey>e2eb1036-9b5b-4df9-95e7-0888be947011</nvdApiKey> </configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
@@ -159,38 +209,23 @@
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.1</version>
|
||||
<version>3.16.0</version>
|
||||
<configuration>
|
||||
<source>${java.version}</source>
|
||||
<target>${java.version}</target>
|
||||
<release>${maven.compiler.release}</release>
|
||||
<showDeprecation>true</showDeprecation>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<version>2.5</version>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>3.5.6</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.tomcat.maven</groupId>
|
||||
<artifactId>tomcat7-maven-plugin</artifactId>
|
||||
<version>2.2</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-nop</artifactId>
|
||||
<version>${slf4j.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<configuration>
|
||||
<url>${tomcat.deploy.url}</url>
|
||||
<server>${tomcat.deploy.server}</server>
|
||||
<warFile>target/portal.war</warFile>
|
||||
<path>/portal</path>
|
||||
</configuration>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<version>3.1.4</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-scm-plugin</artifactId>
|
||||
<version>1.9.4</version>
|
||||
<version>2.2.1</version>
|
||||
<configuration>
|
||||
<tag>portal-${project.version}</tag>
|
||||
</configuration>
|
||||
@@ -198,22 +233,50 @@
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<!-- Security fixes newer than the Spring Boot 4.1.1 BOM. -->
|
||||
<dependency>
|
||||
<groupId>org.apache.tomcat.embed</groupId>
|
||||
<artifactId>tomcat-embed-core</artifactId>
|
||||
<version>${tomcat.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.tomcat.embed</groupId>
|
||||
<artifactId>tomcat-embed-el</artifactId>
|
||||
<version>${tomcat.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.tomcat.embed</groupId>
|
||||
<artifactId>tomcat-embed-websocket</artifactId>
|
||||
<version>${tomcat.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.mysql</groupId>
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
<version>${mysql-connector.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-dependencies</artifactId>
|
||||
<version>${spring-boot.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-beanutils</groupId>
|
||||
<artifactId>commons-beanutils</artifactId>
|
||||
<version>1.9.3</version>
|
||||
<version>1.11.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
<version>1.11</version>
|
||||
<version>1.22.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.6</version>
|
||||
<version>2.22.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
@@ -228,74 +291,47 @@
|
||||
<version>${junit.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.h2database</groupId>
|
||||
<artifactId>h2</artifactId>
|
||||
<version>${h2.version}</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi</artifactId>
|
||||
<version>3.17</version>
|
||||
<version>5.5.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi-ooxml</artifactId>
|
||||
<version>3.17</version>
|
||||
<version>5.5.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.7</version>
|
||||
<version>3.20.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-fileupload</groupId>
|
||||
<artifactId>commons-fileupload</artifactId>
|
||||
<version>1.3.3</version>
|
||||
<version>1.6.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-math3</artifactId>
|
||||
<version>3.6.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.tomcat</groupId>
|
||||
<artifactId>tomcat-jdbc</artifactId>
|
||||
<version>${tomcat-version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-validator</groupId>
|
||||
<artifactId>commons-validator</artifactId>
|
||||
<version>1.6</version>
|
||||
<version>1.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Spring Framework jars to be shared across projects -->
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-core</artifactId>
|
||||
<version>${spring.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-aop</artifactId>
|
||||
<version>${spring.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context</artifactId>
|
||||
<version>${spring.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-jdbc</artifactId>
|
||||
<version>${spring.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-tx</artifactId>
|
||||
<version>${spring.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.data</groupId>
|
||||
<artifactId>spring-data-jpa</artifactId>
|
||||
<version>2.0.8.RELEASE</version>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -304,6 +340,11 @@
|
||||
<version>${flyway.version}</version>
|
||||
<type>jar</type>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.flywaydb</groupId>
|
||||
<artifactId>flyway-mysql</artifactId>
|
||||
<version>${flyway.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/se.jiderhamn.classloader-leak-prevention/classloader-leak-prevention-core -->
|
||||
<dependency>
|
||||
@@ -320,13 +361,42 @@
|
||||
<dependency>
|
||||
<groupId>net.locusworks</groupId>
|
||||
<artifactId>locusworks-commons</artifactId>
|
||||
<version>1.1.0-RELEASE</version>
|
||||
<version>3.0.1-RELEASE</version>
|
||||
<type>pom</type>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.locusworks</groupId>
|
||||
<artifactId>applogger</artifactId>
|
||||
<version>2.0.2-RELEASE</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
<modules>
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>oss-index</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>portal.ossIndexEnabled</name>
|
||||
<value>true</value>
|
||||
</property>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.owasp</groupId>
|
||||
<artifactId>dependency-check-maven</artifactId>
|
||||
<configuration>
|
||||
<ossIndexServerId>oss-index</ossIndexServerId>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<modules>
|
||||
<module>portal_client</module>
|
||||
<module>portal_database</module>
|
||||
<module>portal_migration</module>
|
||||
@@ -334,4 +404,4 @@
|
||||
<module>portal_webapp</module>
|
||||
<module>portal_json</module>
|
||||
</modules>
|
||||
</project>
|
||||
</project>
|
||||
@@ -1,37 +0,0 @@
|
||||
{
|
||||
"important": false,
|
||||
"adjoining-classes": false,
|
||||
"known-properties": true,
|
||||
"box-sizing": false,
|
||||
"box-model": true,
|
||||
"overqualified-elements": false,
|
||||
"display-property-grouping": true,
|
||||
"bulletproof-font-face": true,
|
||||
"compatible-vendor-prefixes": true,
|
||||
"regex-selectors": true,
|
||||
"errors": 2,
|
||||
"duplicate-background-images": true,
|
||||
"duplicate-properties": true,
|
||||
"empty-rules": true,
|
||||
"selector-max-approaching": true,
|
||||
"gradients": true,
|
||||
"fallback-colors": true,
|
||||
"font-sizes": true,
|
||||
"font-faces": true,
|
||||
"floats": true,
|
||||
"star-property-hack": false,
|
||||
"outline-none": true,
|
||||
"import": true,
|
||||
"ids": false,
|
||||
"underscore-property-hack": true,
|
||||
"rules-count": true,
|
||||
"qualified-headings": true,
|
||||
"selector-max": true,
|
||||
"shorthand": true,
|
||||
"text-indent": true,
|
||||
"unique-headings": true,
|
||||
"universal-selector": true,
|
||||
"unqualified-attributes": true,
|
||||
"vendor-prefix": true,
|
||||
"zero-units": true
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
{
|
||||
//See: http://www.jshint.com/docs/options/
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//Enforcements
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
"bitwise": true,
|
||||
"browser": true,
|
||||
"camelcase": true,
|
||||
"curly": true,
|
||||
"eqeqeq": true,
|
||||
"eqnull": true,
|
||||
"freeze": true,
|
||||
"immed": true,
|
||||
"indent": 2,
|
||||
"jasmine": true,
|
||||
"latedef": "nofunc",
|
||||
"laxbreak": true,
|
||||
"newcap": true,
|
||||
"noarg": true,
|
||||
"noempty": true,
|
||||
"nonbsp": true,
|
||||
"nonew": true,
|
||||
"quotmark": "single",
|
||||
//"strict": true, //TODO: tackle this monster. Could provide speedups
|
||||
//"unused": "vars", //TODO: tackle this monster
|
||||
"undef": true,
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//Relaxations
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
"sub": true, //TODO: consider removing this relaxation
|
||||
|
||||
|
||||
//Globals
|
||||
"globals": {
|
||||
"jQuery": true,
|
||||
"angular": true,
|
||||
"console": true,
|
||||
"$": true,
|
||||
"_": true,
|
||||
"moment": true,
|
||||
"describe": true,
|
||||
"beforeEach": true,
|
||||
"afterEach": true,
|
||||
"module": true,
|
||||
"inject": true,
|
||||
"it": true,
|
||||
"expect": true,
|
||||
"Timeline": true,
|
||||
"d3": true,
|
||||
"ngGridLayoutPlugin": true,
|
||||
"tinymce": true,
|
||||
"SockJS": true,
|
||||
"Stomp": true,
|
||||
"paper": true,
|
||||
"validthis": true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
legacy-peer-deps=true
|
||||
# Keep warnings and failures visible without npm's routine stderr notices.
|
||||
loglevel=warn
|
||||
@@ -1,453 +0,0 @@
|
||||
/*jslint node: true */
|
||||
'use strict';
|
||||
|
||||
var pkg = require('./package.json');
|
||||
var serveStatic = require('serve-static');
|
||||
var serveIndex = require('serve-index');
|
||||
|
||||
//Using exclusion patterns slows down Grunt significantly
|
||||
//instead of creating a set of patterns like '**/*.js' and '!**/node_modules/**'
|
||||
//This method assumes the website root is in the app folder.
|
||||
//
|
||||
//omitDirPrefix: If true, refrains from adding 'app/' to each of the patterns.
|
||||
var createFolderGlobs = function (fileTypePatterns, omitDirPrefix) {
|
||||
var ignore = ['yarn_components', 'tzdata'];
|
||||
|
||||
//FOR DEBUGGING
|
||||
//console.log('\ncreateFolderGlobs()...');
|
||||
|
||||
//Convert fileTypePatterns to array
|
||||
fileTypePatterns = Array.isArray(fileTypePatterns) ? fileTypePatterns : [fileTypePatterns];
|
||||
var fs = require('fs');
|
||||
|
||||
//FOR DEBUGGING
|
||||
//console.log('File Type Patterns (Computed): ' + fileTypePatterns);
|
||||
|
||||
//Change from the grunt dir to the app dir
|
||||
var gruntDir = process.cwd();
|
||||
process.chdir('app');
|
||||
|
||||
//FOR DEBUGGING
|
||||
//console.log('CWD: ' + process.cwd());
|
||||
|
||||
//Modify
|
||||
var returnPatterns = fs.readdirSync(process.cwd())
|
||||
.map(function (file) {
|
||||
//console.log('Examining: ' + file);
|
||||
//If this is a file, or a folder in the ignore list
|
||||
if (ignore.indexOf(file) !== -1 ||
|
||||
file.indexOf('.') === 0 ||
|
||||
!fs.lstatSync(file).isDirectory()) {
|
||||
|
||||
//FOR DEBUGGING
|
||||
//console.log('Ignoring: ' + file);
|
||||
return null;
|
||||
} else {
|
||||
//FOR DEBUGGING
|
||||
//console.log('--> Accepting: ' + file);
|
||||
return fileTypePatterns.map(function (pattern) {
|
||||
return file + '/**/' + pattern;
|
||||
});
|
||||
}
|
||||
})
|
||||
.filter(function (patterns) {
|
||||
return patterns;
|
||||
})
|
||||
.concat(fileTypePatterns);
|
||||
|
||||
//Change back from app dir to grunt dir
|
||||
process.chdir(gruntDir);
|
||||
|
||||
if (!omitDirPrefix) {
|
||||
//Prepend 'app/' to each filter item
|
||||
var patternsString = returnPatterns.toString();
|
||||
var csvArray = patternsString.split(',');
|
||||
returnPatterns = csvArray.map(function (pattern) {
|
||||
return 'app/' + pattern;
|
||||
});
|
||||
}
|
||||
|
||||
//FOR DEBUGGING
|
||||
//console.log('RESULT: ' + returnPatterns);
|
||||
|
||||
return returnPatterns;
|
||||
}; //end function createFolderGlobs()
|
||||
|
||||
module.exports = function (grunt) {
|
||||
|
||||
require('time-grunt')(grunt);
|
||||
|
||||
// load all grunt tasks with jit loading
|
||||
require('jit-grunt')(grunt, {
|
||||
protractor: 'grunt-protractor-runner',
|
||||
configureProxies: 'grunt-connect-proxy2',
|
||||
dom_munger: 'grunt-dom-munger2',
|
||||
ngtemplates: 'grunt-angular-templates'
|
||||
});
|
||||
|
||||
// Project configuration.
|
||||
grunt.initConfig({
|
||||
connect: {
|
||||
//Default options for all connect targets
|
||||
options: {
|
||||
port: 9000,
|
||||
hostname: '127.0.0.1',
|
||||
base: 'app/',
|
||||
livereload: 35729,
|
||||
open: 'http://127.0.0.1:9000',
|
||||
middleware: function (connect, options) {
|
||||
if (!Array.isArray(options.base)) {
|
||||
options.base = [options.base];
|
||||
}
|
||||
|
||||
// Setup the proxy
|
||||
var middlewares = [require('grunt-connect-proxy2/lib/utils').proxyRequest];
|
||||
|
||||
// Serve static files.
|
||||
options.base.forEach(function (base) {
|
||||
middlewares.push(serveStatic(base));
|
||||
});
|
||||
|
||||
// Make directory browse-able.
|
||||
var directory = options.directory || options.base[options.base.length - 1];
|
||||
middlewares.push(serveIndex(directory));
|
||||
|
||||
return middlewares;
|
||||
}
|
||||
},
|
||||
main: {
|
||||
//See https://github.com/drewzboto/grunt-connect-proxy
|
||||
proxies: [
|
||||
{
|
||||
context: ['/rest', '/portal'],
|
||||
host: 'localhost',
|
||||
port: 8080,
|
||||
ws: true,
|
||||
}
|
||||
]
|
||||
},
|
||||
dist: {
|
||||
options: {
|
||||
base: 'dist/'
|
||||
},
|
||||
proxies: [
|
||||
{
|
||||
context: ['/rest', '/portal'],
|
||||
host: 'localhost',
|
||||
port: 8080
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
main: {
|
||||
options: {
|
||||
livereload: true,
|
||||
spawn: false,
|
||||
debounceDelay: 250
|
||||
},
|
||||
files: [createFolderGlobs(['*.js', '*.less', '*.html', '*.css']), '!_SpecRunner.html', '!.grunt', '!*-spec.js'],
|
||||
tasks: []
|
||||
},
|
||||
dist: {
|
||||
options: {
|
||||
livereload: true,
|
||||
spawn: false
|
||||
},
|
||||
files: ['app.full.min.css', 'app.full.min.js', 'index.html'],
|
||||
tasks: [] //all the tasks are run dynamically during the watch event handler
|
||||
}
|
||||
},
|
||||
jshint: {
|
||||
main: {
|
||||
options: {
|
||||
jshintrc: '.jshintrc'
|
||||
},
|
||||
src: [createFolderGlobs('*.js'), '*.js', '!app/common/generated_code/**', '!Gruntfile.js', '!assets.js', '!webpack.config.js', '!yarn_file_copy.js']
|
||||
}
|
||||
},
|
||||
csslint: {
|
||||
main: {
|
||||
options: {
|
||||
csslintrc: '.csslintrc'
|
||||
},
|
||||
src: ['<%= dom_munger.data.applintcss %>', '!app/compiled-less/**', '!app/yarn_components/**']
|
||||
}
|
||||
},
|
||||
lesslint: {
|
||||
main: {
|
||||
options: {
|
||||
csslint: {
|
||||
csslintrc: '.csslintrc'
|
||||
}
|
||||
},
|
||||
src: ['app/*.less', '!app/compiled-less/**', '!app/yarn_components/**']
|
||||
}
|
||||
},
|
||||
clean: {
|
||||
before: {
|
||||
src: ['dist', 'temp', 'test_results']
|
||||
},
|
||||
after: {
|
||||
src: ['temp']
|
||||
},
|
||||
cleanDistTest: {
|
||||
src: ['distTestFolder']
|
||||
}
|
||||
},
|
||||
less: {
|
||||
production: {
|
||||
files: [{
|
||||
cwd: 'app',
|
||||
src: ['**/*.less', '!yarn_components/**'],
|
||||
dest: 'app/compiled-less/',
|
||||
filter: 'isFile',
|
||||
expand: true,
|
||||
ext: '.less.css'
|
||||
}]
|
||||
}
|
||||
},
|
||||
ngtemplates: {
|
||||
main: {
|
||||
options: {
|
||||
module: pkg.name,
|
||||
htmlmin: '<%= htmlmin.main.options %>'
|
||||
},
|
||||
src: [createFolderGlobs('*.html', true), '!index.html', '!_SpecRunner.html'],
|
||||
dest: 'temp/templates.js',
|
||||
cwd: 'app/'
|
||||
}
|
||||
},
|
||||
copy: {
|
||||
main: {
|
||||
files: [
|
||||
{cwd: 'app', src: ['<%= dom_munger.data.appjsCopyList %>','<%= dom_munger.data.appcssCopyList %>'], dest: 'dist/', filter: 'isFile', expand: true},
|
||||
{cwd: 'app', src: ['yarn_components/**/*.woff'], dest: 'dist/', filter: 'isFile', expand: true},
|
||||
{cwd: 'app', src: ['yarn_components/**/*.woff2'], dest: 'dist/', filter: 'isFile', expand: true},
|
||||
{cwd: 'app', src: ['yarn_components/**/*.eot'], dest: 'dist/', filter: 'isFile', expand: true},
|
||||
{cwd: 'app', src: ['yarn_components/**/*.svg'], dest: 'dist/', filter: 'isFile', expand: true},
|
||||
{cwd: 'app', src: ['yarn_components/**/*.ttf'], dest: 'dist/', filter: 'isFile', expand: true},
|
||||
{cwd: 'app', src: ['yarn_components/**/*.png'], dest: 'dist/', filter: 'isFile', expand: true},
|
||||
{cwd: 'app', src: ['yarn_components/**/*.jpg'], dest: 'dist/', filter: 'isFile', expand: true},
|
||||
{cwd: 'app', src: ['yarn_components/**/*.gif'], dest: 'dist/', filter: 'isFile', expand: true},
|
||||
{cwd: 'app', src: ['images/**/*.svg'], dest: 'dist/', filter: 'isFile', expand: true},
|
||||
{cwd: 'app', src: ['images/**/*.png'], dest: 'dist/', filter: 'isFile', expand: true},
|
||||
{cwd: 'app', src: ['images/**/*.jpg'], dest: 'dist/', filter: 'isFile', expand: true},
|
||||
{cwd: 'app', src: ['images/**/*.gif'], dest: 'dist/', filter: 'isFile', expand: true},
|
||||
{cwd: 'app', src: ['fonts/google-md-icons/**'], dest:'dist/', filter: 'isFile', expand: true},
|
||||
{cwd: 'app', src: ['favicon.ico'], dest: 'dist/', filter: 'isFile', expand: true},
|
||||
{cwd: 'app', src: ['robots.txt'], dest: 'dist/', filter: 'isFile', expand: true},
|
||||
{cwd: 'app', src: ['404.html'], dest: 'dist/', filter: 'isFile', expand: true}
|
||||
]
|
||||
},
|
||||
//Prepares a copy of the dist folder and inserts unit tests for running
|
||||
//unit tests on the distribution build.
|
||||
prepareDistTestFolder: {
|
||||
files: [
|
||||
//Copy the dist folder's contents to the war.
|
||||
//Path is relative to src/main/webapp/grunt
|
||||
{cwd: 'dist', src: ['**'], dest: 'distTestFolder', filter: 'isFile', expand: true},
|
||||
{cwd: 'app', src: ['**/*-spec.js'], dest: 'distTestFolder', filter: 'isFile', expand: true}
|
||||
]
|
||||
}
|
||||
},
|
||||
dom_munger: { //jshint ignore: line
|
||||
read: {
|
||||
options: {
|
||||
read: [
|
||||
{selector: 'script[data-build!="exclude"]', attribute: 'src', writeto: 'appjs', isPath: true},
|
||||
{selector: 'link[type="text/css"][data-build!="exclude"]', attribute: 'href', writeto: 'appcss', isPath: true},
|
||||
{selector: 'script[data-remove="exclude"]', attribute: 'src', writeto: 'appjsCopyList'},
|
||||
{selector: 'link[type="text/css"][data-remove="exclude"]', attribute: 'href', writeto: 'appcssCopyList'},
|
||||
{selector: 'script[data-karma-tests!="exclude"]', attribute: 'src', writeto: 'applintjs', isPath: true},
|
||||
{selector: 'link[type="text/css"]', attribute: 'href', writeto: 'applintcss', isPath: true}
|
||||
]
|
||||
},
|
||||
src: 'app/index.html'
|
||||
},
|
||||
update: {
|
||||
options: {
|
||||
remove: ['script[data-remove!="exclude"]', 'link[data-remove!="exclude"]'],
|
||||
append: [
|
||||
{selector: 'body', html: '<script src="app.full.min.js"></script>'},
|
||||
{selector: 'head', html: '<link rel="stylesheet" href="app.full.min.css">'}
|
||||
]
|
||||
},
|
||||
src: 'app/index.html',
|
||||
dest: 'dist/index.html'
|
||||
}
|
||||
},
|
||||
cssmin: {
|
||||
options: {
|
||||
target: 'dist/'//Eg. Changes '../relative/url/path/in/bower/components' to 'app/yarn_components/...'
|
||||
//root: 'app' //Eg. changes '../relative/url/path/in/bower/components' to '/yarn_components...', but the starting slash causes problems
|
||||
},
|
||||
main: {
|
||||
files: {
|
||||
'dist/app.full.min.css': [
|
||||
'temp/**/*.less.css',
|
||||
'<%= dom_munger.data.appcss %>'
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
concat: {
|
||||
main: {
|
||||
src: ['<%= dom_munger.data.appjs %>', '<%= ngtemplates.main.dest %>'],
|
||||
dest: 'temp/app.full.js'
|
||||
}
|
||||
},
|
||||
ngAnnotate: {
|
||||
main: {
|
||||
src: 'temp/app.full.js',
|
||||
dest: 'temp/app.full.js'
|
||||
}
|
||||
},
|
||||
uglify: {
|
||||
main: {
|
||||
files: {
|
||||
'dist/app.full.min.js': ['temp/app.full.js']
|
||||
}
|
||||
},
|
||||
pretty: {
|
||||
options: {
|
||||
beautify: true,
|
||||
preserveComments: 'all',
|
||||
sourceMap: true,
|
||||
sourceMapName: 'dist/app.full.min.js.map'
|
||||
},
|
||||
files: {
|
||||
'dist/app.full.min.js': ['temp/app.full.js']
|
||||
}
|
||||
}
|
||||
},
|
||||
html2js: {
|
||||
options: {
|
||||
base: '.',
|
||||
module: 'ui-templates',
|
||||
rename: function (modulePath) {
|
||||
var moduleName = modulePath.replace('app/common/partials/ui-bootstrap-tpls/', '').replace('.html', '');
|
||||
return 'template' + '/' + moduleName + '.html';
|
||||
}
|
||||
},
|
||||
main: {
|
||||
src: ['app/common/partials/ui-bootstrap-tpls/**/*.html'],
|
||||
dest: 'app/common/generated_code/ui-templates.js'
|
||||
}
|
||||
},
|
||||
htmlmin: {
|
||||
main: {
|
||||
options: {
|
||||
collapseBooleanAttributes: true,
|
||||
collapseWhitespace: true,
|
||||
removeAttributeQuotes: true,
|
||||
removeComments: true,
|
||||
removeEmptyAttributes: true,
|
||||
removeScriptTypeAttributes: true,
|
||||
removeStyleLinkTypeAttributes: true
|
||||
},
|
||||
files: {
|
||||
'dist/index.html': 'dist/index.html'
|
||||
}
|
||||
}
|
||||
},
|
||||
concurrent: {
|
||||
build: [
|
||||
'onlyBuild'
|
||||
],
|
||||
/**
|
||||
* Note: The multiCapabilities feature of protractor does not seem compatible
|
||||
* with grunt concurrent, unless everything passes perfectly
|
||||
*/
|
||||
test: {
|
||||
tasks: [
|
||||
'unitTests',
|
||||
]
|
||||
},
|
||||
serve: {
|
||||
tasks: [
|
||||
'unitTests',
|
||||
'onlyServe'
|
||||
],
|
||||
options: {
|
||||
logConcurrentOutput: true
|
||||
}
|
||||
}
|
||||
} //end concurrent
|
||||
|
||||
}); //end grunt.initConfig
|
||||
|
||||
//Runs the linters through our code
|
||||
grunt.registerTask('lintAll', [
|
||||
'dom_munger:read',
|
||||
'jshint',
|
||||
'lesslint',
|
||||
'csslint']);
|
||||
|
||||
grunt.registerTask('unitTests', [
|
||||
'lintAll',
|
||||
'dom_munger:read',
|
||||
]);
|
||||
|
||||
/**
|
||||
* Used by the concurrent task to split up build task.
|
||||
*/
|
||||
grunt.registerTask('onlyBuild', [
|
||||
'clean:before',
|
||||
'dom_munger',
|
||||
'less', //Compiles less files to css. Creates one css file for each less file in a respective folder in temp/path/name.css
|
||||
'ngtemplates', //creates temp/templates.js that maps templates safely for minification
|
||||
'cssmin', //minifies css into dist/app.full.min.css
|
||||
'concat',
|
||||
'ngAnnotate', //Makes AngularJS files minification safe. Reads temp/app.full.js. Writes results to temp/app.full.js
|
||||
'uglify:main', //Minifies and uglifies
|
||||
'copy:main',
|
||||
'htmlmin',
|
||||
'clean:after'
|
||||
]);
|
||||
|
||||
/**
|
||||
* Used by the concurrent task to split up serve task.
|
||||
*/
|
||||
grunt.registerTask('onlyServe', [
|
||||
'configureProxies:main',
|
||||
'connect:main',
|
||||
'watch:main'
|
||||
]);
|
||||
|
||||
//Builds and runs a live watch server using the distribution build.
|
||||
grunt.registerTask('serveDist', ['build', 'connect:dist', 'watch:dist']);
|
||||
|
||||
//Runs a test on the distribution build.
|
||||
//NOTE: this currently fails with an undefined tinyMCE variable
|
||||
//
|
||||
grunt.registerTask('testDist', [
|
||||
'build',
|
||||
'copy:prepareDistTestFolder',
|
||||
'clean:cleanDistTest'
|
||||
]);
|
||||
|
||||
//############################################################################
|
||||
//############################################################################
|
||||
// The tasks below are intended for public command line use
|
||||
//############################################################################
|
||||
//############################################################################
|
||||
|
||||
/** Makes the distribution build */
|
||||
grunt.registerTask('build', ['concurrent:build']);
|
||||
|
||||
/** Runs a live watch server proxied between port 9000 and 8080 */
|
||||
grunt.registerTask('serve', ['concurrent:serve']);
|
||||
|
||||
/** Re converts the html/js templates. */
|
||||
grunt.registerTask('runHTML2js', ['html2js']);
|
||||
|
||||
/** Runs the test task, including lint, unit tests, and e2e tests */
|
||||
grunt.registerTask('test', ['concurrent:test']);
|
||||
|
||||
/** By default, we run the serve task */
|
||||
grunt.registerTask('default', ['serve']);
|
||||
|
||||
/** Compiles project's less files into css. */
|
||||
grunt.registerTask('makeLess', ['dom_munger', 'less']);
|
||||
};
|
||||
+23
-12
@@ -1,12 +1,23 @@
|
||||
Portal Client
|
||||
==
|
||||
|
||||
The portal_client contains all the client side html, javascript, and css files that will be presented to the user
|
||||
|
||||
Yarn
|
||||
======
|
||||
Yarn is the the new package manager used with node.js in replacement of `npm` it uses the same package.json file.
|
||||
|
||||
To download a new client side library use the command `yarn add <package_name> --save` This will add the files to the `node_modules` library.
|
||||
Next include the appropriate file into the `assets.js` file inside `portal_client` to make sure it will be injected into the `index.html` file during run time.
|
||||
The `assets.js` file specifies all the vendor libraries that have to be included into the client code during build.
|
||||
# Portal client
|
||||
|
||||
The portal UI is an Angular 22.1 standalone application built with Angular CLI and npm.
|
||||
|
||||
## Development
|
||||
|
||||
Use Node.js 24.15 or newer in the Node 24 release line and npm 12:
|
||||
|
||||
```shell
|
||||
npm ci
|
||||
npm start
|
||||
```
|
||||
|
||||
The development server serves the client locally. API and WebSocket requests target the Spring application under `/portal`.
|
||||
|
||||
## Verification and production build
|
||||
|
||||
```shell
|
||||
npm test
|
||||
npm run build
|
||||
```
|
||||
|
||||
The production build is emitted to `dist`. Maven performs `npm ci`, runs the tests and build, then packages `dist` under `/portal/client/` in the Spring Boot application.
|
||||
@@ -0,0 +1,92 @@
|
||||
{
|
||||
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
||||
"version": 1,
|
||||
"cli": {
|
||||
"packageManager": "npm"
|
||||
},
|
||||
"newProjectRoot": "projects",
|
||||
"projects": {
|
||||
"portal-modern": {
|
||||
"projectType": "application",
|
||||
"schematics": {
|
||||
"@schematics/angular:component": {
|
||||
"style": "scss"
|
||||
}
|
||||
},
|
||||
"root": "",
|
||||
"sourceRoot": "src",
|
||||
"prefix": "app",
|
||||
"architect": {
|
||||
"build": {
|
||||
"builder": "@angular/build:application",
|
||||
"options": {
|
||||
"allowedCommonJsDependencies": ["sockjs-client"],
|
||||
"browser": "src/main.ts",
|
||||
"polyfills": [
|
||||
"src/polyfills.ts"
|
||||
],
|
||||
"outputPath": {
|
||||
"base": "dist",
|
||||
"browser": ""
|
||||
},
|
||||
"tsConfig": "tsconfig.app.json",
|
||||
"inlineStyleLanguage": "scss",
|
||||
"assets": [
|
||||
{
|
||||
"glob": "**/*",
|
||||
"input": "public"
|
||||
},
|
||||
{
|
||||
"glob": "sockjs.min.js",
|
||||
"input": "node_modules/sockjs-client/dist",
|
||||
"output": "vendor"
|
||||
}
|
||||
],
|
||||
"styles": [
|
||||
"src/styles.scss",
|
||||
"public/fonts/google-md-icons/MaterialIcons-Regular.css"
|
||||
]
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"budgets": [
|
||||
{
|
||||
"type": "initial",
|
||||
"maximumWarning": "500kB",
|
||||
"maximumError": "1MB"
|
||||
},
|
||||
{
|
||||
"type": "anyComponentStyle",
|
||||
"maximumWarning": "4kB",
|
||||
"maximumError": "8kB"
|
||||
}
|
||||
],
|
||||
"outputHashing": "all"
|
||||
},
|
||||
"development": {
|
||||
"optimization": false,
|
||||
"extractLicenses": false,
|
||||
"sourceMap": true
|
||||
}
|
||||
},
|
||||
"defaultConfiguration": "production"
|
||||
},
|
||||
"serve": {
|
||||
"builder": "@angular/build:dev-server",
|
||||
"configurations": {
|
||||
"production": {
|
||||
"buildTarget": "portal-modern:build:production"
|
||||
},
|
||||
"development": {
|
||||
"buildTarget": "portal-modern:build:development"
|
||||
}
|
||||
},
|
||||
"defaultConfiguration": "development"
|
||||
},
|
||||
"test": {
|
||||
"builder": "@angular/build:unit-test"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,523 +0,0 @@
|
||||
/*csslint important: false*/
|
||||
|
||||
#mainBody {
|
||||
background-color: #ff6600;
|
||||
background: url(images/background.png);
|
||||
background-repeat: no-repeat;
|
||||
background-attachment: fixed;
|
||||
background-position: center;
|
||||
-webkit-background-size: cover;
|
||||
-moz-background-size: cover;
|
||||
-o-background-size: cover;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.fill-height {
|
||||
height: 100% !important;
|
||||
}
|
||||
|
||||
.header-container-left,
|
||||
.header-container,
|
||||
.header-container-right {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
margin: 0 5px;
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.header-container-left {
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.header-container-right {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.vertical-align-center,
|
||||
.header-container-right button {
|
||||
-moz-transform: translateY(-50%);
|
||||
-webkit-transform: translateY(-50%);
|
||||
-o-transform: translateY(-50%);
|
||||
-ms-transform: translateY(-50%);
|
||||
transform: translateY(-50%);
|
||||
position: relative;
|
||||
top: 50%;
|
||||
}
|
||||
|
||||
.horizontal-align-center {
|
||||
position: relative;
|
||||
left: 50%;
|
||||
-moz-transform: translateX(-50%);
|
||||
-webkit-transform: translateX(-50%);
|
||||
-ms-transform: translateX(-50%);
|
||||
-o-transform: translateX(-50%);
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
|
||||
.center-text {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#filterBoxAlignment{
|
||||
bottom: -2px;
|
||||
left:1.5px;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
#bottomFilter{
|
||||
height: 35px;
|
||||
bottom: 3px;
|
||||
left: 1px;
|
||||
background-color: #EBEBEB;
|
||||
}
|
||||
#box{
|
||||
|
||||
bottom:50px;
|
||||
}
|
||||
.left-text {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
body {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden !important;
|
||||
}
|
||||
|
||||
|
||||
.fill-height-scroll,
|
||||
.fill-height-scroll .tab-pane {
|
||||
height: 100%;
|
||||
overflow:auto;
|
||||
}
|
||||
|
||||
.fill-height-scroll-y,
|
||||
.fill-height-scroll-y .tab-pane {
|
||||
height: 100%;
|
||||
overflow-y:auto;
|
||||
overflow-x:no-content;
|
||||
}
|
||||
|
||||
.scroll {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.box {
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.tab-pane {
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.ellipsis {
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.margin-none {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.margin-sm {
|
||||
margin: 3px;
|
||||
}
|
||||
|
||||
.margin-md {
|
||||
margin: 5px;
|
||||
}
|
||||
|
||||
.margin-sides-xs {
|
||||
margin-left: 2px;
|
||||
margin-right: 2px;
|
||||
}
|
||||
|
||||
.margin-sides-sm {
|
||||
margin-left: 4px;
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
.margin-right-xs {
|
||||
margin-right: 1px;
|
||||
}
|
||||
|
||||
.margin-right-sm {
|
||||
margin-right: 3px;
|
||||
}
|
||||
|
||||
.margin-right-md {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.margin-right-lg {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
|
||||
.col-padding-none,
|
||||
.padding-none {
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
.padding-left-none {
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
.padding-med {
|
||||
padding: 3px;
|
||||
}
|
||||
|
||||
.padding-sides-small {
|
||||
padding-left: 1px;
|
||||
padding-right: 1px
|
||||
}
|
||||
|
||||
.padding-sides-med {
|
||||
padding-left: 3px;
|
||||
padding-right: 3px;
|
||||
}
|
||||
|
||||
.rounded-border {
|
||||
box-sizing: border-box;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 8px;
|
||||
}
|
||||
/*
|
||||
* lifecycle and ex org table css rules
|
||||
*/
|
||||
|
||||
#availableLC{
|
||||
height: 194px;
|
||||
width: 472px;
|
||||
}
|
||||
#availableOT{
|
||||
height: 430px;
|
||||
width: 472px;
|
||||
}
|
||||
|
||||
|
||||
.thin-border {
|
||||
border: 1px solid #ddd;
|
||||
}
|
||||
|
||||
.thin-border-top {
|
||||
border-top: 1px solid #ddd;
|
||||
}
|
||||
|
||||
.thin-border-bottom {
|
||||
border-bottom: 1px solid #ddd;
|
||||
}
|
||||
|
||||
.thin-border-left {
|
||||
border-left: 1px solid #ddd;
|
||||
}
|
||||
|
||||
.thin-border-right {
|
||||
border-right: 1px solid #ddd;
|
||||
}
|
||||
|
||||
.thin-border-sides {
|
||||
border-left: 1px solid #ddd;
|
||||
border-right: 1px solid #ddd;
|
||||
}
|
||||
|
||||
.progress-bar-label {
|
||||
color: #555;
|
||||
left:50%;
|
||||
top:50%;
|
||||
-o-transform: translate(-50%, -50%);
|
||||
-ms-transform: translate(-50%, -50%);
|
||||
-webkit-transform: translate(-50%, -50%);
|
||||
-moz-transform: translate(-50%, -50%);
|
||||
transform: translate(-50%, -50%);
|
||||
position:absolute;
|
||||
}
|
||||
|
||||
/*Allows label to be centered in progress bar using absolute positioning*/
|
||||
.progress {
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.progress-bar {
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.tab-pane {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.icon-xs svg {
|
||||
float: left;/*Causes vertical centering to work with svg element*/
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
|
||||
.text-small {
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.bold {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* This controls the border around the buttons when they have a selection focus
|
||||
button :focus {
|
||||
outline: none!important;
|
||||
}*/
|
||||
|
||||
.gridStyle {
|
||||
box-sizing: border-box;
|
||||
border: 1px solid rgb(212,212,212);
|
||||
}
|
||||
|
||||
.float-left {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.float-right {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.nav-tabs li:first-of-type {
|
||||
padding-left: 4px; /** TODO Replace this with responsive utility*/
|
||||
}
|
||||
|
||||
/* Override the default gray because it is hard to see. */
|
||||
/* TODO: possible change to a different color/shade */
|
||||
.modal-footer {
|
||||
border-top-color: black;
|
||||
}
|
||||
|
||||
.modal-header {
|
||||
border-bottom-color: black;
|
||||
}
|
||||
|
||||
.rotate90 {
|
||||
/* Safari */
|
||||
-webkit-transform: rotate(90deg);
|
||||
/* Firefox */
|
||||
-moz-transform: rotate(90deg);
|
||||
/* IE */
|
||||
-ms-transform: rotate(90deg);
|
||||
/* Opera */
|
||||
-o-transform: rotate(90deg);
|
||||
transform: rotate(90deg);
|
||||
/* One of these catches chrome */
|
||||
}
|
||||
|
||||
.rotate180 {
|
||||
/* Safari */
|
||||
-webkit-transform: rotate(180deg);
|
||||
/* Firefox */
|
||||
-moz-transform: rotate(180deg);
|
||||
/* IE */
|
||||
-ms-transform: rotate(180deg);
|
||||
/* Opera */
|
||||
-o-transform: rotate(180deg);
|
||||
transform: rotate(180deg);
|
||||
/* One of these catches chrome */
|
||||
}
|
||||
|
||||
/* Prevents drag and shift text selection */
|
||||
.unselectable {
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
cursor:default;
|
||||
}
|
||||
|
||||
/*
|
||||
.modal.fade .modal-dialog, .modal.in .modal-dialog {
|
||||
-webkit-transform: translate(0, 0);
|
||||
-ms-transform: translate(0, 0);
|
||||
-moz-transform: translate(0, 0);
|
||||
-o-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}*/
|
||||
|
||||
#modalDialogContainer>div{
|
||||
overflow-y: hidden;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.modal-body {
|
||||
overflow: hidden;
|
||||
padding-top: 5;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
.input-group-addon:not(:last-child),
|
||||
.input-group-btn:not(:last-child),
|
||||
.input-group .form-control:not(:last-child) {
|
||||
border-right: none;
|
||||
}
|
||||
|
||||
|
||||
.input-group-btn:last-child>.btn,
|
||||
.input-group-btn:last-child>.btn-group {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.no-scroll-table .ngViewport {
|
||||
height: auto !important;
|
||||
}
|
||||
|
||||
.no-scroll-table .ngCanvas,
|
||||
.no-scroll-table .ngViewport,
|
||||
.no-scroll-table .ngRow,
|
||||
.no-scroll-table .ngFooterPanel,
|
||||
.no-scroll-table .ngTopPanel{
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.no-scroll-table .ngRow {
|
||||
border-bottom: none !important;
|
||||
border-radius: 5px !important;
|
||||
}
|
||||
|
||||
.panel-body-relative {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.normal-filter {
|
||||
background-color: white;
|
||||
height: 40px;
|
||||
width: 200px;
|
||||
border-top-right-radius: 5px;
|
||||
border-bottom-left-radius: 5px;
|
||||
padding-bottom: 40px;
|
||||
}
|
||||
|
||||
.bottom-filter {
|
||||
background-color: white;
|
||||
height: 40px;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
width: 200px;
|
||||
border-top-right-radius: 5px;
|
||||
border-bottom-left-radius: 5px;
|
||||
}
|
||||
|
||||
.bottom-filter-pad {
|
||||
padding-bottom: 40px; /** Cooresponds with .bottom-filter */
|
||||
}
|
||||
|
||||
/* Causes an element to fill it's absolute container fully */
|
||||
.fill-container-absolutely {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
/** Fixes issue with loading spinner showing up in front of modal dialogues */
|
||||
.spinner {
|
||||
z-index: 0 !important;
|
||||
}
|
||||
|
||||
/**
|
||||
* Hides the pin button unless you hover over the header for ng-grid
|
||||
*/
|
||||
.ngUnPinnedIcon {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.ngHeaderCell:hover .ngUnPinnedIcon {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
.glyphicon-tile.glyphicon {
|
||||
text-align: center;
|
||||
font-size: 8em;
|
||||
color: lightgray;
|
||||
}
|
||||
|
||||
.label-as-badge {
|
||||
border-radius: 1em;
|
||||
}
|
||||
.loadingFade {
|
||||
position:absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #ababab;
|
||||
z-index: 9000;
|
||||
-moz-opacity: 0.8;
|
||||
opacity: .70;
|
||||
filter: alpha(opacity=80);
|
||||
}
|
||||
|
||||
.loadingModal {
|
||||
position: absolute;
|
||||
top: 45%;
|
||||
left: 48%;
|
||||
z-index: 9001;
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
.splitter{
|
||||
background: #c8c8c8;
|
||||
width: 1px;
|
||||
}
|
||||
|
||||
.ghost {
|
||||
background: #c8c8c8;
|
||||
opacity: 0.5;
|
||||
|
||||
}
|
||||
|
||||
.ui-icon-gripsmall-diagonal-se {
|
||||
right:0 !important;
|
||||
bottom:0 !important;
|
||||
background-position: -64px -224px !important;
|
||||
}
|
||||
|
||||
.hover-cursor {
|
||||
cursor: pointer;
|
||||
cursor: hand;
|
||||
}
|
||||
|
||||
.icon-grid-cell {
|
||||
padding-top: 3px;
|
||||
padding-left: 3px;
|
||||
}
|
||||
|
||||
@media (min-width: 992px) {
|
||||
.modal-xl {
|
||||
width: 95%;
|
||||
}
|
||||
}
|
||||
|
||||
.ui-grid-sort-priority-number {
|
||||
font-size: 0;
|
||||
}
|
||||
|
||||
.stretch input {
|
||||
width: 100%
|
||||
}
|
||||
|
||||
.speech {
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
position: absolute;
|
||||
}
|
||||
@@ -1,130 +0,0 @@
|
||||
var portal = angular.module('portal', [
|
||||
'ui.bootstrap',
|
||||
'ui.router',
|
||||
'ui.grid',
|
||||
'ui.grid.saveState',
|
||||
'ui.grid.selection',
|
||||
'ui.grid.edit',
|
||||
'ui.grid.resizeColumns',
|
||||
'ui.grid.moveColumns',
|
||||
'ui.grid.expandable',
|
||||
'ui.grid.pinning',
|
||||
'ui.grid.autoResize',
|
||||
'ui.grid.exporter',
|
||||
'ui.grid.cellNav',
|
||||
'ui.grid.pagination',
|
||||
'ui.grid.treeView',
|
||||
'ui.tinymce',
|
||||
'ngResource',
|
||||
'ngCookies',
|
||||
'ngSanitize',
|
||||
'ngAnimate',
|
||||
'ngMessages',
|
||||
'ngMaterial',
|
||||
'ngMaterialDatePicker',
|
||||
'debounce',
|
||||
'portal.login',
|
||||
'portal.dashboard',
|
||||
'portal.dashboard.gitBank',
|
||||
'portal.dashboard.userBank',
|
||||
'portal.dashboard.credBank',
|
||||
'portal.dashboard.logBank',
|
||||
'portal.dashboard.scriptBank',
|
||||
'portal.dashboard.emailBank',
|
||||
'portal.dashboard.envBank',
|
||||
'portal.dashboard.permissionBank',
|
||||
'portal.common.constants',
|
||||
'portal.common.factories.pubsub',
|
||||
'portal.common.services.map',
|
||||
'portal.common.services.model.cache',
|
||||
'portal.common.services.model.rest',
|
||||
'portal.common.services.portalUtils',
|
||||
'portal.common.services.authorize',
|
||||
'portal.common.services.triggers',
|
||||
'portal.common.directives.portalTabset',
|
||||
'portal.common.directives.compareTo',
|
||||
'portal.common.directives.portalWebsocket',
|
||||
'portal.common.directives.permissions',
|
||||
'portal.common.partials.sessionEnd',
|
||||
'portal.common.partials.uploadpatchfile',
|
||||
'portal.common.partials.addGit',
|
||||
'portal.common.partials.addUser',
|
||||
'portal.common.partials.addDirectory',
|
||||
'portal.common.partials.addCreds',
|
||||
'portal.common.partials.addScript',
|
||||
'portal.common.partials.addEnvVars',
|
||||
'portal.common.partials.configuration',
|
||||
'portal.common.partials.fileinfo',
|
||||
'portal.common.partials.filevalidate',
|
||||
'portal.common.partials.addPermission',
|
||||
'portal.common.partials.viewScriptStatus',
|
||||
'portal.common.partials.loggerinfo',
|
||||
'portal.common.partials.smtpinfo',
|
||||
'portal.common.partials.addEmailTmpl',
|
||||
'portal.common.partials.seedinfo'
|
||||
]);
|
||||
|
||||
angular.module('portal').config(function ($stateProvider, $urlRouterProvider, $httpProvider) {
|
||||
$urlRouterProvider.otherwise('/dashboard');
|
||||
/* Add New States Above, or else in the module, but not in both */
|
||||
$urlRouterProvider.when('', 'dashboard');
|
||||
|
||||
$httpProvider.defaults.useXDomain = true;
|
||||
delete $httpProvider.defaults.headers.common['X-Requested-With'];
|
||||
|
||||
$stateProvider.state('main', {
|
||||
url: '/main',
|
||||
pageTitle: 'Main',
|
||||
templateUrl: 'main/main.html',
|
||||
resolve: {
|
||||
authorize: ['authorize',
|
||||
function (authorize) {
|
||||
return authorize.validate({
|
||||
authorities: {
|
||||
account: ['USER', 'ADMIN']
|
||||
},
|
||||
redirect: 'dashboard'
|
||||
});
|
||||
}
|
||||
],
|
||||
}
|
||||
}).state('login', {
|
||||
url: '/login',
|
||||
pageTitle: 'Login',
|
||||
templateUrl: 'login/login.html'
|
||||
}).state('prohibited', {
|
||||
url: '/prohibited',
|
||||
pageTitle: 'Access Denied',
|
||||
templateUrl: 'prohibited/prohibited.html'
|
||||
}).state('main.prohibited', {
|
||||
url: '/prohibited',
|
||||
pageTitle: 'Access Denied',
|
||||
templateUrl: 'prohibited/prohibited.html'
|
||||
});
|
||||
|
||||
}); //end angular.module.config
|
||||
|
||||
angular.module('portal').run(function($rootScope, $state, $animate, $window, $location, $transitions) {
|
||||
$transitions.onSuccess({to: 'dashboard.**' }, function(trans){
|
||||
$rootScope.$broadcast('$stateChangeSuccess', trans.router.globals.$current.name);
|
||||
});
|
||||
|
||||
$rootScope.$on('$locationChangeSuccess', function(){
|
||||
$rootScope.actualLocation = $location.path();
|
||||
});
|
||||
|
||||
// Allows easy unregistering of listener callbacks
|
||||
// See https://stackoverflow.com/a/14898930
|
||||
$rootScope.$off = function (name, listener) {
|
||||
var namedListeners = $rootScope.$$listeners[name];
|
||||
if (namedListeners) {
|
||||
// Loop through the array of named listeners and remove them from the array.
|
||||
for (var i = 0; i < namedListeners.length; i++) {
|
||||
if (namedListeners[i] === listener) {
|
||||
return namedListeners.splice(i, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
});//end angular.module.run
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
angular.module('portal.common.constants',[])
|
||||
.constant('Constants',{
|
||||
Permissions: {
|
||||
VIEW_SCRIPT_TAB : 'VIEW_SCRIPT_TAB',
|
||||
VIEW_GIT_TAB : 'VIEW_GIT_TAB',
|
||||
VIEW_USER_TAB : 'VIEW_USER_TAB',
|
||||
VIEW_CREDS_TAB : 'VIEW_CREDS_TAB',
|
||||
VIEW_LOG_TAB : 'VIEW_LOG_TAB',
|
||||
VIEW_PERMISSION_TAB : 'VIEW_PERMISSION_TAB',
|
||||
VIEW_EMAIL_TAB : 'VIEW_EMAIL_TAB',
|
||||
VIEW_ENV_VARS_TAB : 'VIEW_ENV_VARS_TAB',
|
||||
VIEW_CONFIG : 'VIEW_CONFIG',
|
||||
CHANGE_CONFIG : 'CHANGE_CONFIG',
|
||||
VIEW_SMTP_CONFIG : 'VIEW_SMTP_CONFIG',
|
||||
EDIT_SMTP_CONFIG : 'EDIT_SMTP_CONFIG',
|
||||
VIEW_HASH_TYPES : 'VIEW_HASH_TYPES',
|
||||
CHANGE_HASH_TYPES : 'CHANGE_HASH_TYPES',
|
||||
ADD_USERS : 'ADD_USERS',
|
||||
DELETE_USERS : 'DELETE_USERS',
|
||||
PURGE_LOGS : 'PURGE_LOGS',
|
||||
ADD_PERMS : 'ADD_PERMS',
|
||||
DELETE_PERMS : 'DELETE_PERMS',
|
||||
ADD_CREDENTIALS : 'ADD_CREDENTIALS',
|
||||
DELETE_CREDENTIALS : 'DELETE_CREDENTIALS',
|
||||
ADD_GIT_REPO : 'ADD_GIT_REPO',
|
||||
PULL_GIT_REPO : 'PULL_GIT_REPO',
|
||||
DELETE_GIT_REPO : 'DELETE_GIT_REPO',
|
||||
ADD_EMAIL : 'ADD_EMAIL',
|
||||
DELETE_EMAIL : 'DELETE_EMAIL',
|
||||
RUN_SCRIPT : 'RUN_SCRIPT',
|
||||
ADD_SCRIPT : 'ADD_SCRIPT',
|
||||
DELETE_SCRIPT : 'DELETE_SCRIPT',
|
||||
VIEW_SCRIPT_SCHED_STATUS : 'VIEW_SCRIPT_SCHED_STATUS',
|
||||
DELETE_SCRIPT_SCHED_STATUS : 'DELETE_SCRIPT_SCHED_STATUS',
|
||||
ADD_ENV_VARS : 'ADD_ENV_VARS',
|
||||
DELETE_ENV_VARS : 'DELETE_ENV_VARS',
|
||||
VIEW_ENV_VARS : 'VIEW_ENV_VARS',
|
||||
VIEW_LOG_LEVELS : 'VIEW_LOG_LEVELS',
|
||||
CHANGE_LOG_LEVELS : 'CHANGE_LOG_LEVELS',
|
||||
DELETE_FILE : 'DELETE_FILE',
|
||||
UPDATE_SEED_VALUE : 'UPDATE_SEED_VALUE'
|
||||
}
|
||||
});
|
||||
@@ -1,22 +0,0 @@
|
||||
angular.module('portal.common.directives.compareTo', ['ui.router'])
|
||||
.directive('compareTo', function(){
|
||||
return {
|
||||
require: 'ngModel',
|
||||
scope: {
|
||||
otherModelValue: '=compareTo'
|
||||
},
|
||||
link: function(scope, element, attributes, ngModel) {
|
||||
|
||||
ngModel.$validators.compareTo = function(modelValue) {
|
||||
if ((modelValue === null || modelValue === undefined) && scope.otherModelValue === null) {
|
||||
return true;
|
||||
}
|
||||
return modelValue === scope.otherModelValue;
|
||||
};
|
||||
|
||||
scope.$watch('otherModelValue', function() {
|
||||
ngModel.$validate();
|
||||
});
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -1,32 +0,0 @@
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
angular.module('portal.common.directives.permissions', ['ui.router'])
|
||||
.directive('hasPermission', function(permissions){
|
||||
return {
|
||||
link: function(scope, element, attrs) {
|
||||
if (!_.isString(attrs.hasPermission)){
|
||||
throw 'hasPermission value must be a string';
|
||||
}
|
||||
var value = attrs.hasPermission.trim();
|
||||
var notPermissionFlag = value[0] === '!';
|
||||
if (notPermissionFlag) {
|
||||
value = value.slice(1).trim();
|
||||
}
|
||||
|
||||
function toggleVisibility() {
|
||||
permissions.canView({permission: value}).then(function(allowed){
|
||||
if ((allowed && !notPermissionFlag) || (!allowed && notPermissionFlag)) {
|
||||
element.css('display', 'block');
|
||||
} else {
|
||||
element.css('display', 'none');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
toggleVisibility();
|
||||
scope.$on('permissionsChanged', toggleVisibility);
|
||||
}
|
||||
};
|
||||
});
|
||||
})();
|
||||
@@ -1,14 +0,0 @@
|
||||
<md-tabs md-selected="tabIndex" layout="column" layout-fill class="stretch-height">
|
||||
<md-tab ng-repeat="tab in visibleTabs" md-on-select="processTabClick($event, tab, $index);" active="tab.active"layout="column" layout-fill>
|
||||
<md-tab-label>
|
||||
<div layout="row">
|
||||
<div ng-bind-html="tab.leftItem"></div>
|
||||
<span id="{{tab.title.toLowerCase()}}-tab">{{tab.title}}</span>
|
||||
<div ng-bind-html="tab.rightItem"></div>
|
||||
</div>
|
||||
</md-tab-label>
|
||||
<md-tab-body>
|
||||
<div ng-include src="tab.source" style="height:100%"></div>
|
||||
</md-tab-body>
|
||||
</md-tab>
|
||||
</md-tabs>
|
||||
@@ -1,129 +0,0 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
var _$state;
|
||||
|
||||
/**
|
||||
* Creates a tabset with a scrollable tab bar
|
||||
* Based on the incredible example at http://www.bootply.com/l2ChB4vYmC
|
||||
*/
|
||||
angular.module('portal.common.directives.portalTabset', ['ui.router'])
|
||||
.directive('portalTabSet', function ($state) {
|
||||
_$state = $state;
|
||||
return {
|
||||
restrict: 'E',
|
||||
replace: false, //Nothing shows up if you use replace: true
|
||||
transclude: true,
|
||||
scope: {
|
||||
tabs: '=',
|
||||
tabIndex: '=?',
|
||||
},
|
||||
templateUrl: 'common/directives/portal-tab-set/portal-tab-set.html',
|
||||
link: repoTabsetLink
|
||||
};
|
||||
});
|
||||
|
||||
function repoTabsetLink(scope, element, attrs, fn) {
|
||||
|
||||
//The default starting position of the tab group.
|
||||
var DEFAULT_TAB_POSITION = 0;
|
||||
|
||||
scope.tabIndex = scope.tabIndex === null || scope.tabIndex === undefined ? 0 : scope.tabIndex;
|
||||
scope.visibleTabs = [];
|
||||
|
||||
scope.$watch('tabIndex', function(value) {
|
||||
if (scope.tabIndex === null || scope.tabIndex === undefined) {
|
||||
return;
|
||||
}
|
||||
scope.tabIndex = value;
|
||||
});
|
||||
|
||||
scope.tabsetSelectChange = function(index) {
|
||||
scope.tabIndex = index;
|
||||
scope.$emit('tabsetSelectChange', index);
|
||||
};
|
||||
|
||||
scope.$on('changeTabSelection', function(value) {
|
||||
scope.tabIndex = value;
|
||||
});
|
||||
|
||||
/**
|
||||
* Determines if the state object for a tab is active.
|
||||
*
|
||||
* @param {type} state A tab's state
|
||||
* @returns {boolean} True if the state is active, false otherwise.
|
||||
*/
|
||||
function isActive(state) {
|
||||
var isState = _$state.is(state);
|
||||
return isState || (_$state.current.name.indexOf(state) >= 0); // allow for sub tabs.
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the tabs after the state succesfully changes.
|
||||
*
|
||||
* @param {type} tabs An array of tabs. See action-pane.js for example
|
||||
* @returns {undefined}
|
||||
*/
|
||||
function updateTabStates(tabs) {
|
||||
//Update the active tag for each tab to reflect state change
|
||||
var activeTab = false;
|
||||
if (angular.isArray(tabs)) {
|
||||
tabs.forEach(function (tab) {
|
||||
tab.active = isActive(tab.state);
|
||||
activeTab = activeTab || tab.active;
|
||||
});
|
||||
//If no tab has been specified, activate the first tab.
|
||||
if (!activeTab && angular.isDefined(tabs[0])) {
|
||||
tabs[0].default = true;
|
||||
tabs[0].active = true;
|
||||
}
|
||||
|
||||
//Now notify tabs to respect tab activation
|
||||
scope.$broadcast('tabActivated');
|
||||
}
|
||||
}
|
||||
|
||||
scope.$on('tabsetDidChange', function (evt, tabs) {
|
||||
scope.tabs = tabs;
|
||||
update();
|
||||
});
|
||||
|
||||
function update() {
|
||||
updateVisisbleTabls();
|
||||
updateTabStates(scope.tabs);
|
||||
}
|
||||
|
||||
function updateVisisbleTabls() {
|
||||
for (var i = 0; i < scope.tabs.length; i++) {
|
||||
var tab = scope.tabs[i];
|
||||
if (tab.visible === undefined || tab.visible) {
|
||||
scope.visibleTabs[i] = tab;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
scope.$on('$stateChangeSuccess', function () {
|
||||
updateTabStates(scope.tabs);
|
||||
});
|
||||
|
||||
/**
|
||||
* Changes the state to the specified tab state. If the control key was
|
||||
* held when the tab was click on, opens the tab's "big" state (fullscreen) in
|
||||
* a new tab.
|
||||
*
|
||||
* @param {$event} evt The click event. Used to determine if ctrl/cmd was held
|
||||
* during the click.
|
||||
* @param {type} tab The tab to activate. A tab object from $scope.tabs.
|
||||
*
|
||||
* @returns {undefined}
|
||||
*/
|
||||
scope.processTabClick = function (evt, tab, index) {
|
||||
_$state.go(tab.state);
|
||||
update();
|
||||
scope.tabsetSelectChange(index);
|
||||
};
|
||||
|
||||
updateVisisbleTabls();
|
||||
update();
|
||||
} //end dcdTabsetLink function
|
||||
})();
|
||||
@@ -1,3 +0,0 @@
|
||||
<div>
|
||||
<i id="icon" class="material-icons" title="{{stats}}">{{iconImage}}</i>
|
||||
</div>
|
||||
@@ -1,357 +0,0 @@
|
||||
angular.module('portal.common.directives.portalWebsocket', ['ui.router'])
|
||||
.directive('portalWebsocket', PortalWebsocket);
|
||||
|
||||
function PortalWebsocket(Request, $timeout, portalUtils, PortalPubSub) {
|
||||
return {
|
||||
restrict: 'E',
|
||||
templateUrl: 'common/directives/portal-websocket/portal-websocket.html',
|
||||
link: function (scope) {
|
||||
|
||||
scope.iconImage = 'import_export';
|
||||
scope.stats = 'not started';
|
||||
|
||||
var PingPong = function (msg) {
|
||||
this.date = msg.date;
|
||||
this.pull = msg.pull;
|
||||
this.data = msg.data;
|
||||
};
|
||||
|
||||
var Pinger = function () {
|
||||
this.progress = 0;
|
||||
this.count = 0;
|
||||
this.iterations = null;
|
||||
this.ping = null;
|
||||
this.pong = null;
|
||||
|
||||
this.bwConvert = function (bytes, msec) {
|
||||
var res = bytes / msec * 1000 * 8; // bits/second;
|
||||
var units;
|
||||
if (res > 1000000) {
|
||||
res /= 1024000; // Mbits/sec
|
||||
units = 'Mbps';
|
||||
} else if (res > 1024) {
|
||||
res /= 1000; // Kbits/sec
|
||||
units = 'Kbps';
|
||||
} else {
|
||||
units = 'bps';
|
||||
}
|
||||
return this.round(res, 1) + units;
|
||||
};
|
||||
|
||||
this.round = function (value, decimals) {
|
||||
return Number(Math.round(value + 'e' + decimals) + 'e-' + decimals);
|
||||
};
|
||||
|
||||
this.isDone = function () {
|
||||
if (this.count >= this.iterations) {
|
||||
this.progress = 100;
|
||||
return true;
|
||||
} else {
|
||||
this.progress = this.round(this.count / this.iterations * 100, 0);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
var LatencyTask = portalUtils.inherit(function () {
|
||||
Pinger.call(this);
|
||||
this.iterations = 100;
|
||||
this.latencySum = 0;
|
||||
this.latencyMin = 0;
|
||||
this.latencyAve = 0;
|
||||
this.latencyMax = 0;
|
||||
this.pps = 'n/a';
|
||||
|
||||
this.getPing = function () {
|
||||
this.ping = new PingPong({'date': new Date().getTime(), 'pull': 0, 'data': []});
|
||||
return this.ping;
|
||||
};
|
||||
|
||||
this.onPong = function (pong) {
|
||||
this.pong = pong;
|
||||
this.count++;
|
||||
var now = new Date().getTime();
|
||||
var msec = now - this.pong.date;
|
||||
this.latencySum += msec;
|
||||
this.latencyAve = this.round(this.latencySum / this.count, 0);
|
||||
if (this.latencyMin === 0 || msec < this.latencyMin) {
|
||||
this.latencyMin = msec;
|
||||
}
|
||||
if (this.latencyMax === 0 || msec > this.latencyMax) {
|
||||
this.latencyMax = msec;
|
||||
}
|
||||
// calc aggregate ppps
|
||||
this.pps = this.count / this.latencySum * 1000;
|
||||
this.pps = this.round(this.pps, 1);
|
||||
return this.isDone();
|
||||
};
|
||||
|
||||
|
||||
return this;
|
||||
}, Pinger);
|
||||
|
||||
var DownloadTask = portalUtils.inherit(function (latencyTask) {
|
||||
Pinger.call(this);
|
||||
this.iterations = 20;
|
||||
this.downloadBytes = 0;
|
||||
this.downloadTime = 0;
|
||||
this.download = 0;
|
||||
this.pull = 10000;
|
||||
|
||||
this.getPing = function () {
|
||||
this.ping = new PingPong({'date': new Date().getTime(), 'pull': this.pull, 'data': []});
|
||||
return this.ping;
|
||||
};
|
||||
|
||||
this.onPong = function (pong) {
|
||||
this.pong = pong;
|
||||
this.count++;
|
||||
var now = new Date().getTime();
|
||||
var msec = now - this.pong.date - latencyTask.latencyAve / 2;
|
||||
var bytes = this.pong.data.length;
|
||||
this.downloadBytes += bytes;
|
||||
this.downloadTime += msec;
|
||||
// calc aggregate download bandwidth
|
||||
this.download = this.bwConvert(this.downloadBytes, this.downloadTime);
|
||||
return this.isDone();
|
||||
};
|
||||
|
||||
return this;
|
||||
}, Pinger);
|
||||
|
||||
var UploadTask = portalUtils.inherit(function (latencyTask, downloadTask) {
|
||||
Pinger.call(this);
|
||||
this.iterations = 20;
|
||||
this.uploadBytes = 0;
|
||||
this.uploadTime = 0;
|
||||
this.upload = 0;
|
||||
|
||||
this.getPing = function () {
|
||||
this.ping = new PingPong({'date': new Date().getTime(), 'pull': 0, 'data': downloadTask.pong.data});
|
||||
return this.ping;
|
||||
};
|
||||
|
||||
this.onPong = function (pong) {
|
||||
this.pong = pong;
|
||||
this.count++;
|
||||
var now = new Date().getTime();
|
||||
var msec = now - this.pong.date - latencyTask.latencyAve / 2;
|
||||
var bytes = this.ping.data.length;
|
||||
this.uploadBytes += bytes;
|
||||
this.uploadTime += msec;
|
||||
this.upload = this.bwConvert(this.uploadBytes, this.uploadTime);
|
||||
return this.isDone();
|
||||
};
|
||||
|
||||
return this;
|
||||
}, Pinger);
|
||||
|
||||
var icon = document.getElementById('icon');
|
||||
|
||||
var latencyTask = new LatencyTask();
|
||||
var downloadTask = new DownloadTask(latencyTask);
|
||||
var uploadTask = new UploadTask(latencyTask, downloadTask);
|
||||
var task = latencyTask;
|
||||
var transport = null;
|
||||
var stompClient = null;
|
||||
var subscription = null;
|
||||
|
||||
function onConnectionSuccess(frame) {
|
||||
|
||||
transport = stompClient.ws.transport;
|
||||
|
||||
// subscribe to the /info/pong queue for this user, requires controller annotations:
|
||||
// @SubscribeMapping('/info/ping')
|
||||
// @SendToUser('/queue/info/pong')
|
||||
var headers = {/*ack: 'client'*/};
|
||||
subscription = stompClient.subscribe('/user/queue/pong', onPong, headers);
|
||||
|
||||
// if not websocket scale down the number of iterations
|
||||
if (transport !== 'websocket') {
|
||||
var div = 5;
|
||||
latencyTask.iterations /= div;
|
||||
downloadTask.iterations /= div;
|
||||
uploadTask.iterations /= div;
|
||||
}
|
||||
|
||||
// kick it off
|
||||
task = latencyTask;
|
||||
sendPing();
|
||||
}
|
||||
|
||||
function onPong(frame) {
|
||||
|
||||
// frame.ack();
|
||||
scope.$apply(function () {
|
||||
var done = task.onPong(new PingPong(JSON.parse(frame.body)));
|
||||
|
||||
// switch tasks when finished
|
||||
if (done && task === latencyTask) {
|
||||
task = downloadTask;
|
||||
} else if (done && task === downloadTask) {
|
||||
task = uploadTask;
|
||||
} else if (done && task === uploadTask) {
|
||||
task = null;
|
||||
}
|
||||
|
||||
if (task !== null) {
|
||||
|
||||
sendPing();
|
||||
} else {
|
||||
finish();
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
scope.busy = function () {
|
||||
return task !== null;
|
||||
};
|
||||
|
||||
function connect(transports) {
|
||||
|
||||
|
||||
// create stomp client
|
||||
var options = {transports: transports};
|
||||
var socket = new SockJS(Request.baseURI + '/ws/stomp', null, options);
|
||||
stompClient = Stomp.over(socket);
|
||||
stompClient.debug = null;
|
||||
|
||||
// connect to server
|
||||
scope.stats = 'connecting';
|
||||
var headers = {};
|
||||
stompClient.connect(headers, onConnectionSuccess, onConnectionFailure);
|
||||
}
|
||||
|
||||
function sendPing() {
|
||||
setActiveStatus();
|
||||
stompClient.send('/start/ping', {}, JSON.stringify(task.getPing()));
|
||||
}
|
||||
|
||||
var timer = null;
|
||||
|
||||
function flash() {
|
||||
icon.style.color = (icon.style.color === 'green') ? 'goldenrod' : 'green';
|
||||
if (getProgress() < 100) {
|
||||
timer = $timeout(flash, 250);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function getProgress() {
|
||||
return Math.round((latencyTask.progress + uploadTask.progress + downloadTask.progress) / 3);
|
||||
}
|
||||
|
||||
function finish() {
|
||||
$timeout.cancel(timer);
|
||||
|
||||
// shutdown the websocket connection
|
||||
subscription.unsubscribe();
|
||||
stompClient.disconnect();
|
||||
stompClient = null;
|
||||
|
||||
if (transport === 'websocket') {
|
||||
setSuccessfulStatus();
|
||||
} else {
|
||||
setDegradedStatus();
|
||||
}
|
||||
}
|
||||
|
||||
function onConnectionFailure(error) {
|
||||
$timeout.cancel(timer);
|
||||
stompClient = null; // Stomp connections are closed on failure
|
||||
setFailureStatus(error.toString());
|
||||
}
|
||||
|
||||
|
||||
function createStats() {
|
||||
var min = latencyTask.latencyMin;
|
||||
var ave = latencyTask.latencyAve;
|
||||
var max = latencyTask.latencyMax;
|
||||
var pps = latencyTask.pps;
|
||||
var upload = uploadTask.upload;
|
||||
var download = downloadTask.download;
|
||||
var latency = min + '/' + ave + '/' + max;
|
||||
|
||||
// always start with the transport
|
||||
var stats = transport;
|
||||
if (latencyTask.progress > 0) {
|
||||
stats += ', ' + latency + 'ms, ' + pps + 'pps';
|
||||
}
|
||||
if (downloadTask.progress > 0) {
|
||||
stats += ', ' + download;
|
||||
}
|
||||
if (uploadTask.progress > 0) {
|
||||
stats += '/' + upload;
|
||||
}
|
||||
if (getProgress() < 100) {
|
||||
stats += ', ' + getProgress() + '%';
|
||||
}
|
||||
return stats;
|
||||
}
|
||||
|
||||
function setActiveStatus() {
|
||||
|
||||
// make available to html
|
||||
scope.stats = createStats();
|
||||
|
||||
// icon stays flashing
|
||||
|
||||
// notify login dialog that we are not finished
|
||||
PortalPubSub.publish('StompTestStatus', {status: 'active', stats: scope.stats});
|
||||
}
|
||||
|
||||
|
||||
// green
|
||||
function setSuccessfulStatus() {
|
||||
|
||||
// make available to html
|
||||
scope.stats = createStats();
|
||||
|
||||
// flashing has stopped, set green check
|
||||
scope.iconImage = 'check';
|
||||
icon.style.color = 'green';
|
||||
|
||||
// publish status (to login dialog)
|
||||
PortalPubSub.publish('StompTestStatus', {status: 'successful', stats: scope.stats});
|
||||
}
|
||||
|
||||
// yellow
|
||||
function setDegradedStatus() {
|
||||
|
||||
// make available to html
|
||||
scope.stats = createStats();
|
||||
|
||||
// flashing has stopped, set yellow info flag
|
||||
scope.iconImage = 'info';
|
||||
icon.style.color = 'goldenrod';
|
||||
|
||||
// publish status (to login dialog)
|
||||
PortalPubSub.publish('StompTestStatus', {status: 'degraded', stats: scope.stats});
|
||||
}
|
||||
|
||||
//red
|
||||
function setFailureStatus(msg) {
|
||||
|
||||
// set hover over
|
||||
scope.stats = 'failed: ' + msg;
|
||||
|
||||
// flashing has stopped, set red error flag
|
||||
scope.iconImage = 'error';
|
||||
icon.style.color = 'red';
|
||||
|
||||
// publish status (to login dialog)
|
||||
PortalPubSub.publish('StompTestStatus', {status: 'failure', stats: scope.stats});
|
||||
|
||||
}
|
||||
|
||||
// start the test
|
||||
flash();
|
||||
var transports = [/*'websocket', 'xhr-streaming', 'eventsource', 'xhr-polling', 'jsonp-polling'*/];
|
||||
connect(transports);
|
||||
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
(function (module) {
|
||||
'use strict';
|
||||
module('portal.common.factories.pubsub', []).factory('PortalPubSub', [function () {
|
||||
/*jshint ignore:start*/
|
||||
var pub = new PubSub();
|
||||
return pub;
|
||||
/*jshint ignore:end*/
|
||||
}]);
|
||||
}(angular.module));
|
||||
@@ -1,91 +0,0 @@
|
||||
<md-dialog flex="40">
|
||||
<form name="credForm" ng-submit="credForm.$valid && ok()">
|
||||
<md-toolbar>
|
||||
<div class="md-toolbar-tools md-portal">
|
||||
<span>{{header}}</span>
|
||||
<span flex></span>
|
||||
<md-button class="md-icon-button" ng-click="cancel()">
|
||||
<md-icon aria-label="Close dialog">close</md-icon>
|
||||
</md-button>
|
||||
</div>
|
||||
</md-toolbar>
|
||||
<md-dialog-content layout-padding flex>
|
||||
<div>
|
||||
<div layout-gt-xs="row">
|
||||
<md-input-container class="md-block" flex-gt-xs>
|
||||
<label>Credential Name</label>
|
||||
<input ng-model="credentials.name" name="credName" id="credName" required>
|
||||
<div ng-messages="credForm.credName.$error" ng-show="credForm.credName.$invalid && submitted || credForm.credName.$touched">
|
||||
<div ng-message="required">Credentials name is required</div>
|
||||
</div>
|
||||
</md-input-container>
|
||||
</div>
|
||||
<div layout-gt-xs="row">
|
||||
<md-input-container class="md-block" flex-gt-xs>
|
||||
<label>Credential Type</label>
|
||||
<md-select ng-model="credentials.credentialType" required name="type" id="type">
|
||||
<md-option ng-repeat="cred in credentialTypes" ng-value="cred.name">{{cred.value}}</md-option>
|
||||
</md-select>
|
||||
<div ng-messages="credForm.type.$error" ng-show="credForm.type.$invalid && submitted || credForm.type.$touched">
|
||||
<div ng-message="required">Credential type is required</div>
|
||||
</div>
|
||||
</md-input-container>
|
||||
</div>
|
||||
</div>
|
||||
<div layout-gt-xs="row" layout-align="start center" ng-if="credentials.credentialType === 'PASSWD'">
|
||||
<md-input-container class="md-block" flex-gt-sm>
|
||||
<label>User Name</label>
|
||||
<input ng-model="credentials.username" required name="username" id="username">
|
||||
<div ng-messages="credForm.username.$error" ng-show="credForm.username.$invalid && submitted || credForm.username.$touched">
|
||||
<div ng-message="required">Username is required</div>
|
||||
</div>
|
||||
</md-input-container>
|
||||
|
||||
<md-input-container class="md-block" flex-gt-xs>
|
||||
<label>Password</label>
|
||||
<input ng-model="credentials.password" type="{{passwordType}}" name="password" id="password" ng-required="requirePassword">
|
||||
<div ng-messages="credForm.password.$error" ng-show="credForm.password.$invalid && submitted || credForm.password.$touched">
|
||||
<div ng-message="required">Password is required</div>
|
||||
</div>
|
||||
</md-input-container>
|
||||
|
||||
<md-button class="md-icon-button" style="margin-bottom: 25px;" ng-mousedown="passwordType='text'" ng-mouseup="passwordType='password'">
|
||||
<md-icon>remove_red_eye</md-icon>
|
||||
<md-tooltip>View password</md-tooltip>
|
||||
</md-button>
|
||||
|
||||
</div>
|
||||
<div layout="column" ng-if="credentials.credentialType === 'SSH'" flex>
|
||||
<md-input-container class="md-block" flex-gt-sm>
|
||||
<label>User Identity</label>
|
||||
<input ng-model="credentials.username" required name="username" id="username">
|
||||
<div ng-messages="credForm.username.$error" ng-show="credForm.username.$invalid && submitted || credForm.username.$touched">
|
||||
<md-tooltip md-delay="500" class="mediaTileToolTip" md-direction="bottom">Username on the remote system the ssh key belongs to</md-tooltip>
|
||||
<div ng-message="required">User identity is required</div>
|
||||
</div>
|
||||
</md-input-container>
|
||||
<md-input-container class="md-block" flex>
|
||||
<label>SSH Private Key</label>
|
||||
<textarea ng-model="credentials.key" name="sshKey" id="sshKey" required rows="3" cols="50"></textarea>
|
||||
<div ng-messages="credForm.sshKey.$error" ng-show="credForm.sshKey.$invalid && submitted || credForm.sshKey.$touched">
|
||||
<div ng-message="required">SSH Key is required</div>
|
||||
</div>
|
||||
</md-input-container>
|
||||
<md-input-container class="md-block" flex>
|
||||
<label>Passphrase</label>
|
||||
<input ng-model="credentials.passphrase" name="passphrase" id="passphrase">
|
||||
</md-input-container>
|
||||
</div>
|
||||
<div ng-show="loadingBlock" class="loadingFade"></div>
|
||||
<div class="loadingModal" ng-show="loadingBlock">
|
||||
<md-progress-circular md-mode="indeterminate" md-diameter="80" class="md-hue-2"></md-progress-circular>
|
||||
</div>
|
||||
</md-dialog-content>
|
||||
<md-dialog-actions layout="row" class="modal-footer">
|
||||
<div class="text-danger">{{error}}</div>
|
||||
<md-button id="okButton" type="submit" class="md-raised md-primary" >OK</md-button>
|
||||
<md-button id="cancelButton" class="md-raised md-warn" ng-click="cancel()">Cancel</md-button>
|
||||
</md-dialog-actions>
|
||||
</form>
|
||||
</md-dialog>
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* MODULE DESCRIPTION:
|
||||
*
|
||||
* TODO: Write description here.
|
||||
*/
|
||||
angular.module('portal.common.partials.addCreds', ['ui.router']).controller('AddCredsCtrl', AddUserCtrlController);
|
||||
|
||||
function AddUserCtrlController($scope, modalInstance, $state, cache, $mdDialog, Account, Credentials, credentialStores, credentialProvider, portalUtils) {
|
||||
|
||||
$scope.header = modalInstance.header;
|
||||
|
||||
$scope.passwordType = 'password';
|
||||
|
||||
$scope.submitted = false;
|
||||
|
||||
$scope.loadingBlock = false;
|
||||
|
||||
$scope.isNew = modalInstance.credentials === undefined ? true : false;
|
||||
|
||||
$scope.credentials = $scope.isNew ? new Credentials() : modalInstance.credentials;
|
||||
|
||||
$scope.valid = false;
|
||||
|
||||
$scope.mCache = cache.request([new credentialStores.CredentialTypes()]).then(function(){
|
||||
$scope.credentialTypes = $scope.mCache.credentialTypes.data.values;
|
||||
});
|
||||
|
||||
/**
|
||||
* OK button handler
|
||||
* @returns {undefined}
|
||||
*/
|
||||
$scope.ok = function () {
|
||||
$scope.loadingBlock = true;
|
||||
var status = $scope.isNew ? 'added': 'edited';
|
||||
$scope.submitted = true;
|
||||
credentialProvider.addCredentials($scope.credentials).then(function(data){
|
||||
$scope.loadingBlock = false;
|
||||
portalUtils.toast('Credentials ' + status + ' successfully', ['top', 'left'], 2000);
|
||||
$mdDialog.hide();
|
||||
}).catch(function(err){
|
||||
$scope.loadingBlock = false;
|
||||
$scope.error = err.message;
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Cancel button handler.
|
||||
* @returns {undefined}
|
||||
*/
|
||||
$scope.cancel = function () {
|
||||
//Dismiss the modal
|
||||
$mdDialog.cancel();
|
||||
};
|
||||
|
||||
} //end AddUserCtrlController function
|
||||
|
||||
})();
|
||||
@@ -1,32 +0,0 @@
|
||||
<md-dialog flex="25">
|
||||
<md-toolbar>
|
||||
<div class="md-toolbar-tools md-portal">
|
||||
<span>{{header}} to {{currentDir}}</span>
|
||||
<span flex></span>
|
||||
<md-button class="md-icon-button" ng-click="cancel()">
|
||||
<md-icon aria-label="Close dialog">close</md-icon>
|
||||
</md-button>
|
||||
</div>
|
||||
</md-toolbar>
|
||||
<md-dialog-content flex>
|
||||
<div layout="row" flex="100" class="md-dialog-content">
|
||||
<md-input-container flex>
|
||||
<label>File Directory Location</label>
|
||||
<input type="text" id="fileName" ng-model="model.fileDir" required>
|
||||
</md-input-container>
|
||||
</div>
|
||||
<div ng-show="loadingBlock" class="loadingFade"></div>
|
||||
<div class="loadingModal" ng-show="loadingBlock">
|
||||
<md-progress-circular md-mode="indeterminate" md-diameter="80" class="md-hue-2"></md-progress-circular>
|
||||
</div>
|
||||
</md-dialog-content>
|
||||
<div ng-show="loadingBlock" class="loadingFade"></div>
|
||||
<div class="loadingModal" ng-show="loadingBlock">
|
||||
<md-progress-circular md-mode="indeterminate" md-diameter="80" class="md-hue-2"></md-progress-circular>
|
||||
</div>
|
||||
<md-dialog-actions layout="row" class="modal-footer">
|
||||
<div class="text-danger text-center">{{error}}</div>
|
||||
<md-button id="okButton" class="md-raised md-primary" ng-click="ok()" ng-disabled="!valid">OK</md-button>
|
||||
<md-button id="cancelButton" class="md-raised md-warn" ng-click="cancel()">Cancel</md-button>
|
||||
</md-dialog-actions>
|
||||
</md-dialog>
|
||||
@@ -1,67 +0,0 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* MODULE DESCRIPTION:
|
||||
*
|
||||
* TODO: Write description here.
|
||||
*/
|
||||
angular.module('portal.common.partials.addDirectory', ['ui.router'])
|
||||
.controller('AddDirectoryCtrl', AddDirectoryCtrlController);
|
||||
|
||||
function AddDirectoryCtrlController($scope, modalInstance, $state, cache, $mdDialog, fileProvider, UploadFile, portalUtils) {
|
||||
|
||||
$scope.header = modalInstance.header;
|
||||
$scope.currentDir = modalInstance.currentDir;
|
||||
|
||||
$scope.loadingBlock = false;
|
||||
|
||||
$scope.model = { };
|
||||
|
||||
$scope.valid = false;
|
||||
|
||||
$scope.$watch('model', function(){
|
||||
|
||||
if ($scope.model.fileDir === undefined) {
|
||||
$scope.valid = false;
|
||||
return;
|
||||
}
|
||||
|
||||
$scope.valid = true;
|
||||
|
||||
}, true);
|
||||
|
||||
/**
|
||||
* OK button handler
|
||||
* @returns {undefined}
|
||||
*/
|
||||
$scope.ok = function () {
|
||||
$scope.loadingBlock = true;
|
||||
fileProvider.makeDirectory($scope.currentDir, $scope.model.fileDir).then(function(data) {
|
||||
$scope.loadingBlock = false;
|
||||
portalUtils.toast('Directory added successfully', ['top', 'left'], 2000);
|
||||
$mdDialog.hide();
|
||||
}).catch(function(err) {
|
||||
$scope.loadingBlock = false;
|
||||
$scope.error = err.message;
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Cancel button handler.
|
||||
* @returns {undefined}
|
||||
*/
|
||||
$scope.cancel = function () {
|
||||
//Dismiss the modal
|
||||
$mdDialog.cancel();
|
||||
};
|
||||
|
||||
$scope.$on('$destroy', function () {
|
||||
if ($scope.mCache !== undefined) {
|
||||
$scope.mCache.unlisten();
|
||||
}
|
||||
});
|
||||
|
||||
} //end AddDirectoryCtrlController function
|
||||
|
||||
})();
|
||||
@@ -1,39 +0,0 @@
|
||||
<md-dialog>
|
||||
<form name="emailTmplForm" ng-submit="emailTmplForm.$valid && ok()">
|
||||
<md-toolbar>
|
||||
<div class="md-toolbar-tools md-portal">
|
||||
<span>{{header}}</span>
|
||||
<span flex></span>
|
||||
<md-button class="md-icon-button" ng-click="cancel()">
|
||||
<md-icon aria-label="Close dialog">close</md-icon>
|
||||
</md-button>
|
||||
</div>
|
||||
</md-toolbar>
|
||||
<md-dialog-content layout-padding flex>
|
||||
<div layout="column" layout-align="start start" flex>
|
||||
<md-input-container class="md-block" flex-gt-sm>
|
||||
<label>Email Template Name</label>
|
||||
<input ng-model="emailTmpl.emailName" required id="emailTmpl" name="emailTmpl">
|
||||
<div ng-messages="emailTmplForm.emailTmpl.$error" ng-show="emailTmplForm.emailTmpl.$invalid && submitted || emailTmplForm.emailTmpl.$touched">
|
||||
<div ng-message="required">Email template name is required</div>
|
||||
</div>
|
||||
</md-input-container>
|
||||
<md-input-container class="md-block" flex-gt-sm>
|
||||
<label>Email Subject</label>
|
||||
<input ng-model="emailTmpl.emailSubject" required id="emailSubject" name="emailSubject">
|
||||
<div ng-messages="emailTmplForm.emailSubject.$error" ng-show="emailTmplForm.emailSubject.$invalid && submitted || emailTmplForm.emailSubject.$touched">
|
||||
<div ng-message="required">Email subject is required</div>
|
||||
</div>
|
||||
</md-input-container>
|
||||
<span><strong>Email Body</strong></span>
|
||||
<textarea ui-tinymce="tinymceOptions" ng-model="emailTmpl.emailMessage"></textarea>
|
||||
</div>
|
||||
</md-dialog-content>
|
||||
<md-dialog-actions layout="row" class="modal-footer">
|
||||
<div class="text-danger">{{error}}</div>
|
||||
<md-button id="okButton" type="submit" class="md-raised md-primary" >OK</md-button>
|
||||
<md-button id="cancelButton" class="md-raised md-warn" ng-click="cancel()">Cancel</md-button>
|
||||
</md-dialog-actions>
|
||||
</form>
|
||||
</md-dialog>
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* MODULE DESCRIPTION:
|
||||
*
|
||||
* TODO: Write description here.
|
||||
*/
|
||||
angular.module('portal.common.partials.addEmailTmpl', ['ui.router']).controller('AddEmailTmplCtrl', addEmailTmplCtrlController);
|
||||
|
||||
function addEmailTmplCtrlController($scope, modalInstance, $state, cache, $mdDialog, EmailTemplate,
|
||||
systemProvider, scriptStores, portalUtils, $timeout) {
|
||||
|
||||
$scope.trustAsHtml = portalUtils.trustAsHtml;
|
||||
|
||||
$scope.header = modalInstance.header;
|
||||
|
||||
$scope.submitted = false;
|
||||
|
||||
$scope.loadingBlock = false;
|
||||
|
||||
$scope.isNew = modalInstance.template === undefined;
|
||||
|
||||
$scope.emailTmpl = $scope.isNew ? new EmailTemplate() : new EmailTemplate(modalInstance.template);
|
||||
|
||||
/*jshint ignore:start*/
|
||||
$scope.tinymceOptions = {
|
||||
inline: false,
|
||||
skin: 'lightgray',
|
||||
theme : 'modern',
|
||||
branding: false,
|
||||
height: 300,
|
||||
max_height: 300,
|
||||
width: 600,
|
||||
max_width: 600,
|
||||
resize: false
|
||||
};
|
||||
/*jshint ignore:end*/
|
||||
|
||||
/**
|
||||
* OK button handler
|
||||
* @returns {undefined}
|
||||
*/
|
||||
$scope.ok = function () {
|
||||
$scope.loadingBlock = true;
|
||||
var status = $scope.isNew ? 'Added': 'Edited';
|
||||
systemProvider.addEmailTemplate($scope.emailTmpl).then(function(data){
|
||||
portalUtils.toast('Email Template ' + status + ' Successfully', ['top', 'left'], 2000);
|
||||
$mdDialog.hide();
|
||||
}).catch(function(err) {
|
||||
$scope.loadingBlock = false;
|
||||
$scope.error = err.message;
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Cancel button handler.
|
||||
* @returns {undefined}
|
||||
*/
|
||||
$scope.cancel = function () {
|
||||
//Dismiss the modal
|
||||
$mdDialog.cancel();
|
||||
};
|
||||
|
||||
} //end addEmailTmplCtrlController function
|
||||
|
||||
})();
|
||||
@@ -1,50 +0,0 @@
|
||||
<md-dialog flex="40">
|
||||
<form name="envForm" ng-submit="envForm.$valid && ok()">
|
||||
<md-toolbar>
|
||||
<div class="md-toolbar-tools md-portal">
|
||||
<span>{{header}}</span>
|
||||
<md-button class="md-icon-button" ng-click="addEnvVar()">
|
||||
<md-tooltip md-delay="500" class="mediaTileToolTip" md-direction="left">New Environment Variable</md-tooltip>
|
||||
<md-icon class="md-icon-default-color">note_add</md-icon>
|
||||
</md-button>
|
||||
<span flex></span>
|
||||
<md-button class="md-icon-button" ng-click="cancel()">
|
||||
<md-icon aria-label="Close dialog">close</md-icon>
|
||||
</md-button>
|
||||
</div>
|
||||
</md-toolbar>
|
||||
<md-dialog-content flex>
|
||||
<md-list flex>
|
||||
<md-list-item ng-repeat="param in envVars" class="secondary-button-padding">
|
||||
<div layout="row" flex="100" style="background: {{$index % 2 === 0 ? 'white' : '#DCDCDC'}}; padding-left:5px; padding-right:5px;">
|
||||
<div layout="row" flex>
|
||||
<md-input-container flex>
|
||||
<label>Variable Name</label>
|
||||
<input type="text" ng-model="param.name" class="answerInput" required/>
|
||||
</md-input-container>
|
||||
<span flex="5"></span>
|
||||
<md-input-container flex>
|
||||
<label>Variable Value</label>
|
||||
<input type="text" ng-model="param.value" class="answerInput" required/>
|
||||
</md-input-container>
|
||||
</div>
|
||||
<div layout="column" flex="10">
|
||||
<div layout="row" layout-align="end center" flex>
|
||||
<md-button class="md-icon-button" ng-click="delete($index, envVars)" >
|
||||
<md-tooltip md-delay="500" class="mediaTileToolTip" md-direction="left">Remove Environment Variable</md-tooltip>
|
||||
<md-icon>delete</md-icon>
|
||||
</md-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</md-list-item>
|
||||
</md-list>
|
||||
</md-dialog-content>
|
||||
<md-dialog-actions layout="row" class="modal-footer">
|
||||
<div class="text-danger">{{error}}</div>
|
||||
<md-button id="okButton" type="submit" class="md-raised md-primary" >OK</md-button>
|
||||
<md-button id="cancelButton" class="md-raised md-warn" ng-click="cancel()">Cancel</md-button>
|
||||
</md-dialog-actions>
|
||||
</form>
|
||||
</md-dialog>
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* MODULE DESCRIPTION:
|
||||
*
|
||||
* TODO: Write description here.
|
||||
*/
|
||||
angular.module('portal.common.partials.addEnvVars', ['ui.router']).controller('AddEnvVarCtrl', addEnvVarCtrlController);
|
||||
|
||||
function addEnvVarCtrlController($scope, modalInstance, cache, $mdDialog, scriptObjects,
|
||||
systemProvider, systemStores, portalUtils) {
|
||||
|
||||
$scope.header = modalInstance.header;
|
||||
|
||||
$scope.submitted = false;
|
||||
|
||||
$scope.loadingBlock = false;
|
||||
|
||||
$scope.isNew = modalInstance.envVars.length === 0;
|
||||
|
||||
$scope.envVars = [];
|
||||
|
||||
if (!$scope.isNew) {
|
||||
for (var i = 0; i < modalInstance.envVars.length; i++) {
|
||||
$scope.envVars.push( new scriptObjects.ScriptEnvironmentVariable(modalInstance.envVars[i]) );
|
||||
}
|
||||
}
|
||||
|
||||
$scope.valid = false;
|
||||
|
||||
/**
|
||||
* OK button handler
|
||||
* @returns {undefined}
|
||||
*/
|
||||
$scope.ok = function () {
|
||||
|
||||
$scope.loadingBlock = true;
|
||||
var status = $scope.isNew ? 'added': 'edited';
|
||||
$scope.submitted = true;
|
||||
|
||||
systemProvider.addEnvVars($scope.envVars).then(function(data) {
|
||||
$scope.loadingBlock = false;
|
||||
portalUtils.toast('Script ' + status + ' successfully', ['top', 'left'], 2000);
|
||||
$mdDialog.hide();
|
||||
}).catch(function(err) {
|
||||
$scope.loadingBlock = false;
|
||||
$scope.error = err.message;
|
||||
});
|
||||
};
|
||||
|
||||
$scope.addEnvVar = function() {
|
||||
var env = new scriptObjects.ScriptEnvironmentVariable();
|
||||
$scope.envVars.push(env);
|
||||
};
|
||||
|
||||
$scope.moveUp = function(index, array) {
|
||||
var ent1 = array[index];
|
||||
var ent2 = array[index-1];
|
||||
array[index] = ent2;
|
||||
array[index-1] = ent1;
|
||||
};
|
||||
|
||||
$scope.moveDown = function(index, array) {
|
||||
var ent1 = array[index];
|
||||
var ent2 = array[index+1];
|
||||
array[index] = ent2;
|
||||
array[index+1] = ent1;
|
||||
};
|
||||
|
||||
$scope.delete = function (id, array) {
|
||||
array.splice(id, 1);
|
||||
};
|
||||
|
||||
/**
|
||||
* Cancel button handler.
|
||||
* @returns {undefined}
|
||||
*/
|
||||
$scope.cancel = function () {
|
||||
//Dismiss the modal
|
||||
$mdDialog.cancel();
|
||||
};
|
||||
|
||||
} //end addEnvVarCtrlController function
|
||||
|
||||
})();
|
||||
@@ -1,74 +0,0 @@
|
||||
<md-dialog flex="40">
|
||||
<form name="gitForm" ng-submit="gitForm.$valid && ok()">
|
||||
<md-toolbar>
|
||||
<div class="md-toolbar-tools md-portal">
|
||||
<span>{{header}}</span>
|
||||
<span flex></span>
|
||||
<md-button class="md-icon-button" ng-click="cancel()">
|
||||
<md-icon aria-label="Close dialog">close</md-icon>
|
||||
</md-button>
|
||||
</div>
|
||||
</md-toolbar>
|
||||
<md-dialog-content layout-padding flex>
|
||||
<div>
|
||||
<div layout-gt-xs="row">
|
||||
<md-input-container class="md-block" flex-gt-xs>
|
||||
<label>Name</label>
|
||||
<input ng-model="git.name" name="name" id="name" required>
|
||||
<div ng-messages="gitForm.name.$error" ng-show="gitForm.name.$invalid && submitted || gitForm.name.$touched">
|
||||
<div ng-message="required">Name is required</div>
|
||||
</div>
|
||||
</md-input-container>
|
||||
</div>
|
||||
<div layout-gt-xs="row">
|
||||
<md-input-container class="md-block" flex-gt-xs>
|
||||
<label>Git SCM Url</label>
|
||||
<input ng-model="git.scm" name="scm" id="scm" required>
|
||||
<div ng-messages="gitForm.scm.$error" ng-show="gitForm.scm.$invalid && submitted || gitForm.scm.$touched">
|
||||
<div ng-message="required">Git SCM url is required</div>
|
||||
</div>
|
||||
</md-input-container>
|
||||
</div>
|
||||
<div layout-gt-xs="row">
|
||||
<md-input-container class="md-block" flex-gt-xs>
|
||||
<label>Git Branch</label>
|
||||
<input ng-model="git.branch" name="branch" id="branch" required>
|
||||
<div ng-messages="gitForm.branch.$error" ng-show="gitForm.branch.$invalid && submitted || gitForm.branch.$touched">
|
||||
<div ng-message="required">Git SCM url is required</div>
|
||||
</div>
|
||||
</md-input-container>
|
||||
</div>
|
||||
<div layout-gt-xs="row">
|
||||
<md-input-container class="md-block" flex-gt-xs>
|
||||
<label>Local Checkout Directory</label>
|
||||
<input ng-model="git.directory" name="directory" id="directory" required>
|
||||
<div ng-messages="gitForm.directory.$error" ng-show="gitForm.directory.$invalid && submitted || gitForm.directory.$touched">
|
||||
<div ng-message="required">Checkout directory is required</div>
|
||||
</div>
|
||||
</md-input-container>
|
||||
</div>
|
||||
<div layout-gt-xs="row">
|
||||
<md-input-container class="md-block" flex-gt-xs>
|
||||
<label>Credentials</label>
|
||||
<md-select ng-model="git.credentials" required name="creds" id="creds" ng-model-options="{trackBy: '$value.uid'}">
|
||||
<md-option ng-repeat="cred in credentials" ng-value="cred">{{displayKey(cred)}}</md-option>
|
||||
</md-select>
|
||||
<div ng-messages="credForm.creds.$error" ng-show="credForm.creds.$invalid && submitted || credForm.creds.$touched">
|
||||
<div ng-message="required">Credentials are required</div>
|
||||
</div>
|
||||
</md-input-container>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-show="loadingBlock" class="loadingFade"></div>
|
||||
<div class="loadingModal" ng-show="loadingBlock">
|
||||
<md-progress-circular md-mode="indeterminate" md-diameter="80" class="md-hue-2"></md-progress-circular>
|
||||
</div>
|
||||
</md-dialog-content>
|
||||
<md-dialog-actions layout="row" class="modal-footer">
|
||||
<div class="text-danger">{{error}}</div>
|
||||
<md-button id="okButton" type="submit" class="md-raised md-primary" >OK</md-button>
|
||||
<md-button id="cancelButton" class="md-raised md-warn" ng-click="cancel()">Cancel</md-button>
|
||||
</md-dialog-actions>
|
||||
</form>
|
||||
</md-dialog>
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* MODULE DESCRIPTION:
|
||||
*
|
||||
* TODO: Write description here.
|
||||
*/
|
||||
angular.module('portal.common.partials.addGit', ['ui.router']).controller('AddGitCtrl', addGitCtrlController);
|
||||
|
||||
function addGitCtrlController($scope, modalInstance, $state, cache, $mdDialog, GitInfo, Account, accountProvider, gitProvider, credentialStores, portalUtils) {
|
||||
|
||||
$scope.trustAsHtml = portalUtils.trustAsHtml;
|
||||
|
||||
$scope.header = modalInstance.header;
|
||||
|
||||
$scope.submitted = false;
|
||||
|
||||
$scope.loadingBlock = false;
|
||||
|
||||
$scope.isNew = modalInstance.gitInfo === undefined ? true : false;
|
||||
|
||||
$scope.git = $scope.isNew ? new GitInfo() : modalInstance.gitInfo;
|
||||
|
||||
$scope.valid = false;
|
||||
|
||||
$scope.mCache = cache.request([new credentialStores.Credentials()]).then(function(){
|
||||
$scope.credentials = $scope.mCache.credentials.data.values;
|
||||
});
|
||||
|
||||
/**
|
||||
* OK button handler
|
||||
* @returns {undefined}
|
||||
*/
|
||||
$scope.ok = function () {
|
||||
$scope.loadingBlock = true;
|
||||
var status = $scope.isNew ? 'added': 'edited';
|
||||
$scope.submitted = true;
|
||||
gitProvider.addGitRepo($scope.git).then(function(data){
|
||||
$scope.loadingBlock = false;
|
||||
portalUtils.toast('Git ' + status + ' successfully', ['top', 'left'], 2000);
|
||||
$mdDialog.hide();
|
||||
}).catch(function(err){
|
||||
$scope.loadingBlock = false;
|
||||
$scope.error = err.message;
|
||||
});
|
||||
};
|
||||
|
||||
$scope.displayKey = function(cred) {
|
||||
if (cred === undefined) {
|
||||
return '';
|
||||
}
|
||||
return cred.name + (cred.credentialType === 'SSH' ? ' (SSH Key)' : ' (Username/Password)');
|
||||
};
|
||||
|
||||
/**
|
||||
* Cancel button handler.
|
||||
* @returns {undefined}
|
||||
*/
|
||||
$scope.cancel = function () {
|
||||
//Dismiss the modal
|
||||
$mdDialog.cancel();
|
||||
};
|
||||
|
||||
} //end addGitCtrlController function
|
||||
|
||||
})();
|
||||
@@ -1,67 +0,0 @@
|
||||
<md-dialog flex>
|
||||
<form name="permForm" ng-submit="permForm.$valid && ok()">
|
||||
<md-toolbar>
|
||||
<div class="md-toolbar-tools md-portal">
|
||||
<span>{{header}}</span>
|
||||
<span flex></span>
|
||||
<md-button class="md-icon-button" ng-click="cancel()">
|
||||
<md-icon aria-label="Close dialog">close</md-icon>
|
||||
</md-button>
|
||||
</div>
|
||||
</md-toolbar>
|
||||
<md-dialog-content layout-padding flex>
|
||||
<div>
|
||||
<div layout="row">
|
||||
<md-input-container class="md-block" flex-gt-xs ng-if="isNew">
|
||||
<label>Permission Group Unique Name</label>
|
||||
<input ng-model="permission.name" name="name" id="name" required>
|
||||
<div ng-messages="permForm.name.$error" ng-show="permForm.name.$invalid && submitted || permForm.name.$touched">
|
||||
<div ng-message="required">Unique name required</div>
|
||||
</div>
|
||||
</md-input-container>
|
||||
<md-input-container class="md-block" flex-gt-xs>
|
||||
<label>Permission Group Display Name</label>
|
||||
<input ng-model="permission.displayName" name="displayName" id="displayName" required>
|
||||
<div ng-messages="permForm.displayName.$error" ng-show="permForm.displayName.$invalid && submitted || permForm.displayName.$touched">
|
||||
<div ng-message="required">Display name required</div>
|
||||
</div>
|
||||
</md-input-container>
|
||||
</div>
|
||||
<div layout="row" flex>
|
||||
<md-list>
|
||||
<md-list-item>
|
||||
<p flex>Permission Group Enabled</p>
|
||||
<span flex="5"></span>
|
||||
<md-switch md-invert ng-model="permission.enabled" class="md-primary">{{permission.enabled ? 'True' : 'False'}}</md-switch>
|
||||
</md-list-item>
|
||||
</md-list>
|
||||
</div>
|
||||
</div>
|
||||
<div layout="row" flex>
|
||||
<md-tabs md-dynamic-height flex>
|
||||
<md-tab ng-repeat="cat in permissionCategories" label="{{cat.displayName}}">
|
||||
<md-content class="md-padding" flex>
|
||||
<md-list>
|
||||
<md-list-item ng-repeat="perm in cat.permissions">
|
||||
<p>{{perm.displayName}}</p>
|
||||
<span flex="5"></span>
|
||||
<md-switch ng-model="perm.allowed" class="md-primary">{{perm.allowed ? 'Enabled' : 'Disabled'}}</md-switch>
|
||||
</md-list-item>
|
||||
</md-list>
|
||||
</md-content>
|
||||
</md-tab>
|
||||
</md-tabs>
|
||||
</div>
|
||||
<div ng-show="loadingBlock" class="loadingFade"></div>
|
||||
<div class="loadingModal" ng-show="loadingBlock">
|
||||
<md-progress-circular md-mode="indeterminate" md-diameter="80" class="md-hue-2"></md-progress-circular>
|
||||
</div>
|
||||
</md-dialog-content>
|
||||
<md-dialog-actions layout="row" class="modal-footer">
|
||||
<div class="text-danger">{{error}}</div>
|
||||
<md-button id="okButton" type="submit" class="md-raised md-primary" >OK</md-button>
|
||||
<md-button id="cancelButton" class="md-raised md-warn" ng-click="cancel()">Cancel</md-button>
|
||||
</md-dialog-actions>
|
||||
</form>
|
||||
</md-dialog>
|
||||
|
||||
@@ -1,92 +0,0 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* MODULE DESCRIPTION:
|
||||
*
|
||||
* TODO: Write description here.
|
||||
*/
|
||||
angular.module('portal.common.partials.addPermission', ['ui.router']).controller('AddPermissionCtrl', AddPermissionCtrlController);
|
||||
|
||||
function AddPermissionCtrlController($scope, modalInstance, $state, cache, $mdDialog, permissionObjects,
|
||||
permissionStores, permissionProvider, portalUtils) {
|
||||
|
||||
$scope.header = modalInstance.header;
|
||||
|
||||
$scope.submitted = false;
|
||||
$scope.loadingBlock = false;
|
||||
|
||||
$scope.isNew = modalInstance.permission === undefined ? true : false;
|
||||
|
||||
$scope.permission = $scope.isNew ? new permissionObjects.PermissionGroup() : new permissionObjects.PermissionGroup(modalInstance.permission);
|
||||
|
||||
$scope.valid = false;
|
||||
$scope.permissionCategories = [];
|
||||
|
||||
$scope.mCache = cache.request([new permissionStores.PermissionCategories()]).then(function(){
|
||||
$scope.permissionCategories = $scope.mCache.permissionCategories.data.values;
|
||||
if (!$scope.isNew) {
|
||||
$.each($scope.permission.permissions, function(key, value) {
|
||||
for (var i = 0; i < $scope.permissionCategories.length; i++) {
|
||||
var cat = $scope.permissionCategories[i];
|
||||
if (cat.name !== value.permissionCategory) {
|
||||
continue;
|
||||
}
|
||||
for (var j = 0; j < cat.permissions.length; j++) {
|
||||
var perm = cat.permissions[j];
|
||||
if (value.permissionId === perm.id) {
|
||||
perm.allowed = value.allowed;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}).catch(function(err){
|
||||
portalUtils.toast('Unable to get permission categories: ' + err.message, ['top', 'left'], 2000);
|
||||
});
|
||||
|
||||
/**
|
||||
* OK button handler
|
||||
* @returns {undefined}
|
||||
*/
|
||||
$scope.ok = function () {
|
||||
$scope.loadingBlock = true;
|
||||
var status = $scope.isNew ? 'added': 'edited';
|
||||
$scope.submitted = true;
|
||||
|
||||
$scope.permission.permissions = [];
|
||||
$.each($scope.permissionCategories, function(key, cat) {
|
||||
$.each(cat.permissions, function(key2, perm) {
|
||||
var newPerm = new permissionObjects.PermissionGroupPermission({
|
||||
permissionId: perm.id,
|
||||
permissionGroupId: $scope.permission.id,
|
||||
name: perm.name,
|
||||
displayName: perm.displayName,
|
||||
allowed: perm.allowed === undefined ? false : perm.allowed
|
||||
});
|
||||
$scope.permission.permissions.push(newPerm);
|
||||
});
|
||||
});
|
||||
|
||||
permissionProvider.updatePermissions($scope.isNew, $scope.permission).then(function(results) {
|
||||
$scope.loadingBlock = false;
|
||||
portalUtils.toast('Permission ' + status + ' successfully', ['top', 'left'], 2000);
|
||||
$mdDialog.hide();
|
||||
}).catch(function(err){
|
||||
$scope.loadingBlock = false;
|
||||
$scope.error = err.message;
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Cancel button handler.
|
||||
* @returns {undefined}
|
||||
*/
|
||||
$scope.cancel = function () {
|
||||
//Dismiss the modal
|
||||
$mdDialog.cancel();
|
||||
};
|
||||
|
||||
} //end AddPermissionCtrlController function
|
||||
|
||||
})();
|
||||
@@ -1,63 +0,0 @@
|
||||
<md-card>
|
||||
<md-card-content>
|
||||
<div layout="row" flex="100">
|
||||
<md-toolbar class="md-padding md-portal-grey">
|
||||
<div layout="row" layout-align="center center" flex="100">
|
||||
<span><strong>Schedule</strong></span>
|
||||
<span flex></span>
|
||||
<md-button class="md-icon-button" ng-click="addSchedule()">
|
||||
<md-tooltip md-delay="500" class="mediaTileToolTip" md-direction="left">New Schedule</md-tooltip>
|
||||
<md-icon class="md-icon-default-color">note_add</md-icon>
|
||||
</md-button>
|
||||
</div>
|
||||
</md-toolbar>
|
||||
</div>
|
||||
<div layout="row" flex="100">
|
||||
<md-list flex>
|
||||
<md-list-item ng-repeat="sched in script.schedule" class="secondary-button-padding" ng-if="sched.frequency !== 'NOW' && sched.frequency !== 'TRIGGERED'">
|
||||
<div layout="row" flex="100" style="background: {{$index % 2 === 0 ? 'white' : '#DCDCDC'}}; padding-left:5px; padding-right:5px;">
|
||||
<md-input-container flex>
|
||||
<label>Frequency</label>
|
||||
<md-select ng-model="sched.frequency" required>
|
||||
<md-option ng-repeat="sched in schedFreq" ng-value="sched.name" ng-if="sched.name !== 'NOW' && sched.name !== 'TRIGGERED'">{{sched.value}}</md-option>
|
||||
</md-select>
|
||||
</md-input-container>
|
||||
<md-input-container flex>
|
||||
<label >Start Date/Time</label>
|
||||
<input mdc-datetime-picker="" date="true" time="true" type="text" id="startdatetime"
|
||||
show-todays-date="" minutes="true" min-date="date" show-icon="true" format='MMM D, YYYY h:mm:ss A'
|
||||
ng-model="sched.startDatetime" class=" dtp-no-msclear dtp-input">
|
||||
</md-input-container>
|
||||
<md-input-container flex ng-if="sched.frequency !== 'SPECIFIC'" >
|
||||
<label style="padding-left: 35px;">End Date/Time</label>
|
||||
<input mdc-datetime-picker="" date="true" time="true" type="text" id="enddatetime"
|
||||
show-todays-date="" minutes="true" min-date="date" show-icon="true" format='MMM D, YYYY h:mm:ss A'
|
||||
ng-model="sched.endDatetime" class=" dtp-no-msclear dtp-input md-input">
|
||||
</md-input-container>
|
||||
<md-input-container ng-if="sched.frequency !== 'SPECIFIC'">
|
||||
<label>Number of Executions</label>
|
||||
<input type="number" min="0" ng-model="sched.maxExecutions"/>
|
||||
</md-input-container>
|
||||
<div layout="row" layout-align="end center" flex>
|
||||
<md-button class="md-icon-button" ng-click="moveUp($index, script.schedule)" ng-if="($index > 0)">
|
||||
<md-tooltip md-delay="500" class="mediaTileToolTip" md-direction="left">Move Up</md-tooltip>
|
||||
<md-icon>arrow_upward</md-icon>
|
||||
</md-button>
|
||||
<md-button class="md-icon-button" ng-if="($index < script.schedule.length-1) &&
|
||||
(script.schedule[$index + 1] !== undefined &&
|
||||
script.schedule[$index + 1].frequency != 'NOW' &&
|
||||
script.schedule[$index + 1].frequency != 'TRIGGERED')" ng-click="moveDown($index, script.schedule)">
|
||||
<md-tooltip md-delay="500" class="mediaTileToolTip" md-direction="left">Move Down</md-tooltip>
|
||||
<md-icon>arrow_downward</md-icon>
|
||||
</md-button>
|
||||
<md-button class="md-icon-button" ng-click="delete($index,script.schedule)" >
|
||||
<md-tooltip md-delay="500" class="mediaTileToolTip" md-direction="left">Remove Parameter</md-tooltip>
|
||||
<md-icon>delete</md-icon>
|
||||
</md-button>
|
||||
</div>
|
||||
</div>
|
||||
</md-list-item>
|
||||
</md-list>
|
||||
</div>
|
||||
</md-card-content>
|
||||
</md-card>
|
||||
@@ -1,9 +0,0 @@
|
||||
<div layout-gt-xs="row">
|
||||
<md-input-container class="md-block" flex-gt-xs>
|
||||
<label>Command</label>
|
||||
<input ng-model="script.command" name="scm" id="scm" required>
|
||||
<div ng-messages="scriptForm.scm.$error" ng-show="scriptForm.scm.$invalid && submitted || scriptForm.scm.$touched">
|
||||
<div ng-message="required">Script command is required</div>
|
||||
</div>
|
||||
</md-input-container>
|
||||
</div>
|
||||
@@ -1,27 +0,0 @@
|
||||
<div layout-gt-xs="row">
|
||||
<md-input-container class="md-block" flex-gt-xs>
|
||||
<label><strong>Credentials</strong></label>
|
||||
<md-select ng-model="script.remote.scriptCredentials" required name="creds" id="creds" ng-model-options="{trackBy: '$value.uid'}">
|
||||
<md-option ng-repeat="cred in credentials" ng-value="cred">{{displayKey(cred)}}</md-option>
|
||||
</md-select>
|
||||
<div ng-messages="scriptForm.creds.$error" ng-show="scriptForm.creds.$invalid && submitted || scriptForm.creds.$touched">
|
||||
<div ng-message="required">Credentials are required</div>
|
||||
</div>
|
||||
</md-input-container>
|
||||
</div>
|
||||
<div layout-gt-xs="row">
|
||||
<md-input-container class="md-block" flex-gt-xs>
|
||||
<label><strong>SSH URL</strong></label>
|
||||
<input ng-model="script.remote.url" name="url" id="url" required>
|
||||
<div ng-messages="scriptForm.url.$error" ng-show="scriptForm.url.$invalid && submitted || scriptForm.url.$touched">
|
||||
<div ng-message="required">SSH URL is required</div>
|
||||
</div>
|
||||
</md-input-container>
|
||||
<md-input-container class="md-block" flex-gt-xs>
|
||||
<label><strong>SSH Port</strong></label>
|
||||
<input ng-model="script.remote.port" type="number" min="0" max="65535" name="port" id="port" required>
|
||||
<div ng-messages="scriptForm.port.$error" ng-show="scriptForm.port.$invalid && submitted || scriptForm.port.$touched">
|
||||
<div ng-message="required">SSH URL is required</div>
|
||||
</div>
|
||||
</md-input-container>
|
||||
</div>
|
||||
@@ -1,78 +0,0 @@
|
||||
<div layout-gt-xs="row">
|
||||
<md-checkbox ng-model="model.fromLocal" ng-change="fromLocalChange()" class="md-primary">
|
||||
From Local
|
||||
</md-checkbox>
|
||||
</div>
|
||||
<div layout-gt-xs="row" ng-if="!model.fromLocal">
|
||||
<md-input-container class="md-block" flex-gt-xs>
|
||||
<label><strong>From Host</strong></label>
|
||||
<input ng-model="script.scp.fromHost" name="fromHost" id="fromHost" required>
|
||||
<md-tooltip md-delay="500" class="mediaTileToolTip" md-direction="bottom">Host name of the machine script is copying from. For local type 'LOCAL'</md-tooltip>
|
||||
<div ng-messages="scriptForm.fromHost.$error" ng-show="scriptForm.fromHost.$invalid && submitted || scriptForm.fromHost.$touched">
|
||||
<div ng-message="required">From host address is required</div>
|
||||
</div>
|
||||
</md-input-container>
|
||||
<md-input-container class="md-block" flex-gt-xs>
|
||||
<label><strong>From Port</strong></label>
|
||||
<input ng-model="script.scp.fromPort" type="number" min="0" max="65535" name="fromPort" id="fromPort" required>
|
||||
<md-tooltip md-delay="500" class="mediaTileToolTip" md-direction="bottom">Host port of the machine script is copying from. For local type '0'</md-tooltip>
|
||||
<div ng-messages="scriptForm.fromPort.$error" ng-show="scriptForm.fromPort.$invalid && submitted || scriptForm.fromPort.$touched">
|
||||
<div ng-message="required">From Port is required</div>
|
||||
</div>
|
||||
</md-input-container>
|
||||
</div>
|
||||
<div layout-gt-xs="row" ng-if="!model.fromLocal">
|
||||
<md-input-container class="md-block" flex-gt-xs>
|
||||
<label><strong>From Credentials</strong></label>
|
||||
<md-select ng-model="script.scp.fromCredentials" required name="fromCredentials" id="fromCredentials" ng-model-options="{trackBy: '$value.uid'}">
|
||||
<md-option ng-repeat="cred in credentials" ng-value="cred">{{displayKey(cred)}}</md-option>
|
||||
</md-select>
|
||||
<div ng-messages="scriptForm.fromCredentials.$error" ng-show="scriptForm.fromCredentials.$invalid && submitted || scriptForm.fromCredentials.$touched">
|
||||
<div ng-message="required">From credentials are required</div>
|
||||
</div>
|
||||
</md-input-container>
|
||||
</div>
|
||||
<div layout-gt-xs="row">
|
||||
<md-checkbox ng-model="model.toLocal" ng-change="toLocalChange()" class="md-primary">
|
||||
To Local
|
||||
</md-checkbox>
|
||||
</div>
|
||||
<div layout-gt-xs="row" ng-if="!model.toLocal">
|
||||
<md-input-container class="md-block" flex-gt-xs>
|
||||
<label><strong>To Host</strong></label>
|
||||
<input ng-model="script.scp.toHost" name="toHost" id="toHost" required>
|
||||
<md-tooltip md-delay="500" class="mediaTileToolTip" md-direction="bottom">Host name of the machine script is copying to. For local type 'LOCAL'</md-tooltip>
|
||||
<div ng-messages="scriptForm.toHost.$error" ng-show="scriptForm.toHost.$invalid && submitted || scriptForm.toHost.$touched">
|
||||
<div ng-message="required">To host address is required</div>
|
||||
</div>
|
||||
</md-input-container>
|
||||
<md-input-container class="md-block" flex-gt-xs>
|
||||
<label><strong>SSH Port</strong></label>
|
||||
<input ng-model="script.scp.toPort" type="number" min="0" max="65535" name="toPort" id="toPort" required>
|
||||
<md-tooltip md-delay="500" class="mediaTileToolTip" md-direction="bottom">Host port of the machine script is copying to. For local type '0'</md-tooltip>
|
||||
<div ng-messages="scriptForm.toPort.$error" ng-show="scriptForm.toPort.$invalid && submitted || scriptForm.toPort.$touched">
|
||||
<div ng-message="required">To Port is required</div>
|
||||
</div>
|
||||
</md-input-container>
|
||||
</div>
|
||||
<div layout-gt-xs="row" ng-if="!model.toLocal">
|
||||
<md-input-container class="md-block" flex-gt-xs>
|
||||
<label><strong>To Credentials</strong></label>
|
||||
<md-select ng-model="script.scp.toCredentials" required name="toCredentials" id="toCredentials" ng-model-options="{trackBy: '$value.uid'}">
|
||||
<md-option ng-repeat="cred in credentials" ng-value="cred">{{displayKey(cred)}}</md-option>
|
||||
</md-select>
|
||||
<div ng-messages="scriptForm.toCredentials.$error" ng-show="scriptForm.toCredentials.$invalid && submitted || scriptForm.toCredentials.$touched">
|
||||
<div ng-message="required">From credentials are required</div>
|
||||
</div>
|
||||
</md-input-container>
|
||||
</div>
|
||||
<div layout-gt-xs="row">
|
||||
<md-input-container class="md-block" flex-gt-xs>
|
||||
<label><strong>File name or regex for file</strong></label>
|
||||
<input ng-model="script.scp.dataRegex" name="dataRegex" id="dataRegex" required>
|
||||
<md-tooltip md-delay="500" class="mediaTileToolTip" md-direction="bottom">File name or regular expression for file to send'</md-tooltip>
|
||||
<div ng-messages="scriptForm.dataRegex.$error" ng-show="scriptForm.dataRegex.$invalid && submitted || scriptForm.dataRegex.$touched">
|
||||
<div ng-message="required">File name or regular expression required</div>
|
||||
</div>
|
||||
</md-input-container>
|
||||
</div>
|
||||
@@ -1,55 +0,0 @@
|
||||
<md-card>
|
||||
<md-card-content>
|
||||
<div layout="row" flex="100">
|
||||
<md-toolbar class="md-padding md-portal-grey">
|
||||
<div layout="row" layout-align="center center" flex="100">
|
||||
<span><strong>Script</strong></span>
|
||||
<span flex></span>
|
||||
</div>
|
||||
</md-toolbar>
|
||||
</div>
|
||||
<div layout-gt-xs="row">
|
||||
<md-input-container class="md-block" flex-gt-xs>
|
||||
<label><strong>Script Name</strong></label>
|
||||
<input ng-model="script.name" name="name" id="name" required>
|
||||
<div ng-messages="scriptForm.name.$error" ng-show="scriptForm.name.$invalid && submitted || scriptForm.name.$touched">
|
||||
<div ng-message="required">Name is required</div>
|
||||
</div>
|
||||
</md-input-container>
|
||||
</div>
|
||||
<md-input-container class="md-block" flex-gt-xs>
|
||||
<label><strong>Script Type</strong></label>
|
||||
<md-select ng-model="script.scriptType" required name="scriptType" id="scriptType">
|
||||
<md-option ng-repeat="st in scriptTypes" ng-value="st.name">{{st.value}}</md-option>
|
||||
</md-select>
|
||||
<div ng-messages="scriptForm.scriptType.$error" ng-show="scriptForm.scriptType.$invalid && submitted || scriptForm.scriptType.$touched">
|
||||
<div ng-message="required">Script type is required</div>
|
||||
</div>
|
||||
</md-input-container>
|
||||
<div layout-gt-xs="column" ng-switch="script.scriptType">
|
||||
<div ng-switch-when="LOCAL">
|
||||
<div ng-include src ="'common/partials/add-script/add-script-left-local.html'" flex></div>
|
||||
</div>
|
||||
<div ng-switch-when="REMOTE">
|
||||
<div ng-include src ="'common/partials/add-script/add-script-left-remote.html'" flex></div>
|
||||
</div>
|
||||
<div ng-switch-when="SCP">
|
||||
<div ng-include src ="'common/partials/add-script/add-script-left-scp.html'" flex></div>
|
||||
</div>
|
||||
</div>
|
||||
<div layout-gt-xs="row">
|
||||
<md-input-container class="md-block" flex-gt-xs>
|
||||
<label>Base Directory</label>
|
||||
<input ng-model="script.baseDirectory" name="bd" id="bd">
|
||||
<md-tooltip md-delay="500" class="mediaTileToolTip" md-direction="bottom">Base directory to find files in</md-tooltip>
|
||||
</md-input-container>
|
||||
</div>
|
||||
<div layout-gt-xs="row">
|
||||
<md-input-container class="md-block" flex-gt-xs>
|
||||
<label>Output Directory</label>
|
||||
<input ng-model="script.outputDirectory" name="od" id="od">
|
||||
<md-tooltip md-delay="500" class="mediaTileToolTip" md-direction="left">Directory to send/save the files to</md-tooltip>
|
||||
</md-input-container>
|
||||
</div>
|
||||
</md-card-content>
|
||||
</md-card>
|
||||
@@ -1,60 +0,0 @@
|
||||
<div layout="row" flex="100">
|
||||
<md-toolbar class="md-padding md-portal-grey">
|
||||
<div layout="row" layout-align="center center" flex="100">
|
||||
<span><strong>Script Chain</strong></span>
|
||||
<span flex></span>
|
||||
<md-button class="md-icon-button" ng-click="addScriptChain()">
|
||||
<md-tooltip md-delay="500" class="mediaTileToolTip" md-direction="left">New Script Chain</md-tooltip>
|
||||
<md-icon class="md-icon-default-color">note_add</md-icon>
|
||||
</md-button>
|
||||
</div>
|
||||
</md-toolbar>
|
||||
</div>
|
||||
<div layout="row" flex="100">
|
||||
<md-list flex>
|
||||
<md-list-item ng-repeat="chain in script.scriptChain" class="secondary-button-padding">
|
||||
<div layout="row" flex="100" style="background: {{$index % 2 === 0 ? 'white' : '#DCDCDC'}}; padding-left:5px; padding-right:5px;">
|
||||
<div layout="row" flex>
|
||||
<md-input-container class="md-block" flex>
|
||||
<label>Scripts</label>
|
||||
<md-select ng-model="chain.childScript" required name="chain_{{$index}}" id="chain_{{$index}}" ng-model-options="{trackBy: '$value'}" flex>
|
||||
<md-option ng-repeat="s in availScripts" ng-value="s.id" ng-if="s.name !== script.name">{{s.name}}</md-option>
|
||||
</md-select>
|
||||
<div ng-messages="scriptForm['chain_' + $index].$error" ng-show="scriptForm['chain_' + $index].$invalid && submitted || scriptForm['chain_' + $index].$touched">
|
||||
<div ng-message="required">Script Required</div>
|
||||
</div>
|
||||
</md-input-container>
|
||||
<md-input-container flex>
|
||||
<label>Exit Status</label>
|
||||
<input type="number" ng-model="chain.exitStatus" class="answerInput" required name="exitStatus_{{$index}}" id="exitStatus_{{$index}}"/>
|
||||
<md-tooltip md-delay="500" class="mediaTileToolTip" md-direction="left">Exit status of the parent script to execute this script</md-tooltip>
|
||||
<div ng-messages="scriptForm['exitStatus_' + $index].$error" ng-show="scriptForm['exitStatus_' + $index].$invalid && submitted || scriptForm['exitStatus_' + $index].$touched">
|
||||
<div ng-message="required">Exit Status is Required</div>
|
||||
</div>
|
||||
</md-input-container>
|
||||
<md-input-container flex>
|
||||
<label>Exec After N Mins</label>
|
||||
<md-tooltip md-delay="500" class="mediaTileToolTip" md-direction="left">(Optional) How many minutes after the parent script ends should this script execute</md-tooltip>
|
||||
<input type="number" ng-model="chain.executeAfterMin" class="answerInput"/>
|
||||
</md-input-container>
|
||||
</div>
|
||||
<div layout="column" flex="25">
|
||||
<div layout="row" layout-align="end center" flex>
|
||||
<md-button class="md-icon-button" ng-click="moveUp($index, script.scriptChain" ng-if="($index > 0)">
|
||||
<md-tooltip md-delay="500" class="mediaTileToolTip" md-direction="left">Move Up</md-tooltip>
|
||||
<md-icon>arrow_upward</md-icon>
|
||||
</md-button>
|
||||
<md-button class="md-icon-button" ng-if="($index < script.scriptChain.length-1)" ng-click="moveDown($index, script.scriptChain)">
|
||||
<md-tooltip md-delay="500" class="mediaTileToolTip" md-direction="left">Move Down</md-tooltip>
|
||||
<md-icon>arrow_downward</md-icon>
|
||||
</md-button>
|
||||
<md-button class="md-icon-button" ng-click="delete($index, script.scriptChain)" >
|
||||
<md-tooltip md-delay="500" class="mediaTileToolTip" md-direction="left">Remove Parameter</md-tooltip>
|
||||
<md-icon>delete</md-icon>
|
||||
</md-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</md-list-item>
|
||||
</md-list>
|
||||
</div>
|
||||
@@ -1,89 +0,0 @@
|
||||
<div layout="row" flex="100">
|
||||
<md-toolbar class="md-padding md-portal-grey">
|
||||
<div layout="row" layout-align="center center" flex="100">
|
||||
<span><strong>Script Email</strong></span>
|
||||
<span flex></span>
|
||||
<md-button class="md-icon-button" ng-click="addScriptEmail()">
|
||||
<md-tooltip md-delay="500" class="mediaTileToolTip" md-direction="left">New Script Email</md-tooltip>
|
||||
<md-icon class="md-icon-default-color">note_add</md-icon>
|
||||
</md-button>
|
||||
</div>
|
||||
</md-toolbar>
|
||||
</div>
|
||||
<div layout="column" flex="100">
|
||||
<div layout="row" ng-if="model.addEmail" flex>
|
||||
<div layout="row" layout-align="start center" flex>
|
||||
<md-input-container class="md-block" flex>
|
||||
<label>Email Template</label>
|
||||
<md-select ng-model="model.email" required name="email_{{$index}}" id="email_{{$index}}" flex>
|
||||
<md-option ng-repeat="tmpl in emails" ng-value="tmpl">{{tmpl.emailName}}</md-option>
|
||||
</md-select>
|
||||
<div ng-messages="scriptForm['email_' + $index].$error" ng-show="scriptForm['email_' + $index].$invalid && submitted || scriptForm['email_' + $index].$touched">
|
||||
<div ng-message="required">Email Template Required</div>
|
||||
</div>
|
||||
</md-input-container>
|
||||
<md-button class="md-icon-button" ng-click="addRecipient(model)">
|
||||
<md-tooltip md-delay="500" class="mediaTileToolTip" md-direction="left">Add Recipient</md-tooltip>
|
||||
<md-icon>add</md-icon>
|
||||
</md-button>
|
||||
</div>
|
||||
<md-list flex>
|
||||
<md-list-item ng-repeat="recip in model.recipients track by $index">
|
||||
<div layout="row" layout-align="start start" flex>
|
||||
<md-input-container class="md-block" flex>
|
||||
<label>Recipient</label>
|
||||
<md-select ng-model="recip" required name="recip_{{$index}}_{{$parent.$index}}" id="recip_{{$index}}_{{$parent.$index}}" ng-change="userUpdate(model, recip, $index)" flex>
|
||||
<md-option ng-repeat="u in users track by $index" ng-value="u">{{u.username}}</md-option>
|
||||
</md-select>
|
||||
<div ng-messages="scriptForm['recip_' + $index + '_' + $parent.$index].$error"
|
||||
ng-show="scriptForm['recip_' + $index + '_' + $parent.$index].$invalid && submitted || scriptForm['recip_' + $index + '_' + $parent.$index].$touched">
|
||||
<div ng-message="required">Recipient Required</div>
|
||||
</div>
|
||||
</md-input-container>
|
||||
</div>
|
||||
</md-list-item>
|
||||
</md-list>
|
||||
<div layout="column" flex="25">
|
||||
<div layout="row" layout-align="end center" flex>
|
||||
<md-button class="md-icon-button" ng-click="confirmTemplate()" >
|
||||
<md-tooltip md-delay="500" class="mediaTileToolTip" md-direction="left">Confirm Email Template</md-tooltip>
|
||||
<md-icon>check</md-icon>
|
||||
</md-button>
|
||||
<md-button class="md-icon-button" ng-click="removeTmpl()" >
|
||||
<md-tooltip md-delay="500" class="mediaTileToolTip" md-direction="left">Remove Email Template</md-tooltip>
|
||||
<md-icon>delete</md-icon>
|
||||
</md-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<md-list flex>
|
||||
<md-list-item ng-repeat="email in script.scriptEmails track by $index" class="secondary-button-padding">
|
||||
<div layout="row" flex="100" style="background: {{$index % 2 === 0 ? 'white' : '#DCDCDC'}}; padding-left:5px; padding-right:5px;">
|
||||
<div layout="row" layout-align="start center" flex>
|
||||
<md-input-container class="md-block" flex>
|
||||
<label>Email Template</label>
|
||||
<input ng-value="email.emailName" ng-disabled="true" style="color: rgba(0,0,0,1) !important; background: none !important;"/>
|
||||
</md-input-container>
|
||||
</div>
|
||||
<md-list flex>
|
||||
<md-list-item ng-repeat="recip in email.recipients track by $index">
|
||||
<div layout="row" layout-align="start start" flex>
|
||||
<md-input-container class="md-block" flex>
|
||||
<label>Recipient</label>
|
||||
<input ng-value="recip.username" ng-disabled="true" style="color: rgba(0,0,0,1) !important; background: none !important;"/>
|
||||
</md-input-container>
|
||||
</div>
|
||||
</md-list-item>
|
||||
</md-list>
|
||||
<div layout="column" flex="25">
|
||||
<div layout="row" layout-align="end center" flex>
|
||||
<md-button class="md-icon-button" ng-click="delete($index, script.scriptEmails)" >
|
||||
<md-tooltip md-delay="500" class="mediaTileToolTip" md-direction="left">Remove Email Template</md-tooltip>
|
||||
<md-icon>delete</md-icon>
|
||||
</md-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</md-list-item>
|
||||
</md-list>
|
||||
</div>
|
||||
@@ -1,47 +0,0 @@
|
||||
<div layout="row" flex="100">
|
||||
<md-toolbar class="md-padding md-portal-grey">
|
||||
<div layout="row" layout-align="center center" flex="100">
|
||||
<span><strong>Script Environment Variables</strong></span>
|
||||
<span flex></span>
|
||||
<md-button class="md-icon-button" ng-click="addEnvVar()">
|
||||
<md-tooltip md-delay="500" class="mediaTileToolTip" md-direction="left">New Script Environment Variable</md-tooltip>
|
||||
<md-icon class="md-icon-default-color">note_add</md-icon>
|
||||
</md-button>
|
||||
</div>
|
||||
</md-toolbar>
|
||||
</div>
|
||||
<div layout="row" flex="100">
|
||||
<md-list flex>
|
||||
<md-list-item ng-repeat="param in script.scriptVariables" class="secondary-button-padding">
|
||||
<div layout="row" flex="100" style="background: {{$index % 2 === 0 ? 'white' : '#DCDCDC'}}; padding-left:5px; padding-right:5px;">
|
||||
<div layout="row" flex>
|
||||
<md-input-container flex>
|
||||
<label>Variable Name</label>
|
||||
<input type="text" ng-model="param.name" class="answerInput"/>
|
||||
</md-input-container>
|
||||
<span flex="5"></span>
|
||||
<md-input-container flex>
|
||||
<label>Variable Value</label>
|
||||
<input type="text" ng-model="param.value" class="answerInput"/>
|
||||
</md-input-container>
|
||||
</div>
|
||||
<div layout="column" flex="25">
|
||||
<div layout="row" layout-align="end center" flex>
|
||||
<md-button class="md-icon-button" ng-click="moveUp($index, script.scriptVariables)" ng-if="($index > 0)">
|
||||
<md-tooltip md-delay="500" class="mediaTileToolTip" md-direction="left">Move Up</md-tooltip>
|
||||
<md-icon>arrow_upward</md-icon>
|
||||
</md-button>
|
||||
<md-button class="md-icon-button" ng-if="($index < script.scriptVariables.length-1)" ng-click="moveDown($index, script.scriptVariables)">
|
||||
<md-tooltip md-delay="500" class="mediaTileToolTip" md-direction="left">Move Down</md-tooltip>
|
||||
<md-icon>arrow_downward</md-icon>
|
||||
</md-button>
|
||||
<md-button class="md-icon-button" ng-click="delete($index, script.scriptVariables)" >
|
||||
<md-tooltip md-delay="500" class="mediaTileToolTip" md-direction="left">Remove Parameter</md-tooltip>
|
||||
<md-icon>delete</md-icon>
|
||||
</md-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</md-list-item>
|
||||
</md-list>
|
||||
</div>
|
||||
@@ -1,41 +0,0 @@
|
||||
<div layout="row" flex="100">
|
||||
<md-toolbar class="md-padding md-portal-grey">
|
||||
<div layout="row" layout-align="center center" flex="100">
|
||||
<span><strong>{{script.scriptType !== 'LOCAL' ? 'Commands' : 'Parameters'}}</strong></span>
|
||||
<span flex></span>
|
||||
<md-button class="md-icon-button" ng-click="addParameter()">
|
||||
<md-tooltip md-delay="500" class="mediaTileToolTip" md-direction="left">{{script.scriptType !== 'LOCAL' ? 'New Command' : 'New Parameter'}}</md-tooltip>
|
||||
<md-icon class="md-icon-default-color">note_add</md-icon>
|
||||
</md-button>
|
||||
</div>
|
||||
</md-toolbar>
|
||||
</div>
|
||||
<div layout="row" flex="100">
|
||||
<md-list flex>
|
||||
<md-list-item ng-repeat="param in script.parameters" class="secondary-button-padding">
|
||||
<div layout="row" flex="100" style="background: {{$index % 2 === 0 ? 'white' : '#DCDCDC'}}; padding-left:5px; padding-right:5px;">
|
||||
<div layout="column" flex>
|
||||
<md-input-container flex md-no-float>
|
||||
<input type="text" ng-model="param.parameter" class="answerInput"/>
|
||||
</md-input-container>
|
||||
</div>
|
||||
<div layout="column" flex="25">
|
||||
<div layout="row" layout-align="end center" flex>
|
||||
<md-button class="md-icon-button" ng-click="moveUp($index, script.parameters)" ng-if="($index > 0)">
|
||||
<md-tooltip md-delay="500" class="mediaTileToolTip" md-direction="left">Move Up</md-tooltip>
|
||||
<md-icon>arrow_upward</md-icon>
|
||||
</md-button>
|
||||
<md-button class="md-icon-button" ng-if="($index < script.parameters.length-1)" ng-click="moveDown($index, script.parameters)">
|
||||
<md-tooltip md-delay="500" class="mediaTileToolTip" md-direction="left">Move Down</md-tooltip>
|
||||
<md-icon>arrow_downward</md-icon>
|
||||
</md-button>
|
||||
<md-button class="md-icon-button" ng-click="delete($index,script.parameters)" >
|
||||
<md-tooltip md-delay="500" class="mediaTileToolTip" md-direction="left">Remove Parameter</md-tooltip>
|
||||
<md-icon>delete</md-icon>
|
||||
</md-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</md-list-item>
|
||||
</md-list>
|
||||
</div>
|
||||
@@ -1,21 +0,0 @@
|
||||
<md-card ng-if="script.scriptType !== 'SCP'">
|
||||
<md-card-content>
|
||||
<div ng-include src ="'common/partials/add-script/add-script-right-parameters.html'"flex></div>
|
||||
</md-card-content>
|
||||
</md-card>
|
||||
<md-card>
|
||||
<md-card-content>
|
||||
<div ng-include src ="'common/partials/add-script/add-script-right-chain.html'" flex></div>
|
||||
</md-card-content>
|
||||
</md-card>
|
||||
<md-card>
|
||||
<md-card-content ng-if="script.scriptType !== 'SCP'">
|
||||
<div ng-include src ="'common/partials/add-script/add-script-right-env-vars.html'" flex></div>
|
||||
</md-card-content>
|
||||
</md-card>
|
||||
<md-card ng-if="model.smtpEnabled">
|
||||
<md-card-content>
|
||||
<div ng-include src ="'common/partials/add-script/add-script-right-email.html'" flex></div>
|
||||
</md-card-content>
|
||||
</md-card>
|
||||
<md-card>
|
||||
@@ -1,19 +0,0 @@
|
||||
.add-script-even {
|
||||
background-color: #f3f3f3;
|
||||
}
|
||||
|
||||
answerInput.md-input-container.md-input {
|
||||
height: 65px !important;
|
||||
}
|
||||
|
||||
.md-parameter-toolbar {
|
||||
background-color: rgb(219, 233, 240) !important;
|
||||
color: black !important;
|
||||
padding-left: 5px !important;
|
||||
padding-right: 5px !important;
|
||||
}
|
||||
|
||||
.md-icon-default-color {
|
||||
color: grey !important;
|
||||
color: rgba(0, 0, 0, 0.54) !important;
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
<md-dialog flex="95">
|
||||
<form name="scriptForm" ng-submit="scriptForm.$valid && ok()">
|
||||
<md-toolbar>
|
||||
<div class="md-toolbar-tools md-portal">
|
||||
<span>{{header}}</span>
|
||||
<span flex></span>
|
||||
<md-button class="md-icon-button" ng-click="cancel()">
|
||||
<md-icon aria-label="Close dialog">close</md-icon>
|
||||
</md-button>
|
||||
</div>
|
||||
</md-toolbar>
|
||||
<md-dialog-content layout-padding flex>
|
||||
<div layout="row" flex>
|
||||
<div layout="column" flex="50" ng-include src="'common/partials/add-script/add-script-left.html'"></div>
|
||||
<div layout="column" flex="50" ng-include src="'common/partials/add-script/add-script-right.html'"></div>
|
||||
|
||||
</div>
|
||||
<div ng-include src="'common/partials/add-script/add-script-bottom.html'"></div>
|
||||
<div ng-show="loadingBlock" class="loadingFade"></div>
|
||||
<div class="loadingModal" ng-show="loadingBlock">
|
||||
<md-progress-circular md-mode="indeterminate" md-diameter="80" class="md-hue-2"></md-progress-circular>
|
||||
</div>
|
||||
</md-dialog-content>
|
||||
<md-dialog-actions layout="row" class="modal-footer">
|
||||
<div class="text-danger">{{error}}</div>
|
||||
<md-button id="okButton" type="submit" class="md-raised md-primary" >OK</md-button>
|
||||
<md-button id="cancelButton" class="md-raised md-warn" ng-click="cancel()">Cancel</md-button>
|
||||
</md-dialog-actions>
|
||||
</form>
|
||||
</md-dialog>
|
||||
|
||||
@@ -1,218 +0,0 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* MODULE DESCRIPTION:
|
||||
*
|
||||
* TODO: Write description here.
|
||||
*/
|
||||
angular.module('portal.common.partials.addScript', ['ui.router']).controller('AddScriptCtrl', addScriptCtrlController);
|
||||
|
||||
function addScriptCtrlController($scope, modalInstance, $state, cache, $mdDialog, scriptObjects, EmailTemplate, Account,
|
||||
scriptProvider, scriptStores, credentialStores, portalUtils, systemStores, accountStores) {
|
||||
|
||||
$scope.trustAsHtml = portalUtils.trustAsHtml;
|
||||
|
||||
$scope.header = modalInstance.header;
|
||||
|
||||
$scope.submitted = false;
|
||||
|
||||
$scope.loadingBlock = false;
|
||||
|
||||
$scope.isNew = modalInstance.script === undefined ? true : false;
|
||||
|
||||
$scope.script = $scope.isNew ? new scriptObjects.Script() : new scriptObjects.Script(modalInstance.script);
|
||||
|
||||
$scope.model = {
|
||||
fromLocal: $scope.isNew || $scope.script.scriptType !== 'SCP' ? false : $scope.script.scp.fromHost === 'LOCAL',
|
||||
toLocal: $scope.isNew || $scope.script.scriptType !== 'SCP' ? false : $scope.script.scp.toHost === 'LOCAL',
|
||||
addEmail : false,
|
||||
recipients: []
|
||||
};
|
||||
|
||||
$scope.valid = false;
|
||||
|
||||
$scope.mCache = cache.request([
|
||||
new scriptStores.ScriptTypes(),
|
||||
new scriptStores.ScheduleFrequencies(),
|
||||
new credentialStores.Credentials(),
|
||||
new scriptStores.Scripts(),
|
||||
new systemStores.EmailTemplates(),
|
||||
new systemStores.SMTPConfig(),
|
||||
new accountStores.UserPool()
|
||||
]).then(function(){
|
||||
$scope.scriptTypes = $scope.mCache.scriptTypes.data.values;
|
||||
$scope.schedFreq = $scope.mCache.scheduleFrequencies.data.values;
|
||||
$scope.credentials = $scope.mCache.credentials.data.values;
|
||||
$scope.availScripts = $scope.mCache.scripts.data.values;
|
||||
$scope.users = $scope.mCache.userPool.data.values;
|
||||
$scope.emails = $scope.mCache.emailTmpls.data.values;
|
||||
$.each($scope.mCache.smtpConfig.data.values, function(key, value){
|
||||
if (value.name === 'smtp.enabled') {
|
||||
$scope.model.smtpEnabled = value.value === 'true' || value.value === true;
|
||||
return;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$scope.fromLocalChange = function() {
|
||||
if ($scope.model.fromLocal) {
|
||||
$scope.script.scp.fromHost = 'LOCAL';
|
||||
$scope.script.scp.fromPort = 0;
|
||||
$scope.script.scp.fromCredentials = $scope.credentials[0];
|
||||
} else {
|
||||
$scope.script.scp.fromHost = undefined;
|
||||
$scope.script.scp.fromPort = undefined;
|
||||
$scope.script.scp.fromCredentials = undefined;
|
||||
}
|
||||
};
|
||||
|
||||
$scope.toLocalChange = function() {
|
||||
if ($scope.model.toLocal) {
|
||||
$scope.script.scp.toHost = 'LOCAL';
|
||||
$scope.script.scp.toPort = 0;
|
||||
$scope.script.scp.toCredentials = $scope.credentials[0];
|
||||
} else {
|
||||
$scope.script.scp.toHost = undefined;
|
||||
$scope.script.scp.toPort = undefined;
|
||||
$scope.script.scp.toCredentials = undefined;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* OK button handler
|
||||
* @returns {undefined}
|
||||
*/
|
||||
$scope.ok = function () {
|
||||
|
||||
$scope.loadingBlock = true;
|
||||
var status = $scope.isNew ? 'added': 'edited';
|
||||
$scope.submitted = true;
|
||||
|
||||
$.each($scope.script.schedule, function(index, value) {
|
||||
$scope.script.schedule[index].startDatetime = convertTime(value.startDatetime);
|
||||
$scope.script.schedule[index].endDatetime = convertTime(value.endDatetime);
|
||||
$scope.script.schedule[index].lastRun = convertTime(value.lastRun);
|
||||
});
|
||||
|
||||
scriptProvider.addScript($scope.script).then(function(data) {
|
||||
$scope.loadingBlock = false;
|
||||
portalUtils.toast('Script ' + status + ' successfully', ['top', 'left'], 2000);
|
||||
$mdDialog.hide();
|
||||
}).catch(function(err) {
|
||||
$scope.loadingBlock = false;
|
||||
$scope.error = err.message;
|
||||
});
|
||||
};
|
||||
|
||||
function convertTime(value) {
|
||||
if (value === null || value === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
var dte;
|
||||
if(moment.isMoment(value)) {
|
||||
dte = value.unix();
|
||||
} else if ($.isNumeric(value)) {
|
||||
dte = value;
|
||||
} else if (typeof value.getTime === 'function'){
|
||||
dte = value.getTime();
|
||||
} else {
|
||||
//When adding a new file the return date comes back like this format Nov 2, 2017 10:53:19 AM
|
||||
//We need to parse it back to a moment object to parse it to the correct format
|
||||
dte = moment(value, 'MMM D, YYY h:mm:ss A').unix();
|
||||
}
|
||||
|
||||
return dte;
|
||||
}
|
||||
|
||||
$scope.displayKey = function(cred) {
|
||||
if (cred === undefined) {
|
||||
return '';
|
||||
}
|
||||
return cred.name + (cred.credentialType === 'SSH' ? ' (SSH Key)' : ' (Username/Password)');
|
||||
};
|
||||
|
||||
$scope.addParameter = function() {
|
||||
var param = new scriptObjects.ScriptParameter();
|
||||
$scope.script.parameters.push(param);
|
||||
};
|
||||
|
||||
$scope.addSchedule = function() {
|
||||
var sched = new scriptObjects.ScriptSchedule();
|
||||
$scope.script.schedule.unshift(sched);
|
||||
};
|
||||
|
||||
$scope.addScriptChain = function() {
|
||||
var chain = new scriptObjects.ScriptChain();
|
||||
chain.parentScript = $scope.script.id;
|
||||
$scope.script.scriptChain.push(chain);
|
||||
};
|
||||
|
||||
$scope.addEnvVar = function() {
|
||||
var env = new scriptObjects.ScriptEnvironmentVariable();
|
||||
$scope.script.scriptVariables.push(env);
|
||||
};
|
||||
|
||||
$scope.addScriptEmail = function() {
|
||||
$scope.model.addEmail = true;
|
||||
};
|
||||
|
||||
$scope.removeTmpl = function() {
|
||||
$scope.model.email = undefined;
|
||||
$scope.model.recipients = [];
|
||||
$scope.model.addEmail = false;
|
||||
};
|
||||
|
||||
$scope.confirmTemplate = function() {
|
||||
var email = new EmailTemplate($scope.model.email);
|
||||
$.each($scope.model.recipients, function(key, value) {
|
||||
email.recipients.push(new Account(value));
|
||||
});
|
||||
$scope.script.scriptEmails.push(email);
|
||||
$scope.removeTmpl();
|
||||
};
|
||||
|
||||
$scope.emailTmpl = function(email, index) {
|
||||
$scope.script.scriptEmails[index] = email;
|
||||
};
|
||||
|
||||
$scope.userUpdate = function(email, recip, index) {
|
||||
email.recipients[index] = recip;
|
||||
};
|
||||
|
||||
$scope.addRecipient = function(email) {
|
||||
var user = new Account();
|
||||
email.recipients.push(user);
|
||||
};
|
||||
|
||||
$scope.moveUp = function(index, array) {
|
||||
var ent1 = array[index];
|
||||
var ent2 = array[index-1];
|
||||
array[index] = ent2;
|
||||
array[index-1] = ent1;
|
||||
};
|
||||
|
||||
$scope.moveDown = function(index, array) {
|
||||
var ent1 = array[index];
|
||||
var ent2 = array[index+1];
|
||||
array[index] = ent2;
|
||||
array[index+1] = ent1;
|
||||
};
|
||||
|
||||
$scope.delete = function (id, array) {
|
||||
array.splice(id, 1);
|
||||
};
|
||||
|
||||
/**
|
||||
* Cancel button handler.
|
||||
* @returns {undefined}
|
||||
*/
|
||||
$scope.cancel = function () {
|
||||
//Dismiss the modal
|
||||
$mdDialog.cancel();
|
||||
};
|
||||
|
||||
} //end addScriptCtrlController function
|
||||
|
||||
})();
|
||||
@@ -1,102 +0,0 @@
|
||||
<md-dialog flex="40">
|
||||
<form name="userForm" ng-submit="userForm.$valid && ok()">
|
||||
<md-toolbar>
|
||||
<div class="md-toolbar-tools md-portal">
|
||||
<span>{{header}}</span>
|
||||
<span flex></span>
|
||||
<md-button class="md-icon-button" ng-click="cancel()">
|
||||
<md-icon aria-label="Close dialog">close</md-icon>
|
||||
</md-button>
|
||||
</div>
|
||||
</md-toolbar>
|
||||
<md-dialog-content layout-padding flex>
|
||||
<div>
|
||||
<div layout-gt-xs="row">
|
||||
<md-input-container class="md-block" flex-gt-xs>
|
||||
<label>Email Address <small>(This will be their user name)</small></label>
|
||||
<input ng-model="account.email" name="email" id="email" required ng-pattern="/^.+@.+\..+$/">
|
||||
<div ng-messages="userForm.email.$error" ng-show="userForm.email.$invalid && submitted || userForm.email.$touched">
|
||||
<div ng-message="required">Email is required</div>
|
||||
<div ng-message="pattern">Email is not in correct format</div>
|
||||
</div>
|
||||
</md-input-container>
|
||||
</div>
|
||||
<div layout-gt-xs="row" layout-align="start center">
|
||||
<md-input-container class="md-block" flex-gt-xs>
|
||||
<label>Password</label>
|
||||
<input ng-model="account.password" type="{{passwordType}}" name="password" id="password" ng-required="requirePassword">
|
||||
<div ng-messages="userForm.password.$error" ng-show="userForm.password.$invalid && submitted || userForm.password.$touched">
|
||||
<div ng-message="required">Password is required</div>
|
||||
</div>
|
||||
</md-input-container>
|
||||
|
||||
<md-button class="md-icon-button" style="margin-bottom: 25px;" ng-mousedown="passwordType='text'" ng-mouseup="passwordType='password'">
|
||||
<md-icon>remove_red_eye</md-icon>
|
||||
<md-tooltip>View password</md-tooltip>
|
||||
</md-button>
|
||||
|
||||
<md-input-container class="md-block" flex-gt-xs>
|
||||
<label>Confirm Password</label>
|
||||
<input ng-model="account.confPassword" type="{{confPasswordType}}" name="confPassword" id="confPassword"
|
||||
ng-required="requirePassword" compare-to="account.password">
|
||||
<div ng-messages="userForm.confPassword.$error" ng-show="userForm.confPassword.$invalid && submitted || userForm.confPassword.$touched">
|
||||
<div ng-message="compareTo">Passwords do not match</div>
|
||||
<div ng-message="required">Must confirm password</div>
|
||||
</div>
|
||||
</md-input-container>
|
||||
|
||||
<md-button class="md-icon-button" style="margin-bottom: 25px;" ng-mousedown="confPasswordType='text'" ng-mouseup="confPasswordType='password'">
|
||||
<md-icon>remove_red_eye</md-icon>
|
||||
<md-tooltip>View password</md-tooltip>
|
||||
</md-button>
|
||||
|
||||
</div>
|
||||
|
||||
<div layout-gt-sm="row">
|
||||
<md-input-container class="md-block" flex-gt-sm>
|
||||
<label>First name</label>
|
||||
<input ng-model="account.firstName">
|
||||
</md-input-container>
|
||||
|
||||
<md-input-container class="md-block" flex-gt-sm>
|
||||
<label>Last Name</label>
|
||||
<input ng-model="account.lastName">
|
||||
</md-input-container>
|
||||
</div>
|
||||
<div layout-gt-sm="row">
|
||||
<md-input-container class="md-block" flex-gt-sm>
|
||||
<label>Role</label>
|
||||
<md-select ng-model="account.role" id="role" name="role" required>
|
||||
<md-option value="USER">User</md-option>
|
||||
<md-option value="ADMIN">Administrator</md-option>
|
||||
</md-select>
|
||||
<div ng-messages="userForm.role.$error" ng-show="userForm.role.$invalid && submitted || userForm.role.$touched">
|
||||
<div ng-message="required">Role is required</div>
|
||||
</div>
|
||||
</md-input-container>
|
||||
</div>
|
||||
<div layout-gt-sm="row">
|
||||
<md-input-container class="md-block" flex-gt-sm>
|
||||
<label>Effective Date</label>
|
||||
<md-datepicker ng-model="account.effectiveDate"></md-datepicker>
|
||||
</md-input-container>
|
||||
|
||||
<md-input-container class="md-block" flex-gt-sm>
|
||||
<label>Expiration Date</label>
|
||||
<md-datepicker ng-model="account.expirationDate"></md-datepicker>
|
||||
</md-input-container>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-show="loadingBlock" class="loadingFade"></div>
|
||||
<div class="loadingModal" ng-show="loadingBlock">
|
||||
<md-progress-circular md-mode="indeterminate" md-diameter="80" class="md-hue-2"></md-progress-circular>
|
||||
</div>
|
||||
</md-dialog-content>
|
||||
<md-dialog-actions layout="row" class="modal-footer">
|
||||
<div class="text-danger">{{error}}</div>
|
||||
<md-button id="okButton" type="submit" class="md-raised md-primary" >OK</md-button>
|
||||
<md-button id="cancelButton" class="md-raised md-warn" ng-click="cancel()">Cancel</md-button>
|
||||
</md-dialog-actions>
|
||||
</form>
|
||||
</md-dialog>
|
||||
|
||||
@@ -1,85 +0,0 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* MODULE DESCRIPTION:
|
||||
*
|
||||
* TODO: Write description here.
|
||||
*/
|
||||
angular.module('portal.common.partials.addUser', ['ui.router']).controller('AddUserCtrl', AddUserCtrlController);
|
||||
|
||||
function AddUserCtrlController($scope, modalInstance, $state, cache, $mdDialog, Account, accountProvider, portalUtils,
|
||||
permissionStores, configStores, Triggers) {
|
||||
|
||||
$scope.header = modalInstance.header;
|
||||
|
||||
$scope.passwordType = 'password';
|
||||
$scope.confPasswordType = 'password';
|
||||
|
||||
$scope.requirePassword = modalInstance.requirePassword;
|
||||
|
||||
$scope.submitted = false;
|
||||
|
||||
$scope.loadingBlock = false;
|
||||
|
||||
$scope.isNew = modalInstance.account === undefined ? true : false;
|
||||
|
||||
$scope.account = $scope.isNew ? new Account() : modalInstance.account;
|
||||
|
||||
$scope.valid = false;
|
||||
|
||||
$scope.mCache = cache.request([new configStores.Config('userExpirationDays'),
|
||||
new permissionStores.AllPermissionGroups()]).then(function(){
|
||||
$scope.expirationDays = parseInt($scope.mCache.config.data.userExpirationDays);
|
||||
$scope.permissionGroups = $scope.mCache.allPermissionGroups.data.values;
|
||||
}).catch(function(err){
|
||||
portalUtils.toast('Unable to get expiration days: ' + err.message, ['top', 'left'], 4000);
|
||||
});
|
||||
|
||||
if ($scope.isNew) {
|
||||
$scope.account.effectiveDate = new Date();
|
||||
} else {
|
||||
$scope.account.effectiveDate = moment($scope.account.effectiveDate);
|
||||
$scope.account.expirationDate = moment($scope.account.expirationDate);
|
||||
}
|
||||
|
||||
$scope.$watch('expirationDays', function(value){
|
||||
if ($scope.isNew) {
|
||||
$scope.account.expirationDate = moment().add($scope.expirationDays, 'days');
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* OK button handler
|
||||
* @returns {undefined}
|
||||
*/
|
||||
$scope.ok = function () {
|
||||
$scope.loadingBlock = true;
|
||||
var status = $scope.isNew ? 'added': 'edited';
|
||||
$scope.submitted = true;
|
||||
accountProvider.addUser($scope.account).then(function(data){
|
||||
$scope.loadingBlock = false;
|
||||
portalUtils.toast('User ' + status + ' successfully', ['top', 'left'], 2000);
|
||||
$mdDialog.hide();
|
||||
}).catch(function(err){
|
||||
$scope.loadingBlock = false;
|
||||
$scope.error = err.message;
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Cancel button handler.
|
||||
* @returns {undefined}
|
||||
*/
|
||||
$scope.cancel = function () {
|
||||
//Dismiss the modal
|
||||
$mdDialog.cancel();
|
||||
};
|
||||
|
||||
Triggers.listen([Triggers.PERMISSIONS_ADDED, Triggers.PERMISSIONS_DELETED], function(trigger, payload){
|
||||
new permissionStores.AllPermissionGroups().refresh();
|
||||
});
|
||||
|
||||
} //end AddUserCtrlController function
|
||||
|
||||
})();
|
||||
@@ -1,146 +0,0 @@
|
||||
<md-dialog flex="60">
|
||||
<form name="configForm">
|
||||
|
||||
<md-toolbar>
|
||||
<div class="md-toolbar-tools md-portal">
|
||||
<span>Configuration</span>
|
||||
<span flex></span>
|
||||
<md-button class="md-icon-button" ng-click="cancel()">
|
||||
<md-icon>close</md-icon>
|
||||
</md-button>
|
||||
</div>
|
||||
</md-toolbar>
|
||||
|
||||
<md-dialog-content flex>
|
||||
<md-tabs md-dynamic-height md-border-bottom>
|
||||
<md-tab label="General Configuration">
|
||||
<md-content class="md-padding" flex>
|
||||
<md-list>
|
||||
<md-list-item>
|
||||
<md-input-container flex>
|
||||
<input value="File Path" ng-disabled="true" style="color: rgba(0,0,0,1) !important; background: none !important;"/>
|
||||
</md-input-container>
|
||||
<span flex="5"></span>
|
||||
<md-input-container flex>
|
||||
<label>File Path Value</label>
|
||||
<input ng-model="config.filepath" ng-disabled="saving || !canEdit"/>
|
||||
</md-input-container>
|
||||
</md-list-item>
|
||||
<md-list-item>
|
||||
<md-input-container flex>
|
||||
<input value="Default Log Level" ng-disabled="true" style="color: rgba(0,0,0,1) !important; background: none !important;"/>
|
||||
</md-input-container>
|
||||
<span flex="5"></span>
|
||||
<md-input-container flex>
|
||||
<label>Default Log Level</label>
|
||||
<md-select ng-model="config.logLevel" ng-disabled="!canEdit">
|
||||
<md-option ng-value="ll.id" ng-repeat="ll in logLevels">{{ll.name}}</md-option>
|
||||
</md-select>
|
||||
</md-input-container>
|
||||
</md-list-item>
|
||||
<md-list-item>
|
||||
<md-input-container flex>
|
||||
<input value="User Expiration Days" ng-disabled="true" style="color: rgba(0,0,0,1) !important; background: none !important;"/>
|
||||
</md-input-container>
|
||||
<span flex="5"></span>
|
||||
<md-input-container flex>
|
||||
<label>User Expiration Days Value</label>
|
||||
<input ng-model="config.userExpirationDays" ng-disabled="saving || !canEdit" type="number"/>
|
||||
</md-input-container>
|
||||
</md-list-item>
|
||||
</md-list>
|
||||
</md-content>
|
||||
</md-tab>
|
||||
<md-tab label="Database General Configuration">
|
||||
<md-content class="md-padding" flex>
|
||||
<md-list>
|
||||
<md-list-item>
|
||||
<md-input-container flex>
|
||||
<input value="Database Host" ng-disabled="true" style="color: rgba(0,0,0,1) !important; background: none !important;"/>
|
||||
</md-input-container>
|
||||
<span flex="5"></span>
|
||||
<md-input-container flex>
|
||||
<label>Database Host Value</label>
|
||||
<input ng-model="config.dbHost" ng-disabled="saving || !canEdit"/>
|
||||
</md-input-container>
|
||||
</md-list-item>
|
||||
<md-list-item>
|
||||
<md-input-container flex>
|
||||
<input value="Database Port" ng-disabled="true" style="color: rgba(0,0,0,1) !important; background: none !important;"/>
|
||||
</md-input-container>
|
||||
<span flex="5"></span>
|
||||
<md-input-container flex>
|
||||
<label>Database Port Value</label>
|
||||
<input ng-model="config.dbPort" ng-disabled="saving || !canEdit" type="number"/>
|
||||
</md-input-container>
|
||||
</md-list-item>
|
||||
<md-list-item>
|
||||
<md-input-container flex>
|
||||
<input value="Database User Name" ng-disabled="true" style="color: rgba(0,0,0,1) !important; background: none !important;"/>
|
||||
</md-input-container>
|
||||
<span flex="5"></span>
|
||||
<md-input-container flex>
|
||||
<label>Database User Name Value</label>
|
||||
<input ng-model="config.dbUsername" ng-disabled="saving || !canEdit"/>
|
||||
</md-input-container>
|
||||
</md-list-item>
|
||||
<md-list-item>
|
||||
<md-input-container flex>
|
||||
<input value="Database Password" ng-disabled="true" style="color: rgba(0,0,0,1) !important; background: none !important;"/>
|
||||
</md-input-container>
|
||||
<span flex="5"></span>
|
||||
<div layout="row" flex layout-align="center center">
|
||||
<md-input-container flex>
|
||||
<label>Database Password Value</label>
|
||||
<input ng-model="config.dbPassword" ng-disabled="saving || !canEdit" type="{{dbPasswordType}}"/>
|
||||
</md-input-container>
|
||||
<md-button class="md-icon-button" style="margin-bottom: 25px;" ng-mousedown="dbPasswordType='text'" ng-mouseup="dbPasswordType='password'">
|
||||
<md-icon>remove_red_eye</md-icon>
|
||||
<md-tooltip>View password</md-tooltip>
|
||||
</md-button>
|
||||
</div>
|
||||
</md-list-item>
|
||||
</md-list>
|
||||
</md-content>
|
||||
</md-tab>
|
||||
<md-tab label="Database Root Configuration">
|
||||
<md-content class="md-padding" flex>
|
||||
<md-list>
|
||||
<md-list-item>
|
||||
<md-input-container flex>
|
||||
<input value="Database Root User" ng-disabled="true" style="color: rgba(0,0,0,1) !important; background: none !important;"/>
|
||||
</md-input-container>
|
||||
<span flex="5"></span>
|
||||
<md-input-container flex>
|
||||
<label>Database Root User Value</label>
|
||||
<input ng-model="config.dbRootUser" ng-disabled="saving || !canEdit"/>
|
||||
</md-input-container>
|
||||
</md-list-item>
|
||||
<md-list-item>
|
||||
<md-input-container flex>
|
||||
<input value="Database Root Password" ng-disabled="true" style="color: rgba(0,0,0,1) !important; background: none !important;"/>
|
||||
</md-input-container>
|
||||
<span flex="5"></span>
|
||||
<div layout="row" flex layout-align="center center">
|
||||
<md-input-container flex>
|
||||
<label>Database Root Password Value</label>
|
||||
<input ng-model="config.dbRootPassword" ng-disabled="saving || !canEdit" type="{{dbRootPasswordType}}"/>
|
||||
</md-input-container>
|
||||
<md-button class="md-icon-button" style="margin-bottom: 25px;" ng-mousedown="dbRootPasswordType='text'" ng-mouseup="dbRootPasswordType='password'">
|
||||
<md-icon>remove_red_eye</md-icon>
|
||||
<md-tooltip>View password</md-tooltip>
|
||||
</md-button>
|
||||
</div>
|
||||
</md-list-item>
|
||||
</md-list>
|
||||
</md-content>
|
||||
</md-tab>
|
||||
</md-tabs>
|
||||
</md-dialog-content>
|
||||
<md-dialog-actions layout="row" class="modal-footer">
|
||||
<div class="text-danger">{{error}}</div>
|
||||
<md-button id="okButton" type="submit" class="md-raised md-primary" ng-click="ok()">Save</md-button>
|
||||
<md-button id="cancelButton" class="md-raised md-warn" ng-click="cancel()">Cancel</md-button>
|
||||
</md-dialog-actions>
|
||||
</form>
|
||||
</md-dialog>
|
||||
@@ -1,73 +0,0 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* MODULE DESCRIPTION:
|
||||
*
|
||||
* TODO: Write description here.
|
||||
*/
|
||||
angular.module('portal.common.partials.configuration', ['ui.router']).controller('ConfigurationCtrl', configurationCtrlController);
|
||||
|
||||
function configurationCtrlController($scope, account, $state, cache, $mdDialog, configStores, configProvider,
|
||||
portalUtils, Constants, permissions) {
|
||||
|
||||
$scope.logLevels= [
|
||||
{id:'OFF', name: 'Off'},
|
||||
{id:'FATAL', name: 'Fatal'},
|
||||
{id:'ERROR', name:'Error'},
|
||||
{id:'WARN', name:'Warn'},
|
||||
{id:'INFO', name:'Info'},
|
||||
{id:'DEBUG', name:'Debug'},
|
||||
{id:'TRACE', name:'Trace'},
|
||||
{id:'ALL', name: 'All'}
|
||||
];
|
||||
|
||||
$scope.saving = false;
|
||||
$scope.dbPasswordType = 'password';
|
||||
$scope.dbRootPasswordType = 'password';
|
||||
$scope.canEdit = false;
|
||||
$scope.mCache = cache.request([new configStores.Configs()]).then(function(){
|
||||
$scope.config = $scope.mCache.configs.data;
|
||||
});
|
||||
|
||||
permissions.canView({permission: Constants.Permissions.CHANGE_CONFIG}).then(function(allowed){
|
||||
$scope.canEdit = allowed;
|
||||
});
|
||||
|
||||
/**
|
||||
* OK button handler
|
||||
* @returns {undefined}
|
||||
*/
|
||||
$scope.ok = function () {
|
||||
portalUtils.confirmBox('saveConfig', 'Save Configuration',
|
||||
['Are you sure you want to save the configuration values?', 'New values will not take effect until server restart'],
|
||||
false, function(value) {
|
||||
if (value.confirm) {
|
||||
$scope.saveConfig();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
$scope.saveConfig = function() {
|
||||
configProvider.saveConfiguration($scope.config).then(function(value){
|
||||
portalUtils.toast('Configuration values saved successfully', ['top', 'left'], 2000);
|
||||
new configStores.Configs().refresh();
|
||||
$mdDialog.hide();
|
||||
}).catch(function(err){
|
||||
portalUtils.toast('Failed to save configuration: ' + err.message, ['top', 'left'], 4000);
|
||||
new configStores.Configs().refresh();
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Cancel button handler.
|
||||
* @returns {undefined}
|
||||
*/
|
||||
$scope.cancel = function () {
|
||||
//Dismiss the modal
|
||||
$mdDialog.cancel();
|
||||
};
|
||||
|
||||
} //end configurationCtrlController function
|
||||
|
||||
})();
|
||||
@@ -1,87 +0,0 @@
|
||||
<md-dialog flex>
|
||||
<form name="fileInfoForm" ng-submit="fileInfoForm.$valid && (moveFile ? relocate(): validate())">
|
||||
<md-toolbar>
|
||||
<div class="md-toolbar-tools md-portal">
|
||||
<span>{{header}}</span>
|
||||
<span flex></span>
|
||||
<md-button class="md-icon-button" ng-click="cancel()">
|
||||
<md-icon>close</md-icon>
|
||||
</md-button>
|
||||
</div>
|
||||
</md-toolbar>
|
||||
|
||||
<md-dialog-content flex>
|
||||
<md-content class="md-padding" flex>
|
||||
<md-list>
|
||||
<md-list-item ng-if="!file.valid">
|
||||
<div layout="row" layout-align="center start">
|
||||
<p class="text-danger">Please enter hash value and file location to validate the file</p>
|
||||
</div>
|
||||
</md-list-item>
|
||||
<md-list-item ng-if="file.valid && moveFile">
|
||||
<div layout="row" layout-align="center start">
|
||||
<p class="text-danger">Please enter new file location to move the file to</p>
|
||||
</div>
|
||||
</md-list-item>
|
||||
<md-list-item>
|
||||
<div layout="row" layout-align="center start" flex>
|
||||
<md-input-container flex>
|
||||
<label>File Name</label>
|
||||
<input ng-model="file.fileName" ng-disabled="true" class="md-disabled-input"/>
|
||||
</md-input-container>
|
||||
<md-input-container flex>
|
||||
<label>File Location</label>
|
||||
<input ng-model="file.fileLocation" name="location" id="location" ng-required="!file.valid || moveFile" ng-disabled="file.valid && !moveFile" class="md-disabled-input"/>
|
||||
<div ng-messages="fileInfoForm.location.$error" ng-show="fileInfoForm.location.$invalid && submitted || fileInfoForm.location.$touched">
|
||||
<div ng-message="required">File location is required</div>
|
||||
</div>
|
||||
</md-input-container>
|
||||
<md-input-container flex>
|
||||
<label>Date Created</label>
|
||||
<input ng-model="file.dateCreated" ng-disabled="true" class="md-disabled-input"/>
|
||||
</md-input-container>
|
||||
</div>
|
||||
</md-list-item>
|
||||
<md-list-item ng-if="!file.valid">
|
||||
<md-input-container flex>
|
||||
<label>Hash Value</label>
|
||||
<input ng-model="file.newHash" name="newHash" id="newHash" class="md-disabled-input" ng-required="!file.valid"/>
|
||||
<div ng-messages="fileInfoForm.newHash.$error" ng-show="fileInfoForm.newHash.$invalid && submitted || fileInfoForm.newHash.$touched">
|
||||
<div ng-message="required">Hash value required</div>
|
||||
</div>
|
||||
</md-input-container>
|
||||
</md-list-item>
|
||||
<md-list-item ng-if="file.valid && !moveFile">
|
||||
<md-input-container flex>
|
||||
<label>MD5</label>
|
||||
<input ng-model="file.md5" ng-readonly="file.valid" class="md-disabled-input"/>
|
||||
</md-input-container>
|
||||
</md-list-item>
|
||||
<md-list-item ng-if="file.valid && !moveFile">
|
||||
<md-input-container flex>
|
||||
<label>SHA1</label>
|
||||
<input ng-model="file.sha1" ng-readonly="file.valid" class="md-disabled-input"/>
|
||||
</md-input-container>
|
||||
</md-list-item>
|
||||
<md-list-item ng-if="file.valid && !moveFile">
|
||||
<md-input-container flex>
|
||||
<label>SHA512</label>
|
||||
<input ng-model="file.sha512" ng-readonly="file.valid" class="md-disabled-input"/>
|
||||
</md-input-container>
|
||||
</md-list-item>
|
||||
</md-list>
|
||||
</md-content>
|
||||
<div ng-show="loadingBlock" class="loadingFade"></div>
|
||||
<div class="loadingModal" ng-show="loadingBlock">
|
||||
<md-progress-circular md-mode="indeterminate" md-diameter="80" class="md-hue-2"></md-progress-circular>
|
||||
</div>
|
||||
</md-dialog-content>
|
||||
<md-dialog-actions layout="row" class="modal-footer">
|
||||
<div class="text-danger">{{error}}</div>
|
||||
<md-button id="verifButton" type="submit" class="md-raised md-primary" ng-if="!file.valid">Validate</md-button>
|
||||
<md-button id="verifButton" type="submit" class="md-raised md-primary" ng-if="moveFile">Move</md-button>
|
||||
<md-button id="downloadButton" class="md-raised md-primary" ng-click="download()" ng-if="file.valid && !moveFile">Download</md-button>
|
||||
<md-button id="okButton" class="md-raised md-warn" ng-click="ok()">Close</md-button>
|
||||
</md-dialog-actions>
|
||||
</form>
|
||||
</md-dialog>
|
||||
@@ -1,111 +0,0 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* MODULE DESCRIPTION:
|
||||
*
|
||||
* TODO: Write description here.
|
||||
*/
|
||||
angular.module('portal.common.partials.fileinfo', ['ui.router']).controller('FileInfoCtrl', fileInfoController);
|
||||
|
||||
function fileInfoController($scope, modalInstance, $state, cache, $mdDialog, PatchFile, portalUtils, fileProvider) {
|
||||
|
||||
$scope.submitted = false;
|
||||
$scope.loadingBlock = false;
|
||||
$scope.moveFile = modalInstance.moveFile;
|
||||
|
||||
$scope.header = modalInstance.header;
|
||||
$scope.originalFile = modalInstance.file;
|
||||
$scope.file = new PatchFile(modalInstance.file);
|
||||
if (!$scope.file.valid) {
|
||||
$scope.file.md5 = '';
|
||||
$scope.file.sha1 = '';
|
||||
$scope.file.sha512 = '';
|
||||
$scope.file.fileLocation = '';
|
||||
}
|
||||
|
||||
$scope.ok = function () {
|
||||
$mdDialog.hide();
|
||||
};
|
||||
|
||||
$scope.download = function() {
|
||||
var url = '/portal/file/download.do?hashValue=' + $scope.file.sha512;
|
||||
window.open(url, '');
|
||||
};
|
||||
|
||||
$scope.relocate = function() {
|
||||
portalUtils.confirmBox('relocateFile', 'Relocate File', ['Are you sure you want to relocate file:', $scope.file.fileName, 'To directory:', $scope.file.fileLocation],
|
||||
false, function(value) {
|
||||
if (value.confirm) {
|
||||
$scope.loadingBlock = true;
|
||||
fileProvider.moveFile($scope.file).then(function() {
|
||||
$scope.loadingBlock = false;
|
||||
portalUtils.toast('File ' + $scope.file.fileName + ' update successfully', ['top', 'left'], 2000);
|
||||
}).catch(function(err) {
|
||||
$scope.loadingBlock = false;
|
||||
$scope.error = err.message;
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
$scope.validate = function() {
|
||||
$scope.submitted = true;
|
||||
if ($scope.file.valid) {
|
||||
$mdDialog.hide();
|
||||
return true;
|
||||
}
|
||||
|
||||
$scope.error = '';
|
||||
if ($scope.file.fileLocation.trim() === '') {
|
||||
$scope.error = 'File location needed to validate';
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($scope.file.newHash.trim() === '') {
|
||||
$scope.error = 'Hash value needed';
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($scope.file.newHash.trim().length === 32) {
|
||||
$scope.file.md5 = $scope.file.newHash;
|
||||
$scope.file.sha1 = $scope.originalFile.sha1;
|
||||
$scope.file.sha512 = $scope.originalFile.sha512;
|
||||
} else if ($scope.file.newHash.trim().length === 40) {
|
||||
$scope.file.sha1 = $scope.file.newHash;
|
||||
$scope.file.sha512 = $scope.originalFile.sha512;
|
||||
$scope.file.md5 = $scope.originalFile.md5;
|
||||
} else if ($scope.file.newHash.trim().length === 128) {
|
||||
$scope.file.sha512 = $scope.file.newHash;
|
||||
$scope.file.md5 = $scope.originalFile.md5;
|
||||
$scope.file.sha512 = $scope.originalFile.sha512;
|
||||
} else {
|
||||
$scope.error = 'Invalid hash provided';
|
||||
return false;
|
||||
}
|
||||
|
||||
$scope.loadingBlock = true;
|
||||
fileProvider.validate($scope.file).then(function(data) {
|
||||
$scope.loadingBlock = false;
|
||||
portalUtils.toast('File ' + $scope.file.fileName + ' update successfully', ['top', 'left'], 2000);
|
||||
$scope.ok();
|
||||
return true;
|
||||
}).catch(function(err) {
|
||||
$scope.loadingBlock = false;
|
||||
$scope.error = err.message;
|
||||
return false;
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Cancel button handler.
|
||||
* @returns {undefined}
|
||||
*/
|
||||
$scope.cancel = function () {
|
||||
//Dismiss the modal
|
||||
$mdDialog.cancel();
|
||||
};
|
||||
|
||||
} //end fileInfoController function
|
||||
|
||||
})();
|
||||
@@ -1,22 +0,0 @@
|
||||
<md-dialog flex>
|
||||
<md-toolbar>
|
||||
<div class="md-toolbar-tools md-portal">
|
||||
<span>{{header}}</span>
|
||||
<span flex></span>
|
||||
<md-button class="md-icon-button" ng-click="cancel()">
|
||||
<md-icon>close</md-icon>
|
||||
</md-button>
|
||||
</div>
|
||||
</md-toolbar>
|
||||
|
||||
<md-dialog-content flex>
|
||||
<div class="modal-body-preview md-dialog-content">
|
||||
<div class="previewInfoPane pad-sm">
|
||||
<div ng-bind-html="trustAsHtml(content)" id="previewPopOut" name="previewPopOut"></div>
|
||||
</div>
|
||||
</div>
|
||||
</md-dialog-content>
|
||||
<md-dialog-actions layout="row" class="modal-footer">
|
||||
<md-button id="okButton" class="md-raised md-primary" ng-click="ok()">Ok</md-button>
|
||||
</md-dialog-actions>
|
||||
</md-dialog>
|
||||
@@ -1,41 +0,0 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* MODULE DESCRIPTION:
|
||||
*
|
||||
* TODO: Write description here.
|
||||
*/
|
||||
angular.module('portal.common.partials.filevalidate', ['ui.router']).controller('FileValidateCtrl', fileValidateController);
|
||||
|
||||
function fileValidateController($scope, modalInstance, $state, $mdDialog, $sce) {
|
||||
$scope.header = modalInstance.header;
|
||||
$scope.getContent = function() {
|
||||
var content = '';
|
||||
$.each(modalInstance.results, function(key, value) {
|
||||
content += '<p><b>' + key + ':</b></p>';
|
||||
for (var i = 0; i < value.length; i++) {
|
||||
content += '<span class="text-danger">' + value[i] + '</span><br/><br/>';
|
||||
}
|
||||
});
|
||||
$scope.content = content;
|
||||
};
|
||||
|
||||
$scope.getContent();
|
||||
|
||||
$scope.trustAsHtml = function (string){
|
||||
return $sce.trustAsHtml(string);
|
||||
};
|
||||
|
||||
$scope.ok = function () {
|
||||
$mdDialog.hide();
|
||||
};
|
||||
|
||||
$scope.cancel = function () {
|
||||
//Dismiss the modal
|
||||
$mdDialog.cancel();
|
||||
};
|
||||
|
||||
} //end fileValidateController function
|
||||
|
||||
})();
|
||||
@@ -1,46 +0,0 @@
|
||||
<md-dialog flex="40">
|
||||
<md-toolbar>
|
||||
<div class="md-toolbar-tools md-portal">
|
||||
<span>Loggers</span>
|
||||
<span flex></span>
|
||||
<md-button class="md-icon-button" ng-click="cancel()">
|
||||
<md-icon>close</md-icon>
|
||||
</md-button>
|
||||
</div>
|
||||
</md-toolbar>
|
||||
|
||||
<md-dialog-content flex>
|
||||
<md-card class="md-padding">
|
||||
<md-list flex>
|
||||
<md-list-item ng-if="canEdit">
|
||||
<p><strong>All Loggers</strong></p>
|
||||
<span style="width: 50px;"> </span>
|
||||
<md-select ng-model="model.alllevel" ng-change="setAllLoggers()" >
|
||||
<md-option ng-value="ll.id" ng-repeat="ll in model.logLevels" >{{ll.name}}</md-option>
|
||||
</md-select>
|
||||
</md-list-item>
|
||||
</md-list>
|
||||
</md-card>
|
||||
<md-card class="md-padding">
|
||||
<md-tabs md-dynamic-height>
|
||||
<md-tab ng-repeat="tab in tabs" layout="column" layout-fill>
|
||||
<md-tab-label>{{tab.title}}</md-tab-label>
|
||||
<md-tab-body>
|
||||
<md-list-item ng-repeat="log in tab.loggers" flex>
|
||||
<p>{{log.logger}}</p>
|
||||
<span style="width: 50px;"> </span>
|
||||
<md-select ng-model="log.level" ng-disabled="!canEdit">
|
||||
<md-option ng-value="ll.id" ng-repeat="ll in model.logLevels">{{ll.name}}</md-option>
|
||||
</md-select>
|
||||
</md-list-item>
|
||||
</md-tab-body>
|
||||
</md-tab>
|
||||
</md-tabs>
|
||||
</md-card>
|
||||
</md-dialog-content>
|
||||
<md-dialog-actions layout="row" class="modal-footer">
|
||||
<div class="text-danger">{{error}}</div>
|
||||
<md-button id="okButton" type="submit" class="md-raised md-primary" ng-click="ok()">Save</md-button>
|
||||
<md-button id="cancelButton" class="md-raised md-warn" ng-click="cancel()">Cancel</md-button>
|
||||
</md-dialog-actions>
|
||||
</md-dialog>
|
||||
@@ -1,94 +0,0 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* MODULE DESCRIPTION:
|
||||
*
|
||||
* TODO: Write description here.
|
||||
*/
|
||||
angular.module('portal.common.partials.loggerinfo', ['ui.router']).controller('LoggerInfoCtrl', loggerInfoCtrlController);
|
||||
|
||||
function loggerInfoCtrlController($scope, $state, cache, $mdDialog, loggerStores, loggerProvider, portalUtils, permissions, Constants) {
|
||||
$scope.saving = false;
|
||||
|
||||
permissions.canView({permission: Constants.Permissions.CHANGE_LOG_LEVELS}).then(function(allowed) {
|
||||
$scope.canEdit = allowed;
|
||||
});
|
||||
|
||||
$scope.tabs = [];
|
||||
|
||||
$scope.model = {
|
||||
logLevels: [
|
||||
{id:'OFF', name: 'Off'},
|
||||
{id:'FATAL', name: 'Fatal'},
|
||||
{id:'ERROR', name:'Error'},
|
||||
{id:'WARN', name:'Warn'},
|
||||
{id:'INFO', name:'Info'},
|
||||
{id:'DEBUG', name:'Debug'},
|
||||
{id:'TRACE', name:'Trace'},
|
||||
{id:'ALL', name: 'All'}
|
||||
]
|
||||
};
|
||||
|
||||
$scope.mCache = cache.request([new loggerStores.Loggers()]).then(function(){
|
||||
$scope.loggers = $scope.mCache.loggers.data.values;
|
||||
var tabIndex = -1;
|
||||
for (var i = 0; i < $scope.loggers.length; i++) {
|
||||
if (i % 5 === 0) {
|
||||
tabIndex += 1;
|
||||
$scope.tabs.push({
|
||||
title: 'Page' + (tabIndex + 1),
|
||||
loggers: []
|
||||
});
|
||||
}
|
||||
$scope.tabs[tabIndex].loggers.push($scope.loggers[i]);
|
||||
}
|
||||
});
|
||||
|
||||
$scope.setAllLoggers = function() {
|
||||
$.each($scope.loggers, function(key, value) {
|
||||
value.level = $scope.model.alllevel;
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* OK button handler
|
||||
* @returns {undefined}
|
||||
*/
|
||||
$scope.ok = function () {
|
||||
portalUtils.confirmBox('saveLoggers', 'Update Log Levels',
|
||||
['Are you sure you want to change the logging level?'],
|
||||
false, function(value) {
|
||||
if (value.confirm) {
|
||||
$scope.saveLoggingLevel();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
$scope.saveLoggingLevel = function() {
|
||||
loggerProvider.setLoggers($scope.loggers).then(function(value){
|
||||
portalUtils.toast('Log levels set successfully', ['top', 'left'], 2000);
|
||||
new loggerStores.Loggers().refresh();
|
||||
$mdDialog.hide();
|
||||
}).catch(function(err){
|
||||
portalUtils.toast('Failed to set log levels: ' + err.message, ['top', 'left'], 4000);
|
||||
new loggerStores.Loggers().refresh();
|
||||
});
|
||||
};
|
||||
|
||||
$scope.saveConfig = function() {
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* Cancel button handler.
|
||||
* @returns {undefined}
|
||||
*/
|
||||
$scope.cancel = function () {
|
||||
//Dismiss the modal
|
||||
$mdDialog.cancel();
|
||||
};
|
||||
|
||||
} //end loggerInfoCtrlController function
|
||||
|
||||
})();
|
||||
@@ -1,68 +0,0 @@
|
||||
<md-dialog flex>
|
||||
<form>
|
||||
<md-toolbar>
|
||||
<div class="md-toolbar-tools md-portal">
|
||||
<span>{{header}}</span>
|
||||
<span flex></span>
|
||||
<md-button class="md-icon-button" ng-click="cancel()">
|
||||
<md-icon aria-label="Close dialog">close</md-icon>
|
||||
</md-button>
|
||||
</div>
|
||||
</md-toolbar>
|
||||
<md-dialog-content layout-padding flex>
|
||||
<div layout="row" ng-repeat="status in scriptStatus" ng-if="scriptStatus.length > 0">
|
||||
<md-card flex>
|
||||
<md-card-title class="md-portal-grey" flex>
|
||||
<div layout="row" flex>
|
||||
<strong>Run {{scriptStatus.length - $index}}</strong>
|
||||
<span flex></span>
|
||||
<strong>Status: </strong>
|
||||
<strong ng-class="{'text-danger': status.exitStatus !== 0,'play-green': status.exitStatus === 0}">{{status.exitStatus !== 0 ? 'Failed' : 'Success'}}</strong>
|
||||
<span flex></span>
|
||||
<strong>Start: {{formatTime(status.startTime)}}</strong>
|
||||
<span flex></span>
|
||||
<strong>End: {{formatTime(status.endTime)}}</strong>
|
||||
<span flex></span>
|
||||
<md-button class="md-icon-button" ng-click="status.expanded = !status.expanded">
|
||||
<md-icon>{{ status.expanded ? 'expand_less' : 'expand_more' }}</md-icon>
|
||||
<md-tooltip md-delay="500" class="mediaTileToolTip" md-direction="left">{{status.expanded ? 'Collapse' : 'Expand'}}</md-tooltip>
|
||||
</md-button>
|
||||
</div>
|
||||
</md-card-title>
|
||||
<pre ng-if="status.expanded">{{status.results}}</pre>
|
||||
<md-card-content class="md-padding" ng-if="status.expanded && status.resourceFiles.length > 0">
|
||||
<p><strong>Files available for download</strong></p>
|
||||
<md-list>
|
||||
<md-list-item>
|
||||
<b>File Name</b>
|
||||
</md-list-item>
|
||||
<md-list-item ng-repeat="file in status.resourceFiles">
|
||||
<div layout="row" layout-align="start center" flex>
|
||||
<p>{{file.fileName}}</p>
|
||||
<span flex></span>
|
||||
<div layout="row" layout-align="end center">
|
||||
<md-button class="md-icon-button" ng-click="download(file)">
|
||||
<md-icon class="md-16">file_download</md-icon>
|
||||
<md-tooltip md-delay="500" class="mediaTileToolTip" md-direction="left">Download File</md-tooltip>
|
||||
</md-button>
|
||||
<md-button class="md-icon-button" ng-click="delete(file)" has-permission="{{Constants.Permissions.DELETE_FILE}}">
|
||||
<md-icon class="md-16">delete</md-icon>
|
||||
<md-tooltip md-delay="500" class="mediaTileToolTip" md-direction="left">Delete File</md-tooltip>
|
||||
</md-button>
|
||||
</div>
|
||||
</div>
|
||||
</md-list-item>
|
||||
</md-list>
|
||||
</md-card-content>
|
||||
</md-card>
|
||||
</div>
|
||||
<div layout="row" ng-if="scriptStatus.length === 0">
|
||||
<strong class="text-warn">No script job status found for select script job</strong>
|
||||
</div>
|
||||
</md-dialog-content>
|
||||
<md-dialog-actions layout="row" class="modal-footer">
|
||||
<div class="text-danger">{{error}}</div>
|
||||
<md-button id="cancelButton" class="md-raised md-warn" ng-click="cancel()">Cancel</md-button>
|
||||
</md-dialog-actions>
|
||||
</form>
|
||||
</md-dialog>
|
||||
@@ -1,84 +0,0 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* MODULE DESCRIPTION:
|
||||
*
|
||||
* TODO: Write description here.
|
||||
*/
|
||||
angular.module('portal.common.partials.viewScriptStatus', ['ui.router']).controller('ScriptStatusCtrl', ScriptStatusCtrl);
|
||||
|
||||
function ScriptStatusCtrl($scope, modalInstance, cache, $mdDialog, scriptObjects, scriptProvider, fileProvider, portalUtils,
|
||||
Triggers, Constants) {
|
||||
|
||||
$scope.header = modalInstance.header;
|
||||
$scope.scriptStatus = [];
|
||||
|
||||
|
||||
$scope.Constants = Constants;
|
||||
$scope.confirmQuestionBox = true;
|
||||
|
||||
$scope.init = function() {
|
||||
scriptProvider.getScriptStatus(modalInstance.jobId).then(function(data){
|
||||
$scope.scriptStatus = [];
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
$scope.scriptStatus.push(new scriptObjects.ScriptStatus(data[i]));
|
||||
}
|
||||
});
|
||||
};
|
||||
$scope.init();
|
||||
|
||||
$scope.formatTime = function(value) {
|
||||
if (value === null || value === undefined) {
|
||||
return 'None';
|
||||
}
|
||||
return moment(value).format('MM/DD/Y HH:mm:ss');
|
||||
};
|
||||
|
||||
$scope.delete = function(entity) {
|
||||
if ($scope.confirmQuestionBox) {
|
||||
portalUtils.confirmBox('deleteFile', 'Delete File', ['Are you sure you want to delete the file', entity.fileName],
|
||||
true, function(value) {
|
||||
if (value.confirm) {
|
||||
$scope.confirmQuestionBox = !value.checkbox;
|
||||
$scope.deleteFile(entity);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$scope.deleteFile(entity);
|
||||
}
|
||||
};
|
||||
|
||||
$scope.deleteFile = function(entity) {
|
||||
fileProvider.deleteFile(entity).then(function() {
|
||||
portalUtils.toast('File deleted successfully', ['top', 'left'], 2000);
|
||||
}).catch(function(err){
|
||||
portalUtils.toast('File failed to delete: ' + err.message, ['top', 'left'], 4000);
|
||||
});
|
||||
};
|
||||
|
||||
$scope.ok = function () {
|
||||
|
||||
};
|
||||
|
||||
$scope.download = function(row) {
|
||||
var url = '/portal/file/download.do?id=' + row.id;
|
||||
window.open(url, '');
|
||||
};
|
||||
|
||||
/**
|
||||
* Cancel button handler.
|
||||
* @returns {undefined}
|
||||
*/
|
||||
$scope.cancel = function () {
|
||||
//Dismiss the modal
|
||||
$mdDialog.cancel();
|
||||
};
|
||||
|
||||
Triggers.listen([Triggers.FILE_DELETED], function(trigger, payload){
|
||||
$scope.init();
|
||||
});
|
||||
|
||||
} //end addEnvVarCtrlController function
|
||||
|
||||
})();
|
||||
@@ -1,26 +0,0 @@
|
||||
<md-dialog flex="40">
|
||||
<md-toolbar>
|
||||
<div class="md-toolbar-tools md-portal">
|
||||
<span>AES Seed</span>
|
||||
<span flex></span>
|
||||
<md-button class="md-icon-button" ng-click="cancel()">
|
||||
<md-icon>close</md-icon>
|
||||
</md-button>
|
||||
</div>
|
||||
</md-toolbar>
|
||||
|
||||
<md-dialog-content flex>
|
||||
<md-card class="md-padding">
|
||||
<md-input-container flex>
|
||||
<label>Seed Value</label>
|
||||
<input ng-model="model.seed" ng-disabled="saving || !canEdit"/>
|
||||
</md-input-container>
|
||||
</md-list-item>
|
||||
</md-card>
|
||||
</md-dialog-content>
|
||||
<md-dialog-actions layout="row" class="modal-footer">
|
||||
<div class="text-danger">{{error}}</div>
|
||||
<md-button id="okButton" type="submit" class="md-raised md-primary" ng-click="ok()">Save</md-button>
|
||||
<md-button id="cancelButton" class="md-raised md-warn" ng-click="cancel()">Cancel</md-button>
|
||||
</md-dialog-actions>
|
||||
</md-dialog>
|
||||
@@ -1,56 +0,0 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* MODULE DESCRIPTION:
|
||||
*
|
||||
* TODO: Write description here.
|
||||
*/
|
||||
angular.module('portal.common.partials.seedinfo', ['ui.router']).controller('SeedInfoCtrl', seedInfoCtrlController);
|
||||
|
||||
function seedInfoCtrlController($scope, $state, cache, $mdDialog, systemProvider, portalUtils, permissions, Constants) {
|
||||
$scope.saving = false;
|
||||
|
||||
permissions.canView({permission: Constants.Permissions.UPDATE_SEED_VALUE}).then(function(allowed) {
|
||||
$scope.canEdit = allowed;
|
||||
});
|
||||
|
||||
$scope.model = {};
|
||||
|
||||
/**
|
||||
* OK button handler
|
||||
* @returns {undefined}
|
||||
*/
|
||||
$scope.ok = function () {
|
||||
portalUtils.confirmBox('updateSeed', 'Update AES Seed',
|
||||
['Are you sure you want to update the AES Seed',
|
||||
'This will go through and update all the saved encrypted values',
|
||||
'and cannot be undone once performed'],
|
||||
false, function(value) {
|
||||
if (value.confirm) {
|
||||
$scope.updateSeed();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
$scope.updateSeed = function() {
|
||||
systemProvider.updateSeed($scope.model.seed).then(function(){
|
||||
portalUtils.toast('Seed updated successfully', ['top', 'left'], 2000);
|
||||
$mdDialog.hide();
|
||||
}, function(err){
|
||||
$scope.error = err.message;
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Cancel button handler.
|
||||
* @returns {undefined}
|
||||
*/
|
||||
$scope.cancel = function () {
|
||||
//Dismiss the modal
|
||||
$mdDialog.cancel();
|
||||
};
|
||||
|
||||
} //end SeedInfoCtrlController function
|
||||
|
||||
})();
|
||||
@@ -1,20 +0,0 @@
|
||||
<md-dialog>
|
||||
<form>
|
||||
<md-toolbar>
|
||||
<div class="md-toolbar-tools md-portal">
|
||||
<span>Alert!</span>
|
||||
<span flex></span>
|
||||
</div>
|
||||
</md-toolbar>
|
||||
<md-dialog-content layout-padding flex>
|
||||
<div layout="row">
|
||||
<div ng-bind-html="message"></div>
|
||||
</div>
|
||||
</md-dialog-content>
|
||||
<md-dialog-actions layout="row" class="modal-footer">
|
||||
<div class="text-danger">{{error}}</div>
|
||||
<md-button id="okButton" type="submit" class="md-raised md-warn" ng-if="btnCnlText !== undefined" ng-click="onCancel()">{{btnCnlText}}</md-button>
|
||||
<md-button id="cancelButton" class="md-raised md-warn" ng-click="onOkay()">{{btnText}}</md-button>
|
||||
</md-dialog-actions>
|
||||
</form>
|
||||
</md-dialog>
|
||||
@@ -1,16 +0,0 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
angular.module('portal.common.partials.sessionEnd', ['ui.router'])
|
||||
.controller('SessionEndCtrl', SessionEndCtrlController);
|
||||
|
||||
function SessionEndCtrlController($scope, modalInstance, $state, cache) {
|
||||
$scope.onOkay = modalInstance.onOkay;
|
||||
$scope.message = modalInstance.message;
|
||||
$scope.btnText = modalInstance.btnText;
|
||||
|
||||
$scope.btnCnlText = modalInstance.btnCnlText;
|
||||
$scope.onCancel = modalInstance.onCancel;
|
||||
} //end SessionEndCtrlController function
|
||||
|
||||
})();
|
||||
@@ -1,93 +0,0 @@
|
||||
<md-dialog flex="40">
|
||||
<md-toolbar>
|
||||
<div class="md-toolbar-tools md-portal">
|
||||
<span>SMTP Configuration</span>
|
||||
<span flex></span>
|
||||
<md-button class="md-icon-button" ng-click="cancel()">
|
||||
<md-icon>close</md-icon>
|
||||
</md-button>
|
||||
</div>
|
||||
</md-toolbar>
|
||||
|
||||
<md-dialog-content flex>
|
||||
<md-tabs md-dynamic-height md-border-bottom>
|
||||
<md-tab label="General Configuration">
|
||||
<md-content class="md-padding" flex>
|
||||
<md-list>
|
||||
<md-list-item ng-repeat="conf in smtpConfig | limitTo: 5">
|
||||
<div layout="row" layout-align="center start" flex>
|
||||
<md-input-container>
|
||||
<input ng-model="conf.displayValue" ng-disabled="true" style="color: rgba(0,0,0,1) !important; background: none !important;"/>
|
||||
</md-input-container>
|
||||
<span flex="5"></span>
|
||||
<md-switch flex ng-model="conf.value" ng-if="conf.type === 'boolean'" class="md-primary" ng-disabled="!canEdit">{{conf.value ? 'Yes' : 'No'}}</md-switch>
|
||||
<div layout="row" layout-align="start center" flex ng-if="conf.type !== 'boolean'">
|
||||
<md-input-container flex>
|
||||
<input ng-model="conf.value" ng-disabled="!canEdit" type="{{conf.type}}" />
|
||||
</md-input-container>
|
||||
<md-button class="md-icon-button" ng-if="conf.meta === 'password'" style="margin-bottom: 25px;" ng-mousedown="conf.type='text'" ng-mouseup="conf.type='password'">
|
||||
<md-icon>remove_red_eye</md-icon>
|
||||
<md-tooltip>View password</md-tooltip>
|
||||
</md-button>
|
||||
</div>
|
||||
</div>
|
||||
</md-list-item>
|
||||
</md-list>
|
||||
</md-content>
|
||||
</md-tab>
|
||||
<md-tab label="Start TLS Configuration">
|
||||
<md-content class="md-padding" flex>
|
||||
<md-list>
|
||||
<md-list-item ng-repeat="conf in smtpConfig | limitTo: 3:5">
|
||||
<div layout="row" layout-align="center start" flex>
|
||||
<md-input-container>
|
||||
<input ng-model="conf.displayValue" ng-disabled="true" style="color: rgba(0,0,0,1) !important; background: none !important;"/>
|
||||
</md-input-container>
|
||||
<span flex="5"></span>
|
||||
<md-switch flex ng-model="conf.value" ng-if="conf.type === 'boolean'" class="md-primary" ng-disabled="!canEdit">{{conf.value ? 'Yes' : 'No'}}</md-switch>
|
||||
<div layout="row" layout-align="start center" flex ng-if="conf.type !== 'boolean'">
|
||||
<md-input-container flex>
|
||||
<input ng-model="conf.value" ng-disabled="!canEdit" type="{{conf.type}}" />
|
||||
</md-input-container>
|
||||
<md-button class="md-icon-button" ng-if="conf.meta === 'password'" style="margin-bottom: 25px;" ng-mousedown="conf.type='text'" ng-mouseup="conf.type='password'">
|
||||
<md-icon>remove_red_eye</md-icon>
|
||||
<md-tooltip>View password</md-tooltip>
|
||||
</md-button>
|
||||
</div>
|
||||
</div>
|
||||
</md-list-item>
|
||||
</md-list>
|
||||
</md-content>
|
||||
</md-tab>
|
||||
<md-tab label="Auth Configuration">
|
||||
<md-content class="md-padding" flex>
|
||||
<md-list>
|
||||
<md-list-item ng-repeat="conf in smtpConfig | limitTo: 4:8">
|
||||
<div layout="row" layout-align="center start" flex>
|
||||
<md-input-container>
|
||||
<input ng-model="conf.displayValue" ng-disabled="true" style="color: rgba(0,0,0,1) !important; background: none !important;"/>
|
||||
</md-input-container>
|
||||
<span flex="5"></span>
|
||||
<md-switch flex ng-model="conf.value" ng-if="conf.type === 'boolean'" class="md-primary" ng-disabled="!canEdit">{{conf.value ? 'Yes' : 'No'}}</md-switch>
|
||||
<div layout="row" layout-align="start center" flex ng-if="conf.type !== 'boolean'">
|
||||
<md-input-container flex>
|
||||
<input ng-model="conf.value" ng-disabled="!canEdit" type="{{conf.type}}" />
|
||||
</md-input-container>
|
||||
<md-button class="md-icon-button" ng-if="conf.meta === 'password'" style="margin-bottom: 25px;" ng-mousedown="conf.type='text'" ng-mouseup="conf.type='password'">
|
||||
<md-icon>remove_red_eye</md-icon>
|
||||
<md-tooltip>View password</md-tooltip>
|
||||
</md-button>
|
||||
</div>
|
||||
</div>
|
||||
</md-list-item>
|
||||
</md-list>
|
||||
</md-content>
|
||||
</md-tab>
|
||||
</md-tabs>
|
||||
</md-dialog-content>
|
||||
<md-dialog-actions layout="row" class="modal-footer">
|
||||
<div class="text-danger">{{error}}</div>
|
||||
<md-button id="okButton" type="submit" class="md-raised md-primary" ng-click="ok()">Save</md-button>
|
||||
<md-button id="cancelButton" class="md-raised md-warn" ng-click="cancel()">Cancel</md-button>
|
||||
</md-dialog-actions>
|
||||
</md-dialog>
|
||||
@@ -1,140 +0,0 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* MODULE DESCRIPTION:
|
||||
*
|
||||
* TODO: Write description here.
|
||||
*/
|
||||
angular.module('portal.common.partials.smtpinfo', ['ui.router']).controller('SMTPInfoCtrl', smtpInfoCtrlController);
|
||||
|
||||
function smtpInfoCtrlController($scope, $state, cache, $mdDialog, systemProvider, systemStores,
|
||||
portalUtils, permissions, Constants, Triggers) {
|
||||
$scope.saving = false;
|
||||
|
||||
permissions.canView({permission: Constants.Permissions.EDIT_SMTP_CONFIG}).then(function(allowed){
|
||||
$scope.canEdit = allowed;
|
||||
});
|
||||
|
||||
$scope.smtpConfig = [
|
||||
{
|
||||
name: 'smtp.enabled',
|
||||
displayValue: 'SMTP Enabled',
|
||||
value: false,
|
||||
type: 'boolean'
|
||||
},{
|
||||
name: 'mail.transport.protocol',
|
||||
displayValue: 'Transport Protocol',
|
||||
value: 'smtp',
|
||||
type: 'text'
|
||||
},{
|
||||
name: 'mail.smtp.host',
|
||||
displayValue: 'SMTP Server Url',
|
||||
value: '',
|
||||
type: 'text'
|
||||
},{
|
||||
name: 'mail.smtp.port',
|
||||
displayValue: 'SMTP Server Port',
|
||||
value: 0,
|
||||
type: 'number'
|
||||
},{
|
||||
name: 'mail.debug',
|
||||
displayValue: 'Enable Mail Debug Logging',
|
||||
value: false,
|
||||
type: 'boolean'
|
||||
},{
|
||||
name: 'mail.smtp.starttls.enable',
|
||||
displayValue: 'Enable Start TLS',
|
||||
value: false,
|
||||
type: 'boolean'
|
||||
},{
|
||||
name: 'mail.smtp.starttls.required',
|
||||
displayValue: 'Require Start TLS',
|
||||
value: false,
|
||||
type: 'boolean'
|
||||
},{
|
||||
name: 'mail.smtp.ssl.trust',
|
||||
displayValue: 'SSL Trust Certificate',
|
||||
value: '*',
|
||||
type: 'text'
|
||||
},{
|
||||
name: 'mail.smtp.auth',
|
||||
displayValue: 'Require Authentication',
|
||||
value: false,
|
||||
type: 'boolean'
|
||||
},{
|
||||
name: 'smtp.from.user',
|
||||
displayValue: 'From User',
|
||||
value: '',
|
||||
type: 'text'
|
||||
},{
|
||||
name: 'smtp.username',
|
||||
displayValue: 'SMTP Username',
|
||||
value: '',
|
||||
type: 'text'
|
||||
},{
|
||||
name: 'smtp.password',
|
||||
displayValue: 'SMTP Password',
|
||||
value: '',
|
||||
type: 'password',
|
||||
meta: 'password'
|
||||
},
|
||||
];
|
||||
|
||||
$scope.mCache = cache.request([new systemStores.SMTPConfig()]).then(function(){
|
||||
var conf = $scope.mCache.smtpConfig.data.values;
|
||||
|
||||
$.each($scope.smtpConfig, function(key, value) {
|
||||
$.each(conf, function(key2, value2) {
|
||||
if (value.name === value2.name) {
|
||||
if (value.type === 'number') {
|
||||
value.value = parseInt(value2.value);
|
||||
} else if (value.type === 'boolean') {
|
||||
value.value = value2.value === 'true' || value2.value === true;
|
||||
} else {
|
||||
value.value = value2.value;
|
||||
}
|
||||
return;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* OK button handler
|
||||
* @returns {undefined}
|
||||
*/
|
||||
$scope.ok = function () {
|
||||
portalUtils.confirmBox('saveSmtpConfig', 'Update SMTP Configuration',
|
||||
['Are you sure you want to update the smtp configuration?'],
|
||||
false, function(value) {
|
||||
if (value.confirm) {
|
||||
$scope.saveSMTPConf();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
$scope.saveSMTPConf = function() {
|
||||
systemProvider.updateSmtpConfig($scope.smtpConfig).then(function() {
|
||||
$mdDialog.hide();
|
||||
}).catch(function(err) {
|
||||
$scope.error = err.message;
|
||||
portalUtils.toast('Failed to save configuration: ' + err.message, ['top', 'left'], 4000);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Cancel button handler.
|
||||
* @returns {undefined}
|
||||
*/
|
||||
$scope.cancel = function () {
|
||||
//Dismiss the modal
|
||||
$mdDialog.cancel();
|
||||
};
|
||||
|
||||
Triggers.listen([Triggers.SMTP_CONFIG_UPDATED], function(trigger, payload) {
|
||||
new systemStores.SMTPConfig().refresh();
|
||||
});
|
||||
|
||||
} //end smtpInfoCtrlController function
|
||||
})();
|
||||
@@ -1,25 +0,0 @@
|
||||
<md-dialog>
|
||||
<md-toolbar>
|
||||
<div class="md-toolbar-tools md-portal">
|
||||
<span>{{confirmTitle}}</span>
|
||||
<span flex></span>
|
||||
<md-button class="md-icon-button" ng-click="cancel()">
|
||||
<md-icon aria-label="Close dialog">close</md-icon>
|
||||
</md-button>
|
||||
</div>
|
||||
</md-toolbar>
|
||||
<md-dialog-content>
|
||||
<div layout="column" class="md-padding">
|
||||
<ng-repeat ng-repeat="message in confirmMessage">
|
||||
<p>{{message}}</p>
|
||||
</ng-repeat>
|
||||
<div layout="row">
|
||||
<md-checkbox class="md-primary" ng-if="showConfirmMessage" ng-model="data.checkbox">Do not show this message again</md-checkbox>
|
||||
</div>
|
||||
</div>
|
||||
</md-dialog-content>
|
||||
<md-dialog-actions layout="row" class="modal-footer">
|
||||
<md-button id="{{btnId}}-confirm" class="md-raised md-primary" ng-click="confirm()">Yes</md-button>
|
||||
<md-button id="{{btnId}}-cancel" class="md-raised md-warn" ng-click="cancel()">No</md-button>
|
||||
</md-dialog-actions>
|
||||
</md-dialog>
|
||||
@@ -1,39 +0,0 @@
|
||||
<md-dialog flex="15">
|
||||
<md-toolbar>
|
||||
<div class="md-toolbar-tools md-portal">
|
||||
<span>{{title}}</span>
|
||||
<span flex></span>
|
||||
<md-button class="md-icon-button" ng-click="cancel()">
|
||||
<md-icon aria-label="Close dialog">close</md-icon>
|
||||
</md-button>
|
||||
</div>
|
||||
</md-toolbar>
|
||||
<md-dialog-content flex>
|
||||
<div layout="column" class="md-padding" flex>
|
||||
<p class="text-danger">{{message}}</p>
|
||||
<md-input-container flex>
|
||||
<label style="padding-left: 35px;">Purge Start Date</label>
|
||||
<input mdc-datetime-picker="" date="true" time="false" type="text" id="startdatetime"
|
||||
show-todays-date="" minutes="true" min-date="date" show-icon="true" format='MMM D, YYYY'
|
||||
ng-model="model.purgeStartDate" class=" dtp-no-msclear dtp-input">
|
||||
</md-input-container>
|
||||
<md-input-container flex>
|
||||
<label style="padding-left: 35px;">Purge End Date</label>
|
||||
<input mdc-datetime-picker="" date="true" time="false" type="text" id="startdatetime"
|
||||
show-todays-date="" minutes="true" min-date="date" show-icon="true" format='MMM D, YYYY'
|
||||
ng-model="model.purgeEndDate" class=" dtp-no-msclear dtp-input">
|
||||
</md-input-container>
|
||||
</div>
|
||||
</md-dialog-content>
|
||||
<div ng-show="loadingBlock" class="loadingFade"></div>
|
||||
<div class="loadingModal" ng-show="loadingBlock">
|
||||
<md-progress-circular md-mode="indeterminate" md-diameter="80" class="md-hue-2"></md-progress-circular>
|
||||
</div>
|
||||
<md-dialog-actions layout="column" class="modal-footer" flex>
|
||||
<div class="text-danger">{{error}}</div>
|
||||
<div layout="row" layout-align="end center">
|
||||
<md-button id="purge-confirm" class="md-raised md-primary" ng-click="confirm()">Ok</md-button>
|
||||
<md-button id="purge-cancel" class="md-raised md-warn" ng-click="cancel()">Cancel</md-button>
|
||||
</div>
|
||||
</md-dialog-actions>
|
||||
</md-dialog>
|
||||
@@ -1,31 +0,0 @@
|
||||
<md-dialog flex="50">
|
||||
<md-toolbar>
|
||||
<div class="md-toolbar-tools md-portal">
|
||||
<span>{{header}} to {{currentDir}}</span>
|
||||
<span flex></span>
|
||||
<md-button class="md-icon-button" ng-click="cancel()">
|
||||
<md-icon aria-label="Close dialog">close</md-icon>
|
||||
</md-button>
|
||||
</div>
|
||||
</md-toolbar>
|
||||
<md-dialog-content flex>
|
||||
<div layout="row" flex="100" class="md-dialog-content" id="fileInputDiv">
|
||||
<repo-file-input id="fileInput" name="file" ng-model="uploadFile" accepts="false" flex></repo-file-input>
|
||||
</div>
|
||||
<div layout="row" flex="100" class="md-dialog-content">
|
||||
<md-input-container flex>
|
||||
<label>Hash Value</label>
|
||||
<input type="text" id="fileName" ng-model="model.hashValue" required>
|
||||
</md-input-container>
|
||||
</div>
|
||||
<div ng-show="loadingBlock" class="loadingFade"></div>
|
||||
<div class="loadingModal" ng-show="loadingBlock">
|
||||
<md-progress-circular md-mode="indeterminate" md-diameter="80" class="md-hue-2"></md-progress-circular>
|
||||
</div>
|
||||
</md-dialog-content>
|
||||
<md-dialog-actions layout="row" class="modal-footer">
|
||||
<div class="text-danger text-center">{{error}}</div>
|
||||
<md-button id="okButton" class="md-raised md-primary" ng-click="ok()" ng-disabled="!valid">OK</md-button>
|
||||
<md-button id="cancelButton" class="md-raised md-warn" ng-click="cancel()">Cancel</md-button>
|
||||
</md-dialog-actions>
|
||||
</md-dialog>
|
||||
Loaded 100 of 335 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user