feat: display s2oj version
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Baoshuo Ren 2022-09-21 13:27:01 +08:00
parent dac1c4bf51
commit d8bbc6f41c
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A
4 changed files with 20 additions and 8 deletions

View File

@ -57,7 +57,12 @@ steps:
- name: tags - name: tags
image: alpine image: alpine
commands: commands:
- echo -n "latest, $DRONE_BRANCH, ${DRONE_COMMIT_SHA:0:8}" > .tags - echo -n "latest, $DRONE_BRANCH, ${DRONE_COMMIT_SHA:0:7}" > .tags
- name: version
image: alpine
commands:
- sed -i "s/'s2oj-version' => 'dev'/'s2oj-version' => '${DRONE_COMMIT_SHA:0:7}'/g" web/app/.default-config.php
- name: docker - name: docker
image: plugins/docker image: plugins/docker

View File

@ -99,6 +99,10 @@ jobs:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Replace version
run: |
sed -i "s/'s2oj-version' => 'dev'/'s2oj-version' => '$(echo "${{ github.sha }}" | cut -c1-7)'/g" web/app/.default-config.php
- name: Log in to the Container registry - name: Log in to the Container registry
uses: docker/login-action@v2.0.0 uses: docker/login-action@v2.0.0
with: with:

View File

@ -6,7 +6,8 @@ return [
'administrator' => 'root', 'administrator' => 'root',
'admin-email' => 'admin@sjzezoj.com', 'admin-email' => 'admin@sjzezoj.com',
'QQ-group' => '', 'QQ-group' => '',
'ICP-license' => '冀ICP备2020028886号' 'ICP-license' => '冀ICP备2020028886号',
's2oj-version' => 'dev'
], ],
'database' => [ 'database' => [
'database' => 'app_uoj233', 'database' => 'app_uoj233',

View File

@ -16,11 +16,13 @@
</div> </div>
</div> </div>
<ul class="list-inline"><li class="list-inline-item">Universal Online Judge</li></ul> <p><?= UOJLocale::get('server time') ?>: <?= UOJTime::$time_now_str ?></p>
<?php if (UOJConfig::$data['profile']['ICP-license'] != ''): ?> <p>
<p><a target="_blank" href="https://beian.miit.gov.cn" style="text-decoration:none;"><?= UOJConfig::$data['profile']['ICP-license'] ?></a></p> <a href="https://github.com/renbaoshuo/S2OJ<?= UOJConfig::$data['profile']['s2oj-version'] == "dev" ? '' : '/tree/' . UOJConfig::$data['profile']['s2oj-version'] ?>">S2OJ (<?= UOJConfig::$data['profile']['s2oj-version'] ?>)</a>
<?php endif ?> <?php if (UOJConfig::$data['profile']['ICP-license'] != ''): ?>
<p><?= UOJLocale::get('server time') ?>: <?= UOJTime::$time_now_str ?> | <a href="https://github.com/renbaoshuo/S2OJ" target="_blank"><?= UOJLocale::get('opensource project') ?></a></p> | <a target="_blank" href="https://beian.miit.gov.cn" style="text-decoration:none;"><?= UOJConfig::$data['profile']['ICP-license'] ?></a>
<?php endif ?>
</p>
</div> </div>
<?php endif ?> <?php endif ?>
</div> </div>