Compare commits
17 Commits
0.2.1
...
65b36f8e69
| Author | SHA1 | Date | |
|---|---|---|---|
| 65b36f8e69 | |||
| 87387a54f2 | |||
| b497cebe76 | |||
| 0fa107a75b | |||
| b34e3aeed0 | |||
| 35b18d72fd | |||
| 4b80f30afb | |||
| 86c54e04a8 | |||
| ef9fc596f5 | |||
| ad34e455ce | |||
| 01fdd0bee2 | |||
| 32ffa345cd | |||
| 6fc3c16073 | |||
| 7d58657c80 | |||
| fcd657c10e | |||
| 4ab77c5557 | |||
| 87926e69db |
24
.drone.yml
24
.drone.yml
@@ -4,18 +4,6 @@ type: docker
|
|||||||
name: build:dev
|
name: build:dev
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: build dev
|
|
||||||
image: plugins/docker
|
|
||||||
depends_on: [clone]
|
|
||||||
settings:
|
|
||||||
username:
|
|
||||||
from_secret: DOCKER_REGISTRY_USER
|
|
||||||
password:
|
|
||||||
from_secret: DOCKER_REGISTRY_PASSWORD
|
|
||||||
repo: registry.odit.services/lfk/frontend
|
|
||||||
tags:
|
|
||||||
- dev
|
|
||||||
registry: registry.odit.services
|
|
||||||
- name: run full license export
|
- name: run full license export
|
||||||
depends_on: ["clone"]
|
depends_on: ["clone"]
|
||||||
image: node:alpine
|
image: node:alpine
|
||||||
@@ -33,6 +21,18 @@ steps:
|
|||||||
remote: git@git.odit.services:lfk/frontend.git
|
remote: git@git.odit.services:lfk/frontend.git
|
||||||
ssh_key:
|
ssh_key:
|
||||||
from_secret: GITLAB_SSHKEY
|
from_secret: GITLAB_SSHKEY
|
||||||
|
- name: build dev
|
||||||
|
image: plugins/docker
|
||||||
|
depends_on: [clone]
|
||||||
|
settings:
|
||||||
|
username:
|
||||||
|
from_secret: DOCKER_REGISTRY_USER
|
||||||
|
password:
|
||||||
|
from_secret: DOCKER_REGISTRY_PASSWORD
|
||||||
|
repo: registry.odit.services/lfk/frontend
|
||||||
|
tags:
|
||||||
|
- dev
|
||||||
|
registry: registry.odit.services
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
branch:
|
branch:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM node:15.4.0-alpine3.12
|
FROM node:15.5.1-alpine3.12
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN npm i -g pnpm
|
RUN npm i -g pnpm
|
||||||
COPY package.json ./
|
COPY package.json ./
|
||||||
@@ -11,6 +11,7 @@ RUN pnpm run build
|
|||||||
# final image
|
# final image
|
||||||
FROM alpine
|
FROM alpine
|
||||||
COPY --from=0 /app/build /app
|
COPY --from=0 /app/build /app
|
||||||
|
RUN rm -rf build/sw.js.map build/workbox-*.js.map
|
||||||
RUN rm -rf /app/build/_dist_/components
|
RUN rm -rf /app/build/_dist_/components
|
||||||
RUN rm -rf /app/build/_dist_/locales
|
RUN rm -rf /app/build/_dist_/locales
|
||||||
RUN rm -rf /app/build-manifest.json
|
RUN rm -rf /app/build-manifest.json
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
"licenses:export": "license-exporter --json -o public"
|
"licenses:export": "license-exporter --json -o public"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@odit/lfk-client-js": "0.0.11",
|
"@odit/lfk-client-js": "0.0.12",
|
||||||
"filepond": "4.25.1",
|
"filepond": "4.25.1",
|
||||||
"gridjs": "3.2.1",
|
"gridjs": "3.2.1",
|
||||||
"localforage": "1.9.0",
|
"localforage": "1.9.0",
|
||||||
@@ -25,13 +25,13 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@odit/license-exporter": "0.0.9",
|
"@odit/license-exporter": "0.0.9",
|
||||||
"@snowpack/plugin-svelte": "3.4.1",
|
"@snowpack/plugin-svelte": "3.5.1",
|
||||||
"auto-changelog": "^2.2.1",
|
"auto-changelog": "^2.2.1",
|
||||||
"autoprefixer": "10.2.1",
|
"autoprefixer": "10.2.1",
|
||||||
"postcss": "8.2.4",
|
"postcss": "8.2.4",
|
||||||
"postcss-load-config": "3.0.0",
|
"postcss-load-config": "3.0.0",
|
||||||
"release-it": "^14.2.2",
|
"release-it": "^14.2.2",
|
||||||
"snowpack": "3.0.0-rc.2",
|
"snowpack": "3.0.10",
|
||||||
"svelte": "3.31.2",
|
"svelte": "3.31.2",
|
||||||
"svelte-preprocess": "4.6.1",
|
"svelte-preprocess": "4.6.1",
|
||||||
"workbox-cli": "6.0.2"
|
"workbox-cli": "6.0.2"
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -5,10 +5,11 @@ module.exports = {
|
|||||||
src: '/_dist_'
|
src: '/_dist_'
|
||||||
},
|
},
|
||||||
plugins: [ '@snowpack/plugin-svelte' ],
|
plugins: [ '@snowpack/plugin-svelte' ],
|
||||||
install: [
|
routes: [
|
||||||
/* ... */
|
/* Enable an SPA Fallback in development: */
|
||||||
|
{ match: 'routes', src: '.*', dest: '/index.html' }
|
||||||
],
|
],
|
||||||
installOptions: {
|
packageOptions: {
|
||||||
/* ... */
|
/* ... */
|
||||||
sourceMap: false
|
sourceMap: false
|
||||||
},
|
},
|
||||||
@@ -18,13 +19,8 @@ module.exports = {
|
|||||||
buildOptions: {
|
buildOptions: {
|
||||||
/* ... */
|
/* ... */
|
||||||
},
|
},
|
||||||
proxy: {
|
|
||||||
/* ... */
|
|
||||||
},
|
|
||||||
alias: {
|
alias: {
|
||||||
/* ... */
|
/* ... */
|
||||||
},
|
},
|
||||||
experiments: {
|
optimize: { bundle: true, minify: true }
|
||||||
optimize: { bundle: true, minify: true }
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -49,7 +49,7 @@
|
|||||||
OpenAPI.BASE = config.baseurl;
|
OpenAPI.BASE = config.baseurl;
|
||||||
import { register as registerSW } from "./swmodule";
|
import { register as registerSW } from "./swmodule";
|
||||||
store.init();
|
store.init();
|
||||||
registerSW();
|
// registerSW();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Route>
|
<Route>
|
||||||
|
|||||||
@@ -24,19 +24,40 @@
|
|||||||
)
|
)
|
||||||
check = true;
|
check = true;
|
||||||
})(navigator.userAgent || navigator.vendor || window.opera);
|
})(navigator.userAgent || navigator.vendor || window.opera);
|
||||||
|
const aspectratio=window.innerWidth/window.innerHeight;
|
||||||
|
if(aspectratio<=0.765){
|
||||||
|
check=true;
|
||||||
|
}
|
||||||
return check;
|
return check;
|
||||||
}
|
}
|
||||||
$: mobile = ismobile();
|
$: mobile = ismobile();
|
||||||
|
window.addEventListener('resize', function(){
|
||||||
|
const aspectratio=window.innerWidth/window.innerHeight;
|
||||||
|
if(aspectratio<=0.765){
|
||||||
|
navOpen=false;
|
||||||
|
mobile=true;
|
||||||
|
}else{
|
||||||
|
navOpen=true;
|
||||||
|
mobile=false;
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// $: if (mobile===true) {
|
||||||
|
// console.log("changed to mobile");
|
||||||
|
// }
|
||||||
|
// $: if (mobile===false) {
|
||||||
|
// console.log("changed to md");
|
||||||
|
// }
|
||||||
function logout() {
|
function logout() {
|
||||||
localForage.clear();
|
localForage.clear();
|
||||||
location.replace("/");
|
location.replace("/");
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<section class="min-h-screen bg-gray-50 dark:bg-black dark:text-gray-100">
|
<section class="min-h-screen bg-gray-50">
|
||||||
<nav
|
<nav
|
||||||
class:hidden={!navOpen && mobile}
|
class:hidden={!navOpen && mobile}
|
||||||
class="select-none fixed top-0 left-0 z-20 h-full pb-10 overflow-x-hidden overflow-y-auto transition origin-left transform border-r w-60 md:translate-x-0">
|
class="select-none fixed top-0 left-0 z-20 h-full pb-10 overflow-x-hidden overflow-y-auto transition origin-left transform border-r w-60 md:translate-x-0 bg-gray-50">
|
||||||
<a href="/" class="flex items-center px-4 py-5">
|
<a href="/" class="flex items-center px-4 py-5">
|
||||||
<img
|
<img
|
||||||
src="/lfk-logo.png"
|
src="/lfk-logo.png"
|
||||||
|
|||||||
@@ -43,6 +43,20 @@
|
|||||||
allpermissions=allpermissions.concat([p.target + ":" + p.action])
|
allpermissions=allpermissions.concat([p.target + ":" + p.action])
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
// editable_userdata.permissions=[];
|
||||||
|
const user_permissions = UserService.userControllerGetPermissions(params.userid).then((val) => {
|
||||||
|
// console.log(val);
|
||||||
|
editable_userdata.permissions=[]
|
||||||
|
val.directlyGranted.forEach(p => {
|
||||||
|
editable_userdata.permissions=editable_userdata.permissions.concat([p.target + ":" + p.action])
|
||||||
|
});
|
||||||
|
val.inherited.forEach(p => {
|
||||||
|
editable_userdata.permissions=editable_userdata.permissions.concat([p.target + ":" + p.action])
|
||||||
|
});
|
||||||
|
// editable_userdata.permissions.push()
|
||||||
|
// console.log(val.directlyGranted);
|
||||||
|
// console.log(val.inherited);
|
||||||
|
})
|
||||||
$: changes_performed = !lodashIsEqual(original_data, editable_userdata);
|
$: changes_performed = !lodashIsEqual(original_data, editable_userdata);
|
||||||
$: groups_changed = JSON.stringify(usergroups_array)===JSON.stringify(usergroups_array_original);
|
$: groups_changed = JSON.stringify(usergroups_array)===JSON.stringify(usergroups_array_original);
|
||||||
$: save_enabled = changes_performed||!groups_changed;
|
$: save_enabled = changes_performed||!groups_changed;
|
||||||
@@ -171,18 +185,24 @@
|
|||||||
{/if}
|
{/if}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-2 flex items-center">
|
<div class="mt-3 text-sm w-full">
|
||||||
|
<p
|
||||||
|
class="ml-1 font-medium text-gray-700">Profile Picture</p>
|
||||||
<img
|
<img
|
||||||
alt={$_('profile-picture')}
|
alt={$_('profile-picture')}
|
||||||
class="inline-block h-20 w-20 rounded-full overflow-hidden bg-gray-100"
|
class="h-20 w-20 rounded-full overflow-hidden bg-gray-100"
|
||||||
src={editable_userdata.profilePic} />
|
src={editable_userdata.profilePic} />
|
||||||
<button
|
<!-- <button
|
||||||
type="button"
|
type="button"
|
||||||
class="ml-5 bg-white py-2 px-3 border border-gray-300 rounded-md shadow-sm text-sm leading-4 font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">Change</button>
|
class="ml-5 bg-white py-2 px-3 border border-gray-300 rounded-md shadow-sm text-sm leading-4 font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">Change</button> -->
|
||||||
</div>
|
</div>
|
||||||
<!-- -->
|
<!-- -->
|
||||||
<div class="mt-3 text-sm w-full">
|
<div class="mt-3 text-sm w-full">
|
||||||
<input
|
<label
|
||||||
|
for="enabled"
|
||||||
|
class="ml-1 font-medium text-gray-700">Active?</label>
|
||||||
|
<br>
|
||||||
|
<p class="text-gray-500"> <input
|
||||||
id="enabled"
|
id="enabled"
|
||||||
on:change={() => {
|
on:change={() => {
|
||||||
editable_userdata.enabled = !editable_userdata.enabled;
|
editable_userdata.enabled = !editable_userdata.enabled;
|
||||||
@@ -191,11 +211,7 @@
|
|||||||
name="enabled"
|
name="enabled"
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
checked={editable_userdata.enabled}
|
checked={editable_userdata.enabled}
|
||||||
class="focus:ring-indigo-500 h-4 w-4 text-indigo-600 border-gray-300 rounded" />
|
class="focus:ring-indigo-500 h-4 w-4 text-indigo-600 border-gray-300 rounded" /> set the user active/ inactive</p>
|
||||||
<label
|
|
||||||
for="enabled"
|
|
||||||
class="ml-1 font-medium text-gray-700">Active?</label>
|
|
||||||
<p class="text-gray-500">set the user active/ inactive</p>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="text-sm w-full">
|
<div class="text-sm w-full">
|
||||||
<label
|
<label
|
||||||
@@ -291,8 +307,8 @@
|
|||||||
class="border-4 border-dashed rounded mb-4 p-5 text-lg text-center">
|
class="border-4 border-dashed rounded mb-4 p-5 text-lg text-center">
|
||||||
{#each allpermissions as p}
|
{#each allpermissions as p}
|
||||||
{#if !editable_userdata.permissions.includes(p)}
|
{#if !editable_userdata.permissions.includes(p)}
|
||||||
<p
|
<div
|
||||||
class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 bg-gray-200 p-2 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input">
|
class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 bg-gray-200 p-2 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input text-right">
|
||||||
{p}
|
{p}
|
||||||
<button
|
<button
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
@@ -300,8 +316,8 @@
|
|||||||
editable_userdata.permissions = editable_userdata.permissions;
|
editable_userdata.permissions = editable_userdata.permissions;
|
||||||
}}
|
}}
|
||||||
type="button"
|
type="button"
|
||||||
class="w-full justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-green-200 text-base font-medium text-black hover:bg-green-700 hover:text-white focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 sm:ml-3 sm:w-auto sm:text-sm">+</button>
|
class="w-full rounded-md border border-transparent shadow-sm px-4 py-2 bg-green-200 font-medium text-black hover:bg-green-700 hover:text-white focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 sm:ml-3 sm:w-auto sm:text-sm">+</button>
|
||||||
</p>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
@@ -311,16 +327,16 @@
|
|||||||
class="border-4 border-dashed rounded mb-4 p-5 text-lg text-center">
|
class="border-4 border-dashed rounded mb-4 p-5 text-lg text-center">
|
||||||
{#each allpermissions as p}
|
{#each allpermissions as p}
|
||||||
{#if editable_userdata.permissions.includes(p)}
|
{#if editable_userdata.permissions.includes(p)}
|
||||||
<p
|
<div
|
||||||
class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 bg-gray-200 p-2 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input">
|
class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 bg-gray-200 p-2 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input text-left">
|
||||||
{p}
|
<button
|
||||||
<button
|
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
editable_userdata.permissions = editable_userdata.permissions.filter((obj) => obj !== p);
|
editable_userdata.permissions = editable_userdata.permissions.filter((obj) => obj !== p);
|
||||||
}}
|
}}
|
||||||
type="button"
|
type="button"
|
||||||
class="w-full justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-300 text-base font-medium text-black hover:bg-red-700 hover:text-white focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500 sm:ml-3 sm:w-auto sm:text-sm">-</button>
|
class="w-full rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-400 font-medium text-black hover:bg-red-700 hover:text-white focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500 sm:ml-3 sm:w-auto sm:text-sm">-</button>
|
||||||
</p>
|
{p}
|
||||||
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -33,17 +33,17 @@
|
|||||||
{#if current_users.length === 0}
|
{#if current_users.length === 0}
|
||||||
<UsersEmptyState />
|
<UsersEmptyState />
|
||||||
{:else}
|
{:else}
|
||||||
{#if advanced_search}
|
<!-- {#if advanced_search}
|
||||||
advanced search
|
advanced search
|
||||||
{:else}
|
{:else} -->
|
||||||
<input
|
<input
|
||||||
type="search"
|
type="search"
|
||||||
bind:value={searchvalue}
|
bind:value={searchvalue}
|
||||||
placeholder={$_('datatable.search')}
|
placeholder={$_('datatable.search')}
|
||||||
aria-label={$_('datatable.search')}
|
aria-label={$_('datatable.search')}
|
||||||
class="gridjs-input gridjs-search-input mb-4" />
|
class="gridjs-input gridjs-search-input mb-4" />
|
||||||
{/if}
|
<!-- {/if} -->
|
||||||
<button
|
<!-- <button
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
advanced_search = !advanced_search;
|
advanced_search = !advanced_search;
|
||||||
}}
|
}}
|
||||||
@@ -52,7 +52,7 @@
|
|||||||
{#if advanced_search}
|
{#if advanced_search}
|
||||||
toggle simple search
|
toggle simple search
|
||||||
{:else}toggle advanced search{/if}
|
{:else}toggle advanced search{/if}
|
||||||
</button>
|
</button> -->
|
||||||
<div
|
<div
|
||||||
class="shadow border-b border-gray-200 sm:rounded-lg overflow-x-scroll">
|
class="shadow border-b border-gray-200 sm:rounded-lg overflow-x-scroll">
|
||||||
<table class="divide-y divide-gray-200 w-full">
|
<table class="divide-y divide-gray-200 w-full">
|
||||||
|
|||||||
Reference in New Issue
Block a user