Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #387

Merged
merged 49 commits into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
6e5c36f
Remove iframe from share dialog
ggodlewski May 13, 2023
6c11fd9
Fix share drive dialog
ggodlewski May 15, 2023
72d7e24
Fix folder unregister
ggodlewski May 17, 2023
b68e740
Fix initial file list
ggodlewski May 21, 2023
76bf96a
Fix editor settings
ggodlewski May 24, 2023
091f09a
Update welcome page
ggodlewski May 24, 2023
329bdd4
Fix dir scanner
ggodlewski May 24, 2023
fa53157
Fix not registered
ggodlewski May 24, 2023
aab1f8e
Fix links to files with removed access
ggodlewski Aug 24, 2023
872f190
Fix typo
ggodlewski Sep 13, 2023
f8300c3
Improve debugging
ggodlewski Sep 13, 2023
22be85f
Add express compression
ggodlewski Sep 14, 2023
4dd9f36
Improve git
ggodlewski Sep 14, 2023
be7f756
Refactor transform_subdir
ggodlewski Sep 16, 2023
292a6fd
Add upload to gdrive
ggodlewski Sep 18, 2023
b30dda3
Fix test
ggodlewski Sep 18, 2023
599ef14
Rewrite links after google upload
ggodlewski Sep 19, 2023
5978f41
Add missing http headers
ggodlewski Sep 23, 2023
da84c69
Fix first render
ggodlewski Sep 23, 2023
062f895
Fix header
ggodlewski Sep 23, 2023
e99613b
Fix svg relative path
ggodlewski Sep 23, 2023
518dcf6
Create separate logger per job
ggodlewski Sep 24, 2023
b5ba689
Fix logs for action
ggodlewski Sep 24, 2023
460c9e7
Fix overwriting log
ggodlewski Sep 24, 2023
f091b75
Fix log link
ggodlewski Sep 24, 2023
61cc15c
Security upgrade
ggodlewski Oct 2, 2023
09f7aa6
Fix directory scanner
ggodlewski Oct 5, 2023
70cd5e5
Update docs
ggodlewski Oct 5, 2023
7835518
Cleanup test dir
ggodlewski Oct 5, 2023
3ea405d
Improve markdown transforming
ggodlewski Oct 5, 2023
14e7dfb
Add support for hugo mermaid diagrams
ggodlewski Oct 7, 2023
43858e2
Fix intellij test run
ggodlewski Oct 8, 2023
d280cd1
Refactor cli commands
ggodlewski Oct 9, 2023
095bfd7
Start usage documentation
ggodlewski Oct 10, 2023
73f2874
Update documentation
ggodlewski Oct 17, 2023
10d003d
Bump word-wrap from 1.2.3 to 1.2.4
dependabot[bot] Jul 18, 2023
a00fd7e
Fix tree version
ggodlewski Sep 1, 2023
fef7be8
fix: package.json & package-lock.json to reduce vulnerabilities
snyk-bot Sep 28, 2023
05d3634
Security upgrade
ggodlewski Oct 2, 2023
179f0b3
Rebase
ggodlewski Oct 19, 2023
b1c7375
Merge branch 'master' into develop
ggodlewski Oct 19, 2023
9558da1
Fix test
ggodlewski Oct 19, 2023
878bf9d
Fix CodeQL warning
ggodlewski Oct 19, 2023
c403042
Improve HTML
ggodlewski Oct 22, 2023
82f32b9
Fix CodeQL warnings
ggodlewski Oct 22, 2023
9093878
Fix nginx and docker config
ggodlewski Oct 22, 2023
8c87647
Fix action runner initial setup
ggodlewski Oct 24, 2023
e573dac
Use menus config file instead of frontmatters
ggodlewski Oct 24, 2023
ab26ac9
Fix logger
ggodlewski Oct 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ root = true
end_of_line = lf
insert_final_newline = true

