mirror of
https://github.com/notherealmarco/WASAPhoto.git
synced 2025-05-05 20:32:35 +02:00
First webui commit
This commit is contained in:
parent
e38f5d08ab
commit
c4611b92f8
2011 changed files with 30382 additions and 1874 deletions
29
webui/node_modules/vue-auth-image/.eslintrc
generated
vendored
Normal file
29
webui/node_modules/vue-auth-image/.eslintrc
generated
vendored
Normal file
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"env": {
|
||||
"node": true
|
||||
},
|
||||
"rules": {
|
||||
"array-bracket-spacing": [2, "never"],
|
||||
"block-scoped-var": 2,
|
||||
"brace-style": [2, "1tbs"],
|
||||
"camelcase": 1,
|
||||
"computed-property-spacing": [2, "never"],
|
||||
"curly": 2,
|
||||
"eol-last": 2,
|
||||
"eqeqeq": [2, "smart"],
|
||||
"max-depth": [1, 3],
|
||||
"max-len": [1, 80],
|
||||
"max-statements": [1, 15],
|
||||
"new-cap": 1,
|
||||
"no-extend-native": 2,
|
||||
"no-mixed-spaces-and-tabs": 2,
|
||||
"no-trailing-spaces": 2,
|
||||
"no-unused-vars": 1,
|
||||
"no-use-before-define": [2, "nofunc"],
|
||||
"object-curly-spacing": [2, "never"],
|
||||
"quotes": [2, "single", "avoid-escape"],
|
||||
"semi": [2, "always"],
|
||||
"keyword-spacing": [2, {"before": true, "after": true}],
|
||||
"space-unary-ops": 2
|
||||
}
|
||||
}
|
27
webui/node_modules/vue-auth-image/.gitlab-ci.yml
generated
vendored
Normal file
27
webui/node_modules/vue-auth-image/.gitlab-ci.yml
generated
vendored
Normal file
|
@ -0,0 +1,27 @@
|
|||
image: node:10
|
||||
|
||||
cache:
|
||||
untracked: true
|
||||
key: "$CI_BUILD_REF_NAME"
|
||||
paths:
|
||||
- node_modules/
|
||||
|
||||
stages:
|
||||
- setup
|
||||
- test
|
||||
- build
|
||||
|
||||
setup:
|
||||
stage: setup
|
||||
script:
|
||||
- npm install
|
||||
|
||||
test:
|
||||
stage: test
|
||||
script:
|
||||
- npm run lint
|
||||
|
||||
build:
|
||||
stage: build
|
||||
script:
|
||||
- npm run build
|
15
webui/node_modules/vue-auth-image/CHANGELOG.md
generated
vendored
Normal file
15
webui/node_modules/vue-auth-image/CHANGELOG.md
generated
vendored
Normal file
|
@ -0,0 +1,15 @@
|
|||
# Change log
|
||||
|
||||
## 0.0.3 - 2019-11-10
|
||||
|
||||
- Fix typo in README regarding directive name to use
|
||||
- Update README with instructions on how to use directive with Nuxt.js
|
||||
|
||||
## 0.0.2 - 2017-08-17
|
||||
|
||||
Add src tag update in the directive's componentUpdated method
|
||||
|
||||
## 0.0.1 - 2017-06-25
|
||||
|
||||
Initial release
|
||||
|
21
webui/node_modules/vue-auth-image/LICENSE
generated
vendored
Normal file
21
webui/node_modules/vue-auth-image/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2017 Jean Lalande
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
94
webui/node_modules/vue-auth-image/README.md
generated
vendored
Normal file
94
webui/node_modules/vue-auth-image/README.md
generated
vendored
Normal file
|
@ -0,0 +1,94 @@
|
|||
# vue-auth-image
|
||||
|
||||
> A reusable directive for [Vue.js](https://github.com/vuejs/vue) that loads
|
||||
> an image requiring authentication and includes it as data in-line in your web
|
||||
> pages.
|
||||
|
||||
[](https://www.npmjs.com/package/vue-auth-image)
|
||||
|
||||
## Overview
|
||||
|
||||
Contrary to other HTTP requests, browsers don't send common headers such as
|
||||
`Authorization` when retrieving an image specified in a `<img>` tag.
|
||||
|
||||
This Vue.js directive overcomes this limitation by providing a way to load your
|
||||
images as any other resources and then embedding them into your web pages using
|
||||
the `data:image/FILETYPE;base64` URI scheme.
|
||||
|
||||
## Requirements
|
||||
|
||||
- vue: \^2.0.0
|
||||
- axios: >= 0.5.0
|
||||
|
||||
## Install
|
||||
|
||||
### npm
|
||||
|
||||
``` sh
|
||||
$ npm install vue-auth-image --save
|
||||
```
|
||||
|
||||
### Using a CDN
|
||||
|
||||
``` html
|
||||
<script src="https://cdn.jsdelivr.net/npm/vue-auth-image/vue-auth-image.js"></script>
|
||||
<!-- OR -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/vue-auth-image/vue-auth-image.min.js"></script>
|
||||
```
|
||||
|
||||
### Using Nuxt.js
|
||||
|
||||
To use `vue-auth-image` with [Nuxt.js](https://nuxtjs.org/), start by creating
|
||||
a new plugin file name `vue-auth-image.js` in your `plugins/` directory. Add
|
||||
the following content to it:
|
||||
|
||||
```javascript
|
||||
import Vue from 'vue';
|
||||
import VueAuthImage from 'vue-auth-image';
|
||||
|
||||
Vue.use(VueAuthImage);
|
||||
```
|
||||
|
||||
Then, add the plugin to your `nuxt.config.js` at the root of your project:
|
||||
|
||||
```javascript
|
||||
plugins: [
|
||||
'@/plugins/vue-auth-image.js'
|
||||
]
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### auth-image
|
||||
|
||||
A directive that requests an image URI asynchronously and embed it into your
|
||||
`<img>` tag using the [data URI scheme](https://en.wikipedia.org/wiki/Data_URI_scheme).
|
||||
|
||||
``` js
|
||||
import axios from 'axios';
|
||||
import Vue from 'vue';
|
||||
import VueAuthImage from 'vue-auth-image';
|
||||
|
||||
// register vue-auth-image directive
|
||||
Vue.use(VueAuthImage);
|
||||
|
||||
// set Authorization header used by axios
|
||||
var authHeader = 'Bearer ' + localStorage.getItem('id_token');
|
||||
axios.defaults.headers.common['Authorization'] = authHeader;
|
||||
```
|
||||
|
||||
Once the directive is registered, you can use it in your Vue templates.
|
||||
|
||||
``` html
|
||||
<template>
|
||||
<div>
|
||||
<img v-auth-image="https://api.app.com/images/authenticatedImg.png">
|
||||
</div>
|
||||
</template>
|
||||
```
|
||||
|
||||
See `/example` for a demo. To build it, run `npm install && npm run build`.
|
||||
|
||||
## License
|
||||
|
||||
[MIT](https://opensource.org/licenses/MIT)
|
12
webui/node_modules/vue-auth-image/example/example.js
generated
vendored
Normal file
12
webui/node_modules/vue-auth-image/example/example.js
generated
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
var Vue = require('vue/dist/vue.common.js');
|
||||
var VueAuthImage = require('../vue-auth-image');
|
||||
var axios = require('axios');
|
||||
|
||||
Vue.use(VueAuthImage);
|
||||
|
||||
var authHeader = 'Bearer ' + 'id_token';
|
||||
axios.defaults.headers.common['Authorization'] = authHeader;
|
||||
|
||||
new Vue({
|
||||
el: 'div'
|
||||
});
|
19
webui/node_modules/vue-auth-image/example/index.html
generated
vendored
Normal file
19
webui/node_modules/vue-auth-image/example/index.html
generated
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||
<title>vue-auth-image example</title>
|
||||
<style>
|
||||
img {
|
||||
width: 300px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div>
|
||||
<img v-auth-image="'https://raw.githubusercontent.com/vuejs/art/master/vue-badge.png'">
|
||||
</div>
|
||||
<script src="example.build.js"></script>
|
||||
</body>
|
||||
</html>
|
47
webui/node_modules/vue-auth-image/package.json
generated
vendored
Normal file
47
webui/node_modules/vue-auth-image/package.json
generated
vendored
Normal file
|
@ -0,0 +1,47 @@
|
|||
{
|
||||
"name": "vue-auth-image",
|
||||
"version": "0.0.3",
|
||||
"description": "Vue directive to load and display secured images",
|
||||
"author": "Jean Lalande <jeanlalande@gmail.com>",
|
||||
"license": "MIT",
|
||||
"main": "vue-auth-image.js",
|
||||
"scripts": {
|
||||
"build": "webpack example/example.js example/example.build.js && uglifyjs vue-auth-image.js -c -m > vue-auth-image.min.js",
|
||||
"dev": "webpack --watch example/example.js example/example.build.js",
|
||||
"lint": "eslint vue-auth-image.js example/example.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://gitlab.com/jlalande/vue-auth-image.git"
|
||||
},
|
||||
"homepage": "https://gitlab.com/jlalande/vue-auth-image",
|
||||
"bugs": {
|
||||
"url": "https://gitlab.com/jlalande/vue-auth-image/issues"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"vue": "^2.0.0",
|
||||
"axios": ">= 0.5.0 < 1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"axios": "^0.19.0",
|
||||
"babel-eslint": "^7.2.3",
|
||||
"eslint": "^4.1.1",
|
||||
"uglify-js": "^3.6.0",
|
||||
"vue": "^2.6.10",
|
||||
"webpack": "^3.12.0"
|
||||
},
|
||||
"keywords": [
|
||||
"vue",
|
||||
"vue-auth-image",
|
||||
"directive",
|
||||
"authentication",
|
||||
"authorization",
|
||||
"token",
|
||||
"headers",
|
||||
"image",
|
||||
"src",
|
||||
"data-uri",
|
||||
"data",
|
||||
"uri"
|
||||
]
|
||||
}
|
50
webui/node_modules/vue-auth-image/vue-auth-image.js
generated
vendored
Normal file
50
webui/node_modules/vue-auth-image/vue-auth-image.js
generated
vendored
Normal file
|
@ -0,0 +1,50 @@
|
|||
;(function () {
|
||||
var vueAuthImage = {};
|
||||
var axios = typeof require === 'function'
|
||||
? require('axios')
|
||||
: window.Axios;
|
||||
|
||||
if (!axios) {
|
||||
throw new Error('[vue-auth-image] cannot locate Axios');
|
||||
}
|
||||
|
||||
function setImgSrc(el, binding) {
|
||||
if (binding.oldValue === undefined || binding.value !== binding.oldValue) {
|
||||
var imageUrl = binding.value;
|
||||
axios({
|
||||
method: 'get',
|
||||
url: imageUrl,
|
||||
responseType: 'arraybuffer'
|
||||
})
|
||||
.then(function(resp) {
|
||||
var mimeType = resp.headers['content-type'].toLowerCase();
|
||||
var imgBase64 = new Buffer(resp.data, 'binary').toString('base64');
|
||||
el.src = 'data:' + mimeType + ';base64,' + imgBase64;
|
||||
}).catch((function() {
|
||||
el.src = imageUrl;
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
vueAuthImage.install = function(Vue) {
|
||||
Vue.directive('auth-image', {
|
||||
bind: function(el, binding) {
|
||||
setImgSrc(el, binding);
|
||||
},
|
||||
componentUpdated: function(el, binding) {
|
||||
setImgSrc(el, binding);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
if (typeof exports == 'object') {
|
||||
module.exports = vueAuthImage;
|
||||
} else if (typeof define == 'function' && define.amd) {
|
||||
define([], function() {
|
||||
return vueAuthImage;
|
||||
});
|
||||
} else if (window.Vue) {
|
||||
window.VueAuthImage = vueAuthImage;
|
||||
Vue.use(vueAuthImage);
|
||||
}
|
||||
})();
|
1
webui/node_modules/vue-auth-image/vue-auth-image.min.js
generated
vendored
Normal file
1
webui/node_modules/vue-auth-image/vue-auth-image.min.js
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
!function(){var e={},t="function"==typeof require?require("axios"):window.Axios;if(!t)throw new Error("[vue-auth-image] cannot locate Axios");function o(o,e){if(void 0===e.oldValue||e.value!==e.oldValue){var n=e.value;t({method:"get",url:n,responseType:"arraybuffer"}).then(function(e){var n=e.headers["content-type"].toLowerCase(),t=new Buffer(e.data,"binary").toString("base64");o.src="data:"+n+";base64,"+t}).catch(function(){o.src=n})}}e.install=function(e){e.directive("auth-image",{bind:function(e,n){o(e,n)},componentUpdated:function(e,n){o(e,n)}})},"object"==typeof exports?module.exports=e:"function"==typeof define&&define.amd?define([],function(){return e}):window.Vue&&(window.VueAuthImage=e,Vue.use(e))}();
|
Loading…
Add table
Add a link
Reference in a new issue