mirror of
https://github.com/NLnetLabs/krill.git
synced 2026-09-22 09:24:55 +02:00
Removing the UI altogether for release 0.1 - will come back better in 0.2.
This commit is contained in:
@@ -12,6 +12,3 @@ before_install:
|
||||
- sudo apt update
|
||||
- sudo apt-get install -y nodejs
|
||||
- sudo apt-get install -y yarn
|
||||
|
||||
install:
|
||||
- ./daemon/build-dist.sh
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
name = "krill_daemon"
|
||||
version = "0.1.0"
|
||||
authors = ["Tim Bruijnzeels <tim@nlnetlabs.nl>", "Martin Hoffmann <martin@nlnetlabs.nl>"]
|
||||
build = "build-ui.rs"
|
||||
|
||||
[dependencies]
|
||||
actix-identity = "0.1.0"
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
DIR=`dirname $0`
|
||||
|
||||
cd $DIR/ui
|
||||
if [ ! -d "node_modules" ]; then
|
||||
npm install
|
||||
fi
|
||||
|
||||
yarn run build
|
||||
@@ -1,14 +0,0 @@
|
||||
extern crate ignore;
|
||||
|
||||
use ignore::Walk;
|
||||
use std::process::Command;
|
||||
|
||||
//#[allow(dead_code)]
|
||||
fn main() {
|
||||
for result in Walk::new("./ui/src") {
|
||||
if let Ok(entry) = result {
|
||||
println!("cargo:rerun-if-changed={}", entry.path().display());
|
||||
}
|
||||
}
|
||||
Command::new("./build-dist.sh").status().unwrap();
|
||||
}
|
||||
@@ -22,8 +22,6 @@ use crate::ca::{self, ParentHandle};
|
||||
use crate::http::server::AppServer;
|
||||
use crate::krillserver;
|
||||
|
||||
const NOT_FOUND: &[u8] = include_bytes!("../ui/dist/404.html");
|
||||
|
||||
//------------ Support Functions ---------------------------------------------
|
||||
|
||||
/// Helper function to render json output.
|
||||
@@ -58,7 +56,7 @@ fn api_not_found() -> HttpResponse {
|
||||
}
|
||||
|
||||
pub fn not_found() -> HttpResponse {
|
||||
HttpResponse::build(StatusCode::NOT_FOUND).body(NOT_FOUND)
|
||||
HttpResponse::build(StatusCode::NOT_FOUND).body("NOT_FOUND")
|
||||
}
|
||||
|
||||
/// A clean 200 result for the API (no content, not for humans)
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
pub mod server;
|
||||
pub mod ssl;
|
||||
pub mod statics;
|
||||
pub mod ssl;
|
||||
@@ -18,12 +18,11 @@ use bcder::decode;
|
||||
|
||||
use krill_commons::api::PublishDelta;
|
||||
|
||||
use crate::auth::{is_logged_in, login, logout, AUTH_COOKIE_NAME};
|
||||
use crate::auth::AUTH_COOKIE_NAME;
|
||||
use crate::config::Config;
|
||||
use crate::endpoints;
|
||||
use crate::endpoints::*;
|
||||
use crate::http::ssl;
|
||||
use crate::http::statics::WithStaticContent;
|
||||
use crate::krillserver;
|
||||
use crate::krillserver::KrillServer;
|
||||
|
||||
@@ -97,13 +96,13 @@ pub fn start(config: &Config) -> Result<(), Error> {
|
||||
.data(web::Json::<PublishDelta>::configure(|cfg| {
|
||||
cfg.limit(256 * 1024 * 1024)
|
||||
}))
|
||||
|
||||
// Identity exchanges for remote publishers
|
||||
.route("/rfc8181/{handle}", post().to(rfc8181))
|
||||
|
||||
// Provisioning for remote krill clients
|
||||
.route("/rfc6492/{handle}", post().to(rfc6492))
|
||||
// UI support
|
||||
.route("/ui/is_logged_in", get().to(is_logged_in))
|
||||
.route("/ui/login", post().to(login))
|
||||
.route("/ui/logout", post().to(logout))
|
||||
|
||||
// RRDP repository
|
||||
.route("/rrdp/{path:.*}", get().to(serve_rrdp_files))
|
||||
.route(
|
||||
@@ -114,7 +113,6 @@ pub fn start(config: &Config) -> Result<(), Error> {
|
||||
.finish()
|
||||
}),
|
||||
)
|
||||
.add_statics()
|
||||
// default
|
||||
.default_service(
|
||||
// 404 for GET request
|
||||
|
||||
@@ -1,296 +0,0 @@
|
||||
use actix_service::NewService;
|
||||
use actix_web::dev::{MessageBody, ServiceRequest, ServiceResponse};
|
||||
use actix_web::{web, App, Error, HttpResponse};
|
||||
|
||||
/// This trait allows for adding static content.
|
||||
/// Using a trait here so that it can be used fluidly in the
|
||||
/// building of the 'App'.
|
||||
pub trait WithStaticContent {
|
||||
/// Add a single static resource.
|
||||
fn add_static(self, static_content: &'static StaticContent) -> Self;
|
||||
|
||||
/// Add all static resources defined in this module.
|
||||
fn add_statics(self) -> Self;
|
||||
}
|
||||
|
||||
/// Implementation for the App type that is returned when App::new()
|
||||
/// is used.
|
||||
impl<T, B> WithStaticContent for App<T, B>
|
||||
where
|
||||
B: MessageBody,
|
||||
T: NewService<
|
||||
Config = (),
|
||||
Request = ServiceRequest,
|
||||
Response = ServiceResponse<B>,
|
||||
Error = Error,
|
||||
InitError = (),
|
||||
>,
|
||||
{
|
||||
fn add_static(self, static_content: &'static StaticContent) -> Self {
|
||||
self.route(
|
||||
static_content.web_path,
|
||||
web::get().to(move || {
|
||||
HttpResponse::Ok()
|
||||
.content_type(static_content.ctype)
|
||||
.header("Cache-Control", "max-age: 86400")
|
||||
.body(static_content.content)
|
||||
}),
|
||||
)
|
||||
}
|
||||
|
||||
fn add_statics(self) -> Self {
|
||||
self.add_static(&NOT_FOUND)
|
||||
.add_static(&INDEX)
|
||||
.add_static(&FAVICON)
|
||||
.add_static(&APP_JS)
|
||||
.add_static(&APP_JS_MAP)
|
||||
.add_static(&APP_CSS)
|
||||
.add_static(&IMG_KRILL_LOG)
|
||||
.add_static(&IMG_ROUTE_LEFT)
|
||||
.add_static(&IMG_ROUTE_RIGHT)
|
||||
.add_static(&FONTS_EL_ICONS)
|
||||
.add_static(&FONTS_LATIN_100)
|
||||
.add_static(&FONTS_LATIN_100_2)
|
||||
.add_static(&FONTS_LATIN_300)
|
||||
.add_static(&FONTS_LATIN_300_2)
|
||||
.add_static(&FONTS_LATIN_400)
|
||||
.add_static(&FONTS_LATIN_400_2)
|
||||
.add_static(&FONTS_LATIN_700)
|
||||
.add_static(&FONTS_LATIN_700_2)
|
||||
.add_static(&FONTS_LATIN_900)
|
||||
.add_static(&FONTS_LATIN_900_2)
|
||||
.add_static(&FONTS_LATIN_100_IT)
|
||||
.add_static(&FONTS_LATIN_100_IT_2)
|
||||
.add_static(&FONTS_LATIN_300_IT)
|
||||
.add_static(&FONTS_LATIN_300_IT_2)
|
||||
.add_static(&FONTS_LATIN_400_IT)
|
||||
.add_static(&FONTS_LATIN_400_IT_2)
|
||||
.add_static(&FONTS_LATIN_700_IT)
|
||||
.add_static(&FONTS_LATIN_700_IT_2)
|
||||
.add_static(&FONTS_LATIN_900_IT)
|
||||
.add_static(&FONTS_SOURCE_CODE_200)
|
||||
.add_static(&FONTS_SOURCE_CODE_200_2)
|
||||
.add_static(&FONTS_SOURCE_CODE_300)
|
||||
.add_static(&FONTS_SOURCE_CODE_300_2)
|
||||
.add_static(&FONTS_SOURCE_CODE_400)
|
||||
.add_static(&FONTS_SOURCE_CODE_400_2)
|
||||
.add_static(&FONTS_SOURCE_CODE_700)
|
||||
.add_static(&FONTS_SOURCE_CODE_700_2)
|
||||
.add_static(&FONTS_SOURCE_CODE_900)
|
||||
.add_static(&FONTS_SOURCE_CODE_900_2)
|
||||
}
|
||||
}
|
||||
|
||||
//------------ StaticContent -------------------------------------------------
|
||||
|
||||
pub struct StaticContent {
|
||||
pub web_path: &'static str,
|
||||
pub content: &'static [u8],
|
||||
pub ctype: &'static str,
|
||||
}
|
||||
|
||||
//------------ Definition of Statics -----------------------------------------
|
||||
|
||||
static HTML: &str = "text/html";
|
||||
static FAV: &str = "image/x-icon";
|
||||
static JS: &str = "application/javascript";
|
||||
static CSS: &str = "text/css";
|
||||
static SVG: &str = "image/svg+xml";
|
||||
static WOFF: &str = "font/woff";
|
||||
static WOFF2: &str = "font/woff2";
|
||||
|
||||
static NOT_FOUND: StaticContent = StaticContent {
|
||||
web_path: "/ui/404.html",
|
||||
content: include_bytes!("../../ui/dist/404.html"),
|
||||
ctype: HTML,
|
||||
};
|
||||
static INDEX: StaticContent = StaticContent {
|
||||
web_path: "/ui/index.html",
|
||||
content: include_bytes!("../../ui/dist/index.html"),
|
||||
ctype: HTML,
|
||||
};
|
||||
static FAVICON: StaticContent = StaticContent {
|
||||
web_path: "/ui/favicon.ico",
|
||||
content: include_bytes!("../../ui/dist/favicon.ico"),
|
||||
ctype: FAV,
|
||||
};
|
||||
static APP_JS: StaticContent = StaticContent {
|
||||
web_path: "/ui/js/app.js",
|
||||
content: include_bytes!("../../ui/dist/js/app.js"),
|
||||
ctype: JS,
|
||||
};
|
||||
static APP_JS_MAP: StaticContent = StaticContent {
|
||||
web_path: "/ui/js/app.js.map",
|
||||
content: include_bytes!("../../ui/dist/js/app.js.map"),
|
||||
ctype: JS,
|
||||
};
|
||||
static APP_CSS: StaticContent = StaticContent {
|
||||
web_path: "/ui/css/app.css",
|
||||
content: include_bytes!("../../ui/dist/css/app.css"),
|
||||
ctype: CSS,
|
||||
};
|
||||
static IMG_KRILL_LOG: StaticContent = StaticContent {
|
||||
web_path: "/ui/img/krill_logo_white.svg",
|
||||
content: include_bytes!("../../ui/dist/img/krill_logo_white.svg"),
|
||||
ctype: SVG,
|
||||
};
|
||||
static IMG_ROUTE_LEFT: StaticContent = StaticContent {
|
||||
web_path: "/ui/img/route_left.svg",
|
||||
content: include_bytes!("../../ui/dist/img/route_left.svg"),
|
||||
ctype: SVG,
|
||||
};
|
||||
static IMG_ROUTE_RIGHT: StaticContent = StaticContent {
|
||||
web_path: "/ui/img/route_right.svg",
|
||||
content: include_bytes!("../../ui/dist/img/route_right.svg"),
|
||||
ctype: SVG,
|
||||
};
|
||||
static FONTS_EL_ICONS: StaticContent = StaticContent {
|
||||
web_path: "/ui/fonts/element-icons.woff",
|
||||
content: include_bytes!("../../ui/dist/fonts/element-icons.woff"),
|
||||
ctype: WOFF,
|
||||
};
|
||||
static FONTS_LATIN_100: StaticContent = StaticContent {
|
||||
web_path: "/ui/fonts/lato-latin-100.woff",
|
||||
content: include_bytes!("../../ui/dist/fonts/lato-latin-100.woff"),
|
||||
ctype: WOFF,
|
||||
};
|
||||
static FONTS_LATIN_100_2: StaticContent = StaticContent {
|
||||
web_path: "/ui/fonts/lato-latin-100.woff2",
|
||||
content: include_bytes!("../../ui/dist/fonts/lato-latin-100.woff2"),
|
||||
ctype: WOFF2,
|
||||
};
|
||||
static FONTS_LATIN_300: StaticContent = StaticContent {
|
||||
web_path: "/ui/fonts/lato-latin-300.woff",
|
||||
content: include_bytes!("../../ui/dist/fonts/lato-latin-300.woff"),
|
||||
ctype: WOFF,
|
||||
};
|
||||
static FONTS_LATIN_300_2: StaticContent = StaticContent {
|
||||
web_path: "/ui/fonts/lato-latin-300.woff2",
|
||||
content: include_bytes!("../../ui/dist/fonts/lato-latin-300.woff2"),
|
||||
ctype: WOFF2,
|
||||
};
|
||||
static FONTS_LATIN_400: StaticContent = StaticContent {
|
||||
web_path: "/ui/fonts/lato-latin-400.woff",
|
||||
content: include_bytes!("../../ui/dist/fonts/lato-latin-400.woff"),
|
||||
ctype: WOFF,
|
||||
};
|
||||
static FONTS_LATIN_400_2: StaticContent = StaticContent {
|
||||
web_path: "/ui/fonts/lato-latin-400.woff2",
|
||||
content: include_bytes!("../../ui/dist/fonts/lato-latin-400.woff2"),
|
||||
ctype: WOFF2,
|
||||
};
|
||||
static FONTS_LATIN_700: StaticContent = StaticContent {
|
||||
web_path: "/ui/fonts/lato-latin-700.woff",
|
||||
content: include_bytes!("../../ui/dist/fonts/lato-latin-700.woff"),
|
||||
ctype: WOFF,
|
||||
};
|
||||
static FONTS_LATIN_700_2: StaticContent = StaticContent {
|
||||
web_path: "/ui/fonts/lato-latin-700.woff2",
|
||||
content: include_bytes!("../../ui/dist/fonts/lato-latin-700.woff2"),
|
||||
ctype: WOFF2,
|
||||
};
|
||||
static FONTS_LATIN_900: StaticContent = StaticContent {
|
||||
web_path: "/ui/fonts/lato-latin-900.woff",
|
||||
content: include_bytes!("../../ui/dist/fonts/lato-latin-900.woff"),
|
||||
ctype: WOFF,
|
||||
};
|
||||
static FONTS_LATIN_900_2: StaticContent = StaticContent {
|
||||
web_path: "/ui/fonts/lato-latin-900.woff2",
|
||||
content: include_bytes!("../../ui/dist/fonts/lato-latin-900.woff2"),
|
||||
ctype: WOFF2,
|
||||
};
|
||||
static FONTS_LATIN_100_IT: StaticContent = StaticContent {
|
||||
web_path: "/ui/fonts/lato-latin-100italic.woff",
|
||||
content: include_bytes!("../../ui/dist/fonts/lato-latin-100italic.woff"),
|
||||
ctype: WOFF,
|
||||
};
|
||||
static FONTS_LATIN_100_IT_2: StaticContent = StaticContent {
|
||||
web_path: "/ui/fonts/lato-latin-100italic.woff2",
|
||||
content: include_bytes!("../../ui/dist/fonts/lato-latin-100italic.woff2"),
|
||||
ctype: WOFF2,
|
||||
};
|
||||
static FONTS_LATIN_300_IT: StaticContent = StaticContent {
|
||||
web_path: "/ui/fonts/lato-latin-300italic.woff",
|
||||
content: include_bytes!("../../ui/dist/fonts/lato-latin-300italic.woff"),
|
||||
ctype: WOFF,
|
||||
};
|
||||
static FONTS_LATIN_300_IT_2: StaticContent = StaticContent {
|
||||
web_path: "/ui/fonts/lato-latin-300italic.woff2",
|
||||
content: include_bytes!("../../ui/dist/fonts/lato-latin-300italic.woff2"),
|
||||
ctype: WOFF2,
|
||||
};
|
||||
static FONTS_LATIN_400_IT: StaticContent = StaticContent {
|
||||
web_path: "/ui/fonts/lato-latin-400italic.woff",
|
||||
content: include_bytes!("../../ui/dist/fonts/lato-latin-400italic.woff"),
|
||||
ctype: WOFF,
|
||||
};
|
||||
static FONTS_LATIN_400_IT_2: StaticContent = StaticContent {
|
||||
web_path: "/ui/fonts/lato-latin-400italic.woff2",
|
||||
content: include_bytes!("../../ui/dist/fonts/lato-latin-400italic.woff2"),
|
||||
ctype: WOFF2,
|
||||
};
|
||||
static FONTS_LATIN_700_IT: StaticContent = StaticContent {
|
||||
web_path: "/ui/fonts/lato-latin-700italic.woff",
|
||||
content: include_bytes!("../../ui/dist/fonts/lato-latin-700italic.woff"),
|
||||
ctype: WOFF,
|
||||
};
|
||||
static FONTS_LATIN_700_IT_2: StaticContent = StaticContent {
|
||||
web_path: "/ui/fonts/lato-latin-700italic.woff2",
|
||||
content: include_bytes!("../../ui/dist/fonts/lato-latin-700italic.woff2"),
|
||||
ctype: WOFF2,
|
||||
};
|
||||
static FONTS_LATIN_900_IT: StaticContent = StaticContent {
|
||||
web_path: "/ui/fonts/lato-latin-900italic.woff",
|
||||
content: include_bytes!("../../ui/dist/fonts/lato-latin-900italic.woff"),
|
||||
ctype: WOFF,
|
||||
};
|
||||
static FONTS_SOURCE_CODE_200: StaticContent = StaticContent {
|
||||
web_path: "/ui/fonts/source-code-pro-latin-200.woff",
|
||||
content: include_bytes!("../../ui/dist/fonts/source-code-pro-latin-200.woff"),
|
||||
ctype: WOFF,
|
||||
};
|
||||
static FONTS_SOURCE_CODE_200_2: StaticContent = StaticContent {
|
||||
web_path: "/ui/fonts/source-code-pro-latin-200.woff2",
|
||||
content: include_bytes!("../../ui/dist/fonts/source-code-pro-latin-200.woff2"),
|
||||
ctype: WOFF2,
|
||||
};
|
||||
static FONTS_SOURCE_CODE_300: StaticContent = StaticContent {
|
||||
web_path: "/ui/fonts/source-code-pro-latin-300.woff",
|
||||
content: include_bytes!("../../ui/dist/fonts/source-code-pro-latin-300.woff"),
|
||||
ctype: WOFF,
|
||||
};
|
||||
static FONTS_SOURCE_CODE_300_2: StaticContent = StaticContent {
|
||||
web_path: "/ui/fonts/source-code-pro-latin-300.woff2",
|
||||
content: include_bytes!("../../ui/dist/fonts/source-code-pro-latin-300.woff2"),
|
||||
ctype: WOFF2,
|
||||
};
|
||||
static FONTS_SOURCE_CODE_400: StaticContent = StaticContent {
|
||||
web_path: "/ui/fonts/source-code-pro-latin-400.woff",
|
||||
content: include_bytes!("../../ui/dist/fonts/source-code-pro-latin-400.woff"),
|
||||
ctype: WOFF,
|
||||
};
|
||||
static FONTS_SOURCE_CODE_400_2: StaticContent = StaticContent {
|
||||
web_path: "/ui/fonts/source-code-pro-latin-400.woff2",
|
||||
content: include_bytes!("../../ui/dist/fonts/source-code-pro-latin-400.woff2"),
|
||||
ctype: WOFF2,
|
||||
};
|
||||
static FONTS_SOURCE_CODE_700: StaticContent = StaticContent {
|
||||
web_path: "/ui/fonts/source-code-pro-latin-700.woff",
|
||||
content: include_bytes!("../../ui/dist/fonts/source-code-pro-latin-700.woff"),
|
||||
ctype: WOFF,
|
||||
};
|
||||
static FONTS_SOURCE_CODE_700_2: StaticContent = StaticContent {
|
||||
web_path: "/ui/fonts/source-code-pro-latin-700.woff2",
|
||||
content: include_bytes!("../../ui/dist/fonts/source-code-pro-latin-700.woff2"),
|
||||
ctype: WOFF2,
|
||||
};
|
||||
static FONTS_SOURCE_CODE_900: StaticContent = StaticContent {
|
||||
web_path: "/ui/fonts/source-code-pro-latin-900.woff",
|
||||
content: include_bytes!("../../ui/dist/fonts/source-code-pro-latin-900.woff"),
|
||||
ctype: WOFF,
|
||||
};
|
||||
static FONTS_SOURCE_CODE_900_2: StaticContent = StaticContent {
|
||||
web_path: "/ui/fonts/source-code-pro-latin-900.woff2",
|
||||
content: include_bytes!("../../ui/dist/fonts/source-code-pro-latin-900.woff2"),
|
||||
ctype: WOFF2,
|
||||
};
|
||||
@@ -1,3 +0,0 @@
|
||||
> 1%
|
||||
last 2 versions
|
||||
not ie <= 8
|
||||
@@ -1,2 +0,0 @@
|
||||
VUE_APP_I18N_LOCALE=en
|
||||
VUE_APP_I18N_FALLBACK_LOCALE=en
|
||||
@@ -1,17 +0,0 @@
|
||||
module.exports = {
|
||||
root: true,
|
||||
env: {
|
||||
node: true
|
||||
},
|
||||
'extends': [
|
||||
'plugin:vue/essential',
|
||||
'eslint:recommended'
|
||||
],
|
||||
rules: {
|
||||
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
|
||||
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
|
||||
},
|
||||
parserOptions: {
|
||||
parser: 'babel-eslint'
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
.DS_Store
|
||||
node_modules
|
||||
/dist
|
||||
|
||||
/tests/e2e/videos/
|
||||
/tests/e2e/screenshots/
|
||||
|
||||
# local env files
|
||||
.env.local
|
||||
.env.*.local
|
||||
|
||||
# Log files
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# Editor directories and files
|
||||
.idea
|
||||
.vscode
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw*
|
||||
@@ -1,39 +0,0 @@
|
||||
# ui
|
||||
|
||||
## Project setup
|
||||
```
|
||||
yarn install
|
||||
```
|
||||
|
||||
### Compiles and hot-reloads for development
|
||||
```
|
||||
yarn run serve
|
||||
```
|
||||
|
||||
### Compiles and minifies for production
|
||||
```
|
||||
yarn run build
|
||||
```
|
||||
|
||||
### Run your tests
|
||||
```
|
||||
yarn run test
|
||||
```
|
||||
|
||||
### Lints and fixes files
|
||||
```
|
||||
yarn run lint
|
||||
```
|
||||
|
||||
### Run your end-to-end tests
|
||||
```
|
||||
yarn run test:e2e
|
||||
```
|
||||
|
||||
### Run your unit tests
|
||||
```
|
||||
yarn run test:unit
|
||||
```
|
||||
|
||||
### Customize configuration
|
||||
See [Configuration Reference](https://cli.vuejs.org/config/).
|
||||
@@ -1,5 +0,0 @@
|
||||
module.exports = {
|
||||
presets: [
|
||||
'@vue/app'
|
||||
]
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"pluginsFile": "tests/e2e/plugins/index.js"
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
{
|
||||
"name": "ui",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"serve": "vue-cli-service serve",
|
||||
"build": "vue-cli-service build",
|
||||
"lint": "vue-cli-service lint",
|
||||
"test:e2e": "vue-cli-service test:e2e",
|
||||
"test:unit": "vue-cli-service test:unit"
|
||||
},
|
||||
"dependencies": {
|
||||
"@fortawesome/fontawesome-svg-core": "^1.2.19",
|
||||
"@fortawesome/free-solid-svg-icons": "^5.9.0",
|
||||
"@fortawesome/vue-fontawesome": "^0.1.5",
|
||||
"axios": "^0.19.0",
|
||||
"element-ui": "^2.9.1",
|
||||
"typeface-lato": "^0.0.54",
|
||||
"typeface-source-code-pro": "^0.0.71",
|
||||
"vue": "^2.5.21",
|
||||
"vue-i18n": "^8.11.2",
|
||||
"vue-router": "^3.0.6",
|
||||
"vuex": "^3.1.1",
|
||||
"webpack": "^4.33.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/cli-plugin-babel": "^3.8.0",
|
||||
"@vue/cli-plugin-e2e-cypress": "^3.8.0",
|
||||
"@vue/cli-plugin-eslint": "^3.8.0",
|
||||
"@vue/cli-plugin-unit-mocha": "^3.8.0",
|
||||
"@vue/cli-service": "^3.8.0",
|
||||
"@vue/test-utils": "^1.0.0-beta.20",
|
||||
"babel-eslint": "^10.0.1",
|
||||
"chai": "^4.1.2",
|
||||
"eslint": "^5.8.0",
|
||||
"eslint-plugin-vue": "^5.0.0",
|
||||
"node-sass": "^4.12.0",
|
||||
"sass-loader": "^7.0.3",
|
||||
"vue-cli-plugin-element": "^1.0.1",
|
||||
"vue-cli-plugin-i18n": "^0.5.2",
|
||||
"vue-template-compiler": "^2.5.21"
|
||||
}
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
module.exports = {
|
||||
plugins: {
|
||||
autoprefixer: {}
|
||||
}
|
||||
}
|
||||
@@ -1,127 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>Oh no! Krill is lost.</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<style>
|
||||
.center {
|
||||
text-align: center;
|
||||
font-size: 70px;
|
||||
font-family: 'Courier New', Courier, monospace;
|
||||
}
|
||||
|
||||
.emoji {
|
||||
font-size: 120px;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
|
||||
@-webkit-keyframes tada {
|
||||
from {
|
||||
-webkit-transform: scale3d(1, 1, 1);
|
||||
transform: scale3d(1, 1, 1);
|
||||
}
|
||||
|
||||
10%,
|
||||
20% {
|
||||
-webkit-transform: scale3d(0.9, 0.9, 0.9) rotate3d(0, 0, 1, -3deg);
|
||||
transform: scale3d(0.9, 0.9, 0.9) rotate3d(0, 0, 1, -3deg);
|
||||
}
|
||||
|
||||
30%,
|
||||
50%,
|
||||
70%,
|
||||
90% {
|
||||
-webkit-transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg);
|
||||
transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg);
|
||||
}
|
||||
|
||||
40%,
|
||||
60%,
|
||||
80% {
|
||||
-webkit-transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg);
|
||||
transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg);
|
||||
}
|
||||
|
||||
to {
|
||||
-webkit-transform: scale3d(1, 1, 1);
|
||||
transform: scale3d(1, 1, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes tada {
|
||||
from {
|
||||
-webkit-transform: scale3d(1, 1, 1);
|
||||
transform: scale3d(1, 1, 1);
|
||||
}
|
||||
|
||||
10%,
|
||||
20% {
|
||||
-webkit-transform: scale3d(0.9, 0.9, 0.9) rotate3d(0, 0, 1, -3deg);
|
||||
transform: scale3d(0.9, 0.9, 0.9) rotate3d(0, 0, 1, -3deg);
|
||||
}
|
||||
|
||||
30%,
|
||||
50%,
|
||||
70%,
|
||||
90% {
|
||||
-webkit-transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg);
|
||||
transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg);
|
||||
}
|
||||
|
||||
40%,
|
||||
60%,
|
||||
80% {
|
||||
-webkit-transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg);
|
||||
transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg);
|
||||
}
|
||||
|
||||
to {
|
||||
-webkit-transform: scale3d(1, 1, 1);
|
||||
transform: scale3d(1, 1, 1);
|
||||
}
|
||||
}
|
||||
|
||||
.tada {
|
||||
-webkit-animation-name: tada;
|
||||
animation-name: tada;
|
||||
}
|
||||
|
||||
|
||||
.animated {
|
||||
-webkit-animation-duration: 1s;
|
||||
animation-duration: 1s;
|
||||
-webkit-animation-fill-mode: both;
|
||||
animation-fill-mode: both;
|
||||
}
|
||||
|
||||
.animated.infinite {
|
||||
-webkit-animation-iteration-count: infinite;
|
||||
animation-iteration-count: infinite;
|
||||
}
|
||||
|
||||
@media (print),
|
||||
(prefers-reduced-motion) {
|
||||
.animated {
|
||||
-webkit-animation: unset !important;
|
||||
animation: unset !important;
|
||||
-webkit-transition: none !important;
|
||||
transition: none !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<h1 class="center">
|
||||
<div class="emoji animated infinite tada">🍤</div>
|
||||
Page not found.
|
||||
</h1>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 15 KiB |
@@ -1,17 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
||||
<title>Krill UI</title>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>
|
||||
<strong>We're sorry but ui doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
|
||||
</noscript>
|
||||
<div id="app"></div>
|
||||
<!-- built files will be auto injected -->
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,126 +0,0 @@
|
||||
<template>
|
||||
<div id="app">
|
||||
<el-container>
|
||||
<el-header>
|
||||
<el-row>
|
||||
<el-col :span="4">
|
||||
<router-link :to="{ name: 'home'}">
|
||||
<div class="logo">
|
||||
<img src="@/assets/images/krill_logo_white.svg">
|
||||
</div>
|
||||
</router-link>
|
||||
</el-col>
|
||||
<el-col :span="14">
|
||||
<el-menu
|
||||
v-if="user"
|
||||
:router="true"
|
||||
:default-active="activeIndex"
|
||||
mode="horizontal"
|
||||
background-color="#f63107"
|
||||
text-color="#fff"
|
||||
active-text-color="#fff">
|
||||
<el-menu-item index="1" :route="{ name: 'publishers'}">
|
||||
{{ $t("publishers.publishers") }}
|
||||
</el-menu-item>
|
||||
<el-menu-item index="2" :route="{ name: 'trustanchor'}">
|
||||
{{ $t("trustanchor.ta") }}
|
||||
</el-menu-item>
|
||||
</el-menu>
|
||||
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<div class="toolbar">
|
||||
<el-select v-model="$i18n.locale" placeholder="Language" size="small">
|
||||
<el-option v-for="lang in langs" :key="lang.iso" :value="lang.iso" :label="lang.label"></el-option>
|
||||
</el-select>
|
||||
<font-awesome-icon icon="sign-out-alt" v-if="user" class="logout" @click="logout"/>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-header>
|
||||
|
||||
<el-main>
|
||||
<router-view v-on:authEvent="loadUser"/>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
|
||||
<style>
|
||||
html,
|
||||
body {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
font-family: "Lato", sans-serif;
|
||||
background-color: #fff;
|
||||
}
|
||||
.el-header {
|
||||
background: linear-gradient(45deg, #f63107, #f63107);
|
||||
line-height: 60px;
|
||||
color: #ffffff;
|
||||
z-index: 3;
|
||||
}
|
||||
.el-menu-item a {
|
||||
text-decoration: none;
|
||||
}
|
||||
.logo {
|
||||
line-height: 10px;
|
||||
}
|
||||
.logo img {
|
||||
width: 146px;
|
||||
margin-left: -14px;
|
||||
}
|
||||
.logout {
|
||||
margin-left: 2rem;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.toolbar {
|
||||
text-align: right;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
import router from "@/router";
|
||||
import APIService from "@/services/APIService.js";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
user: null,
|
||||
langs: [
|
||||
{iso: "it", label: "Italiano"},
|
||||
{iso: "en", label: "English"}
|
||||
],
|
||||
activeIndex: null
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
$route (to, from) {
|
||||
this.activeIndex = this.getActiveIndex(to.name);
|
||||
}
|
||||
},
|
||||
mounted: function(){
|
||||
this.activeIndex = this.getActiveIndex(this.$route.name);
|
||||
},
|
||||
created() {
|
||||
this.loadUser();
|
||||
},
|
||||
methods: {
|
||||
getActiveIndex(path) {
|
||||
return ''+ (['publishers', 'trustanchor'].indexOf(path) + 1);
|
||||
},
|
||||
loadUser() {
|
||||
this.user = JSON.parse(localStorage.getItem("user"));
|
||||
},
|
||||
logout() {
|
||||
return APIService.logout().then(() => {
|
||||
this.user = null;
|
||||
router.push("/login");
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
File diff suppressed because it is too large
Load Diff
|
Before Width: | Height: | Size: 769 KiB |
@@ -1,14 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="689px" height="565px" viewBox="0 0 689 565" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 54.1 (76490) - https://sketchapp.com -->
|
||||
<title>Group</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="Group" transform="translate(344.500000, 284.000000) scale(1, -1) rotate(-90.000000) translate(-344.500000, -284.000000) translate(71.000000, -53.000000)" stroke="#F9EADD" stroke-width="20.953">
|
||||
<path d="M369,674 L26.3679636,330.88605 C-8.78932121,295.679316 -8.78932121,238.597974 26.3679636,203.391241 L229.4729,0" id="Stroke-396"></path>
|
||||
<path d="M426,674 L83.3679636,330.88605 C48.2106788,295.679316 48.2106788,238.597974 83.3679636,203.391241 L286.4729,0" id="Stroke-396"></path>
|
||||
<path d="M490,674 L147.367964,330.88605 C112.210679,295.679316 112.210679,238.597974 147.367964,203.391241 L350.4729,0" id="Stroke-396"></path>
|
||||
<path d="M547,674 L204.367964,330.88605 C169.210679,295.679316 169.210679,238.597974 204.367964,203.391241 L407.4729,0" id="Stroke-396"></path>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.2 KiB |
@@ -1,14 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="566px" height="690px" viewBox="0 0 566 690" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 54.1 (76490) - https://sketchapp.com -->
|
||||
<title>Group</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="Group" transform="translate(11.000000, 8.000000)" stroke="#F9EADD" stroke-width="20.953">
|
||||
<path d="M369,674 L26.3679636,330.88605 C-8.78932121,295.679316 -8.78932121,238.597974 26.3679636,203.391241 L229.4729,0" id="Stroke-396"></path>
|
||||
<path d="M426,674 L83.3679636,330.88605 C48.2106788,295.679316 48.2106788,238.597974 83.3679636,203.391241 L286.4729,0" id="Stroke-396"></path>
|
||||
<path d="M490,674 L147.367964,330.88605 C112.210679,295.679316 112.210679,238.597974 147.367964,203.391241 L350.4729,0" id="Stroke-396"></path>
|
||||
<path d="M547,674 L204.367964,330.88605 C169.210679,295.679316 169.210679,238.597974 204.367964,203.391241 L407.4729,0" id="Stroke-396"></path>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.1 KiB |
@@ -1,12 +0,0 @@
|
||||
export function authHeader() {
|
||||
let user = JSON.parse(localStorage.getItem('user'));
|
||||
let headers = {
|
||||
'Accept': 'application/json',
|
||||
'Content-Type': 'application/json',
|
||||
'Authorization': 'Bearer secret'
|
||||
}
|
||||
if (user && user.authdata) {
|
||||
headers.Authorization = 'Bearer ' + window.atob(user.authdata);
|
||||
}
|
||||
return headers;
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
/*
|
||||
Write your variables here. All available variables can be
|
||||
found in element-ui/packages/theme-chalk/src/common/var.scss.
|
||||
For example, to overwrite the theme color:
|
||||
*/
|
||||
$--color-primary: #F63107;
|
||||
|
||||
/* icon font path, required */
|
||||
$--font-path: '~element-ui/lib/theme-chalk/fonts';
|
||||
|
||||
@import "~element-ui/packages/theme-chalk/src/index";
|
||||
@@ -1,23 +0,0 @@
|
||||
import Vue from 'vue'
|
||||
import VueI18n from 'vue-i18n'
|
||||
|
||||
Vue.use(VueI18n)
|
||||
|
||||
function loadLocaleMessages () {
|
||||
const locales = require.context('./locales', true, /[A-Za-z0-9-_,\s]+\.json$/i)
|
||||
const messages = {}
|
||||
locales.keys().forEach(key => {
|
||||
const matched = key.match(/([A-Za-z0-9-_]+)\./i)
|
||||
if (matched && matched.length > 1) {
|
||||
const locale = matched[1]
|
||||
messages[locale] = locales(key)
|
||||
}
|
||||
})
|
||||
return messages
|
||||
}
|
||||
|
||||
export default new VueI18n({
|
||||
locale: process.env.VUE_APP_I18N_LOCALE || 'en',
|
||||
fallbackLocale: process.env.VUE_APP_I18N_FALLBACK_LOCALE || 'en',
|
||||
messages: loadLocaleMessages()
|
||||
})
|
||||
@@ -1,45 +0,0 @@
|
||||
{
|
||||
"errors": {
|
||||
"2003": "Insert a customized error message here."
|
||||
},
|
||||
"login": {
|
||||
"password": "Password",
|
||||
"placeholder": "Your password",
|
||||
"signin": "Sign In",
|
||||
"required": "Please insert your password"
|
||||
},
|
||||
"publishers": {
|
||||
"loading": "Loading Publishers",
|
||||
"publishers": "Publishers",
|
||||
"search": "Search publishers...",
|
||||
"add": "Add Publisher",
|
||||
"retire": "Retire Publisher"
|
||||
},
|
||||
"publisherDetails": {
|
||||
"loading": "Loading {handle}",
|
||||
"notretired": "Active",
|
||||
"confirm": {
|
||||
"title": "Warning",
|
||||
"message": "This will deactivate the publisher. Continue?",
|
||||
"retired": " deactivated.",
|
||||
"success": "The publisher has been deactivated successfully."
|
||||
},
|
||||
"nopublisherdata": "No published data found."
|
||||
},
|
||||
"trustanchor": {
|
||||
"ta": "Trust Anchor",
|
||||
"absent": "There is no embedded Trust Anchor configured",
|
||||
"sure" : "Are you sure? You typically only need this in test and development situations.",
|
||||
"present": "Embedded Trust Anchor Details",
|
||||
"downloadTal": "Download TAL file",
|
||||
"add": "Initialise Trust Anchor",
|
||||
"publish": "Publish Trust Anchor"
|
||||
},
|
||||
"form": {
|
||||
"required": "This field is required",
|
||||
"rsync_uri_format": "Rsync URI must have a format of: rsync://host/module/<path>",
|
||||
"rrdp_uri_format": "RRDP notify URI must have a format of: https://host/<path>",
|
||||
"confirm": "Confirm",
|
||||
"cancel": "Cancel"
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
{
|
||||
"errors": {
|
||||
"2003": "Inserire un messaggio di errore qui."
|
||||
},
|
||||
"login": {
|
||||
"password": "Password",
|
||||
"placeholder": "La tua password",
|
||||
"signin": "Login",
|
||||
"required": "Inserire la propria password"
|
||||
},
|
||||
"publishers": {
|
||||
"loading": "Caricamento dei Publishers",
|
||||
"publishers": "Publishers",
|
||||
"search": "Cerca publishers...",
|
||||
"add": "Aggiungi Publisher",
|
||||
"retire": "Disattiva Publisher",
|
||||
"cancel": "Annulla",
|
||||
"confirm": "Conferma",
|
||||
"required": "Campo obbligatorio",
|
||||
"uriFormat": "Valore errato per il campo. Dovrebbe essere rsync://HOST/folder/"
|
||||
},
|
||||
"publisherDetails": {
|
||||
"loading": "Caricamento di {handle}",
|
||||
"notretired": "Attivo",
|
||||
"confirm": {
|
||||
"title": "Attenzione",
|
||||
"message": "Disattivare un publisher non e' revocabile. Continuare?",
|
||||
"ok": "OK",
|
||||
"cancel": "Annulla",
|
||||
"retired": " disattivato.",
|
||||
"success": "Il publisher e' stato disattivato correttamente."
|
||||
},
|
||||
"nopublisherdata": "Nessun dato trovato."
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
import Vue from 'vue'
|
||||
import App from './App.vue'
|
||||
import router from './router'
|
||||
import store from './store'
|
||||
import './plugins/element.js'
|
||||
import i18n from './i18n'
|
||||
import { library } from '@fortawesome/fontawesome-svg-core'
|
||||
import { faSignOutAlt } from '@fortawesome/free-solid-svg-icons'
|
||||
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
|
||||
import (/* webpackPreload: true */ 'typeface-lato/index.css')
|
||||
import (/* webpackPreload: true */ 'typeface-source-code-pro/index.css')
|
||||
|
||||
|
||||
library.add({
|
||||
faSignOutAlt
|
||||
})
|
||||
Vue.component('font-awesome-icon', FontAwesomeIcon)
|
||||
|
||||
Vue.config.productionTip = false
|
||||
|
||||
new Vue({
|
||||
router,
|
||||
store,
|
||||
i18n,
|
||||
render: h => h(App)
|
||||
}).$mount('#app')
|
||||
@@ -1,6 +0,0 @@
|
||||
import Vue from 'vue'
|
||||
import Element from 'element-ui'
|
||||
import '../element-variables.scss'
|
||||
import locale from 'element-ui/lib/locale/lang/en'
|
||||
|
||||
Vue.use(Element, { locale })
|
||||
@@ -1,64 +0,0 @@
|
||||
import Vue from 'vue'
|
||||
import Router from 'vue-router'
|
||||
|
||||
import Login from './views/Login.vue'
|
||||
import Publishers from './views/Publishers.vue'
|
||||
import PublisherDetails from './views/PublisherDetails.vue'
|
||||
import TrustAnchor from './views/TrustAnchor'
|
||||
import APIService from "./services/APIService.js";
|
||||
|
||||
Vue.use(Router)
|
||||
|
||||
const router = new Router({
|
||||
routes: [
|
||||
{
|
||||
path: '/',
|
||||
name: 'home',
|
||||
redirect: { name: 'publishers' }
|
||||
},
|
||||
{
|
||||
path: '/publishers',
|
||||
name: 'publishers',
|
||||
component: Publishers
|
||||
},
|
||||
{
|
||||
path: '/ta',
|
||||
name: 'trustanchor',
|
||||
component: TrustAnchor
|
||||
},
|
||||
{
|
||||
path: '/login',
|
||||
name: 'login',
|
||||
component: Login
|
||||
},
|
||||
{
|
||||
path: '/publishers/:handle',
|
||||
name: 'publisherDetails',
|
||||
component: PublisherDetails
|
||||
},
|
||||
]
|
||||
});
|
||||
|
||||
router.beforeEach((to, from, next) => {
|
||||
const publicPages = ['/login'];
|
||||
const authRequired = !publicPages.includes(to.path);
|
||||
const loggedInOnFrontend = localStorage.getItem('user');
|
||||
|
||||
if (authRequired) {
|
||||
APIService.isLoggedIn().then(loggedInOnBackend => {
|
||||
if (!loggedInOnFrontend || !loggedInOnBackend) {
|
||||
return next({
|
||||
path: '/login',
|
||||
query: {
|
||||
returnUrl: to.path
|
||||
}
|
||||
});
|
||||
}
|
||||
next();
|
||||
});
|
||||
} else {
|
||||
next();
|
||||
}
|
||||
});
|
||||
|
||||
export default router;
|
||||
@@ -1,78 +0,0 @@
|
||||
import axios from 'axios';
|
||||
import {
|
||||
authHeader
|
||||
} from '../auth-header'
|
||||
|
||||
const apiClient = axios.create({
|
||||
withCredentials: false,
|
||||
headers: authHeader()
|
||||
})
|
||||
|
||||
export default {
|
||||
isLoggedIn() {
|
||||
return apiClient.get('/ui/is_logged_in').then(() => true).catch(() => false);
|
||||
},
|
||||
login(token) {
|
||||
return apiClient.post('/ui/login', {
|
||||
token: token
|
||||
}).then(response => {
|
||||
if (response.status === 200) {
|
||||
let user = {
|
||||
authdata: window.btoa(token)
|
||||
}
|
||||
localStorage.setItem('user', JSON.stringify(user));
|
||||
}
|
||||
return response;
|
||||
});
|
||||
|
||||
},
|
||||
logout() {
|
||||
localStorage.removeItem('user');
|
||||
return apiClient.post('/ui/logout');
|
||||
},
|
||||
getPublishers() {
|
||||
return apiClient.get('/api/v1/publishers')
|
||||
},
|
||||
getPublisher(handle) {
|
||||
return apiClient.get('/api/v1/publishers/' + handle);
|
||||
},
|
||||
getPublisherData(handle) {
|
||||
return apiClient.get('/publication/' + handle);
|
||||
},
|
||||
retirePublisher(handle) {
|
||||
return apiClient.delete('/api/v1/publishers/' + handle);
|
||||
},
|
||||
getEndpoint(uri) {
|
||||
return apiClient.get(uri);
|
||||
},
|
||||
addPublisher(handle, uri, token) {
|
||||
return apiClient.post('/api/v1/publishers', {
|
||||
handle: handle,
|
||||
base_uri: uri,
|
||||
token: token
|
||||
}).catch((error) => {
|
||||
if (error.response && error.response.data) {
|
||||
return Promise.reject({
|
||||
data: error.response.data
|
||||
});
|
||||
}
|
||||
return Promise.reject({
|
||||
data: {
|
||||
code: -1
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
|
||||
getTrustAnchor() {
|
||||
return apiClient.get('/api/v1/trustanchor');
|
||||
},
|
||||
|
||||
initTrustAnchor() {
|
||||
return apiClient.post('/api/v1/trustanchor')
|
||||
},
|
||||
|
||||
publishTrustAnchor() {
|
||||
return apiClient.post('/api/v1/publish/ta')
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
import Vue from 'vue'
|
||||
import Vuex from 'vuex'
|
||||
|
||||
Vue.use(Vuex)
|
||||
|
||||
export default new Vuex.Store({
|
||||
state: {
|
||||
|
||||
},
|
||||
mutations: {
|
||||
|
||||
},
|
||||
actions: {
|
||||
|
||||
}
|
||||
})
|
||||
@@ -1,119 +0,0 @@
|
||||
<template>
|
||||
<div class="login">
|
||||
<el-row type="flex" justify="center">
|
||||
<el-col :span="10">
|
||||
<el-card class="box-card">
|
||||
<div class="text item">
|
||||
<el-form :model="form" :inline="true" ref="loginForm">
|
||||
<el-form-item
|
||||
:label="$t('login.password')"
|
||||
prop="token"
|
||||
:rules="[{ required: true, message: $t('login.required')}]"
|
||||
>
|
||||
<el-input
|
||||
type="password"
|
||||
:placeholder="$t('login.placeholder')"
|
||||
v-model="form.token"
|
||||
clearable
|
||||
@keyup.enter.native="submitForm"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="submitForm">{{ $t("login.signin") }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row type="flex" class="alert-row" justify="center">
|
||||
<el-col :span="10">
|
||||
<el-alert type="error" v-if="error" :closable="false">{{error}}</el-alert>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="route-left">
|
||||
<img src="@/assets/images/route_left.svg">
|
||||
</div>
|
||||
<div class="route-right">
|
||||
<img src="@/assets/images/route_right.svg">
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import router from "../router";
|
||||
import APIService from "@/services/APIService.js";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
token: ""
|
||||
},
|
||||
submitted: false,
|
||||
loading: false,
|
||||
returnUrl: "",
|
||||
error: ""
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.returnUrl = this.$route.query.returnUrl || "/";
|
||||
},
|
||||
methods: {
|
||||
login() {
|
||||
this.submitted = true;
|
||||
|
||||
const self = this;
|
||||
this.loading = true;
|
||||
APIService.login(this.form.token)
|
||||
.then(() => {
|
||||
this.$emit("authEvent");
|
||||
router.push(this.returnUrl);
|
||||
})
|
||||
.catch(function(error) {
|
||||
self.error = error;
|
||||
self.loading = false;
|
||||
});
|
||||
},
|
||||
submitForm() {
|
||||
this.$refs["loginForm"].validate(valid => {
|
||||
if (valid) {
|
||||
this.login();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.login {
|
||||
margin-top: 40px;
|
||||
}
|
||||
.box-card {
|
||||
.el-form {
|
||||
padding: 2rem;
|
||||
text-align: center;
|
||||
.el-form-item {
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
.alert-row {
|
||||
margin-top: 1rem;
|
||||
}
|
||||
.route-left {
|
||||
position: fixed;
|
||||
left: -100px;
|
||||
bottom: -280px;
|
||||
z-index: 2;
|
||||
}
|
||||
.route-right {
|
||||
position: fixed;
|
||||
right: -196px;
|
||||
top: 40px;
|
||||
z-index: 2;
|
||||
}
|
||||
</style>
|
||||
@@ -1,135 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="box-card" v-if="publisher.handle">
|
||||
<div slot="header" class="clearfix">
|
||||
<el-breadcrumb separator-class="el-icon-arrow-right">
|
||||
<el-breadcrumb-item :to="{ path: '/' }">{{ $t("publishers.publishers") }}</el-breadcrumb-item>
|
||||
<el-breadcrumb-item>{{ handle }}</el-breadcrumb-item>
|
||||
</el-breadcrumb>
|
||||
<div class="retire" v-if="!loading && publisher && !publisher.deactivated">
|
||||
<el-form :inline="true">
|
||||
<el-form-item>
|
||||
<el-button
|
||||
class="retire"
|
||||
icon="el-icon-delete"
|
||||
type="primary"
|
||||
round
|
||||
size="mini"
|
||||
@click="confirmRetirePublisher"
|
||||
>{{ $t("publishers.retire") }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text item">
|
||||
<span v-if="loading">
|
||||
<i class="el-icon-loading"></i>
|
||||
<span v-t="{ path: 'publisherDetails.loading', args: { handle: handle } }"></span>
|
||||
</span>
|
||||
<el-table v-if="!loading && publisher" :data="[publisher]" style="width: 100%">
|
||||
<el-table-column prop="base_uri" label="Base URI"></el-table-column>
|
||||
<el-table-column :label="$t('publisherDetails.notretired')" width="150" align="center">
|
||||
<template slot-scope="scope">
|
||||
<strong>
|
||||
<i class="el-icon-check" v-if="![publisher][scope.$index].deactivated"></i>
|
||||
<i class="el-icon-close" v-if="[publisher][scope.$index].deactivated"></i>
|
||||
</strong>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<div class="publisher-data">Publisher Data <i class="el-icon-loading" v-if="loadingPublisherData"></i></div>
|
||||
|
||||
<el-table v-if="!loadingPublisherData && publisherData.elements" :data="publisherData.elements" style="width: 100%">
|
||||
<el-table-column prop="uri" label="URI"></el-table-column>
|
||||
<el-table-column prop="hash" label="Hash"></el-table-column>
|
||||
</el-table>
|
||||
|
||||
<div
|
||||
v-if="!loadingPublisherData && publisherData.elements == null"
|
||||
>{{ $t("publisherDetails.nopublisherdata") }}</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import router from "@/router";
|
||||
import APIService from "@/services/APIService.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
handle: this.$route.params.handle,
|
||||
loading: false,
|
||||
loadingPublisherData: false,
|
||||
publisher: {},
|
||||
publisherData: {}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.loading = true;
|
||||
this.loadingPublisherData = true;
|
||||
APIService.getPublisher(this.handle).then(response => {
|
||||
this.loading = false;
|
||||
this.publisher = response.data;
|
||||
});
|
||||
APIService.getPublisherData(this.handle).then(response => {
|
||||
this.loadingPublisherData = false;
|
||||
this.publisherData = response.data;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
confirmRetirePublisher() {
|
||||
this.$confirm(
|
||||
this.$t("publisherDetails.confirm.message"),
|
||||
this.$t("publisherDetails.confirm.title"),
|
||||
{
|
||||
confirmButtonText: this.$t("publisherDetails.confirm.ok"),
|
||||
cancelButtonText: this.$t("publisherDetails.confirm.cancel")
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
APIService.retirePublisher(this.handle).then(() => {
|
||||
this.$notify({
|
||||
title: this.handle + this.$t("publisherDetails.confirm.retired"),
|
||||
message: this.$t("publisherDetails.confirm.success"),
|
||||
type: "success"
|
||||
});
|
||||
router.push("/");
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
getFile(uri) {
|
||||
APIService.getEndpoint(uri).then(response => {
|
||||
console.log("got file", uri);
|
||||
console.log(response.data);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
a {
|
||||
color: #F63107;
|
||||
&:hover {
|
||||
color: #f85a39;
|
||||
}
|
||||
}
|
||||
.box-card {
|
||||
margin: 2rem;
|
||||
}
|
||||
.retire {
|
||||
float: right;
|
||||
margin-top: -10px;
|
||||
}
|
||||
|
||||
.publisher-data {
|
||||
font-size: 14px;
|
||||
margin-top: 3rem;
|
||||
margin-bottom: 1rem;
|
||||
padding-bottom: 1rem;
|
||||
border-bottom: 1px solid #F9EADD;
|
||||
}
|
||||
</style>
|
||||
@@ -1,202 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<el-breadcrumb separator-class="el-icon-arrow-right">
|
||||
<el-breadcrumb-item :to="{ path: '/' }">{{ $t("publishers.publishers") }}</el-breadcrumb-item>
|
||||
</el-breadcrumb>
|
||||
<div class="search-input" v-if="!loading">
|
||||
<el-form :inline="true">
|
||||
<el-form-item>
|
||||
<el-input
|
||||
size="mini"
|
||||
:placeholder="$t('publishers.search')"
|
||||
prefix-icon="el-icon-search"
|
||||
v-model="search"
|
||||
clearable
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button
|
||||
class="retire"
|
||||
icon="el-icon-plus"
|
||||
type="primary"
|
||||
round
|
||||
size="mini"
|
||||
@click="dialogFormVisible = true"
|
||||
>{{ $t("publishers.add") }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text item">
|
||||
<span v-if="loading">
|
||||
<i class="el-icon-loading"></i>
|
||||
{{ $t("publishers.loading") }}
|
||||
</span>
|
||||
<el-table
|
||||
v-if="filteredPublishers"
|
||||
:data="filteredPublishers"
|
||||
@row-click="loadPublisher"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column label="Handle" v-if="!loading">
|
||||
<template slot-scope="scope">
|
||||
<router-link
|
||||
:to="{ name: 'publisherDetails', params: { handle: filteredPublishers[scope.$index].id }}"
|
||||
>
|
||||
<el-button type="text">{{ filteredPublishers[scope.$index].id }}</el-button>
|
||||
</router-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-dialog :title="$t('publishers.add')" :visible.sync="dialogFormVisible" :close-on-click-modal="false">
|
||||
<el-form :model="form" :rules="rules" ref="addPublisherForm">
|
||||
<el-form-item label="Handle" prop="handle">
|
||||
<el-input v-model="form.handle" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="URI" placeholder="rsync://HOST/folder/" prop="uri">
|
||||
<el-input v-model="form.uri" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="Token" prop="token">
|
||||
<el-input v-model="form.token" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-alert type="error" v-if="error" :closable="false">{{error}}</el-alert>
|
||||
<el-row type="flex" class="modal-footer" justify="end">
|
||||
<el-form-item>
|
||||
<el-button @click="resetForm('addPublisherForm')">{{ $t('form.cancel') }}</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="submitForm('addPublisherForm')"
|
||||
>{{ $t('form.confirm') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import router from "@/router";
|
||||
import APIService from "@/services/APIService.js";
|
||||
export default {
|
||||
data() {
|
||||
|
||||
var check_rsync_uri = (rule, value, callback) => {
|
||||
if (value === "") {
|
||||
callback(new Error(this.$t("form.required")));
|
||||
} else {
|
||||
if (new RegExp(/rsync:\/\/[^\s]+\/[^\s]+\//gm).test(value)) {
|
||||
callback();
|
||||
} else {
|
||||
callback(new Error(this.$t("form.rsync_uri_format")));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
return {
|
||||
loading: false,
|
||||
publishers: [],
|
||||
search: "",
|
||||
dialogFormVisible: false,
|
||||
error: "",
|
||||
form: {
|
||||
handle: "",
|
||||
token: "",
|
||||
uri: ""
|
||||
},
|
||||
rules: {
|
||||
handle: [{ required: true, message: this.$t("form.required") }],
|
||||
uri: [{ validator: check_rsync_uri, required: true }],
|
||||
token: [{ required: true, message: this.$t("form.required") }]
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
filteredPublishers: function() {
|
||||
let src = this.search;
|
||||
return this.publishers.filter(function(publisher) {
|
||||
return publisher.id.toLowerCase().indexOf(src) > -1;
|
||||
});
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.loading = true;
|
||||
this.loadPublishers();
|
||||
},
|
||||
methods: {
|
||||
sortPublishers: function(publishers) {
|
||||
return [...publishers].sort(function(a, b) {
|
||||
const handleA = a.id.toLowerCase();
|
||||
const handleB = b.id.toLowerCase();
|
||||
|
||||
if (handleA > handleB) {
|
||||
return 1;
|
||||
} else if (handleA < handleB) {
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
},
|
||||
loadPublishers: function() {
|
||||
APIService.getPublishers().then(response => {
|
||||
this.loading = false;
|
||||
this.publishers = response.data.publishers;
|
||||
});
|
||||
},
|
||||
loadPublisher: function(row) {
|
||||
router.push("/publishers/" + row.id);
|
||||
},
|
||||
addPublisher: function() {
|
||||
const self = this;
|
||||
APIService.addPublisher(this.form.handle, this.form.uri, this.form.token)
|
||||
.then(() => {
|
||||
this.dialogFormVisible = false;
|
||||
this.loadPublishers();
|
||||
})
|
||||
.catch(function(error) {
|
||||
let e = self.$t('errors.' + error.data.code);
|
||||
if (e === 'errors.' + error.data.code) {
|
||||
e = error.data.msg;
|
||||
}
|
||||
self.error = e;
|
||||
});
|
||||
},
|
||||
submitForm(formName) {
|
||||
this.$refs[formName].validate(valid => {
|
||||
if (valid) {
|
||||
this.addPublisher();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
resetForm(formName) {
|
||||
this.error = '';
|
||||
this.dialogFormVisible = false;
|
||||
this.$refs[formName].resetFields();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.box-card {
|
||||
margin: 2rem;
|
||||
}
|
||||
.search-input {
|
||||
float: right;
|
||||
margin-top: -27px;
|
||||
}
|
||||
.modal-footer {
|
||||
margin-top: 30px;
|
||||
.el-form-item {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,142 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<el-breadcrumb separator-class="el-icon-arrow-right">
|
||||
<el-breadcrumb-item :to="{ path: '/' }">{{ $t("trustanchor.ta") }}</el-breadcrumb-item>
|
||||
</el-breadcrumb>
|
||||
</div>
|
||||
<div class="text item">
|
||||
<div v-if="hasTa">
|
||||
<div class="message">{{ $t("trustanchor.present") }}</div>
|
||||
<el-table :data="[taData]" style="width: 100%">
|
||||
<el-table-column prop="resources.asn.Blocks" label="ASNs"></el-table-column>
|
||||
<el-table-column prop="resources.v4" label="IPv4"></el-table-column>
|
||||
<el-table-column prop="resources.v6" label="IPv6"></el-table-column>
|
||||
<el-table-column prop="repo_info.base_uri" label="Base URI"></el-table-column>
|
||||
<el-table-column prop="repo_info.rpki_notify" label="RPKI notify"></el-table-column>
|
||||
</el-table>
|
||||
|
||||
<el-form :inline="true" class="download-anchor">
|
||||
<el-form-item>
|
||||
<a href="/ta/ta.tal">{{ $t("trustanchor.downloadTal")}}</a>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button
|
||||
icon="el-icon-upload"
|
||||
type="primary"
|
||||
round
|
||||
size="mini"
|
||||
@click="publishTrustAnchor()"
|
||||
>{{ $t("trustanchor.publish") }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div v-else>
|
||||
<div class="message">{{ $t("trustanchor.absent") }}</div>
|
||||
<el-form :inline="true">
|
||||
<el-form-item>
|
||||
<el-button
|
||||
icon="el-icon-plus"
|
||||
type="primary"
|
||||
round
|
||||
size="mini"
|
||||
@click="dialogFormVisible = true"
|
||||
>{{ $t("trustanchor.add") }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-dialog
|
||||
:title="$t('trustanchor.add')"
|
||||
:visible.sync="dialogFormVisible"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
{{ $t("trustanchor.sure") }}
|
||||
<div style="height: 20px"></div>
|
||||
|
||||
<el-form :inline="true">
|
||||
<el-row type="flex" class="modal-footer" justify="end">
|
||||
<el-form-item>
|
||||
<el-button @click="hideInitForm()">
|
||||
{{ $t('form.cancel')
|
||||
}}
|
||||
</el-button>
|
||||
<el-button type="primary" @click="initTrustAnchor()">{{ $t('form.confirm') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import APIService from "@/services/APIService.js";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
hasTa: null,
|
||||
dialogFormVisible: false,
|
||||
taData: {}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.loadTa();
|
||||
},
|
||||
methods: {
|
||||
loadTa: function() {
|
||||
const self = this;
|
||||
APIService.getTrustAnchor()
|
||||
.then(response => {
|
||||
self.hasTa = true;
|
||||
self.taData = response.data;
|
||||
response.toString();
|
||||
})
|
||||
.catch(() => {
|
||||
self.hasTa = false;
|
||||
});
|
||||
},
|
||||
|
||||
hideInitForm: function() {
|
||||
this.dialogFormVisible = false;
|
||||
},
|
||||
|
||||
initTrustAnchor: function() {
|
||||
APIService.initTrustAnchor();
|
||||
this.loadTa();
|
||||
this.dialogFormVisible = false;
|
||||
},
|
||||
|
||||
publishTrustAnchor: function() {
|
||||
APIService.publishTrustAnchor();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
a {
|
||||
color: #f63107;
|
||||
font-size: 14px;
|
||||
text-decoration: none;
|
||||
&:hover {
|
||||
color: #f85a39;
|
||||
}
|
||||
}
|
||||
.box-card {
|
||||
margin: 2rem;
|
||||
}
|
||||
.message {
|
||||
font-size: 14px;
|
||||
margin-top: 1rem;
|
||||
margin-bottom: 1rem;
|
||||
padding-bottom: 1rem;
|
||||
border-bottom: 1px solid #f9eadd;
|
||||
}
|
||||
.download-anchor {
|
||||
margin-top: 2rem;
|
||||
}
|
||||
</style>
|
||||
@@ -1,12 +0,0 @@
|
||||
module.exports = {
|
||||
plugins: [
|
||||
'cypress'
|
||||
],
|
||||
env: {
|
||||
mocha: true,
|
||||
'cypress/globals': true
|
||||
},
|
||||
rules: {
|
||||
strict: 'off'
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
// https://docs.cypress.io/guides/guides/plugins-guide.html
|
||||
|
||||
// if you need a custom webpack configuration you can uncomment the following import
|
||||
// and then use the `file:preprocessor` event
|
||||
// as explained in the cypress docs
|
||||
// https://docs.cypress.io/api/plugins/preprocessors-api.html#Examples
|
||||
|
||||
/* eslint-disable import/no-extraneous-dependencies, global-require, arrow-body-style */
|
||||
// const webpack = require('@cypress/webpack-preprocessor')
|
||||
|
||||
module.exports = (on, config) => {
|
||||
// on('file:preprocessor', webpack({
|
||||
// webpackOptions: require('@vue/cli-service/webpack.config'),
|
||||
// watchOptions: {}
|
||||
// }))
|
||||
|
||||
return Object.assign({}, config, {
|
||||
fixturesFolder: 'tests/e2e/fixtures',
|
||||
integrationFolder: 'tests/e2e/specs',
|
||||
screenshotsFolder: 'tests/e2e/screenshots',
|
||||
videosFolder: 'tests/e2e/videos',
|
||||
supportFile: 'tests/e2e/support/index.js'
|
||||
})
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
// https://docs.cypress.io/api/introduction/api.html
|
||||
|
||||
describe('My First Test', () => {
|
||||
it('Visits the app root url', () => {
|
||||
cy.visit('/')
|
||||
cy.contains('h1', 'Welcome to Your Vue.js App')
|
||||
})
|
||||
})
|
||||
@@ -1,25 +0,0 @@
|
||||
// ***********************************************
|
||||
// This example commands.js shows you how to
|
||||
// create various custom commands and overwrite
|
||||
// existing commands.
|
||||
//
|
||||
// For more comprehensive examples of custom
|
||||
// commands please read more here:
|
||||
// https://on.cypress.io/custom-commands
|
||||
// ***********************************************
|
||||
//
|
||||
//
|
||||
// -- This is a parent command --
|
||||
// Cypress.Commands.add("login", (email, password) => { ... })
|
||||
//
|
||||
//
|
||||
// -- This is a child command --
|
||||
// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
|
||||
//
|
||||
//
|
||||
// -- This is a dual command --
|
||||
// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
|
||||
//
|
||||
//
|
||||
// -- This is will overwrite an existing command --
|
||||
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
|
||||
@@ -1,20 +0,0 @@
|
||||
// ***********************************************************
|
||||
// This example support/index.js is processed and
|
||||
// loaded automatically before your test files.
|
||||
//
|
||||
// This is a great place to put global configuration and
|
||||
// behavior that modifies Cypress.
|
||||
//
|
||||
// You can change the location of this file or turn off
|
||||
// automatically serving support files with the
|
||||
// 'supportFile' configuration option.
|
||||
//
|
||||
// You can read more here:
|
||||
// https://on.cypress.io/configuration
|
||||
// ***********************************************************
|
||||
|
||||
// Import commands.js using ES2015 syntax:
|
||||
import './commands'
|
||||
|
||||
// Alternatively you can use CommonJS syntax:
|
||||
// require('./commands')
|
||||
@@ -1,5 +0,0 @@
|
||||
module.exports = {
|
||||
env: {
|
||||
mocha: true
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
import { expect } from 'chai'
|
||||
import { shallowMount } from '@vue/test-utils'
|
||||
import HelloWorld from '@/components/HelloWorld.vue'
|
||||
|
||||
describe('HelloWorld.vue', () => {
|
||||
it('renders props.msg when passed', () => {
|
||||
const msg = 'new message'
|
||||
const wrapper = shallowMount(HelloWorld, {
|
||||
propsData: { msg }
|
||||
})
|
||||
expect(wrapper.text()).to.include(msg)
|
||||
})
|
||||
})
|
||||
@@ -1,32 +0,0 @@
|
||||
const webpack = require('webpack')
|
||||
|
||||
module.exports = {
|
||||
devServer: {
|
||||
proxy: 'https://localhost:3000'
|
||||
},
|
||||
|
||||
publicPath: '/ui',
|
||||
|
||||
pluginOptions: {
|
||||
i18n: {
|
||||
locale: 'en',
|
||||
fallbackLocale: 'en',
|
||||
localeDir: 'locales',
|
||||
enableInSFC: false
|
||||
}
|
||||
},
|
||||
|
||||
filenameHashing: false,
|
||||
|
||||
configureWebpack: {
|
||||
plugins: [
|
||||
new webpack.optimize.LimitChunkCountPlugin({
|
||||
maxChunks: 1
|
||||
})
|
||||
]
|
||||
},
|
||||
chainWebpack: config => {
|
||||
config.optimization.delete('splitChunks')
|
||||
}
|
||||
|
||||
}
|
||||
-9843
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user