[*.{ts,js,mjs,css,scss,html}]
[*.{ts,js,mjs,css,scss,html,vue}]
charset = utf-8
indent_style = space
indent_size = 2
25 changes: 14 additions & 11 deletions .github/workflows/DevelopServerDeploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,18 @@ jobs:
node-version: 18
cache: npm

- name: Build hugo docs
run: |
docker run \
-v "${GITHUB_WORKSPACE}/hugo:/site" \
-v "${GITHUB_WORKSPACE}/website:/website" \
-v "/var/www/dev.wikigdrive.com:/dist/hugo" \
--env CONFIG_TOML="/site/config/_default/config.toml" --env BASE_URL="https://dev.wikigdrive.com" \
wgd-action-runner:develop /steps/step_render_hugo

- name: Copy index for vite
run: mkdir -p ${GITHUB_WORKSPACE}/dist/hugo && cp -rf /var/www/dev.wikigdrive.com/* ${GITHUB_WORKSPACE}/dist/hugo

- uses: whoan/docker-build-with-cache-action@v5
with:
image_name: "wikigdrive-develop"
Expand All @@ -55,16 +67,6 @@ jobs:
run: docker stop wikigdrive-develop ; docker rm wikigdrive-develop
continue-on-error: true

- name: Build hugo docs
run: |
docker run \
-v "${GITHUB_WORKSPACE}/doc:/site/doc" \
-v "${GITHUB_WORKSPACE}/themes:/site/themes" \
-v "${GITHUB_WORKSPACE}/config.toml:/site/config.toml" \
-v "/var/www/dev.wikigdrive.com:/site/dist/hugo" \
--env CONFIG_TOML="/site/config.toml" --env BASE_URL="https://dev.wikigdrive.com" \
wgd-action-runner:develop /steps/step_render_hugo

- name: Start
run: |
docker run -d --name wikigdrive-develop \
Expand All @@ -73,12 +75,13 @@ jobs:
-v /home/githubactions/wikigdrive/service_account.json:/service_account.json \
-v /home/githubactions/wikigdrive/env.develop:/usr/src/app/.env \
-v /var/run/docker.sock:/var/run/docker.sock \
-v "/var/www/dev.wikigdrive.com:/usr/src/app/dist/hugo" \
-e "GIT_SHA=${GITHUB_SHA}" \
-e "ZIPKIN_URL=https://dev.wikigdrive.com/zipkin" \
-e "ZIPKIN_SERVICE=wikigdrive-develop" \
--link=zipkin:zipkin \
--publish 127.0.0.1:4000:3000 \
"wikigdrive-develop:${GITHUB_SHA}" wikigdrive-ts \
"wikigdrive-develop:${GITHUB_SHA}" wikigdrive \
--service_account /service_account.json \
--share_email mie-docs-wikigdrive@wikigdrive.iam.gserviceaccount.com \
--workdir /data \
Expand Down
25 changes: 14 additions & 11 deletions .github/workflows/ProdServerDeploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,18 @@ jobs:
node-version: 18
cache: npm

- name: Build hugo docs
run: |
docker run \
-v "${GITHUB_WORKSPACE}/hugo:/site" \
-v "${GITHUB_WORKSPACE}/website:/website" \
-v "/var/www/dev.wikigdrive.com:/dist/hugo" \
--env CONFIG_TOML="/site/config/_default/config.toml" --env BASE_URL="https://wikigdrive.com" \
wgd-action-runner:prod /steps/step_render_hugo

- name: Copy index for vite
run: mkdir -p ${GITHUB_WORKSPACE}/dist/hugo && cp -rf /var/www/wikigdrive.com/* ${GITHUB_WORKSPACE}/dist/hugo

- uses: whoan/docker-build-with-cache-action@v5
with:
image_name: "wikigdrive-prod"
Expand All @@ -56,27 +68,18 @@ jobs:
run: docker stop wikigdrive-prod ; docker rm wikigdrive-prod
continue-on-error: true

- name: Build hugo docs
run: |
docker run \
-v "${GITHUB_WORKSPACE}/doc:/site/doc" \
-v "${GITHUB_WORKSPACE}/themes:/site/themes" \
-v "${GITHUB_WORKSPACE}/config.toml:/site/config.toml" \
-v "/var/www/wikigdrive.com:/site/dist/hugo" \
--env CONFIG_TOML="/site/config.toml" --env BASE_URL="https://wikigdrive.com" \
wgd-action-runner:prod /steps/step_render_hugo

- name: Start
run: |
docker run -d --name wikigdrive-prod \
-v wikiGDriveProd:/data \
-v /home/githubactions/wikigdrive/service_account.json:/service_account.json \
-v /home/githubactions/wikigdrive/env.prod:/usr/src/app/.env \
-v /var/run/docker.sock:/var/run/docker.sock \
-v "/var/www/wikigdrive.com:/usr/src/app/dist/hugo" \
-e "GIT_SHA=${GITHUB_SHA}" \
--publish 127.0.0.1:3000:3000 \
--restart unless-stopped \
"wikigdrive-prod:${GITHUB_SHA}" wikigdrive-ts \
"wikigdrive-prod:${GITHUB_SHA}" wikigdrive \
--service_account /service_account.json \
--share_email mie-docs-wikigdrive@wikigdrive.iam.gserviceaccount.com \
--workdir /data \
Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@ jobs:
node-version: 18
cache: npm

- name: Build hugo docs
run: |
docker run \
-v "${GITHUB_WORKSPACE}/hugo:/site" \
-v "${GITHUB_WORKSPACE}/website:/website" \
-v "/var/www/test.wikigdrive.com:/dist/hugo" \
--env CONFIG_TOML="/site/config/_default/config.toml" --env BASE_URL="https://test.wikigdrive.com" \
wgd-action-runner:develop /steps/step_render_hugo

- name: Copy index for vite
run: mkdir -p dist/hugo && cp -rf /var/www/test.wikigdrive.com/* dist/hugo

- name: Build
run: docker build -t wikigdrive-test --build-arg "GIT_SHA=${GITHUB_SHA}" .

Expand All @@ -52,4 +64,4 @@ jobs:
continue-on-error: true

- name: Start
run: docker run -t -v wikiGDriveExample:/data -v /home/githubactions/wikigdrive/service_account.json:/service_account.json wikigdrive-test wikigdrive-ts --service_account /service_account.json --share_email mie-docs-wikigdrive@wikigdrive.iam.gserviceaccount.com --workdir /data pull 0AIkOKXbzWCtSUk9PVA
run: docker run -t -v wikiGDriveExample:/data -v /home/githubactions/wikigdrive/service_account.json:/service_account.json -v "/var/www/dev.wikigdrive.com:/usr/src/app/dist/hugo" wikigdrive-test wikigdrive --service_account /service_account.json --share_email mie-docs-wikigdrive@wikigdrive.iam.gserviceaccount.com --workdir /data pull 0AIkOKXbzWCtSUk9PVA
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ node_modules
dist
content
.hugo*
hugo/resources
hugo_stats.json

4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ RUN npm link --location=user
EXPOSE 3000
VOLUME /data

RUN cp /usr/src/app/hugo/themes/wgd-bootstrap/layouts/_default/baseof.html /usr/src/app/apps/ui/index.html
RUN if [[ -d /usr/src/app/dist/hugo/ui ]]; then cp /usr/src/app/dist/hugo/ui/index.html /usr/src/app/apps/ui/index.html ; fi
RUN cd /usr/src/app/apps/ui && npm install && npm run build

WORKDIR "/usr/src/app"

CMD [ "sh", "-c", "wikigdrive-ts --workdir /data server 3000" ]
CMD [ "sh", "-c", "wikigdrive --workdir /data server 3000" ]
2 changes: 1 addition & 1 deletion README.md
7 changes: 6 additions & 1 deletion apps/ui/assets/layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ body,
.mainbar__content {
flex: 1 1 auto;
text-overflow: ellipsis;
white-space: nowrap;
height: calc(100vh - var(--navbar-height));
overflow: auto;
}
Expand Down Expand Up @@ -97,3 +96,9 @@ body,
}

}

@media (min-width: 768px) {
.position-fixed-md {
position: fixed;
}
}
9 changes: 8 additions & 1 deletion apps/ui/assets/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ nav {
justify-content: space-between;
display: flex;
align-items: center;
background-color: #2196F3;
color: #FFF;
}

Expand Down Expand Up @@ -167,6 +166,9 @@ a[disabled] {
.border-left-0 {
border-left: none;
}
.border-left-0-not-first:not(:first-of-type) {
border-left: none;
}

.mh-auto {
min-height: auto !important;
Expand All @@ -192,3 +194,8 @@ a[disabled] {
.pl-1 {
padding-left: 10px !important;
}

.docs__content pre {
border-left: 3px solid var(--bs-gray-500);
padding: 2em 0 2em 3em;
}
Binary file modified apps/ui/assets/share-example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 0 additions & 28 deletions apps/ui/index.html

This file was deleted.

2 changes: 1 addition & 1 deletion apps/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
"@vitejs/plugin-vue": "4.0.0",
"eslint-plugin-vue": "8.7.1",
"typescript": "4.9.4",
"vite": "4.0.1"
"vite": "4.4.9"
}
}
2 changes: 1 addition & 1 deletion apps/ui/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<ErrorView v-if="errorMessage" :errorMessage="errorMessage">
</ErrorView>
<router-view v-else class="view main-content"></router-view>
<router-view v-else class="router-view"></router-view>
<ModalsContainer></ModalsContainer>
<ToastsContainer></ToastsContainer>
</template>
Expand Down
10 changes: 3 additions & 7 deletions apps/ui/src/components/ChangesViewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
</div>
<div class="card-footer" v-if="active_jobs.length === 0">
<div class="btn-group">
<a class="btn btn-outline-primary me-2" v-if="selectedFile.id" @click.prevent="$emit('sync', { $event, file: selectedFile })">Sync Single</a>
<a class="btn btn-outline-primary me-2" v-if="selectedFile.id && selectedFile.id !== 'TO_FILL'" @click.prevent="$emit('sync', { $event, file: selectedFile })">Sync Single</a>
<a class="btn btn-outline-danger me-2" v-if="drive.name" @click.prevent="syncAll">Sync All</a>
<a class="btn btn-outline-secondary me-2" v-if="!isGDocsPreview && drive.name && selectedFile.id" @click.prevent="$emit('transform', $event, selectedFile)">Transform Single Markdown</a>
<a class="btn btn-outline-secondary me-2" v-if="!isGDocsPreview && drive.name" @click.prevent="transformAll">Transform All Markdown</a>
Expand Down Expand Up @@ -105,7 +105,7 @@
<td>
{{ job.finishedStr }}
({{ job.durationStr }})
<button class="btn float-end" @click="showLogs(job)">Logs</button>
<a class="btn float-end" :href="'#drive_logs:job-' + job.id" @click.prevent="showLogs(job)">Logs</a>
</td>
</tr>
</tbody>
Expand Down Expand Up @@ -177,11 +177,7 @@ export default {
}
},
showLogs(job) {
this.$emit('showLogs', {
from: job.started,
until: job.finished
});
this.setActiveTab('drive_logs');
this.$router.push(`/drive/${this.driveId}#drive_logs:job-${job.id}`);
}
}
};
Expand Down
13 changes: 11 additions & 2 deletions apps/ui/src/components/DriveTools.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,20 @@
</a>
</li>

<li class="list-group-item" v-if="treeEmpty && !isGDocsPreview">
<li class="list-group-item" v-if="selectedFolder.contentDir && treeEmpty && !isGDocsPreview">
Markdown tree empty
<a class="btn btn-outline-secondary me-2" @click.prevent="syncAll">Sync All</a>
</li>
<li class="list-group-item" v-else-if="treeVersion && treeVersion !== GIT_SHA">
<li class="list-group-item" v-else-if="selectedFolder.contentDir && treeVersion && treeVersion !== GIT_SHA">
Markdowns were generated with version: <em>{{treeVersion}}</em>.<br/>
WikiGDrive is now running: <em>{{GIT_SHA}}</em>.<br/>
<a class="btn btn-outline-secondary me-2" @click.prevent="transformAll">Update your entire tree now?</a>
</li>

<li class="list-group-item" v-if="selectedFolder.contentDir">
Synchronize to Google Drive
<a class="btn btn-outline-secondary me-2" @click.prevent="uploadGdrive">Upload missing markdowns to Google Drive</a>
</li>
</ul>
</div>
</template>
Expand All @@ -59,6 +64,10 @@ export default {
mixins: [UtilsMixin, UiMixin],
components: {ToolButton},
props: {
driveEmpty: {
type: Boolean,
default: false
},
treeEmpty: {
type: Boolean,
default: false
Expand Down
2 changes: 1 addition & 1 deletion apps/ui/src/components/FilesTreeLeaf.vue
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export default {
}
},
openExternal(file) {
if (file.id === 'UNKNOWN') {
if (file.id === 'UNKNOWN' || file.id === 'TO_FILL') {
return;
}
if (this.isFolder(file)) {
Expand Down
25 changes: 22 additions & 3 deletions apps/ui/src/components/GitCommit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@

<template v-slot:sidebar="{ collapse }">
<GitSideBar
ref="git_sidebar"
:selectedPath="selectedPath"
:gitChanges="gitChanges"
:checked="checked"
@toggle="toggle"
@toggleAll="toggleAll"
@setCurrentDiff="setCurrentDiff"
@collapse="collapse"
/>
Expand All @@ -21,7 +23,6 @@
<form>
<div class="container d-flex flex-column order-0 w-vh-toolbar w-100">
<GitToolBar :active-tab="activeTab" :selected-file="selectedFile" />

<div v-if="file_deleted" class="flex-grow-1">
<div class="alert-warning p-3 mb-3">
File deleted
Expand Down Expand Up @@ -88,7 +89,8 @@ export default {
contentDir: {
type: String
},
selectedFile: Object
selectedFile: Object,
selectedFolder: Object
},
data() {
return {
Expand All @@ -103,7 +105,8 @@ export default {
},
computed: {
file_deleted() {
return !this.selectedFile.id && !['/toc.md'].includes(this.selectedFile.path);
return false;
// return !this.selectedFile.id && !this.selectedFolder?.path && !['/toc.md'].includes(this.selectedFile.path);
},
git_remote_url() {
return this.user_config.remote_url || '';
Expand Down Expand Up @@ -178,6 +181,13 @@ export default {

const responseConfig = await this.authenticatedClient.fetchApi(`/api/config/${this.driveId}`);
this.user_config = await responseConfig.json();

this.$nextTick(() => {
const el = this.$el.querySelector('[data-path="' + this.selectedPath + '"]');
if (el) {
el.scrollIntoView();
}
});
},
open(url) {
window.open(url, '_blank');
Expand Down Expand Up @@ -270,6 +280,15 @@ export default {
}
});
},
toggleAll() {
if (Object.keys(this.checked).length === this.gitChanges.length) {
this.checked = {};
} else {
for (const change of this.gitChanges) {
this.checked[change.path] = true;
}
}
},
toggle(path) {
if (this.checked[path]) {
delete this.checked[path];
Expand Down
Loading
Loading